
	function bannerAnuncioDestacados(na,bca,bta,i)
	{
		var aleat = Math.random() * 1000 * (na+1);
		var str;
		
		aleat = i; //Math.round(aleat) % (na+1);
		
		if(aleat==na)
		{
			str = "<span class='letra9blanco'>Si quieres que tu anuncio salga en destacados<br/> <a href='javascript:abrirDestacaAnuncio()' class='link9blanco'>Infórmate Aquí</a> </span>";
		}else{
			str = "<a href='/anuncio,"+bca[aleat]+".html' class='link12blanco'>"+bta[aleat]+"</a>";
		}
		document.getElementById("divBAD").innerHTML = str;
		j = (i+1) % (na+1);
		setTimeout("bannerAnuncioDestacados(na,bca,bta,j)",3500);
	}
	
	function abrirFAQFotoSMS()
	{
	    url = "/faqFotoSMS.aspx"
		carac = "SCROLLBARS=yes,width=520,height=350"
		window.open(url,"FAQ",carac)
	}
	
	function abrirDestacaAnuncio()
	{
	    url = "/faqdestacaanuncio.aspx"
		carac = "SCROLLBARS=yes,width=520,height=350"
		window.open(url,"FAQ",carac)
	}
	
	function abrirFoto(codigo)
	{
		url = "foto,"+codigo+".html"
		carac = "SCROLLBARS=yes,width=800,height=500"
		window.open(url,"Foto",carac)
	}
	
	function abrirVideo(codigo)
	{
		url = "video,"+codigo+".html"
		carac = "SCROLLBARS=yes,width=450,height=350"
		window.open(url,"Video",carac)
	}
	
	function abrirAnuncio(cod)
	{
		url ="anuncio,"+cod+".html"
		carac = "scrollbars=yes,menubar=no,width=500,heigth=300"
		window.open(url,"Anuncio",carac)
	}

	function comprar(codigo)
	{
		url = "comprar,"+codigo+".html"
		carac = "SCROLLBARS=yes,width=450,height=350"
		window.open(url,"ComprarVideo",carac)
	}
	
	
	function comprar(codigo)
	{
		url = "popUpComprar,"+codigo+".html"
		carac = "SCROLLBARS=yes,width=450,height=350"
		window.open(url,"Video",carac)
	}
	
	function mailAmigo(t,c)
	{
		url = "enviamail.aspx?t="+t+"&c="+c;
		carac = "SCROLLBARS=yes,width=460,height=420"
		window.open(url,"Video",carac)
	}
	
	function vota(votar)
	{
		var fencuesta = document.getElementById("fencuesta")
		for (i=0;i<fencuesta.respuesta.length;i++){ 
    		if (fencuesta.respuesta[i].checked) 
        			break; 
    	} 
		if (i<fencuesta.respuesta.length || votar!="si")
		{
			carac = "toolbar=no,menubar=no,scrollbars=yes,resizable=no,width=500,height=300,left=100,top=100"
			window.open("","Votar",carac)
			fencuesta.target = "Votar"
			fencuesta.action = "votar.aspx?votar=si"
			fencuesta.submit()
		}
		else		
		{
			alert('Debe seleccionar alguna respueta')
		}
	}
	
	function Identificacion()
	{
		alert('fdas');
		var formI = document.getElementById('fzusu')
		formI.action = "http://www.mallorcarallye.net/identificacion.aspx"
		formI.submit()
	}
	
		function Identificacion2()
	{
	
		var formI = document.getElementById('fzusu')
		formI.action = "/identificacion.aspx"
		formI.submit()
	}
	
	function buscarFotos()
	{
		var form = document.getElementById('fbuscador')
		if(form.prueba.value=='' && form.piloto.value=='' && form.coche.value=='')
		{
			alert('Debe seleccionar algún método de búsqueda')
		}else{
			form.buscar.value = "1"
			form.submit()
		}
	}
	
	function bannerSportRacing()
	{
		url = "/banners/sportRacing/popupSportRacing.htm";
		url = "http://www.sportracing.es";
		url = "/banners/sportRacing/popupSportRacing.aspx";
		carac = "";
		//carac = "SCROLLBARS=yes,Resizable=yes,menubar=yes,width=550,height=420"
		window.open(url,"SportRacing",carac)
	}

	function bannerSportRacingOfertas()
	{
		url = "/banners/sportRacing/popupSportRacing.aspx";
		carac = "SCROLLBARS=yes,Resizable=yes,menubar=yes,width=550,height=420"
		window.open(url,"SportRacing",carac)
	}
	
	function banner(cod)
	{
		if(cod==2)
		{
			url = "http://www.gostrallye.com";
			window.open(url,"GostRallye");
		}else if(cod==4){	
			url = "http://www.sicsolutions.net";
			window.open(url,"SICSolutions");
		}else{
			url = "/banners/"+cod+"/popup.aspx";
			carac = "SCROLLBARS=yes,width=550,height=420"
			window.open(url,"Banner",carac)
		}
	}	

	function votar(item, cod, punt)
	{
		var url;
		if(window.XMLHttpRequest)
		{
			http_request = new XMLHttpRequest();
		}else if(window.ActiveXObject){
			http_request = new ActiveXObject("Microsoft.XMLHTTP");
		}
		url = 'http://www.mallorcarallye.com/ajax/votar.aspx?i='+item+'&c='+cod+'&p='+punt;
		//alert(url);
		http_request.onreadystatechange = respuestaVotar;
		http_request.open('GET',url,true);
		http_request.send(null);
		votado = true;		
	}