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) {	
	var mi_url = document.location.href;
	
	//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='../js/" + plat_mac + "' type='text/css'>");
	}
	else{
		if (bIsOk){
		   document.write("<link rel='stylesheet' href='../js/" + Pc_e4 + "' type='text/css'>");
		}else{
		   document.write("<link rel='stylesheet' href='../js/" + Pc_n4 + "' type='text/css'>");
		}
	}
}
//Escribo plantilla (no puedo usar selecciona porque es distinta ruta)
plat_mac = "/estilos/plantillae4.css";
Pc_n4 = "/estilos/plantillan4.css";
Pc_e4 = "/estilos/plantillae4.css";	
if (esMac != -1){
  	document.write("<link rel='stylesheet' href='../js/" + plat_mac + "' type='text/css'>");
}
else{
	if (bIsOk){	   
	   document.write("<link rel='stylesheet' href='../js/" + Pc_e4 + "' type='text/css'>");
	}else{
	   document.write("<link rel='stylesheet' href='../js/" + 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 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');
}
// Abre ventana nueva a partir de un SELECT
function ir(objeto) {
	var peich = objeto.options[objeto.options.selectedIndex].value;
	nueva = window.open(peich);
}
function cambioWebCam(ciudadwebcam) {
	var url='http://'+ ciudadwebcam +'.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');
}

var saco_url = document.location.href;
if(saco_url.indexOf("sevilla.abc.es") > 0) {
			url_canal = "sevilla.abc.es/";			
			}else if(saco_url.indexOf("cordoba.abc.es") > 0) {
			url_canal = "cordoba.abc.es/";
			}else if(saco_url.indexOf("abcdesevilla") > 0) {
			url_canal = "sevilla.abc.es/";
			}else{
			url_canal = "www.abc.es/";
			}	

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";
     }
   }

//Zooming

 function ftvlaunch(video,quality,pid) {
	  var LeftPosition = (screen.width) ? (screen.width-665)/2 : 0;
	  var TopPosition = (screen.height) ? (screen.height-430)/2 : 0;
	  var popwin = window.open('http://videonoticias.vocento.com/videoplayer/index.cfm?id='+video+'&mode=normal&quality='+ quality +'&pid='+ pid,'MTV6_window','toolbar=no,width=665,height=430,top='+TopPosition+',left='+LeftPosition+',directories=no,status=no,statusbar=0,scrollbars=no,resizable=no,menubar=no');
      popwin.focus();
}

