function tryit()
{
	var fourteen = document.reg.dob.value;

	 if(fourteen != "")
	{
	 if (!dateValidate(fourteen)) {
        alert("Invalid date fomat. Please enter dd-mm-yyyy");
        document.reg.dob.focus();
		 document.reg.dob.select();
		 return false;
      }
        function dateValidate(fourteen) {
     s = fourteen
     s1 = s.split("-");
     if (s1.length==1) s1 = s.split("/");
     if (s1.length<3) { 
		return false;
	}
	       if  (!( ((s1[2].toString() > "1900")  && (s1[2].toString() <= "2050")) &&
  	     ((s1[1].toString() >= "0")    && (s1[1].toString() <= "12"))  &&
	    ((s1[0].toString() >= "0")  && (s1[0].toString() <= "31"))

	  ))
	return false;
     return true;
  }
  return true;
  }
}

function again()
{
		var three = document.reg.name.value;
		var six = document.reg.email.value;
		var seventy = document.reg.login.value;
		var eighteen = document.reg.password.value;

	if(three == "")
	{
		alert("Please enter the First Name");
		document.reg.name.focus();
		return false;
	}
	if (/^\s+$/.test(three))
	{
		alert("No Blank spaces allowed");
		document.reg.name.focus();
		document.reg.name.select();
	return false;
	}
	if(six == "")
	{
		alert("Please enter the Email");
		document.reg.email.focus();
		return false;
	}
		if (/^\s+$/.test(six))
	{
		alert("No Blank spaces allowed");
		document.reg.email.focus();
		document.reg.email.select();
	return false;
	}
	if(seventy == "")
	{
		alert("Please enter the Login");
		document.reg.login.focus();
		return false;
	}
	if(eighteen == "")
	{
		alert("Please enter the password");
		document.reg.password.focus();
		return false;
	}

}
function validate(field) {
	var valid = "abcdefghijklmnopqrstuvwxyz0123456789._- "
	var ok = "yes";
	var temp;
	for (var i=0; i<field.value.length; i++) {
	temp = "" + field.value.substring(i, i+1);
	if (valid.indexOf(temp) == "-1") ok = "no";
}
	if (ok == "no") {
	alert("Invalid entry!  Only lower case characters and numbers are accepted!");
//field.focus(); 
	document.reg.name.focus();
	document.reg.name.select();

//field.select();
	return false;
   }

var c = field.value.charAt(0);
        if(!isLetter(c))
		{
		alert("Invalid Entry...Only lower case characters allowed in First Alphabet");
				document.reg.name.select();
		document.reg.name.focus();
        return false;
		}
function isLetter (c)
{   return ( ((c >= "a") && (c <= "z")))
}

if(field.value == "itc")
	{
		alert(" Sorry. Invalid entry ");
		document.reg.name.select();
		document.reg.name.focus();
		return false;
	}

var c = field.value.charAt(0);
	if (c >= 0)
    {
	alert("Cannot start with numeric");
	document.reg.name.focus();
	return false;
	}
	else
	{
	   return true;
	}
}

function validate1(field) {
	var valid = "abcdefghijklmnopqrstuvwxyz0123456789._-"
	var ok = "yes";
	var temp;
	for (var i=0; i<field.value.length; i++) {
	temp = "" + field.value.substring(i, i+1);
	if (valid.indexOf(temp) == "-1") ok = "no";
}
	if (ok == "no" || ok == " ") {
	alert("Invalid entry!  Only lower case characters and numbers are accepted!");
//field.focus(); 
		document.reg.login.select();
		document.reg.login.focus();
//field.select();
	return false;
   }

var c = field.value.charAt(0);
        if(!isLetter(c))
		{
		alert("Invalid Entry...Only lower case characters allowed in First Alphabet");
		document.reg.login.select();
		document.reg.login.focus();

        return false;
		}
function isLetter (c)
{   return ( ((c >= "a") && (c <= "z")))
}

if(field.value == "itc")
	{
		alert(" Sorry. Invalid entry ");
		document.reg.login.select();
		document.reg.login.focus();

		return false;
	}

var c = field.value.charAt(0);
	if (c >= 0)
    {
	alert("Cannot start with numeric");
	document.reg.login.focus();
	return false;
	}
	else
	{
	   return true;
	}
}

function checkEmail(myForm) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.email.value)){
	return (true);
}
	alert("Invalid E-mail Address! Please re-enter.");
	document.reg.email.focus();
	document.reg.email.select();
	return (false);
}

function validate2(field) {
	var valid = "abcdefghijklmnopqrstuvwxyz0123456789._-"
	var ok = "yes";
	var temp;
	for (var i=0; i<field.value.length; i++) {
	temp = "" + field.value.substring(i, i+1);
	if (valid.indexOf(temp) == "-1") ok = "no";
}
	if (ok == "no" || ok == " ") {
	alert("Invalid entry!  Only lower case characters and numbers are accepted!");
//field.focus(); 
		document.reg.login1.select();
		document.reg.login1.focus();
//field.select();
	return false;
   }

var c = field.value.charAt(0);
        if(!isLetter(c))
		{
		alert("Invalid Entry...Only lower case characters allowed in First Alphabet");
		document.reg.login1.select();
		document.reg.login1.focus();

        return false;
		}
function isLetter (c)
{   return ( ((c >= "a") && (c <= "z")))
}

if(field.value == "itc")
	{
		alert(" Sorry. Invalid entry ");
		document.reg.login1.select();
		document.reg.login1.focus();

		return false;
	}

var c = field.value.charAt(0);
	if (c >= 0)
    {
	alert("Cannot start with numeric");
	document.reg.login1.focus();
	return false;
	}
	else
	{
	   return true;
	}
}