
<!--
function testForm() {

var fName=document.reg.fName;
var vfName=document.reg.fName.value;
var vlName=document.reg.lName.value;
var lName=document.reg.lName;
var password=document.reg.password;
var vpassword=document.reg.password.value;
var passwordR=document.reg.passwordR;
var present_date = new Date();
var add1= document.reg.address1.value;
var add2= document.reg.address2.value;	
	yy = present_date.getFullYear() ;
	mm = present_date.getMonth();
	dd = present_date.getDate();
var emailStr = document.reg.emailAdd.value;
var dayV = document.reg.dayVal;
var monthV = document.reg.monthVal;
var yearV = document.reg.year;
var add1 = document.reg.address1;
var add2 = document.reg.address2;
var cityV = document.reg.city;
var stateV = document.reg.state;
var pinC = document.reg.pincode;
var phNo = document.reg.phoneNumber;
var occupation = document.reg.occupation;
var Income = document.reg.Income;
var emailAdd = document.reg.emailAdd;
var agree = document.reg.agree;
var regForm = document.reg;


if ((fName.value == "")||(fName.value ==" "))
{
alert("Please enter First Name.");
 			fName.select();
  			fName.focus();
    return false;
}
var str=vfName;
for (var i = 0; i < str.length; i++) 
	{
 		 var ch = str.substring(i, i + 1);
 		 if ( (ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)  && (ch != " ")  )
	{
   			alert("Please enter your correct First Name. You can not type anything other than alphabets.");
 			fName.select();
  			fName.focus();
 			return false;
		  }

}
	
if ((lName.value == "")||(lName.value ==" "))
{
alert("Please enter your Last Name.");
 			lName.select();
  			lName.focus();
    return false;
}

var str=vlName;
for (var i = 0; i < str.length; i++) 
	{
 		 var ch = str.substring(i, i + 1);
 		 if ( (ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)   && (ch != " ")  )
	{
   			alert("Please enter your correct Last Name. You can not type anything other than alphabets.");
 			lName.select();
  			lName.focus();
 			return false;
		  }
}





if ((password.value == ""))
		{
			alert("Please enter password.");
 			password.select();
  			password.focus();
		    return false;
		}

if ((passwordR.value == ""))
		{
			alert("Please enter 'Retype-Password'.");
 			passwordR.select();
  			passwordR.focus();
		    return false;
		}

if ((password.value!==passwordR.value))
		{
			alert("Your 'Password' is different than 'Retype Password'");
 			passwordR.select();
  			passwordR.focus();
		    return false;
		}

var str=vpassword;
for (var i = 0; i < str.length; i++) 
	{
 		 var ch = str.substring(i, i + 1);
 		 if ( ((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch) && (ch < "0" || "9" < ch) && (ch != '_')) )
{
   			alert("You can create a Password with a combination of only letters, numbers & underscore. No other characters will be accepted. Please type in a new password.");
 			password.select();
  			password.focus();
 			return false;
		  }
}

if ((password.value.length<4)||(password.value.length>12))
		{
			alert("Password should be minimum of 4 to maximum of 12 characters in length.");
		    return false;
		}




if ((occupation.value == "0"))
   {
      alert("Please select one of the option describing your Occupation.");
      occupation.select();
  	  occupation.focus();
      return false;
     }




if ((dayV.value == "0"))
{
alert("Please select Date of Birth.");
		dayV.select();
		dayV.focus();
    return false;
}

if ((monthV.value == "0"))
{
alert("Please select Month of Birth.");
		monthV.select();
		monthV.focus();
    return false;
}  	

if ((yearV.value == "")||(yearV.value.length < 4))
{
alert("The Year field is either empty or not in YYYY format. Please enter the Year field correctly.")
		yearV.select();
		yearV.focus();
		return false;
}  	

if (isNaN(yearV.value))
{
alert("The birth year should be numeric. Please re-enter the correct year of birth.");
	yearV.select();
	yearV.focus();
    return false;
} 
if( (yearV.value < (yy-80) ) || (yearV.value > (yy-15) ) )
	{
		alert("Please enter the correct year of birth. Your age should be between 16 and 80 years")
		yearV.select();
		yearV.focus();
		return false;
	}

	
if ((add1.value == ""))
{
alert("Please enter the Address Line 1.");
 			add1.select();
  			add1.focus();
    return false;
}

var str=add1;
for (var i = 0; i < str.length; i++) 
	{
 		 var ch = str.substring(i, i + 1);
 		 if ((ch == '|') || (ch=='"'))
		{
		 alert('You can not use special characters like " or | in your address.');
 			add1.select();
  			add1.focus();
		 return false;
		}
}
	
if ((add2.value == ""))
{
alert("Please enter the Address Line 2.");
 			add2.select();
  			add2.focus();
    return false;
}

var str=add2;
for (var i = 0; i < str.length; i++) 
	{
 		 var ch = str.substring(i, i + 1);
 		 if ((ch == '|') || (ch=='"'))
		{
		 alert('You can not use special characters like " or | in your address.');
 			add2.select();
  			add2.focus();
		 return false;
		}
}

if ((cityV.value == ""))
{
alert("Please enter CITY.");
	cityV.select();
  	cityV.focus();
    return false;
}

if ((stateV.value == ""))
{
alert("Please enter STATE.");
	stateV.select();
  	stateV.focus();
    return false;
}


var str=phNo.value;
if ((str == ""))
{
alert("Please enter your telephone number.");
 			phNo.select();
  			phNo.focus();
    return false;
}

for (var i = 0; i < str.length; i++) 
{
 		 var ch = str.substring(i, i + 1);
 		 if ( isNaN(ch) && (ch != "-") && (ch != "(") && (ch != ")") )
		{
   			alert("Please enter your correct Telephone number. You can not type anything other than numbers or '-'.");
 			phNo.select();
  			phNo.focus();
 			return false;
		  }

}



// checks if the e-mail address is valid
if (emailStr == "") {
alert("Email is empty!!");
	emailAdd.select();
  	emailAdd.focus();
return false;
}

str = emailStr
for (var i = 0; i < str.length; i++) 
{
 		 var ch = str.substring(i, i + 1);
 		 if ((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch) && (ch < "0" || "9" < ch) && (ch != "-") && (ch != ".") && (ch != "@") && (ch != "_")   )
		{
		alert("Your email address seems incorrect. Check the '@' and '.' should be present in the email address. Invalid characters are not allowed.  Please try again.");
		emailAdd.select();
  		emailAdd.focus();
		return false;
		  }
}



if(!(agree.checked))
    {
alert("You need to click on the Terms of Services radio button before submitting the Registration Form.");
    return false;
}

regForm.action = "/register.asp";
regForm.submit();
}


function init() {
var regForm = document.reg;
regForm.swap.disabled = false;
}

// -->