var appver = navigator.appVersion.substring(0,navigator.appVersion.indexOf('.'));
var bIsOk = (navigator.appName == 'Netscape') && (appver >= '5') || (navigator.appName == 'Microsoft Internet Explorer') && (appver >= '4');
var esMac=navigator.appVersion.indexOf("Mac");
function selecciona(cual) {		
	//Hoja de estilos para Mac
	plat_mac = "/estilosM/explorer/"+cual+"e4.css";
	//Hoja de estilos para Pc según navegador
	Pc_n4 = "/estilosM/netscape/"+cual+"n4.css";
	Pc_e4 = "/estilosM/explorer/"+cual+"e4.css";		
	if (esMac != -1){
	        document.write("<link rel='stylesheet' href='" + plat_mac + "' type='text/css'>");
	}
	else{
		if (bIsOk){
		   document.write("<link rel='stylesheet' href='" + Pc_e4 + "' type='text/css'>");
		}else{
		   document.write("<link rel='stylesheet' href='" + Pc_n4 + "' type='text/css'>");
		}
	}
}
//Escribo plantilla (no puedo usar selecciona porque es distinta ruta)
plat_mac = "estilos/descargare4.css";
Pc_n4 = "estilos/descargarn4.css";
Pc_e4 = "estilos/descargare4.css";	
if (esMac != -1){
  	document.write("<link rel='stylesheet' href='" + plat_mac + "' type='text/css'>");
}
else{
	if (bIsOk){	   
	   document.write("<link rel='stylesheet' href='" + Pc_e4 + "' type='text/css'>");
	}else{
	   document.write("<link rel='stylesheet' href='" + Pc_n4 + "' type='text/css'>");
	}
}
function overTD(td,color){td.style.cursor='hand';td.bgColor=color;}
function outTD(td,color){td.style.cursor='default';td.bgColor=color;}
function clickTD(td){td.children.tags('A')[0].click();}
function MM_openBrWindow(theURL,winName,features) {
window.name='principal';
window.open(theURL,winName,features);
}
function cambiar(objeto) { //v4.0
	valor = objeto.options[objeto.selectedIndex].value;
	if(valor) {
		window.document.location = valor;
	}
}
function cambioWebCam(ciudadwebcam)
{
var url='http://bilbao.viapolis.com/webcams.htm?webcam=' + ciudadwebcam;
ventana=window.open(url,'WEBCAM','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=770,height=570,screenX=50,screenY=50');
}
function Imprimir() {
      var direccion = '/interactivo/imprimir/imprimir.php?url=' + document.URL;
      newWindow = window.open(direccion, 'Imprimir', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=550,height=420');
}
function abrir(){
      var direccion = '/interactivo/enviar_amigo/enviar_amigo.php?dir=' + document.URL;
      newWindow = window.open(direccion, 'Enviar', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=490,height=540');
}
function Enviar(){
      var direccion = '/interactivo/enviar_amigo/enviar_amigo.php?dir=' + document.URL;
      newWindow = window.open(direccion, 'Enviar', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=490,height=540');
}





/*
  function cargarPubliMethode(posicion) {
    if(navigator.userAgent.indexOf("Netscape/7.0") > -1) {
        bIsNS70 = true;
    }
    else {
        bIsNS70 = false;
    }
    var ie4 = document.all;
    var ns6 = document.getElementById;
    if (ie4 || ns6) {
        eval('var objOrigen = document.getElementById ? document.getElementById("publi2_' + posicion + '") : document.all.publi2_' + posicion + ';');
        eval('var objDestino = document.getElementById ? document.getElementById("publi1_' + posicion + '") : document.all.publi1_' + posicion + ';');
        if((objDestino != null) && (!bIsNS70))
                objDestino.appendChild(objOrigen);
        else
                objOrigen.style.display = "none";
    }
  }
 */
