
function check_mail()
{
    var i=0;

    if (document.getElementById("email").value.length>0)
    {
       while ((document.getElementById("email").value.charAt(i)!="@") && (i<=document.getElementById("email").value.length))
	      i++;

       if (document.getElementById("email").value.charAt(i)=="@")
	   {
           while ((document.getElementById("email").value.charAt(i)!=".") && (i<=document.getElementById("email").value.length))
	         i++;

           if (document.getElementById("email").value.charAt(i)==".")
              return true;
           else
           {
              alert("Por favor introduzca correctamente si e-mail. Gracias");
              document.getElementById("email").focus();
              document.getElementById("email").select();
			  return false;
           }
       }
       else          
       {
             alert("Por favor introduzca correctamente su e-mail. Gracias");
             document.getElementById("email").focus();
             document.getElementById("email").select();
		     return false;
       }
    }
    else
	{
	   alert("Por favor introduzca correctamente su e-mail. Gracias");
       document.getElementById("email").focus();
       document.getElementById("email").select();
       return false;
	}
}

function check_pass(){
   if (document.getElementById("passwd").value.length>0)
      return true;
   else
   {
      alert("Por favor introduzca su Contraseņa. Gracias");
      document.getElementById("passwd").focus();
      return false;
   }
}

function check_pass2(){
   if (document.getElementById("passwd2").value.length>0){
   	 if (document.getElementById("passwd").value==document.getElementById("passwd2").value){
		 return true;
	 }
	 else{
	 	alert("Por favor introduzca el mismo valor que en la Contraseņa. Gracias");
      	document.getElementById("passwd2").focus();
      	return false;
	 }
      
   }
   else
   {
      alert("Por favor introduzca la confirmacion de la Contraseņa. Gracias");
      document.getElementById("passwd2").focus();
      return false;
   }
}

function check_nick()
{
   if (document.getElementById("name").value.length>0)
      return true;
   else
   {
      alert("Por favor introduzca su Nick. Gracias");
      document.getElementById("name").focus();
      return false;
   }
}

function check_nombre()
{
   if (document.getElementById("name_largo").value.length>0)
      return true;
   else
   {
      alert("Por favor introduzca su Nombre. Gracias");
      document.getElementById("name_largo").focus();
      return false;
   }
}

function check_acepta()
{
   if (document.getElementById("agree_cond").checked==true)
      return true;
   else
   {
      alert("Debe de aceptar las condiciones. Gracias");
      document.getElementById("agree_cond").focus();
      return false;
   }
}


function check_form()
{
   if ( check_mail()
		&& check_nick()
		&& check_pass()
        && check_pass2()
		&& check_acepta() )
   {
			return true;

   }
   
   return false;
}
