//******************************************************************
// Detección del Navegador
//******************************************************************
function lib_bwcheck(){ 
	 this.ver=navigator.appVersion
        this.agent=navigator.userAgent
        this.dom=document.getElementById?1:0
        this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
        this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
        this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom)?1:0;
        this.ie4=(document.all && !this.dom)?1:0;
        this.ie=this.ie4||this.ie5||this.ie6||this.ie7
        this.mac=this.agent.indexOf("Mac")>-1
        this.opera5=this.agent.indexOf("Opera 5")>-1
        this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
        this.ns4=(document.layers && !this.dom)?1:0;
        this.bw=(this.ie7 || this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5 || this.dom)
        return this
}
var bw=new lib_bwcheck();
//**************************************************************************
//Funciones de rollover
//**************************************************************************
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//***************************************************************************
//Funciones generales de control de capas
//***************************************************************************
//var tiempo_in;

function BorrarCapa() {
	var a = BorrarCapa.arguments;
	var i;
	for (i=0; i<a.length; i++) {
		if (bw.ie) document.getElementById(a[i]).filters.alpha.opacity = 0;
		if(bw.ns6) document.getElementById(a[i]).style.MozOpacity = 0;
		document.getElementById(a[i]).style.zIndex=0;
    	document.getElementById(a[i]).style.visibility="hidden";
	}
}

function fadeIn(elemento, inicio, fin) {
  //Esta funcion crea una unica variable para cada vez que llamamos al FadeIn
  //de esta forma podemos ejecutar varios simultaneamente
  d = new Date();
  //nombrevar = "v"+ d.getSeconds()+d.getMilliseconds();
  //eval("var "+ nombrevar);
  fadeIn2(elemento, inicio, fin);//fadeIn2(nombrevar,elemento, inicio, fin);
}
 
function fadeIn2(elemento, inicio, fin) {
	document.getElementById(elemento).style.visibility = "visible";
	document.getElementById(elemento).style.zIndex=20;
	if(inicio < fin){
		inicio+=10;
		if (bw.ie) document.getElementById(elemento).filters.alpha.opacity = inicio;
		if(bw.ns6) document.getElementById(elemento).style.MozOpacity = inicio/100;
		nombrevar=setTimeout("fadeIn2('"+ elemento + "',"+ inicio + ","+ fin + ")", 0);
	} else {
		clearTimeout(nombrevar);
	}
}

