
function validateEntry() 
{
	
	  var obj = document.getElementById("form");
	  var email     = obj.customer_email.value.toLowerCase();
	  var email2    = obj.customer_email2.value.toLowerCase();
	  var alt_email = obj.customer_alt_email.value.toLowerCase();


	  if (obj.license_owner.value.length < 3 || obj.license_owner.value.length > 50){
	   alert("Please, give the name of the license owner.");
	   obj.license_owner.focus();
	   return false;
	 }
	 
	 if (obj.customer_name.value.length < 3 || obj.customer_name.value.length > 50){
	   alert("Please, enter your name.");
	   obj.customer_name.focus();
	   return false;
	 }
	 
	 if ( (email.length<3) || (email.length>100) || (email.indexOf(",") > 0) || (email.indexOf("*") > 0) || (email.indexOf("@") < 0) || (email.indexOf(".") < 0) || (email.indexOf(" ") > 0) )
	 {
	   alert("Please, enter a valid e-mail address. It's used to delived the license file to you.");
	   obj.e_mail.focus();
	   return false;
	 }
	 
	 if ( (alt_email.length>0) && ( (alt_email.indexOf(",") > 0) || (alt_email.indexOf("*") > 0) || (alt_email.indexOf("@") < 0) || (alt_email.indexOf(".") < 0) || (alt_email.indexOf(" ") > 0)) )
	 {
	   alert("Please, enter a valid alternative e-mail address. It's used to delived the license file to you.");
	   obj.alt_email.focus();
	   return false;
	 }
	

	 if ( (email.indexOf("@aol.") > 0) || (email.indexOf("@comcast.") > 0)) {
	   if ( obj.alt_email.value.length<3 ) {
		 alert("Please, provide an alternative e-mail address.");
		 obj.alt_email.focus();
		 return false;
	   }
	 }
	 
	 if ( (alt_email.indexOf("@comcast.")>0) || (alt_email.indexOf("@aol.")>0) )
	 {
	   alert("Please, provide a non-aol.com and non-comcast.net e-mail address as your alternative e-mail address.");
	   obj.alt_email.focus();
	   return false;
	 }

	 if (email == alt_email){
	   alert("Please give a valid alternative e-mail address or leave the field blank, it doesn't help to give the same address twice.");
	   obj.alt_email.focus();
	   return false;
	 }
	 
	 if (email != email2){
	   alert("Please, check the E-mail address and the Re-enter e-mail address fields. The entered two addresses are not identical.");
	   obj.customer_email2.focus();
	   return false;
	 }

	 var i = email.indexOf("@");
     var j = alt_email.indexOf("@");

	 var serveri1 = email.substring(i+1, i+20);
	 var serveri2 = alt_email.substring(j+1, j+20);

	 if (serveri1 == serveri2)
	 {
	   alert("Both your primary e-mail address and the alternative e-mail address use the same e-mail service provider ('" +serveri1+ "'). Please provide an alternative e-mail address from some other e-mail service provider or leave the field blank.");
	   obj.alt_email.focus();
	   return false;
	 }

}


function winopen(url) {
	wasOpen = false;
	win = window.open(url);
	return false;
}