function imagenOn(imagen,nombre) {
	var imagen_on = "images/" + nombre + "_on.jpg"
	imagen.src = imagen_on
}
function imagenOff(imagen,nombre) {
	var imagen_off = "images/" + nombre + "_off.jpg"
	imagen.src = imagen_off
}

function abrirventana(URLtoOpen, windowName, windowFeatures) {
  newWindow=window.open(URLtoOpen, windowName, windowFeatures);
}
function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features); 
}

var tiempo;
function ver_photo(seccion){
	if (seccion == "photo1") {
		document.getElementById("photo1").style.display = "block";
		document.getElementById("photo2").style.display = "none";
		document.getElementById("photo3").style.display = "none";
		document.getElementById("photo4").style.display = "none";
		document.getElementById("photo5").style.display = "none";
		document.getElementById("photo6").style.display = "none";
		document.getElementById("photo7").style.display = "none";
		document.getElementById("photo8").style.display = "none";
	}
	else if (seccion == "photo2") {
		document.getElementById("photo1").style.display = "none";
		document.getElementById("photo2").style.display = "block";
		document.getElementById("photo3").style.display = "none";
		document.getElementById("photo4").style.display = "none";
		document.getElementById("photo5").style.display = "none";
		document.getElementById("photo6").style.display = "none";
		document.getElementById("photo7").style.display = "none";
		document.getElementById("photo8").style.display = "none";
	}
	else if (seccion == "photo3") {
		document.getElementById("photo1").style.display = "none";
		document.getElementById("photo2").style.display = "none";
		document.getElementById("photo3").style.display = "block";
		document.getElementById("photo4").style.display = "none";
		document.getElementById("photo5").style.display = "none";
		document.getElementById("photo6").style.display = "none";
		document.getElementById("photo7").style.display = "none";
		document.getElementById("photo8").style.display = "none";
	}
	else if (seccion == "photo4") {
		document.getElementById("photo1").style.display = "none";
		document.getElementById("photo2").style.display = "none";
		document.getElementById("photo3").style.display = "none";
		document.getElementById("photo4").style.display = "block";
		document.getElementById("photo5").style.display = "none";
		document.getElementById("photo6").style.display = "none";
		document.getElementById("photo7").style.display = "none";
		document.getElementById("photo8").style.display = "none";
	}
	else if (seccion == "photo5") {
		document.getElementById("photo1").style.display = "none";
		document.getElementById("photo2").style.display = "none";
		document.getElementById("photo3").style.display = "none";
		document.getElementById("photo4").style.display = "none";
		document.getElementById("photo5").style.display = "block";
		document.getElementById("photo6").style.display = "none";
		document.getElementById("photo7").style.display = "none";
		document.getElementById("photo8").style.display = "none";
	}
	else if (seccion == "photo6") {
		document.getElementById("photo1").style.display = "none";
		document.getElementById("photo2").style.display = "none";
		document.getElementById("photo3").style.display = "none";
		document.getElementById("photo4").style.display = "none";
		document.getElementById("photo5").style.display = "none";
		document.getElementById("photo6").style.display = "block";
		document.getElementById("photo7").style.display = "none";
		document.getElementById("photo8").style.display = "none";
	}
	else if (seccion == "photo7") {
		document.getElementById("photo1").style.display = "none";
		document.getElementById("photo2").style.display = "none";
		document.getElementById("photo3").style.display = "none";
		document.getElementById("photo4").style.display = "none";
		document.getElementById("photo5").style.display = "none";
		document.getElementById("photo6").style.display = "none";
		document.getElementById("photo7").style.display = "block";
		document.getElementById("photo8").style.display = "none";
	}
	else if (seccion == "photo8") {
		document.getElementById("photo1").style.display = "none";
		document.getElementById("photo2").style.display = "none";
		document.getElementById("photo3").style.display = "none";
		document.getElementById("photo4").style.display = "none";
		document.getElementById("photo5").style.display = "none";
		document.getElementById("photo6").style.display = "none";
		document.getElementById("photo7").style.display = "none";
		document.getElementById("photo8").style.display = "block";
	}
}
function inicio_photos() {
	tiempo = setTimeout("cambio_photo()", 2000);
}
function cambio_photo() {
	if (document.getElementById("photo1").style.display == "block") ver_photo("photo2")
	else if (document.getElementById("photo2").style.display == "block") ver_photo("photo3")
	else if (document.getElementById("photo3").style.display == "block") ver_photo("photo4")
	else if (document.getElementById("photo4").style.display == "block") ver_photo("photo5")
	else if (document.getElementById("photo5").style.display == "block") ver_photo("photo6")
	else if (document.getElementById("photo6").style.display == "block") ver_photo("photo7")
	else if (document.getElementById("photo7").style.display == "block") ver_photo("photo8")
	else if (document.getElementById("photo8").style.display == "block") ver_photo("photo1")
tiempo = setTimeout("cambio_photo()", 2000);
}
function pausa_photos() {
	clearTimeout(tiempo);
}

