function BuscaCine(){
	document.buscacine.texto.value=QuitaEspacios(document.buscacine.texto.value);
	var sPor=document.buscacine.texto.value, iIndice=document.buscacine.por.options.selectedIndex, iLongitud=sPor.length, sMensaje;
	
	if ((sPor=="")||(iIndice==0)) sMensaje="Se requiere indicar el criterio de búsqueda -actor, director, película ó noticia- y un texto relacionado";
	else if(iLongitud < 2) sMensaje="Debe realizar una búsqueda, con al menos dos caracteres de texto";
	else{
		switch (iIndice){
			case 1: document.buscacine.action="/cinemania/actores/buscador.php";break;
			case 2: break;
			case 3: break;
			case 4: document.buscacine.action="/cinemania/busca-noticias.php";break;
		}
		return true;
	}
		
	alert(sMensaje);
	document.buscacine.texto.focus();
	return false;
}

function BuscarCineClick(){
	bAccion=BuscaCine();
	if (bAccion==true) document.buscacine.submit();
}

/*function BuscaNoticias(){
	document.buscanoticias.texto2.value=QuitaEspacios(document.buscanoticias.texto2.value);
	var sPor=document.buscanoticias.texto2.value, iLongitud=sPor.length, sMensaje;

	if (sPor=="") sMensaje="Se requiere un texto relacionado con la noticia";
	else if(iLongitud < 2) sMensaje="Debe realizar una búsqueda, con al menos dos caracteres de texto";
	else return true;

	alert(sMensaje);
	document.buscanoticias.texto2.focus();
	return false;
}

function BuscarNoticiasClick(){
	bAccion=BuscaNoticias();
	if (bAccion==true) document.buscanoticias.submit();
}*/

function BuscaGeneral(){
	var iPor=document.buscador.tipo.options.selectedIndex;

	if (!iPor > 0){
		alert("Debe indicar o una categoría o alguna palabra relacionada con la búsqueda");
		document.buscador.tipo.focus();
	}
	else{
		var sDirEnlace = document.buscador.action + document.buscador.tipo.options[document.buscador.tipo.options.selectedIndex].value;
		document.location.href = sDirEnlace;
	}
}

function BuscaActorClick(){
	bAccion=BuscaActor();
	if (bAccion==true) document.buscadoractor.submit();
}


function BuscaActor(){
	document.buscadoractor.texto.value=QuitaEspacios(document.buscadoractor.texto.value);
	var sPor=document.buscadoractor.texto.value, iLongitud=sPor.length, sMensaje="";

	if (sPor=="") sMensaje="Debe indicar alguna palabra relacionada con la búsqueda";
	else if(iLongitud < 2) sMensaje="Debe realizar una búsqueda, con al menos dos caracteres de texto";
	else return true;

	alert(sMensaje);
	document.buscadoractor.texto.focus();
	return false;
}

function EligeRanking(sRanking){
	if(sRanking!="") window.location.href = document.rankings.action + sRanking;
}

function OpcionMasCine(iOpcion){
	switch (iOpcion){
		case "1": window.location.href="/cinemania/especiales.php";break;
		case "2": window.location.href="/cinemania/entrevistas.php";break;
		case "3": window.location.href="/postales/cine";break;
		case "4": window.location.href="/chats/cine";break;
		//case "6": window.open("http://ad.zanox.com/ppc/?2868930C1922716422T", "cartel");break;
		case "7": window.location.href="/tienda/cine.html";break;
		default:
	}
}

function ComprarPeli(){
	window.open("http://ad.zanox.com/ppc/?6902574C2025053473T&ULP=[[http://cine.fnac.es/home/video.aspx?&zparam_fnac]]", "_blank");
}
