<!--
function isLoginPassword(id)
{
	if(document.getElementById(id).value.length > 6 && document.getElementById(id).value.length < 15)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function isNumeric(id)
{
	var ValidChars = "0123456789";
	var IsNumber=true;
	var Char;

	for (i = 0; i < document.getElementById(id).value.length && IsNumber == true; i++)
	{
		Char = document.getElementById(id).value.charAt(i);
		if (ValidChars.indexOf(Char) == -1)
		{
			IsNumber = false;
		}
	}
	return IsNumber;
}

function isEmail(id)
{
	var emailReg = /^[a-z][a-z-_0-9\.]+@[a-z-_=>0-9\.]+\.[a-z]{2,3}$/i;

	return emailReg.test(document.getElementById(id).value);
}

function isFilledUp(id)
{
	if(document.getElementById(id).value != '')
		return true;
	else
		return false ;
}


function isDate(id)
{
	var Fecha= new String(document.getElementById(id).value)	// Crea un string
	var RealFecha= new Date()	// Para sacar la fecha de hoy
	// Cadena Año
	var Ano= new String(Fecha.substring(Fecha.lastIndexOf("/")+1,Fecha.length))
	// Cadena Mes
	var Mes= new String(Fecha.substring(Fecha.indexOf("/")+1,Fecha.lastIndexOf("/")))
	// Cadena Día
	var Dia= new String(Fecha.substring(0,Fecha.indexOf("/")))

	// Valido el año
	if 	(
			( isNaN(Ano) || Ano.length<4 || parseFloat(Ano)<1900 ) // Comprobamos Año
		 	|| ( isNaN(Mes) || parseFloat(Mes)<1 || parseFloat(Mes)>12 ) // Comprobamos mes
		 	|| ( ( Mes==4 || Mes==6 || Mes==9 || Mes==11 || Mes==2 ) && ( Mes==2 && Dia > 28 || Dia>30 ) )
		)
			{  return false; } else { return true; }
}

function isNif(id)
{
	abc=document.getElementById(id).value;
	dni=abc.substring(0,abc.length-1);
	let=abc.charAt(abc.length-1);
	if (!isNaN(let))
	 {
	  //document.getElementById(id).focus();
	  return false;
	 }
	else
	 {
	  cadena="TRWAGMYFPDXBNJZSQVHLCKET";
	  posicion = dni % 23;
	  letra = cadena.substring(posicion,posicion+1);
	  if (letra!=let.toUpperCase())
	   {
	    //document.getElementById(id).focus();
	    return false;
	   }
	 }
	return true;
}

function isFilledUp(id)
{
	var whitespace = " \t\n\r";
	var i;
	var strValor = document.getElementById(id).value;

	if(s.length == 0)
	{
		return true;
	}

	for (i = 0; i < strValor.length; i++)
	{
		var c = strValor.charAt(i);

		if (whitespace.indexOf(c) == -1)
		{
			return false;
		}
	}
	return true;
}

function isAlfaNumeric( id , tipo )
{
	var strValor = document.getElementById(id).value;
	var isValid = true;

	if(document.getElementById(id).value != '')
	{
		// Return immediately if an invalid value was passed in
		if (strValor+"" == "undefined" || strValor+"" == "null" || strValor+"" == "")
		return false;
			// convert to a string for performing string comparisons.
		strValor = " " + strValor;
		// Loop through length of string and test for any alpha numeric
		// characters

		// Alphanumeric must be between "0"-"9", "A"-"Z", or "a"-"z"
		var pararFor = false;
		for (i = 0; i < strValor.length && pararFor == false; i++)
		{
			switch (tipo )
			{
				case 'alfanumeric':
				{
					if 	( !(	((strValor.charAt(i) >= "0") && (strValor.charAt(i) <= "9")) ||
								((strValor.charAt(i) >= "a") && (strValor.charAt(i) <= "z")) ||
								((strValor.charAt(i) >= "A") && (strValor.charAt(i) <= "Z"))	)	)
				   	{
				   		if 	((strValor.charAt(i) == " ") || (strValor.charAt(i) == "¿") || (strValor.charAt(i) == "?") || (strValor.charAt(i) == ".") || (strValor.charAt(i) == ",") || (strValor.charAt(i) == ";") || (strValor.charAt(i) == ":") || (strValor.charAt(i) == "@") || (strValor.charAt(i) == "(") || (strValor.charAt(i) == ")") || (strValor.charAt(i) == "-"))
				   		{	
				   				isValid = true;
				   		}
				   		else
				   		{
				   				isValid = false;
				   		}
				   	}

					pararFor = true;
					break;
				}
				case 'alfa':
				{
					if 	(	!(	((strValor.charAt(i) >= "a") && (strValor.charAt(i) <= "z")) ||
								((strValor.charAt(i) >= "A") && (strValor.charAt(i) <= "Z"))    ) 	)

					{
						if 	((strValor.charAt(i) == " ") || (strValor.charAt(i) == "¿") || (strValor.charAt(i) == "?") || (strValor.charAt(i) == ".") || (strValor.charAt(i) == ",") || (strValor.charAt(i) == ";") || (strValor.charAt(i) == ":") || (strValor.charAt(i) == "@") || (strValor.charAt(i) == "(") || (strValor.charAt(i) == ")") || (strValor.charAt(i) == "-"))
				   		{	
				   				isValid = true;
				   		}
				   		else
				   		{
				   				isValid = false;
				   		}
					}

					pararFor = true;
					break;
				}
				case 'numeric':
				{
					if((strValor.charAt(i) >= "0") && (strValor.charAt(i) <= "9"))
					{
						isValid = false;
					}

					pararFor = true;
					break;
				}
			}

		} // END for


	}

	return isValid;
} // end IsAlphaNum

-->
