function comprobarRespuestas (){

	if ((document.forms[0].respuesta[0].checked == false) && (document.forms[0].respuesta[1].checked == false))

		alert ("Por favor debe seleccionar una opción.");

	else

		document.forms[0].submit();

	

}

function comprobarRegistro(){

if ((window.event.keyCode == 13)||(window.event.type == 'click')){

with (formRegistro){

	 if (strNombre.value == ''){

     alert ("Debe rellenar el formulario con nombre");

	 strNombre.focus();

	 return true;}

	  if (strApellidoP.value == ''){

     alert ("Debe rellenar el formulario con su primer apellido");

	 strApellidoP.focus();

	 return true;}

	  if (strApellidoS.value == ''){

     alert ("Debe rellenar el formulario con su segundo apellido");

	 strApellidoS.focus();

	 return true;}

	  if ((strEmail.value == '')||(strEmail.value.indexOf('@')==-1 )||(strEmail.value.indexOf('.')==-1 )){

     alert ("Debe rellenar el campo E-MAIL con la estructura:direccion@pagina.dominio");

	 strEmail.focus();

	 return true;}

	if (strCentro.value == ''){

     alert ("Debe especificar el centro de trabajo");

	 strCentro.focus();

	 return true;}

	   
	 if (strProvincia.selectedIndex == 0){

     alert ("Debe rellenar el campo 'provincia'");

	 strProvincia.focus();

	 return true}

	  if (strLocalidad.value == ''){

     alert ("Debe Especificar la localidad del centro");

	 strLocalidad.focus();

	 return true;}

	  if (strComoConocio.selectedIndex == 0){

     alert ("Especifique cómo nos conoció");

	 strComoConocio.focus();

	 return true;}

	if (strUsuario.value == ''){

     alert ("Introduzca su login");

	 strUsuario.focus();

	 return true;}

	 if (strClave.value == ''){

     alert ("Introduzca su contraseña");

	 strClave.focus();

	 return true;}

   if (strRepiteClave.value == ''){

     alert ("Repita su contraseña");

	 strClave2.focus();

	 return true;}

	 if (strClave.value != strRepiteClave.value){

	 alert ("ambas contraseñas son diferentes");

	 strClave2.focus();

	 return true;}	

   }



   if ((formRegistro.cCorrecto.checked)&& (formRegistro.cLeyes.checked)){formRegistro.submit();

   //ejecutar el codigo php de insercion de alumnos

   return true;}

   else{

   alert ("Para poder inscribirse debe verificar sus datos y aceptar las condiciones legales");

  // MostrarDatos(frmRegistro);

   return true;

   }

 //  }

 //alert("submit");

 formRegistro.submit();

 }

}



function pop_programa(){

window.open("popups/pop_programa.htm","","width=431px,height=480px,scrollbars=yes");

}

function pop_calendario(){

window.open("popups/pop_calendario.htm","","width=431px,height=280px,scrollbars=yes");

}

function pop_test(){

window.open("popups/pop_test.htm","","width=431px,height=280px,scrollbars=yes");

}

function pop_soporte(){

window.open("popups/pop_soporte.htm","","width=431px,height=380px,scrollbars=yes");

}

function pop_foro(){

window.open("./formacion/tutoria.php","","");

}

function pop_diploma(){

window.open("popups/pop_diploma.htm","","width=431px,height=280px,scrollbars=yes");

}

function pop_preguntas(){

window.open("popups/pop_faqs.htm","","width=431px,height=480px,scrollbars=yes");

}

function pop_olvido(){

window.open("popups/pop_olvido.htm","","width=431px,height=280px,scrollbars=yes");

}

/*function pop_asistencia(){

window.open("popups/popasistencia.htm","","width=425px,height=480px");

}

function pop_diploma(){

window.open("popups/popdiploma.htm","","width=425px,height=230px");

}

function pop_buzon(){

window.open("popups/popbuzon.htm","","width=425px,height=480px");

}

function pop_test(){

window.open("popups/poptest.htm","","width=425px,height=320px");

}

function pop_fechas(){

window.open("popups/popfechas.htm","","width=425px,height=350px");

}

function olvido(){

window.open("popups/pop_olvido.htm","","width=500,height=300");

}

function faq(){

window.open("popups/popfaq.htm","","width=500,height=450, scrollbars=yes");

}

function auto(){

window.open("popups/popautores.htm","","width=500,height=450, scrollbars=yes");

}

function conte(){

window.open("popups/popcontenido.htm","","width=500,height=450, scrollbars=yes");

}

function estr(){

window.open("popups/popestructura.htm","","width=450,height=430");

}

function pop_fechas_intro(){

window.open("popups/Aviso_fechas.htm","","width=425px,height=300px");

}*/





