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("There is a missing @ within your email address. Please enter again.");
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID");
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("There is a missing dot, or the dot is in the wrong place. Please try again.");
		    return false
		}

		if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID");
		    return false
		}

		if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID");
		    return false
		}

		if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID");
		    return false
		}
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}


function validate(){

	var firstName = document.inform.first_name.value;
	if (firstName =="" || firstName ==" First Name") {
		
		alert("Please enter your first name");
		return false
	}
    var lastName = document.inform.last_name.value;	
	if (lastName=="" || lastName==" Last Name") {
		alert("Please enter your last name");
		return false
	}
	var emailID = document.inform.email.value;	
	if (emailID=="" || emailID==" Company Email") {
	  alert("Please enter your Company Email");
		return false
		
	}
	var phoneNum = document.inform.phone.value;	
	if (phoneNum=="" || phoneNum==" Phone Number") {
		alert("Please enter your phone number");
		return false
	}
	
	var jobTitle = document.inform.title.value;	
	if (jobTitle=="" || jobTitle==" Job Title") {
	    alert("Please enter your job title");
		return false
		
	}
		var companyName = document.inform.company.value;	
	if (companyName=="" || companyName==" Company Name") {
	    alert("Please enter your company name");
		return false
	}
	var companySize = document.inform.company_size.value;	
	if (companySize=="") {
	  alert("Please select your company size");
		return false
	}
	   	var strState = document.inform.state.value;	
	if (strState=="") {
	  alert("Please select State/Province");
		return false
	}
		 var strCountry = document.inform.country.value;	
	if (strCountry=="") {
	   alert("Please select your country");
		return false
	}
	if (echeck(emailID)==false){
		return false
	}
	
	return true
 }
