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.formula1.telecinco.es'; return true }
if (document.layers) document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)
document.onmouseover=hidestatus;
document.onmouseout=hidestatus;

function imprimediv(idcapa)
{
	if (window.print) 
	  {					
	  var ficha = document.getElementById(idcapa);
	  var ventimp = window.open('', 'popimpr');
	  ventimp.document.write("<base href='http://f1.informativos.telecinco.es'><link href='/estilos/css06.css' rel='stylesheet' type='text/css'>");
	  ventimp.document.write( ficha.innerHTML );
	  ventimp.document.write("<p></p><p></p><span class=a12g>www.formula1.telecinco.com<br><br>Copyright © Europortal Jumpy España, S.A. 2006</span>");
	  ventimp.document.close();
	  ventimp.print();
	  //ventimp.close();
	  }	  
	else 		
	  alert("Lo siento, pero a su navegador no se le puede ordenar imprimir" + " desde la web. Actualicese o hágalo desde los menús del propio navegador"); 		
} 

function sendfriend()
	{
	var ruta = "http://www.telecinco.es/enviar.php?pagina=" + location.href;
	//window.open(ruta);
	alert("Servicio no disponible, disculpa las molestias");
	}

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://f1.informativos.telecinco.es/resultados.php";
var RutaVotacion = "http://f1.informativos.telecinco.es/votaciones/resultados.php";

function validaResultado2(modo){
	var chekeado=-1;
	
	if(modo==1){
	 for(var i=0;i<document.votacion2.elements.length;i++){
	  if(document.votacion2.elements[i].type!="hidden"){
	   if (document.votacion2.elements[i].checked)
	    chekeado=document.votacion2.elements[i].value;
   	  }
 	 }
	}
	var ruta = RutaVotacion + "?id="+ document.votacion2.id.value +"&i="+document.votacion2.i.value+"&modo="+modo+"&v="+chekeado+"&z="+z;	
	//location.replace=ruta;
	//window.open(ruta);
	alert("Servicio no disponible, disculpa las molestias");
}//validaResultado2


function validaResultado(modo){
	var chekeado=-1;
	
	if(modo==1){
	 for(var i=0;i<document.votacion.elements.length;i++){
	  if(document.votacion.elements[i].type!="hidden" && document.votacion.elements[i].checked) 
	   chekeado=document.votacion.elements[i].value;   	  
	 }  
 	}	
	var ruta = RutaVotacion + "?id="+ document.votacion.id.value +"&i="+document.votacion.i.value+"&modo="+modo+"&v="+chekeado+"&z="+z;
	//location.replace=ruta;
	//window.open(ruta);
	alert("Servicio no disponible, disculpa las molestias");
}//validaResultado

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://f1.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://f1.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;
}

//Para redimensionar el iframe de la tabla inferior de las clasificaciones 
function resizeFrame(fr,idiframe){ 			
 var h;
 var w = fr.contentWindow;
 if (w && w.document && w.document.body && w.document.body.scrollHeight) h = w.document.body.scrollHeight;		
 if ( h ) fr.style.height = h; 												
 else window.setTimeout( "window.resizeFrame(window.document.getElementById('"+idiframe+"'))", 3000 )				
}  	