function ReconoceCapas(){

  var cadena="";

  if (NS7)

    {

       cadena="Capa=document.getElementById('Capa')";

       eval (cadena);

    }

}



function Ocultar(CapaMenu)

{

   /* var micapa;

   micapa=window.top.frames[3].document.getElementById(CapaMenu);

   micapa.style.visibility="hidden";*/



     var cadena="CapaMenu.style.visibility='hidden'";

     eval(cadena);

  

}



function Mostrar(CapaMenu)

{

  //Ocultar();

     /*var micapa;

   micapa=window.top.frames[3].document.getElementById(CapaMenu);

   micapa.style.visibility="visible";*/



  var cadena="CapaMenu.style.visibility='visible'";

  eval(cadena);

  var cadena="CapaMenu.style.top=20";

  eval(cadena);

   var cadena="CapaMenu.style.left=54";

  eval(cadena);

}



function capturar_Charcode (evento){



	if(evento && evento.which)

	{ //if which property of event object is supported (NN4)

		evento = evento;

		characterCode = evento.which ;//character code is contained in NN4's which property 

	}

	else

	{

		evento = event

		characterCode = evento.keyCode //character code is contained in IE's keyCode property

	}



	return characterCode;

}



function utils_compformEntrada(evento){

	

	charcode = capturar_Charcode (evento);

	

	if ((charcode == 0) || (charcode == 1) || (charcode == 13)){

	

		if ((frmEntrada.strUsuario.value == "") || (frmEntrada.strPasswd.value == "")){

			alert("debe introducir su nombre de usuario y contraseña");

		  return true;

		}

		else{

		 frmEntrada.submit();

		}

	}

}



function utils_compformExamen()

{

	var RadioSel = '';

	var RadioChecked = false;

	var n_no_respondidas = 0;

	var n_preguntas = 0;



	for (var i=0; i<document.frmExamen.elements.length;i++)

	{

				//Solo cogemos los que son radios...

		if (document.frmExamen.elements[i].type == 'radio')

		{	

			if (!n_preguntas)

			{

				RadioSel = document.frmExamen.elements[i].name;

				n_preguntas++;

			}

					

			if (document.frmExamen.elements[i].name == RadioSel)

			{

				if (!RadioChecked)

					RadioChecked = document.frmExamen.elements[i].checked;

			}	

			else

			{

				if (!RadioChecked) n_no_respondidas++;

						//Cambiamos de radio.

					RadioSel = document.frmExamen.elements[i].name;

					RadioChecked = document.frmExamen.elements[i].checked;

					n_preguntas++;

			}

		}

	} //for

			

	if (!RadioChecked) n_no_respondidas++;

		

	if (n_no_respondidas)

		alert('Responda a todas las preguntas.');

	else

		document.frmExamen.submit();	

	return;

}

function utils_compFormEncuesta(){

	var RadioSel = '';

	var RadioChecked = false;

	var n_no_respondidas = 0;

	var n_preguntas = 0;



	for (var i=0; i<document.frmEncuesta.elements.length;i++)

	{

				//Solo cogemos los que son radios...

		if (document.frmEncuesta.elements[i].type == 'radio')

		{	

			if (!n_preguntas)

			{

				RadioSel = document.frmEncuesta.elements[i].name;

				n_preguntas++;

			}

					

			if (document.frmEncuesta.elements[i].name == RadioSel)

			{

				if (!RadioChecked)

					RadioChecked = document.frmEncuesta.elements[i].checked;

			}	

			else

			{

				if (!RadioChecked) n_no_respondidas++;

						//Cambiamos de radio.

					RadioSel = document.frmEncuesta.elements[i].name;

					RadioChecked = document.frmEncuesta.elements[i].checked;

					n_preguntas++;

			}

		}

	} //for

			

	if (!RadioChecked) n_no_respondidas++;

		

	if (n_no_respondidas)

		alert('Responda a todas las preguntas.');

	else

		document.frmEncuesta.submit();	

	return;

}



function pop_tutorias (){

		//window.open("./popups/pop_tutorias.htm","ventana1","");

		window.open("./formacion/tutoria.php","ventana1","");

}

function pop_ayuda (){

		window.open("./popups/pop_ayuda.htm","ventana1","width=395, height=180, scrollbars=auto, menubar=no, location=no, resizable=no");

}function pop_calendario (){

		window.open("./popups/pop_calendario.htm","ventana1","width=395, height=200, scrollbars=auto, menubar=no, location=no, resizable=no");

}

function pop_biblio (){

		window.open("./popups/pop_biblio.htm","ventana1","width=395, height=550, scrollbars=auto, menubar=no, location=no, resizable=no");

}
