function salir()
{
 if(confirm("¿Estás seguro que quieres salir sin reclamar?"))
 {
   document.location.href='index.php?pid=14&accion=listar';
 }
}

function poppeer(url)

{

  newwindow=window.open(url,'poppeers','height=400,width=700,resizable=yes,scrollbars=yes');

  if (window.focus) {newwindow.focus()}

}

function mostrar()
	{
	//////////////////////////////////////////////////////////////////////////////
	//Control de datos del formulario
	if(document.getElementById('pilotos_carrera').style.display == 'block'){
		if(document.getElementById('pilotos_carrera').value == ""){
			alert("Debe seleccionar un piloto");
			document.getElementById('pilotos_carrera').focus();
			return;
		}
		document.getElementById('pilotos_carrera').name = 'acusado';
	}else{
		if(document.getElementById('pilotos_foro').value == ""){
			alert("Debe seleccionar un piloto");
			document.getElementById('pilotos_foro').focus();
			return;
		}
		document.getElementById('pilotos_foro').name = 'acusado';
	}

	if((document.getElementById('vuelta').value).replace(/^\s*|\s*$/g,'')==""){
		alert("Debe especificar la vuelta en la que ocurrió el incidente");
		document.getElementById('vuelta').focus();
		document.getElementById('vuelta').select();
		return;
	}
	if(document.getElementById('normativa').checked == false)
	{
		alert('Debes marcar la casilla que indica que aceptas la Normativa de Reclamaciones');
		die();
	}

	if((document.getElementById('texto').value).replace(/^\s*|\s*$/g,'')==""){
		alert("Debe indicar el motivo de la acusación. Sea breve y cíñase objetivamente al incidente");
		document.getElementById('texto').focus();
		document.getElementById('texto').select();
		return;
	}
	//////////////////////////////////////////////////////////////////////////////



	document.reclam.submit();
	}

    function enviar2()
	{
		var idcarrera = document.getElementById('idCarrera').value;
		var pid = document.getElementById('pid').value;
		window.location = "index.php?pid="+pid+"&accion=reclamar&idCarrera="+idcarrera;
	}

    function setDatos(momento)
	{

			document.getElementById('t_datos').style.visibility='visible';

			document.getElementById('pilotos_carrera').value = "";
			document.getElementById('pilotos_foro').value = "";

		 switch(momento){
			case "calificacion":
				document.getElementById('pilotos_carrera').style.display='block';
				document.getElementById('pilotos_foro').style.display='none';
				break;

			case "carrera":
				document.getElementById('pilotos_carrera').style.display='block';
				document.getElementById('pilotos_foro').style.display='none';
				break;

			case "otros":
				document.getElementById('pilotos_carrera').style.display='none';
				document.getElementById('pilotos_foro').style.display='block';
				break;

			case "":
				document.getElementById('pilotos_carrera').style.display='none';
				document.getElementById('pilotos_foro').style.display='none';
					document.getElementById('t_datos').style.visibility='hidden';
				break;
		 }

	}
