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")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid Email Address")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid Email Address")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid Email Address")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid Email Address")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid Email Address")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid Email Address")
		    return false
		 }

 		 return true					
}

function check_number(num_str){
		
	var re = new RegExp(/[a-zA-Z]/);
	if (num_str.value.match(re)) {
    	return false
  	}else{
    	return true
  	}
		
}

function validate_form(){
	//Form Variables
	var first=document.web_form.first
	var last=document.web_form.last
	var email=document.web_form.email
	//Phone Variables
	
	
	if((first.value==null)||(first.value=="")||(first.value=="First Name")){
		alert("Please enter your First Name")
		first.value=""
		first.focus()
		return false
	}
	if((last.value==null)||(last.value=="")||(last.value=="Last Name")){
		alert("Please enter your Last Name")
		last.value=""
		last.focus()
		return false
	}
	if ((email.value==null)||(email.value=="")||(echeck(email.value)==false)){
		alert("Please Enter a valid Email Address")
		email.value=""
		email.focus()
		return false
	}
	
	return true
 }

