//funcion que comprueba los campos de validacion de usuario
function enviate(){
	 if(IsAlphaNum(document.formy.user.value) && IsAlphaNum(document.formy.pass.value) ){ 
	 	document.formy.submit();
	 	}
	 else 	 {
	    alert('Los datos introducidos no son correctos, intentelo de nuevo');
	 }
	 
}
function IsAlphaNum( str ) {
	
	if (str+"" == "undefined" || str+"" == "null" || str+"" == "")	{
		return false;
		}
	
	//if (str.length<5 || str.length>10){
	//	return false;
	//        }	
	var isValid = true;
	
	str += "";	
	
	for (i = 0; i < str.length; i++)
   	{
	
      	if (!(((str.charAt(i) >= "0") && (str.charAt(i) <= "9")) || 
      	      ((str.charAt(i) >= "a") && (str.charAt(i) <= "z")) ||
      	      ((str.charAt(i) >= "A") && (str.charAt(i) <= "Z")) ||
      	      (str.charAt(i) == "-") ||
      	      (str.charAt(i) == "_") 
      	      || (str.charAt(i) == ".")       	      
      	      || (str.charAt(i) == "ç")       	      
      	      || (str.charAt(i) == "Ç")
      	      || (str.charAt(i) == "Ñ")
      	      || (str.charAt(i) == "ñ")
      	      ))
			{
				isValid = false;
				break;
			}	
   	}
   	
   	return isValid;
	
}