function fadeOut(elemento,inicio, fin) {
	if(inicio > fin){
		inicio-=10;
		if (bw.ie) document.getElementById(elemento).filters.alpha.opacity = inicio;
		if(bw.ns6) document.getElementById(elemento).style.MozOpacity = inicio/100;
		setTimeout("fadeOut('"+ elemento + "',"+ inicio + "," + fin + ")", 0);
	} else {
		document.getElementById(elemento).style.visibility = "hidden";
	}
}
//*******************************************************************************
function CargaMenu(submenu,idioma) {
	switch (submenu) {
		case 0:
			setTimeout("fadeOut('firma',100,0)",1500);
			setTimeout("fadeIn('firmasoft',0,100)",2000);
			setTimeout("fadeIn('menu',0,100)",3000);
			break;
		case 1:
			fadeIn('firmasoft',0,100);
			setTimeout("fadeIn('menu',0,100)",1500);
			setTimeout("fadeIn('microarquitectura',0,100)",1500);
			document.getElementById('01mnu').src = "/99_img/01_mnu_on"+idioma+".gif";
			break;
		case 2:
			fadeIn('firmasoft',0,100);
			setTimeout("fadeIn('menu',0,100)",1500);
			setTimeout("fadeIn('esculturaurb',0,100)",1500);
			document.getElementById('02mnu').src = "/99_img/02_mnu_on"+idioma+".gif";
			break;
		case 3:
			fadeIn('firmasoft',0,100);
			setTimeout("fadeIn('menu',0,100)",1500);
			setTimeout("fadeIn('mobiliariourb',0,100)",1500);
			document.getElementById('03mnu').src = "/99_img/03_mnu_on"+idioma+".gif";
			break;
		case 4:
			fadeIn('firmasoft',0,100);
			setTimeout("fadeIn('menu',0,100)",1500);
			setTimeout("fadeIn('producto',0,100)",1500);
			document.getElementById('04mnu').src = "/99_img/04_mnu_on"+idioma+".gif";
			break;			
		case 5:
			fadeIn('firmasoft',0,100);
			setTimeout("fadeIn('menu',0,100)",1500);
			setTimeout("fadeIn('esculturapeq',0,100)",1500);
			document.getElementById('05mnu').src = "/99_img/05_mnu_on"+idioma+".gif";
			break;
		case 6:
			fadeIn('firmasoft',0,100);
			setTimeout("fadeIn('menu',0,100)",1500);
			setTimeout("fadeIn('escenografias',0,100)",1500);
			document.getElementById('06mnu').src = "/99_img/06_mnu_on"+idioma+".gif";
			break;
		case 7:
			fadeIn('firmasoft',0,100);
			setTimeout("fadeIn('menu',0,100)",1500);
			setTimeout("fadeIn('especiales',0,100)",1500);
			document.getElementById('07mnu').src = "/99_img/07_mnu_on"+idioma+".gif";
			break;
		case 8:
			fadeIn('firmasoft',0,100);
			setTimeout("fadeIn('menu',0,100)",1500);
			setTimeout("fadeIn('asociacion',0,100)",1500);
			document.getElementById('08mnu').src = "/99_img/08_mnu_on"+idioma+".gif";
			break;
		case 9:
			fadeIn('firmasoft',0,100);
			setTimeout("fadeIn('menu',0,100)",1500);
			setTimeout("fadeIn('premios',0,100)",1500);
			document.getElementById('09mnu').src = "/99_img/09_mnu_on"+idioma+".gif";
			break;
		case 10:
			fadeIn('firmasoft',0,100);
			setTimeout("fadeIn('menu',0,100)",1500);
			setTimeout("fadeIn('clientes',0,100)",1500);
			document.getElementById('10mnu').src = "/99_img/10_mnu_on"+idioma+".gif";
			break;
	}
}
function Marcarmenu(opcion, indice) {
	switch (opcion) {
		case 1: //microarquitectura
			document.getElementById("laika_mnu").style.color="#666666";
			document.getElementById("castanyas_mnu").style.color="#666666";
			document.getElementById("umb_mnu").style.color="#666666";
			document.getElementById("hermes_mnu").style.color="#666666";
			document.getElementById("circular_mnu").style.color="#666666";
			document.getElementById("cabinfo_mnu").style.color="#666666";
			break;
		case 2: //escultura urbana
			document.getElementById("2001_mnu").style.color="#666666";
			document.getElementById("atocha_mnu").style.color="#666666";
			document.getElementById("casanovas_mnu").style.color="#666666";
			document.getElementById("collfava_mnu").style.color="#666666";
			document.getElementById("elspilons_mnu").style.color="#666666";
			document.getElementById("libertadcastellon_mnu").style.color="#666666";
			document.getElementById("libertadvalencia_mnu").style.color="#666666";
			document.getElementById("martifranques_mnu").style.color="#666666";
			document.getElementById("mendebaldea_mnu").style.color="#666666";
			document.getElementById("portacostabrava_mnu").style.color="#666666";
			document.getElementById("portarenfe_mnu").style.color="#666666";
			document.getElementById("treslamparas_mnu").style.color="#666666";
			document.getElementById("trestorres_mnu").style.color="#666666";
			document.getElementById("viajulia_mnu").style.color="#666666";
			break;
		case 3: //Mobiliario urbano
			document.getElementById("georgina_mnu").style.color="#666666";
			document.getElementById("judd_mnu").style.color="#666666";
			//Judd
			BorrarCapa('main','alcorque','fuente','banco','baculo','papelera','pilona','marquesina','juegos','quiosco1','quiosco2');
			//***
			document.getElementById("matisse_mnu").style.color="#666666";
			document.getElementById("mowgli_mnu").style.color="#666666";
			document.getElementById("olimpia_mnu").style.color="#666666";
			document.getElementById("parmenides_mnu").style.color="#666666";
			document.getElementById("topolino_mnu").style.color="#666666";
			document.getElementById("wc_mnu").style.color="#666666";
			break;
		case 4: //producto
			document.getElementById("ballarina_mnu").style.color="#666666";
			document.getElementById("claudia_mnu").style.color="#666666";
			document.getElementById("estudio31_mnu").style.color="#666666";
			break;
		case 5: //escultura pequeña
			break;
		case 6: //escenografias
			document.getElementById("juglars_mnu").style.color="#666666";
			document.getElementById("tricicle_mnu").style.color="#666666";
			break;
		case 7: //Especiales
			document.getElementById("busbcn92_mnu").style.color="#666666";
			document.getElementById("cruzroja_mnu").style.color="#666666";
			document.getElementById("helados_mnu").style.color="#666666";
			document.getElementById("modular_mnu").style.color="#666666";
			document.getElementById("pabellonberlin_mnu").style.color="#666666";
			document.getElementById("plazarodes_mnu").style.color="#666666";
			document.getElementById("santjordi_mnu").style.color="#666666";
			document.getElementById("schara_mnu").style.color="#666666";
			document.getElementById("taquillabcnII_mnu").style.color="#666666";
			document.getElementById("torreteatre_mnu").style.color="#666666";
			document.getElementById("tradecenter_mnu").style.color="#666666";
			document.getElementById("ump_mnu").style.color="#666666";
			break;
		case 8: //Asociacion
			document.getElementById("11m_mnu").style.color="#666666";
			document.getElementById("alting_mnu").style.color="#666666";
			document.getElementById("malaga_mnu").style.color="#666666";
			document.getElementById("tranviabcn_mnu").style.color="#666666";
			break;
	}
	document.getElementById(indice).style.color="#000000";
}