function checkValid(f) {

		if(isblank(f.firstname.value))
		{
			alert("You must enter first name to continue !!");
			f.firstname.focus();
			return false;
		}
		if(checkLength(f.firstname.value, 3, 50) == false)
		{
			alert("You must enter first name having atleast 3 and atmost 50 characters !!");
			f.firstname.focus();
			return false;
		}
		if(checkChar(f.firstname) == false)
		{
			alert("You must not include special characters (%, @ etc) in the first name !!");
			f.firstname.focus();
			return false;
		}
		if(checkSpace(f.firstname) == false)
		{
			alert("You must not include spaces in the first name !!");
			f.firstname.focus();
			return false;
		}

		if(isblank(f.lastname.value))
		{
			alert("You must enter last name to continue !!");
			f.lastname.focus();
			return false;
		}
		if(checkLength(f.lastname.value, 3, 50) == false)
		{
			alert("You must enter last name having atleast 3 and atmost 50 characters !!");
			f.lastname.focus();
			return false;
		}
		if(checkChar(f.lastname) == false)
		{
			alert("You must not include special characters (%, @ etc) in the last name !!");
			f.lastname.focus();
			return false;
		}
		if(checkSpace(f.lastname) == false)
		{
			alert("You must not include spaces in the last name !!");
			f.lastname.focus();
			return false;
		}
if	 (!isblank(f.address_1.value))
	   {
		
		 if(checkLength(f.address_1.value, 5, 100) == false)
		{
			alert("You must enter address 1 having atleast 5 and atmost 100 characters !!");
			f.address_1.focus();
			return false;
		}
}
	if(isblank(f.city.value))
		{
			alert("You can not leave the city empty; it is not optional !!");
			f.city.focus();
			return false;
		}

	if(isblank(f.state.value))
		{
			alert("You can not leave the state empty; it is not optional !!");
			f.state.focus();
			return false;
		}
if	 (!isblank(f.zipcode.value))
	   {
		if (isNaN(f.zipcode.value))
	   {
		    alert("You must enter the valid zip code empty !!");
			f.zipcode.focus();
			return false;
	    }
	    }


		if (f.country[f.country.selectedIndex].text == f.country[0].text)
		{
		 alert("Please choose your country. !!");
			f.country.focus();
			return false;
		}

	   
  if(isblank(f.email.value))
		{
			alert("You must enter email id to continue !!");
			f.email.focus();
			return false;
		}

	    if(checkEmail(f.email.value) == false)
		{
			f.email.focus();
			return false;
		}
  if(isblank(f.confirmemail.value))
		{
			alert("You must enter email confirmation to continue !!");
			f.confirmemail.focus();
			return false;
		}
		if (f.email.value != f.confirmemail.value)
	    {
	    	alert("Email confirmation is incorrect. Please enter it again !!");
			f.confirmemail.focus();
			return false;

	    }
		if(isblank(f.phone.value) == false)
				{

				if(checkLength(f.phone.value, 5, 15) == false)
				{
					alert("Your phone no. must have atleast 5 and atmost 15 characters !!");
					f.phone.focus();
					return false;
				}
				if(checkSpace(f.phone) == false)
				{
					alert("Your must not include spaces in phone no. eg. '01722215640' !!");
					f.phone.focus();
					return false;
				}
				if(checkTelephone(f.phone.value) == false)
				{
					alert("Your phone no. must be a number; please correct it !!");
					f.phone.focus();
					return false;
				}
			}
	 	if(isblank(f.username.value))
		{
			alert("You must enter Username to continue !!");
			f.username.focus();
			return false;
		}

		if(checkLength(f.username.value, 8, 20) == false)
		{
			alert("You must enter Username having atleast 8 and atmost 20 characters !!");
			f.username.focus();
			return false;
		}
		if(checkChar(f.username) == false)
		{
			alert("You must not include special characters (%, @ etc) in the Username !!");
			f.username.focus();
			return false;
		}
		if(checkSpace(f.username) == false)
		{
			alert("You must not include spaces in the Username !!");
			f.username.focus();
			return false;
		}

		
	 	if(isblank(f.password.value))
		{
			alert("You must enter password to continue !!");
			f.password.focus();
			return false;
		}
		if(checkLength(f.password.value, 8, 25) == false)
		{
			alert("You must enter password having atleast 8 and atmost 25 characters !!");
			f.password.focus();
			return false;
		}
		/*
		if(checkChar(f.password) == false)
		{
			alert("You must not include special characters (%, @ etc) in the password !!");
			f.password.focus();
			return false;
		}
*/	
	if(checkSpace(f.password) == false)
		{
			alert("You must not include spaces in the password !!");
			f.password.focus();
			return false;
		}


		if(isblank(f.confirmpassword.value))
		{
			alert("You must enter password confirmation to continue !!");
			f.confirmpassword.focus();
			return false;
		}


	    if (f.password.value != f.confirmpassword.value)
	    {
	    	alert("Password confirmation is incorrect. Please enter it again !!");
			f.confirmpassword.focus();
			return false;

	    }
if(isblank(f.securityCode.value))
		{
			alert("You must enter Security Code to continue !!");
			f.securityCode.focus();
			return false;
		}

		if (f.terms.checked == 0)
		{
			alert("You must agreed to terms and condtions");
			f.terms.focus();
			return false;

		}

		submitonce(f);
	}
	
