 function checkscript() {
            
            if (empty(stripSpaces(document.form1.name.value)) || document.form1.name.value=='name'){alert("You must enter your name."); document.form1.name.focus(); return false; } 
			if (document.form1.name.value == 'Name'){alert("You must enter your name."); document.form1.name.focus(); return false; } 
			if (empty(stripSpaces(document.form1.phone.value)) || document.form1.phone.value=='phone'){alert("You must enter your phone number."); document.form1.phone.focus(); return false; } 

			if (document.form1.name.value == 'Phone'){alert("You must enter your phone number."); document.form1.phone.focus(); return false; } 
if (empty(stripSpaces(document.form1.comments.value)) || document.form1.comments.value=='comments'){alert("You must enter your comments."); document.form1.comments.focus(); return false; } 
            
            if(!isValidEmail(document.form1.email.value)){
                alert('Your Email address is invalid');
                document.form1.email.focus();
                return false;  
            }
                       			

	return true;
    }             




	function isValidEmail2(s)
	{
		var x = s;
		var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
						
		if (!filter.test(x)){
			return false;
			}
			else{
			return true;
		}	            
	}

	function isValidEmail(str) {
	  // These comments use the following terms from RFC2822:
	  // local-part, domain, domain-literal and dot-atom.
	  // Does the address contain a local-part followed an @ followed by a domain?
	  // Note the use of lastIndexOf to find the last @ in the address
	  // since a valid email address may have a quoted @ in the local-part.
	  // Does the domain name have at least two parts, i.e. at least one dot,
	  // after the @? If not, is it a domain-literal?
	  // This will accept some invalid email addresses
	  // BUT it doesn't reject valid ones. 
	  var atSym = str.lastIndexOf("@");
	  if (atSym < 1) { return false; } // no local-part
	  if (atSym == str.length - 1) { return false; } // no domain
	  if (atSym > 64) { return false; } // there may only be 64 octets in the local-part
	  if (str.length - atSym > 255) { return false; } // there may only be 255 octets in the domain
	
	  // Is the domain plausible?
	  var lastDot = str.lastIndexOf(".");
	  // Check if it is a dot-atom such as example.com
	  if (lastDot > atSym + 1 && lastDot < str.length - 1) { return true; }
	  //  Check if could be a domain-literal.
	  if (str.charAt(atSym + 1) == '[' &&  str.charAt(str.length - 1) == ']') { return true; }
	  return false;
	}



	function stripSpaces(x) {
		while (x.substring(0,1) == ' ') x = x.substring(1);
		return x;
	}
	
	function empty(x) { if (x.length > 0) return false; else return true; }

	
	function validZipCA(zip)
	{
	if (zip.match(/^\s*[a-ceghj-npr-tvxy]\d[a-z](\s)?\d[a-z]\d\s*$/i)) {
	return true;
	}
	//alert('*** Bad ZIP.');
	return false;
	}      
	
	function validZipUS2(zip)
	{
	if (zip.match(/^[0-9]{5}$/)) {
	return true;
	}
	zip=zip.toUpperCase();
	if (zip.match(/^[A-Z][0-9][A-Z][0-9][A-Z][0-9]$/)) {
	return true;
	}
	if (zip.match(/^[A-Z][0-9][A-Z]-[0-9][A-Z][0-9]$/)) {
	return true;
	}
	//alert('*** Bad ZIP.');
	return false;
	}   
		
		
//Check For a valid U.S. zipcode
   function validZipUS(strFieldValue)
   {
     if(CheckLength(strFieldValue,  5, "")){
        if(IsNumber(strFieldValue, 5, "")){
         if(IsNonZeroNumber(strFieldValue, 5, "")){
               return true;     
         }
         else{
           return false;
         }  
       }
       else{
         return false;
       }   
     }
     else{
       return false;
     }  
   }		
		       
    function IsNotEmpty(strFieldValue)
    {
      if(strFieldValue == ""){
	  return false;
	}
        return true;
     }

    function CheckLength(strFieldValue, size)
    {
      for ( var i=0; i < size; i++) {	    
	 if(strFieldValue.charAt(i)==""){
	     return false;
	     }
         }
      if(strFieldValue.charAt(size)!=""){
	  return false;
	  }
       return true;
      }

   function IsNumber(strFieldValue, size)
    {
    for ( var i=0; i < size; i++) {     
      if(strFieldValue.charAt(i)!="" ){	    
        if( strFieldValue.charAt(i) < "0" || strFieldValue.charAt(i) > "9") {
          return false;
        }
      }
     }
     return true;
    }
	
    function IsNonZeroNumber(strFieldValue, size)
    {
    if(IsNumber(strFieldValue, size)){    
      if(parseInt(strFieldValue) == 0){
        return false;
      }
    }
   return true;    
  }	


	// Declaring required variables
	var digits = "0123456789";
	// non-digit characters which are allowed in phone numbers
	var phoneNumberDelimiters = "()- ";
	// characters which are allowed in international phone numbers
	// (a leading + is OK)
	var validWorldPhoneChars = phoneNumberDelimiters + "+";
	// Minimum no of digits in an international phone no.
	var minDigitsInIPhoneNumber = 10;

	function isInteger(s)
	{   var i;
		for (i = 0; i < s.length; i++)
		{   
			// Check that current character is number.
			var c = s.charAt(i);
			if (((c < "0") || (c > "9"))) return false;
		}
		// All characters are numbers.
		return true;
	}
	
	function stripCharsInBag(s, bag)
	{   var i;
		var returnString = "";
		// Search through string's characters one by one.
		// If character is not in bag, append to returnString.
		for (i = 0; i < s.length; i++)
		{   
			// Check that current character isn't whitespace.
			var c = s.charAt(i);
			if (bag.indexOf(c) == -1) returnString += c;
		}
		return returnString;
	}
	
	function checkInternationalPhone(strPhone){
		s=stripCharsInBag(strPhone,validWorldPhoneChars);
	return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
	}