function valid()
{
	if(document.registration.fname.value.length<1)
	{
	alert("Pls Enter First Name");
	document.registration.fname.focus();
	return false;
	}
	chk1="!@#$%^&*_|\~`{}[]:<>?/,'.";
	for(i=0;i!=document.registration.fname.value.length;i++)
	{
	ch1=document.registration.fname.value.charAt(i);
	rtn1=chk1.indexOf(ch1);
		if(rtn1!=-1)
		{
		alert("Pls Enter Valid First Name.");
		document.registration.fname.focus();
		return false;
		break;
		}
	}
	
	if(document.registration.lname.value.length<1)
	{
	alert("Pls Enter Last Name");
	document.registration.lname.focus();
	return false;
	}
	chk1="!@#$%^&*_|\~`{}[]:<>?/,'.";
	for(i=0;i!=document.registration.lname.value.length;i++)
	{
	ch1=document.registration.lname.value.charAt(i);
	rtn1=chk1.indexOf(ch1);
		if(rtn1!=-1)
		{
		alert("Pls Enter Valid Last Name.");
		document.registration.lname.focus();
		return false;
		break;
		}
	}
	
	if(document.registration.address.value.length<1)
	{
	alert("Pls Enter Address");
	document.registration.address.focus();
	return false;
	}

	if(document.registration.city.value.length<1)
	{
	alert("Pls Enter City");
	document.registration.city.focus();
	return false;
	}
	chk1="!@#$%^&*_|\~`{}[]:<>?/,'.";
	for(i=0;i!=document.registration.city.value.length;i++)
	{
	ch1=document.registration.city.value.charAt(i);
	rtn1=chk1.indexOf(ch1);
		if(rtn1!=-1)
		{
		alert("Pls Enter Valid City.");
		document.registration.city.focus();
		return false;
		break;
		}
	}
	
	if(document.registration.zipcode.value.length<1)
	{
	alert("Pls Enter Zip Code");
	document.registration.zipcode.focus();
	return false;
	}
	chk1="!@#$%^&*_|\~`{}[]:<>?/,'.abcdefghijklmnopqrstuvwxyz";
	for(i=0;i!=document.registration.zipcode.value.length;i++)
	{
	ch1=document.registration.zipcode.value.charAt(i);
	rtn1=chk1.indexOf(ch1);
		if(rtn1!=-1)
		{
		alert("Pls Enter Valid Zip Code.");
		document.registration.zipcode.focus();
		return false;
		break;
		}
	}
	
	if(document.registration.state.value.length<1)
	{
	alert("Pls Enter State");
	document.registration.state.focus();
	return false;
	}
	chk1="!@#$%^&*_|\~`{}[]:<>?/,'.";
	for(i=0;i!=document.registration.state.value.length;i++)
	{
	ch1=document.registration.state.value.charAt(i);
	rtn1=chk1.indexOf(ch1);
		if(rtn1!=-1)
		{
		alert("Pls Enter Valid State.");
		document.registration.state.focus();
		return false;
		break;
		}
	}
	
	if(document.registration.month1.options.value=="0")
	{
	alert("Pls Select Month");
	document.registration.month1.focus();
	return false;
	}
	
	if(document.registration.day1.options.value=="0")
	{
	alert("Pls Select Day");
	document.registration.day1.focus();
	return false;
	}
	
	if(document.registration.year1.options.value=="0")
	{
	alert("Pls Enter Year");
	document.registration.year1.focus();
	return false;
	}
	
	chk1="!@#$%^&*_|\~`{}[]:<>?/,'.abcdefghijklmnopqrstuvwxyz";
	for(i=0;i!=document.registration.phone.value.length;i++)
	{
	ch1=document.registration.phone.value.charAt(i);
	rtn1=chk1.indexOf(ch1);
		if(rtn1!=-1)
		{
		alert("Pls Enter Valid Phone No.");
		document.registration.phone.focus();
		return false;
		break;
		}
	}

	chk1="!@#$%^&*_|\~`{}[]:<>?/,'.abcdefghijklmnopqrstuvwxyz";
	for(i=0;i!=document.registration.fax.value.length;i++)
	{
	ch1=document.registration.fax.value.charAt(i);
	rtn1=chk1.indexOf(ch1);
		if(rtn1!=-1)
		{
		alert("Pls Enter Valid Fax No.");
		document.registration.fax.focus();
		return false;
		break;
		}
	}

		chk1="!@#$%^&*_|\~`{}[]:<>?/,'.abcdefghijklmnopqrstuvwxyz";
	for(i=0;i!=document.registration.mobile.value.length;i++)
	{
	ch1=document.registration.mobile.value.charAt(i);
	rtn1=chk1.indexOf(ch1);
		if(rtn1!=-1)
		{
		alert("Pls Enter Valid Mobile No.");
		document.registration.mobile.focus();
		return false;
		break;
		}
	}

	
	var input = document.registration.email.value ;
	var lenth = input.length ;
	var ctr=0 ;
  	for ( i = 0; i < lenth; i++ )
	if ( ( document.registration.email.value.charAt(i) == '!' ) || ( document.registration.email .value.charAt(i) == '#' ) )
    {
	  alert("Please enter a proper email address") ;
	  document.registration.email.focus();
      return false;
    }
	if (input == "")
	{
		alert("Please enter email address") ;
		document.registration.email.focus();
		return false ;
	}
	if(input.length == 40)
	{
		alert("Please enter a proper email address") ;
		document.registration.email.focus();
		return false ;
	}
	for ( i=0; i < lenth; i++ )
	{
		var oneChar = input.charAt(i) ;
		if(oneChar == "@")
		{
			ctr = ctr+1 ;
		}
		if ( (i == 0 && oneChar == "@") || (i == 0 && oneChar == ".") || 
			( oneChar == " " ) )
		{
			alert ( "This does not seem to be a proper email address" ) ;
			document.registration.email.focus();
			return false ;
		}
		if ( (oneChar == "@" && input.charAt(i+1) == ".") || 
			(oneChar == "." && input.charAt(i+1) == "@") ||
			(oneChar == "." && input.charAt(i+1) == ".") )
		{
			alert ( "This does not seem to be a proper email address" ) ;
			document.registration.email.focus();
			return false ;
		}
		if( input.indexOf("@") < 2 )
		{
			alert ( "This does not seem to be a proper email address" ) ;
			document.registration.email.focus();
			return false ;
		}
		if(input.indexOf(".")<4)
		{
			alert ( "This does not seem to be a proper email address" ) ;
			document.registration.email.focus();
			return false ;
		}
		if (ctr > 1)
		{
			alert ( "This does not seem to be a proper email address" ) ;
			document.registration.email.focus();
			return false ;
		}
	}  
	
	if(document.registration.website.value.length > 1)
	{
		if (document.registration.website.value == "" || document.registration.website.value.indexOf ('www', 0) == -1 || document.registration.website.value.length < 10) 
	{
	if (document.registration.website.value == "" || document.registration.website.value.indexOf ('.com', 0) == -1 || document.registration.website.value.length < 10) 
	{
		alert ("Enter a valid URL")
		document.registration.website.focus();
		return false;
	}
	}}
	
	chk1="!@#$%^&*_|\~`{}[]:<>?/,'";
	for(i=0;i!=document.registration.company.value.length;i++)
	{
	ch1=document.registration.company.value.charAt(i);
	rtn1=chk1.indexOf(ch1);
		if(rtn1!=-1)
		{
		alert("Pls Enter Valid Company.");
		document.registration.company.focus();
		return false;
		break;
		}
	}

	chk1="!@#$%^&*_|\~`{}[]:<>?/,'.abcdefghijklmnopqrstuvwxyz";
	for(i=0;i!=document.registration.companyphone.value.length;i++)
	{
	ch1=document.registration.companyphone.value.charAt(i);
	rtn1=chk1.indexOf(ch1);
		if(rtn1!=-1)
		{
		alert("Pls Enter Valid Company Phone No.");
		document.registration.companyphone.focus();
		return false;
		break;
		}
	}
	
	if(document.registration.user.value.length<6)
	{
	alert("User should be six charcter");
	document.registration.user.focus();
	return false;
	}
	chk1="!@#$%^&*|\~`{}[]:<>?/,'.";
	for(i=0;i!=document.registration.user.value.length;i++)
	{
	ch1=document.registration.user.value.charAt(i);
	rtn1=chk1.indexOf(ch1);
		if(rtn1!=-1)
		{
		alert("Pls Enter Valid User Name.");
		document.registration.user.focus();
		return false;
		break;
		}
	}
	
	if(document.registration.password.value.length<6)
	{
	alert("password should be six charcter");
	document.registration.password.focus();
	return false;
	}
	chk1="!@#$%^&*_|\~`{}[]:<>?/,'.";
	for(i=0;i!=document.registration.password.value.length;i++)
	{
	ch1=document.registration.password.value.charAt(i);
	rtn1=chk1.indexOf(ch1);
		if(rtn1!=-1)
		{
		alert("Pls Enter Valid Password.");
		document.registration.password.focus();
		return false;
		break;
		}
	}
	
	if(document.registration.password1.value.length<6)
	{
	alert("Confirm Password should be six charcter");
	document.registration.password1.focus();
	return false;
	}
	chk1="!@#$%^&*_|\~`{}[]:<>?/,'.";
	for(i=0;i!=document.registration.password1.value.length;i++)
	{
	ch1=document.registration.password1.value.charAt(i);
	rtn1=chk1.indexOf(ch1);
		if(rtn1!=-1)
		{
		alert("Pls Enter Valid Password.");
		document.registration.password1.focus();
		return false;
		break;
		}
	}
	
	if((document.registration.password.value) != (document.registration.password1.value))
	{
	alert("Please Enter Same Password");
	return false;
	}
	
	
	if(document.registration.no.value.length<2)
	{
	alert("Pls Enter Check or DD No.");
	document.registration.no.focus();
	return false;
	}	
	chk1="!@#$%^&*_|\~`{}[]:<>?/,'abcdefghijklmnopqrstuvwxyz.";
	for(i=0;i!=document.registration.no.value.length;i++)
	{
	ch1=document.registration.no.value.charAt(i);
	rtn1=chk1.indexOf(ch1);
		if(rtn1!=-1)
		{
		alert("Pls Enter Valid Check or DD No.");
		document.registration.no.focus();
		return false;
		break;
		}
	}
	
	if(document.registration.bankname.value.length<1)
	{
	alert("Pls Enter Bank Name");
	document.registration.bankname.focus();
	return false;
	}
	chk1="!@#$%^&*_|\~`{}[]:<>?/,'.";
	for(i=0;i!=document.registration.bankname.value.length;i++)
	{
	ch1=document.registration.bankname.value.charAt(i);
	rtn1=chk1.indexOf(ch1);
		if(rtn1!=-1)
		{
		alert("Pls Enter Valid Bank Name.");
		document.registration.bankname.focus();
		return false;
		break;
		}
	}
	
	if(document.registration.month2.options.value=="0")
	{
	alert("Pls Select Month");
	document.registration.month2.focus();
	return false;
	}
	
	if(document.registration.day2.options.value=="0")
	{
	alert("Pls Select Day");
	document.registration.day2.focus();
	return false;
	}
	
	if(document.registration.year2.options.value=="0")
	{
	alert("Pls Select Year");
	document.registration.year2.focus();
	return false;
	}
	
	if(document.registration.amt.value.length<0)
	{
	alert("Plz do not fill amount");
	document.registration.amt.focus();
	return false;
	}	
	
	chk1="!@#$%^&*_|\~`{}[]:<>?/,'";
	for(i=0;i!=document.registration.amt.value.length;i++)
	{
	ch1=document.registration.amt.value.charAt(i);
	rtn1=chk1.indexOf(ch1);
		if(rtn1!=-1)
		{
		alert("Pls Enter Valid Amount");
		document.registration.amt.focus();
		return false;
		break;
		}
	}
}
function cal()
{
	if(document.registration.price[0].checked)
	{
		if(document.registration.duration[0].checked)
		{
			document.registration.amt.value="200";
		}
		if(document.registration.duration[1].checked)
		{
			document.registration.amt.value="350";
		}
		if(document.registration.duration[2].checked)
		{
			document.registration.amt.value="500";
		}
		if(document.registration.ppage[0].checked)
		{
			document.registration.amt.value=parseInt(document.registration.amt.value) + parseInt(100);
		}
	}else
	{
		if(document.registration.duration[0].checked)
		{
			document.registration.amt.value="20";
		}
		if(document.registration.duration[1].checked)
		{
			document.registration.amt.value="35";
		}
		if(document.registration.duration[2].checked)
		{
			document.registration.amt.value="50";
		}
		if(document.registration.ppage[0].checked)
		{
			document.registration.amt.value=parseInt(document.registration.amt.value) + parseInt(10);
		}		
	}
}