function validate_anaForm(theForm){
	if((isEmpty(theForm.firstname.value))||(isWhitespace(theForm.firstname.value))){
		alert("Please enter your First Name");
		theForm.firstname.focus();
		return(false);
	}
	
	 if(!isValidChar(theForm.firstname.value)){
	 	alert("Please enter a valid First Name");
		theForm.firstname.focus();
		return(false);
	 }
	 
	 if((isEmpty(theForm.lastname.value))|| (isWhitespace(theForm.lastname.value))){
		alert("Please enter your Last Name");
		theForm.lastname.focus();
		return(false);
	}
	
	 if(!isValidChar(theForm.lastname.value)){
	 	alert("Please enter a valid Last Name");
		theForm.lastname.focus();
		return(false);
	 }
 
		 
	 if((isEmpty(theForm.address.value))|| (isWhitespace(theForm.address.value))){
		alert("Please enter your Address");
		theForm.address.focus();
		return(false);
	}
	
	 if(!isValidChar(theForm.address.value)){
	 	alert("Please enter a valid Address");
		theForm.address.focus();
		return(false);
	 }
		
	if(theForm.address.value.length > 250){
		alert("Adrress should be within 250 characters");
		theForm.address.focus();
		return(false);
	}

	if((isEmpty(theForm.city.value))|| (isWhitespace(theForm.city.value))){
		alert("Please enter your City");
		theForm.city.focus();
		return(false);
	}
	
	 if(!isValidChar(theForm.city.value)){
	 	alert("Please enter a valid City");
		theForm.city.focus();
		return(false);
	}
	 
       if((isEmpty(theForm.state.value))|| (isWhitespace(theForm.state.value))){
		alert("Please enter your State");
		theForm.state.focus();
		return(false);

      }

	  if(!isValidChar(theForm.state.value)){
	 	alert("Please enter a valid State");
		theForm.state.focus();
		return(false);

		
      }

	 if((isEmpty(theForm.zip.value))|| (isWhitespace(theForm.zip.value))){
		alert("Please enter your Zip Code");
		theForm.zip.focus();
		return(false);
	}
	
	 if(!isDigit(theForm.zip.value)){
	 	alert("Please enter a valid Zip Code");
		theForm.zip.focus();
		return(false);
	 }
	 	
if((isEmpty(theForm.country.value))|| (isWhitespace(theForm.country.value))){
		alert("Please enter your country");
		theForm.country.focus();
		return(false);
	}
	
	 if(!isValidChar(theForm.country.value)){
	 	alert("Please enter a valid country");
		theForm.country.focus();
		return(false);
	 }


	if((isEmpty(theForm.emailid.value))||(isWhitespace(theForm.emailid.value))){
		alert("Please enter your Email ID");
		theForm.emailid.focus();
		return(false);
	}
	 if(!isEmail(theForm.emailid.value)){
	 	alert("Please enter a valid Email ID");
		theForm.emailid.focus();
		return(false);
	 }
	if((isEmpty(theForm.compname.value))|| (isWhitespace(theForm.compname.value))){
		alert("Please enter your Company Name");
		theForm.compname.focus();
		return(false);
	}
	
	 if(!isValidChar(theForm.compname.value)){
	 	alert("Please enter a valid Company Name");
		theForm.compname.focus();
		return(false);
	 }
if((isEmpty(theForm.designation.value))|| (isWhitespace(theForm.designation.value))){
		alert("Please enter your Designation");
		theForm.designation.focus();
		return(false);
	}
	
	 if(!isValidChar(theForm.designation.value)){
	 	alert("Please enter a valid Designation");
		theForm.designation.focus();
		return(false);
	 }
	 
if((isEmpty(theForm.phoneno.value))|| (isWhitespace(theForm.phoneno.value))){
		alert("Please enter your Phone Number");
		theForm.phoneno.focus();
		return(false);
	}
	
	 if(!isValidChar(theForm.phoneno.value)){
	 	alert("Please enter a valid Phone Number");
		theForm.phoneno.focus();
		return(false);
	 }

	theForm.action = "sendinfo.php";
	theForm.submit();
}

function netscapeKeyPress(e) {
    if (e.which == 13)
       validate_anaForm(document.anaForm);
    }

function microsoftKeyPress() {
    if (window.event.keyCode == 13)
       validate_anaForm(document.anaForm);
    }

if (navigator.appName == 'Netscape') {
    window.captureEvents(Event.KEYPRESS);
    window.onKeyPress = netscapeKeyPress;
}

