var flash_ok = navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
document.write('<SCRI' + 'PT LANGUAGE=VBScript\> \n');
document.write('on error resume next \n');
document.write('flash_ok = NOT IsNull(CreateObject("ShockwaveFlash.ShockwaveFlash")) \n');
document.write('</SCR' + 'IPT\> \n');

function pintaflash(pelicula,width,height)
{
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" ');
	document.write('  WIDTH=' + width + ' HEIGHT=' + height + '>');
	document.write(' <PARAM NAME=movie VALUE="' + pelicula + '"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>  '); 
	document.write(' <EMBED src="' + pelicula + '" quality=high bgcolor=#FFFFFF wLiveConnect=FALSE WIDTH=' + width + ' HEIGHT=' + height);
	document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
	document.write(' </EMBED></OBJECT>');
}

function pintaimagen(imagen,ancho,alto,enlace) 
	{ 
	if (!enlace) // si NO viene enlace
		document.write("<img src='" + imagen + "' width='" + ancho + "' height='" + alto + "'>");
	else		
		document.write("<a href='" + enlace + "' target='_blank'><img src='" + imagen + "' width='" + ancho + "' height='" + alto + "' border=0></a>");
	}

function hidestatus(){ window.status='www.informativos.telecinco.es'; return true }
if (document.layers) document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)
document.onmouseover=hidestatus;
document.onmouseout=hidestatus;


function ax2()
{
	var refe = window.event.srcElement;
	if (!(!refe.hit))
	{
		m=refe.hit.split('/');
		LPth=m[0];
		LPg=m[1];
		emspy.addImpression('www.hits.telecinco.es','home_inft5',LPth,LPg);
		return;
	}

}

function ax(url,bol,hit,feat,logc,logd)
{
	if((hit.indexOf ("/")!=-1)) 	{ m=hit.split('/'); LPth=m[0]; LPg=m[1]; }
	else { LPth=undefined; LPg=hit;}
emspy.jump(url,bol,'www.hits.telecinco.es','home_informativos',LPth,LPg,'ventana',feat);
}
function az(url,bol,hit,feat,logc,logd)
{
	if((hit.indexOf ("/")!=-1))	{m=hit.split('/'); LPth=m[0];  LPg=m[1];}
	else {LPth=undefined; LPg=hit;}
	//alert("logdomain=www.hits.telecinco.es, logchannel="+logd+", lPth="+LPth+", Lpg="+LPg);
emspy.jump(url,bol,'www.hits.telecinco.es',logd,LPth,LPg,'ventana',feat);
}

function wopen(theURL,feat)
{
	if (feat == "")
	{
		feat = "'scrollbars=yes,toolbars=yes'";
	}

	window.open(theURL,'ventana',feat);}

//ruta absoluta del jsp de votacion
var z=Math.floor(Math.random()*100000);
var RutaJSPVotacion = "http://www.informativos.telecinco.es/VotacionEstadisticas.php";
var RutaVotacion = "http://www.informativos.telecinco.es/VotacionEstadisticas.php";

function validaResultadohome(modo)
	{
	var valor = document.votacion2.votos.options[document.votacion2.votos.options.selectedIndex].value;
	var counter = document.votacion2.votos.length-1;
	counter=350+(counter*30);
	if(modo==0)  window.open(RutaVotacion + "?wa=" + document.votacion2.wa.value+ "&id="+ document.votacion2.id.value+"&i="+document.votacion2.i.value+"&porc="+document.votacion2.porc.value+"&counter="+counter+"&modo=resultado&z="+z ,"","width=468,height="+counter);
	else if (modo==1 && valor != "")  window.open(RutaVotacion + "?wa=" + document.votacion2.wa.value + "&id="+ document.votacion2.id.value +"&i="+document.votacion2.i.value+"&porc="+document.votacion2.porc.value+"&v="+valor+"&counter="+counter+"&modo=voto&z="+z,"","width=468,height="+counter);
	}

function validaResultadohome_der(modo)
	{
	var valor = document.votacion_der.votos.options[document.votacion_der.votos.options.selectedIndex].value;
	var counter = document.votacion_der.votos.length-1;
	counter=350+(counter*30);
	if(modo==0)  window.open(RutaVotacion + "?wa=" + document.votacion_der.wa.value+ "&id="+ document.votacion_der.id.value+"&i="+document.votacion_der.i.value+"&porc="+document.votacion_der.porc.value+"&counter="+counter+"&modo=resultado&z="+z ,"","width=468,height="+counter);
	else if (modo==1 && valor != "")  window.open(RutaVotacion + "?wa=" + document.votacion_der.wa.value + "&id="+ document.votacion_der.id.value +"&i="+document.votacion_der.i.value+"&porc="+document.votacion_der.porc.value+"&v="+valor+"&counter="+counter+"&modo=voto&z="+z,"","width=468,height="+counter);
	}

