// JavaScript Document
function SecurityFormValidation(theForm){
		if(theForm.name.value=='' || theForm.name.value=='Name:'){
			alert('Please enter your Name.');
			theForm.name.select();
			theForm.name.focus();
			return false;
		}
		
		if(theForm.email.value=='' || theForm.email.value=='Email:'){
			alert('Please enter your Email.');
			theForm.email.select();
			theForm.email.focus();
			return false;
		}
		
		if (echeck(theForm.email.value)==false){
			theForm.email.select();
			theForm.email.focus();
			return false
		}
		
		if(theForm.phone.value=='' || theForm.phone.value=='Phone:'){
			alert('Please enter your Phone.');
			theForm.phone.select();
			theForm.phone.focus();
			return false;
		}
		
		if(theForm.comments.value=='' || theForm.comments.value=='Message:'){
			alert('Please enter your Comments.');
			theForm.comments.select();
			theForm.comments.focus();
			return false;
		}
		
	}
	
/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */

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("Please enter a Valid Email.")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Please enter a Valid Email.")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Please enter a Valid Email.")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Please enter a Valid Email.")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Please enter a Valid Email.")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Please enter a Valid Email.")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Please enter a Valid Email.")
		    return false
		 }

 		 return true					
	}
