
function fnRegValidate()
{
	//FOR First Name
	if(!(fnCheckLength("First Name",document.getElementById("txtFName"),1,40)))	
		return(false);
	
	//FOR Last Name
	if(!(fnCheckLength("Last Name",document.getElementById("txtLName"),1,40)))	
		return(false);
	
	
	// FOR EMAIL
	if (!(fnCheckLength("Email",document.getElementById("txtEmail"),1,40)))
			return (false);	
	
	// VALID EMAIL FORMAT
	if (!(fnIsValidEmail(document.getElementById("txtEmail"))))
		return (false);
	
	//FOR Address
	if(!(fnCheckLength("Address",document.getElementById("txtAddress"),1,40)))	
		return(false);
		
	//FOR City
	if(!(fnCheckLength("City",document.getElementById("txtCity"),1,40)))	
		return(false);
		
	//FOR SCHEME CHOSEN 
	if(document.getElementById("cmbPlan").value=='') 
	{ 
		alert("Please select the Subscription Scheme!"); 
		//document.frmReg.cmdPlan.focus(); 
		return (false); 
	} 
	
	// 	FOR LOGIN NAME		
		if (!(fnCheckLength("Login Name",document.getElementById("txtLogin"),1,12)))
			return (false);
		// CHECKING FOR NO SPECIAL CHARS 
		if (!(fnIsValidAlpha("Login Name",document.getElementById("txtLogin"))))
				return (false);
		// CHECKING FOR SPACES IN BETWEEN
		if (!(fnCheckWhiteSpaces("Login Name",document.getElementById("txtLogin"))))
				return (false);
	
	// FOR PASSWORD1
		if (!(fnCheckLength("Password",document.getElementById("txtPassword"),6,12)))
			return (false);
	
	// PASSWORD CANNOT BE SAME AS THE SIGN IN NAME
		if (document.getElementById("txtLogin").value.toUpperCase() == document.getElementById("txtPassword").value.toUpperCase())
		{
			alert("Password cannot be same as sign-in name");
			document.getElementById("txtPassword").focus();
			return (false);
		} 
		// CHECKING FOR NO SPECIAL CHARS	
		if (!(fnIsValidAlpha("Password",document.getElementById("txtPassword"))))
				return (false);
		// CHECKING FOR SPACES IN BETWEEN		
		if (!(fnCheckWhiteSpaces("Password",document.getElementById("txtPassword"))))
				return (false);
	//alert("Password1 Checked");
	// CHECKING FOR PASSWORD1 MATHCING WITH PASSWORD2
	if (document.getElementById("txtPassword").value != document.getElementById("txtConfirmPassword").value)
	{
		alert("The passwords do not match! Please retry..");
		document.getElementById("txtPassword").value = "";
		document.getElementById("txtConfirmPassword").value = "";
		document.getElementById("txtPassword").focus();
		return (false);
	}
	

	//// 	FOR LOGIN NAME		

	//	if (!(fnCheckLength("Name on Card",document.getElementById("txtCardName"),1,50)))
	//		return (false);

	//// 	FOR LOGIN NAME		

	//	if (!(fnCheckLength("Card number",document.getElementById("txtCardNumber"),1,16)))
	//		return (false);


	if (document.getElementById("txtCardNumber").value !="" && isNaN(document.getElementById("txtCardNumber").value))
			{
				alert("Please enter numeric value for Card Number in the given box");
				document.getElementById("txtCardNumber").focus();
				return (false);
			}
	if (document.getElementById("txtCardNumber").value !="" && (document.getElementById("txtCardNumber").value).length!=16)
			{
				alert("Please 16 digit Card Number in the given box");
				document.getElementById("txtCardNumber").focus();
				return (false);
			}

	
	if (document.getElementById("chkAgreed").checked==false)
	{
		alert("Please go through the terms and conditions");
		document.getElementById("chkAgreed").focus();
		return (false);
	}
	return (true);
}