function validar_envio(){

    if (document.inscripciones.nombre.value.length==0){
       alert("Debes indicar el Nombre y Apellidos")
       document.inscripciones.nombre.focus()
       return 0;
    } 
	
	if (document.inscripciones.direccion.value.length==0){
       alert("Debes indicar una Dirección")
       document.inscripciones.direccion.focus()
       return 0;
    } 

	if (document.inscripciones.localidad.value.length==0){
       alert("Debes indicar una Localidad")
       document.inscripciones.localidad.focus()
       return 0;
    }
	
    if (document.inscripciones.postal.value.length==0){
       alert("Debes indicar un Código Postal")
       document.inscripciones.postal.focus()
       return 0;
    } 

    if (document.inscripciones.provincia.value.length==0){
       alert("Debes indicar una Provincia")
       document.inscripciones.provincia.focus()
       return 0;
    }
	
	if (document.inscripciones.telefono1.value.length==0){
       alert("Debes indicar un Teléfono de contacto")
       document.inscripciones.telefono1.focus()
       return 0;
    } 
	
	if (document.inscripciones.mail.value.length==0){
       alert("Debes indicar una direccion de e-mail")
       document.inscripciones.mail.focus()
       return 0;
    } 

    if (document.inscripciones.fndia.value.length==0){
       alert("Debes indicar el Día de Nacimiento")
       document.inscripciones.fndia.focus()
       return 0;
    } 

    if (document.inscripciones.fnmes.value==0){
       alert("Debes indicar el Mes de Nacimiento")
       document.inscripciones.fnmes.focus()
       return 0;
    }

    if (document.inscripciones.fnano.value.length==0){
       alert("Debes indicar el Año de Nacimiento")
       document.inscripciones.fnano.focus()
       return 0;
    } 

    if (document.inscripciones.talla.value.length==0){
       alert("Debes indicar una Talla de camiseta")
       document.inscripciones.talla.focus()
       return 0;
    }

    if (document.inscripciones.tiempo.value==0){
       alert("Debes indicar cuánto tiempo llevas jugando al baloncesto")
       document.inscripciones.tiempo.focus()
       return 0;
    }
	
	if (document.inscripciones.enfermo.value==0){
       alert("Debes indicar si el jugador/a no presenta ningún problema médico")
       document.inscripciones.enfermo.focus()
       return 0;
    }
	
    var check1=0;
	var check2=0;
	if (document.inscripciones.turno1.checked==true) check1=1;
	if (document.inscripciones.turno2.checked==true) check2=1;
	if (check1==0 && check2==0){
   		alert("Debes indicar al menos un turno del Campus")
		document.inscripciones.turno1.focus()
       	return 0;
	}

    if (document.inscripciones.nomtutor.value.length==0){
       alert("Debes indicar el Nombre del Padre/Madre o Tutor")
       document.inscripciones.nomtutor.focus()
       return 0;
    }

    if (document.inscripciones.dnitutor.value.length==0){
       alert("Debes indicar el D.N.I. del Padre/Madre o Tutor")
       document.inscripciones.dnitutor.focus()
       return 0;
    }
	
    if (document.inscripciones.nomjug.value.length==0){
       alert("Debes indicar el Nombre del participante al que autorizas")
       document.inscripciones.nomjug.focus()
       return 0;
    }

    document.inscripciones.submit();
}