function chequearLogin(f){
	if (f.usuarioLogin.value.length==0)
	{
		alert("Debe especificar un nombre de usuario.");
		f.usuarioLogin.focus();
		return;
	} 
	if (f.usuarioPassword.value.length==0)
	{
		alert("Debe especificar una clave de acceso.");
		f.usuarioPassword.focus();
		return;
	}

	f.submit();
}

function PonerSiguienteImagen(banner){

	var d,x,timeEvery3000,i,sFuncion;
	i = banner 
	if(i < universidades.length){

		document.getElementById('imagen').src = 'images/universidades/'+imagenes[i];
		document.getElementById('imagen').alt = universidades[i];

		document.getElementById('enlace1').href="http://" +urls[i];
		document.getElementById('nombreUniversidad').innerHTML = "<a href='http://"+ urls[i] +"' target='_blank'>"+ universidades[i] +"</a>";
		i++;
		sFuncion='PonerSiguienteImagen('+ i +');';
		timeEvery3000 = setTimeout(sFuncion, 20000);
	}       
	else{
		PonerSiguienteImagen(0);
	}
	return
}

function PonerSiguienteImagenProyCoop(banner){
    
	var d,x,timeEvery3000,i,pFuncion;
	i = banner 
	if(i < proyCoop.length){

		document.getElementById('imagen2').src = 'imagenesWeb/'+imagenesProyCoop[i];
		document.getElementById('imagen2').alt = proyCoop[i];
        document.getElementById('txt_destacado').innerHTML = "<a href='http://"+ urlsProyCoop[i] +"' target='_blank'>"+ proyCoop[i] +"</a>";
		document.getElementById('txt_destacado').href="http://" +urlsProyCoop[i];
		
		i++;
		pFuncion='PonerSiguienteImagenProyCoop('+ i +');';
		timeEvery3000 = setTimeout(pFuncion, 20000);
	}       
	else{
		PonerSiguienteImagenProyCoop(0);
	}
	return
}

function verFicha(IdFicha){
	document.f2.action = "html/Gxxi_Ficha.asp"
	document.f2.IdFicha.value = IdFicha;
	document.f2.submit();
}

function enviarNoticia(idnoticia){
	document.f2.action = "html/actualidad/noticias_noticia.asp"
	document.f2.IdNoticia.value = idnoticia;
	document.f2.submit();
}

function enviarEntrevista(IdEntrevista){
	document.f2.action = "html/tribuna/entrevista.asp"
	document.f2.IdEntrevista.value = IdEntrevista;
	document.f2.submit();
}
function enviarEntrevista2(IdEntrevista){
	document.f2.action = "html/tribuna/entrevista2opinion.asp"
	document.f2.IdEntrevista.value = IdEntrevista;
	document.f2.submit();
}

function enviarTest(idtest){
	document.f2.action = "html/creacion/test_test.asp"
	document.f2.idtest.value = idtest;
	document.f2.submit();
}

//"valor" indica si hemos procedido a votar o queremos ver los resultados
function votar(valor, id){

	var seleccionado=false;

	for(i=0; i<=document.f1.opcVoto.length-1; i++){	
		if (document.f1.opcVoto[i].checked==true){
			seleccionado=true;
			break;	
		}		
	}
	
	if (seleccionado || valor==0){
		document.f1.action = "html/encuestas/encuestas.asp"	
		document.f1.votado.value = valor;
		document.f1.idEncuesta.value= id;
		document.f1.submit();
	}else{
		alert("No puede realizar una votación si no ha elegido una opción.", "Advertencia");
	}
}