function validaResultado2(modo){
var chekeado=-1;
var counter=0;
if(modo==0){
for(var i=0;i < document.votacion2.elements.length;i++){
if(document.votacion2.elements[i].type!="hidden"){
counter++;
if (document.votacion2.elements[i].checked)
document.votacion2.elements[i].checked=false;
}
}
counter=90+(counter*36);
window.open(RutaVotacion + "?wa=" + document.votacion2.wa.value+ "&id="+ document.votacion2.id.value+"&i="+document.votacion2.i.value+"&porc="+document.votacion2.porc.value+"&counter="+counter+"&modo=resultado&z="+z ,"ventana","width=400,height="+counter);}
else{
for(var i=0;i < document.votacion2.elements.length;i++){
if(document.votacion2.elements[i].type!="hidden"){
counter++;
if (document.votacion2.elements[i].checked)
chekeado=document.votacion2.elements[i].value;
}
}
if (chekeado!=-1){
counter=90+(counter*36);
//voto
window.open(RutaVotacion + "?wa=" + document.votacion2.wa.value + "&id="+ document.votacion2.id.value +"&i="+document.votacion2.i.value+"&porc="+document.votacion2.porc.value+"&v="+chekeado+"&counter="+counter+"&modo=voto&z="+z,"ventana","width=300,height=50");
}}}


function video(idskin,destURL)
{
//idskin=322;
if((!idskin)||(idskin=="undefined")) idskin=218;
	window.open('http://www.video.telecinco.es/video/checkvideo.htm?idSkin=' + idskin + '&urlVideo='+destURL,'Reproductor','width=460,height=320,scrollbars=no');
}



function open_video(idVideo, urlVideo, idskin)
 	{
		if (idVideo == "")
		{
			if((!idskin)||(idskin=="undefined")){ idskin=218;}
			//no pago
			var url = "http://www.video.telecinco.es/video/checkvideo.htm?idSkin=" + idskin + "&urlVideo=" + urlVideo;
			window.open(url,"VideosTelecinco","width=320 height=240");
		}
		else
		{ //es de pago
			var url = "http://www.video.telecinco.es/video/checkvideo.htm?idSkin=" + idskin + "&idVideo=" + idVideo;
			window.open(url,"VideosTelecinco","width=320 height=240");

		}
	}



	function validaResultado(modo){
		var chekeado=-1;
		var counter=0;
		if(modo==0){
			for(var i=0;i<document.votacion.elements.length;i++){
				if(document.votacion.elements[i].type!="hidden"){
					counter++;
		 			if (document.votacion.elements[i].checked)
			  				document.votacion.elements[i].checked=false;
			  	}
			}
			counter=90+(counter*36);
			window.open(RutaVotacion + "?wa=" + document.votacion.wa.value+ "&id="+ document.votacion.id.value+"&i="+document.votacion.i.value+"&porc="+document.votacion.porc.value+"&counter="+counter+"&modo=resultado&z="+z ,"","width=400,height="+counter);
		}
		else{
			for(var i=0;i<document.votacion.elements.length;i++){
				if(document.votacion.elements[i].type!="hidden"){
					counter++;
		 			if (document.votacion.elements[i].checked)
			  			chekeado=document.votacion.elements[i].value;
			  	}
			}
			if (chekeado!=-1){
				counter=90+(counter*36);
				//votar
				window.open(RutaVotacion + "?wa=" + document.votacion.wa.value + "&id="+ document.votacion.id.value +"&i="+document.votacion.i.value+"&porc="+document.votacion.porc.value+"&v="+chekeado+"&counter="+counter+"&modo=voto&z="+z,"","width=400,height=50");
			}
		}
	}//validaResultado

function buscastr(str_origen,str_buscar)
{
	//devuelve verdadero o falso dependiendo de si encuentra el str a buscar en el location
	var url_val = String(str_origen);
	var res = url_val.search(str_buscar);
	//alert(res);
	if(res != -1)
		return true;
	else
		return false;
}

function open_google(form)
	{
	var texto = form.q.value;
	var dom = location.href.substring(location.href.indexOf("//")+2,location.href.length);
	dom = dom.substring(0,dom.indexOf("/"));
    if (form.site[0].checked)  { var sitio = form.site[0].value; } else { var sitio = form.site[1].value; }
	var ir = "http://www.informativos.telecinco.es/hits_buscador.htm?s_i_t_e="+dom+"&u_r_l=http://www.google.com/search?q=" + texto + "+site:" +  sitio + "&l=es";
	window.open(ir,'buscador','width=700,height=500,status=1,menubar=1,toolbar=1,location=1,scrollbars=1,resizable=1,left=0,top=0')
	return false;
}
function open_google_ext(form,dom)
	{
	var texto = form.q.value;
    if (form.site[0].checked)  { var sitio = form.site[0].value; } else { var sitio = form.site[1].value; }
	var ir = "http://www.informativos.telecinco.es/hits_buscador.htm?s_i_t_e="+dom+"&u_r_l=http://www.google.com/search?q=" + texto + "+site:" +  sitio + "&l=es";
	window.open(ir,'buscador','width=700,height=500,status=1,menubar=1,toolbar=1,location=1,scrollbars=1,resizable=1,left=0,top=0')
	return false;
}