// JavaScript Document
function ValidateContact(form){
					if(form.name.value==""){
						alert("Please tell us your name.");
						form.name.focus();
						return false;
					}
					if(form.company.value==""){
						alert("Please tell us your company's name.");
						form.company.focus();
						return false;
					}
					if(form.title.value==""){
						alert("Please tell us what title you hold with this company.");
						form.title.focus();
						return false;
					}
					if(form.phone.value==""){
						alert("Please tell us what phone number we can reach you at.");
						form.phone.focus();
						return false;
					}
					if(form.comments.value==""){
						alert("Please give us your comments or questions.");
						form.comments.focus();
						return false;
					}
					var emailID=form.email;
					//Check if an email was given
					if ((emailID.value==null)||(emailID.value=="")){
						alert("Please Enter your email address.");
						emailID.focus();
						return false;
					}
					//Check For Email Code Matching
					if (echeck(emailID.value)==false){
						emailID.value="";
						emailID.focus();
						return false;
					}
}

function echeck(str) {
		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		
		if (str.indexOf(at)==-1){
		   alert("Invalid email address format!");
		   return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid email address format!");
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
			alert("Invalid email address format!");
			return false;
		}
	
		if (str.indexOf(at,(lat+1))!=-1){
			alert("Invalid email address format!");
			return false;
		}
	
		if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
			alert("Invalid email address format!");
			return false;
		}
	
		if (str.indexOf(dot,(lat+2))==-1){
			 alert("Invalid email address format!");
			 return false;
		}
	
		
		if (str.indexOf(" ")!=-1){
			alert("Invalid email address format!");
			return false;
		}
	return true;
}


