function validate_premium()
{

	if(document.premium_form.UserName.value == "")
	{
		alert("Enter the UserName");
		document.premium_form.UserName.focus();
		return false;
	}

 	if(document.premium_form.Password.value == "")
	{
		alert("Enter the password");
		document.premium_form.Password.focus();
		return false;
	}
	
	if(document.premium_form.ConfirmPassword.value == "")
	{
		alert("Enter the Confirm Password");
		document.premium_form.ConfirmPassword.focus();
		return false;
	}
	
	if(document.premium_form.Password.value != document.premium_form.ConfirmPassword.value)
	{
		alert("your confirm password does not match");   
		document.premium_form.ConfirmPassword.focus();
		return false;  
	}

	if(document.premium_form.Name.value == "")
	{
		alert("Enter the Name");
		document.premium_form.Name.focus();
		return false;
	}
	else
	{
		val = document.premium_form.Name.value;
		len = document.premium_form.Name.value.length;
		lead = val.charAt(0);
		trial = val.charAt(len-1);
		if(lead == " ")
		{
			alert("Remove the leading spaces");
			document.premium_form.Name.focus();
			return false;
		}
		if(trial == " ")
		{
			alert("Remove the trailing spaces");
			document.premium_form.Name.focus();
			return false;
		}
		else
		{
			var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ "
			var ok = "yes";
			var temp;
			for(var i=0;i<document.premium_form.Name.value.length; i++)
			{
				temp = "" + document.premium_form.Name.value.substring(i, i+1);
				if(valid.indexOf(temp) == "-1")
					ok = "no";
			}
			if(ok == "no")
			{
				alert("Name must be Alphabets");
				document.premium_form.Name.focus();
				document.premium_form.Name.select();
				return false;
			}
		}
	}
	/*
	if(document.premium_form.Firmname.value == "")
	{
		alert("Enter the Firmname");
		document.premium_form.Firmname.focus();
		return false;
	}
	else
	{
		val = document.premium_form.Firmname.value;
		len = document.premium_form.Firmname.value.length;
		lead = val.charAt(0);
		trial = val.charAt(len-1);
		if(lead == " ")
		{
			alert("Remove the leading spaces");
			document.premium_form.Firmname.focus();
			return false;
		}
		if(trial == " ")
		{
			alert("Remove the trailing spaces");
			document.premium_form.Firmname.focus();
			return false;
		}
		else
		{
			var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ /"
			var ok = "yes";
			var temp;
			for(var i=0;i<document.premium_form.Firmname.value.length; i++)
			{
				temp = "" + document.premium_form.Firmname.value.substring(i, i+1);
				if(valid.indexOf(temp) == "-1")
					ok = "no";
			}
			if(ok == "no")
			{
				alert("Firmname must be Alphabets");
				document.premium_form.Firmname.focus();
				document.premium_form.Firmname.select();
				return false;
			}
		}
	}
	*/
	
	if(document.premium_form.Tel_office.value == "")
	{
		alert("Enter the Tel_office field");
		document.premium_form.Tel_office.focus();
		return false;
	}
	else
	{
		val = document.premium_form.Tel_office.value;
		len = document.premium_form.Tel_office.value.length;
		lead = val.charAt(0);
		trial = val.charAt(len-1);
		if(lead == " ")
		{
			alert("Remove the leading spaces");
			document.premium_form.Tel_office.focus();
			return false;
		}
		if(trial == " ")
		{
			alert("Remove the trailing spaces");
			document.premium_form.Tel_office.focus();
			return false;
		}
		else
		{
			var valid = "0123456789- ()"
			var ok = "yes";
			var temp;
			for(var i=0;i<document.premium_form.Tel_office.value.length; i++)
			{
				temp = "" + document.premium_form.Tel_office.value.substring(i, i+1);
				if(valid.indexOf(temp) == "-1")
					ok = "no";
			}
			if(ok == "no")
			{
				alert("Tel_office field  should be numeric");
				document.premium_form.Tel_office.focus();
				document.premium_form.Tel_office.select();
				return false;
			}
		}
	}
	/*if(document.premium_form.Tel_cell.value == "")
	{
		alert("Enter the Zipcode");
		document.premium_form.Tel_cell.focus();
		return false;
	}
	else
	{*/
		val = document.premium_form.Tel_cell.value;
		len = document.premium_form.Tel_cell.value.length;
		lead = val.charAt(0);
		trial = val.charAt(len-1);
		if(lead == " ")
		{
			alert("Remove the leading spaces");
			document.premium_form.Tel_cell.focus();
			return false;
		}
		if(trial == " ")
		{
			alert("Remove the trailing spaces");
			document.premium_form.Tel_cell.focus();
			return false;
		}
		else
		{
			var valid = "0123456789- ()"
			var ok = "yes";
			var temp;
			for(var i=0;i<document.premium_form.Tel_cell.value.length; i++)
			{
				temp = "" + document.premium_form.Tel_cell.value.substring(i, i+1);
				if(valid.indexOf(temp) == "-1")
					ok = "no";
			}
			if(ok == "no")
			{
				alert("Tel_cell field  should be numeric");
				document.premium_form.Tel_cell.focus();
				document.premium_form.Tel_cell.select();
				return false;
			}
		}
	//}
	if(document.premium_form.Email.value == "")
	{
		alert("Enter the email");
		document.premium_form.Email.focus();
		return false;
	}
	else
			{
				val = document.premium_form.Email.value;
				len = document.premium_form.Email.value.length;
				lead = val.charAt(0);
				trial = val.charAt(len-1);
			if(lead == " ")
				{
					alert("Remove the leading spaces");
					document.premium_form.Email.focus();
					return false;
				}
				if(trial == " ")
					{
						alert("Remove the trailing spaces");
						document.premium_form.Email.focus();
						return false;
					}
					else
					{
				if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.premium_form.Email.value)) {
					} else {
						alert("Invalid Email Id");
						document.premium_form.Email.focus();
						document.premium_form.Email.select();
						return false;
					}
		}
}
	/*if(document.premium_form.description.value == "")
	{
		alert("Enter the Name");
		document.premium_form.description.focus();
		return false;
	}
	else
	{*/
		val = document.premium_form.description.value;
		len = document.premium_form.description.value.length;
		lead = val.charAt(0);
		trial = val.charAt(len-1);
		if(lead == " ")
		{
			alert("Remove the leading spaces");
			document.premium_form.description.focus();
			return false;
		}
		if(trial == " ")
		{
			alert("Remove the trailing spaces");
			document.premium_form.description.focus();
			return false;
		}
		
	/*}
	if(document.premium_form.Areaoflaw.value == "")
	{
		alert("Enter the Name");
		document.premium_form.Areaoflaw.focus();
		return false;
	}
	else
	{*/
		val = document.premium_form.Areaoflaw.value;
		len = document.premium_form.Areaoflaw.value.length;
		lead = val.charAt(0);
		trial = val.charAt(len-1);
		if(lead == " ")
		{
			alert("Remove the leading spaces");
			document.premium_form.Areaoflaw.focus();
			return false;
		}
		if(trial == " ")
		{
			alert("Remove the trailing spaces");
			document.premium_form.Areaoflaw.focus();
			return false;
		}
		else
		{
			var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ "
			var ok = "yes";
			var temp;
			for(var i=0;i<document.premium_form.Areaoflaw.value.length; i++)
			{
				temp = "" + document.premium_form.Areaoflaw.value.substring(i, i+1);
				if(valid.indexOf(temp) == "-1")
					ok = "no";
			}
			if(ok == "no")
			{
				alert("Areaoflaw must be Alphabets");
				document.premium_form.Areaoflaw.focus();
				document.premium_form.Areaoflaw.select();
				return false;
			}
		}
	/*}
	if(document.premium_form.City.value == "")
	{
		alert("Enter the Name");
		document.premium_form.City.focus();
		return false;
	}
	else
	{*/
		val = document.premium_form.City.value;
		len = document.premium_form.City.value.length;
		lead = val.charAt(0);
		trial = val.charAt(len-1);
		if(lead == " ")
		{
			alert("Remove the leading spaces");
			document.premium_form.City.focus();
			return false;
		}
		if(trial == " ")
		{
			alert("Remove the trailing spaces");
			document.premium_form.City.focus();
			return false;
		}
		else
		{
			var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ "
			var ok = "yes";
			var temp;
			for(var i=0;i<document.premium_form.City.value.length; i++)
			{
				temp = "" + document.premium_form.City.value.substring(i, i+1);
				if(valid.indexOf(temp) == "-1")
					ok = "no";
			}
			if(ok == "no")
			{
				alert("City must be Alphabets");
				document.premium_form.City.focus();
				document.premium_form.City.select();
				return false;
			}
		}
	/*}
	if(document.premium_form.State.value == "")
	{
		alert("Enter the Name");
		document.premium_form.State.focus();
		return false;
	}
	else
	{*/
		val = document.premium_form.State.value;
		len = document.premium_form.State.value.length;
		lead = val.charAt(0);
		trial = val.charAt(len-1);
		if(lead == " ")
		{
			alert("Remove the leading spaces");
			document.premium_form.State.focus();
			return false;
		}
		if(trial == " ")
		{
			alert("Remove the trailing spaces");
			document.premium_form.State.focus();
			return false;
		}
		else
		{
			var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ "
			var ok = "yes";
			var temp;
			for(var i=0;i<document.premium_form.State.value.length; i++)
			{
				temp = "" + document.premium_form.State.value.substring(i, i+1);
				if(valid.indexOf(temp) == "-1")
					ok = "no";
			}
			if(ok == "no")
			{
				alert("State must be Alphabets");
				document.premium_form.State.focus();
				document.premium_form.State.select();
				return false;
			}
		}
	//}
	
return true;
}
