
function chkAllfields()

{
   	if(isEmptyString(window.document.form2.fnm.value.toString()))
	{
		window.alert("Please enter your First Name.");
		window.document.form2.fnm.value="";
		window.document.form2.fnm.focus();
		return false;
	}
   	if(isEmptyString(window.document.form2.lnm.value.toString()))
	{
		window.alert("Please enter your Last Name.");
		window.document.form2.lnm.value="";
		window.document.form2.lnm.focus();
		return false;
	}
   	if(window.document.form2.company.value=="")
	{
		window.alert("Please enter your Company Name.");
		window.document.form2.company.value="";
		window.document.form2.company.focus();
		return false;
	}
	if(window.document.form2.address.value=="")
	{
		window.alert("Please enter your Address.");
		window.document.form2.address.value="";
		window.document.form2.address.focus();
		return false;
	}
	if(window.document.form2.city.value=="")
	{
		window.alert("Please enter your City.");
		window.document.form2.city.value="";
		window.document.form2.city.focus();
		return false;
	}
	/*if(window.document.form2.state.value=="sel")
	{
		window.alert("Please choose your State.");
		window.document.form2.state.focus();
		return false;

	}*/
	if(window.document.form2.software.value=="")
	{
		window.alert("Please enter How did you find us.");
		window.document.form2.software.focus();
		return false;

	}
	if(window.document.form2.zip.value=="")



	{



		window.alert("Please enter your Zip.");



		window.document.form2.zip.value="";



		window.document.form2.zip.focus();



		return false;



	}



	if(window.document.form2.phone.value=="")



	{



		window.alert("Please enter your Phone No.");



		window.document.form2.phone.value="";



		window.document.form2.phone.focus();



		return false;



	}



	if(isValid_Phone(window.document.form2.phone.value.toString()))



	{



		window.alert("Please enter your valid Phone No. \n only allow 1234567890+-.()-\/ and space");



		window.document.form2.phone.value="";



		window.document.form2.phone.focus();



		return false;



	}



	if(isEmptyString(window.document.form2.email.value.toString()))



	{



		window.alert("Please enter your Email.");



		window.document.form2.email.value="";



		window.document.form2.email.focus();



		return false;



	}



	if (!isvalidmail(window.document.form2.email.value.toString()))



	{



		window.alert("Please enter your Valid E-mail address");



		window.document.form2.email.value="";



		window.document.form2.email.focus();



		return false;



	}



}



All_phonechars = " 1234567890+-.()-\/";



function isValid_Phone(s)



{



	var i;



	for(i=0;i < s.length;i++)



	{



		var currchar = s.charAt(i);



		//window.alert(All_phonechars.indexOf(currchar));



		if(All_phonechars.indexOf(currchar) == -1)



		{



			return true;



		}



	}



	return false;



}



function isvalidmail(str) //function to validate Email Address



{



	var temp = str;



	var obj =/^(\w|-|\.)+@(\w|-)+\.\w{2,3}(\.\w{2,3})?$/;



	return obj.test(temp); 



}



whitespace = "\t \n\r";



function isEmptyString(s)



{



    var i;



	if((s == null) || (s.length == 0)) return true;



	for(i=0;i < s.length;i++)



	{



		var currchar = s.charAt(i);



		if(whitespace.indexOf(currchar) == -1) return false;



	}



	return true;



}


