//<!--
function validfield() 
{
	if (document.nhform.message.value == "") { alert ("Please fill in the Message field"); document.nhform.message.focus(); return false; }
	if (document.nhform.message.value.length > 200) { alert ("Your Message field has exceeded the maximum number of characters allowed.\n Please reduce it to 200 characters or less."); document.nhform.message.focus();	return false; }	
		
	if (document.nhform.usermail.value == "") { alert ("Please fill in the E-mail field"); document.nhform.usermail.focus(); return false; }	
	if ((document.nhform.usermail.value.indexOf ('@') == -1) || (document.nhform.usermail.value.indexOf ('.') == -1)) {
      	alert('The E-mail field requires \"@\" and \".\" to be used.\nPlease RE-ENTER your E-MAIL ADDRESS.');  
        document.nhform.usermail.focus(); document.nhform.usermail.select();
		return false; } 	
	if (document.nhform.firstname.value == "") { alert ("Please fill in the First Name field"); document.nhform.firstname.focus();	return false; }		
	if (document.nhform.lastname.value == "") { alert ("Please fill in the Last Name field"); document.nhform.lastname.focus(); return false; }				
   //start phone nos.
   if ((document.nhform.tel_ctry.value != "") || (document.nhform.tel_area.value != "") || (document.nhform.tel_num.value != "")){
	   var tel1 = document.nhform.tel_ctry.value;
	   if (tel1 == "") { alert("Please enter your (TELEPHONE) COUNTRY CODE.");
	   document.nhform.tel_ctry.focus();document.nhform.tel_ctry.select();	   	   
	   return false; }
	   for (var i = 0; i < tel1.length; i++){      
			var telchh = tel1.substring(i, i + 1);      
			if (telchh < "0" || "9" < telchh) { alert("The (TELEPHONE) COUNTRY CODE field accepts only numbers. \nPlease RE-ENTER a NUMBER.");         
			    document.nhform.tel_ctry.focus();document.nhform.tel_ctry.select();	   	   				
				return false; }      
		}    
	   var tel2 = document.nhform.tel_area.value;	   
	   //if (tel2 == "") { alert("Please enter your (TELEPHONE) AREA CODE.");
	   //document.nhform.tel_area.focus(); document.nhform.tel_area.select();	   	   
	   //return false; }	   	   
	   for (var i = 0; i < tel2.length; i++){      
			var telchh2 = tel2.substring(i, i + 1);      
			if (telchh2 < "0" || "9" < telchh2) { alert("The (TELEPHONE) AREA CODE field accepts only numbers. \nPlease RE-ENTER a NUMBER.");         
			    document.nhform.tel_area.focus();document.nhform.tel_area.select();	   				
				return false; }      
		}    		
	   var tel3 = document.nhform.tel_num.value;
	   if (tel3 == "") { alert("Please enter your TELEPHONE NUMBER.");
	   document.nhform.tel_num.focus();document.nhform.tel_num.select();	   	   
	   return false; }
	   for (var i = 0; i < tel3.length; i++){      
	   //new function -- can have space & dash    
                var telchh3=tel3.charAt(i);
                if(i==0 || i==tel3.length-1){ //doesnt allow space OR dash on the 1st and last digit of the entered value
                    if(isNaN(telchh3) || telchh3==' '){
                      alert("Please use only numbers for Tel Number.  However, you may separate the numbers with space or dash.");
                      document.nhform.tel_num.focus();
				      document.nhform.tel_num.select();
				      //document.nhform.tel_num.value = '';
                      return false;
                    }
                }else{
                    if(telchh3==" "){ //doesnt allow space AND dash on the 1st and last digit of the entered value
                    }else if(telchh3=="-"){
                    }else if(telchh3>=0){
                    }else if(telchh3<=9){
                    }else{
                        alert("Please use only numbers for Tel Number.  However, you may separate the numbers with space or dash.");
                        document.nhform.tel_num.focus();
				        document.nhform.tel_num.select();
				        //document.nhform.tel_num.value = '';
                        return false;
                    }
				}
	    //end new function -- can have space & dash  	   
	  	//OLD JS
		/*	var telchh3 = tel3.substring(i, i + 1);      
		if (telchh3 < "0" || "9" < telchh3) { alert("\nThe TELEPHONE field accepts only numbers. \nPlease RE-ENTER a NUMBER.");         
		    document.nhform.tel_num.focus();document.nhform.tel_num.select();	   				
			return false; }    
		*/					  
		// END OLD JS	
		}  //end  for (var i = 0; i < tel3.length; i++){		   
   }
   //end phone nos.
   //start fax nos.
   if ((document.nhform.fax_ctry.value != "") || (document.nhform.fax_area.value != "") || (document.nhform.fax_num.value != "")){
	   var fax1 = document.nhform.fax_ctry.value;
	   if (fax1 == "") { alert("Please enter your (FAX) COUNTRY CODE.");
	   document.nhform.fax_ctry.focus();document.nhform.fax_ctry.select();	   	   
	   return false; }
	   for (var i = 0; i < fax1.length; i++){      
			var faxchh = fax1.substring(i, i + 1);      
			if (faxchh < "0" || "9" < faxchh) { alert("The (FAX) COUNTRY CODE field accepts only numbers. \nPlease RE-ENTER a NUMBER.");         
			    document.nhform.fax_ctry.focus();document.nhform.fax_ctry.select();	   	   				
				return false; }      
		}    
	   var fax2 = document.nhform.fax_area.value;
	   //if (fax2 == "") { alert("Please enter your (FAX) AREA CODE.");
	   //document.nhform.fax_area.focus(); document.nhform.fax_area.select();	   	   
	   //return false; }	   
	   for (var i = 0; i < fax2.length; i++){      
			var faxchh2 = fax2.substring(i, i + 1);      
			if (faxchh2 < "0" || "9" < faxchh2) { alert("The (FAX) AREA CODE field accepts only numbers. \nPlease RE-ENTER a NUMBER.");         
			    document.nhform.fax_area.focus();document.nhform.fax_area.select();	   				
				return false; }      
		}    		
	   var fax3 = document.nhform.fax_num.value;
	   if (fax3 == "") { alert("Please enter your FAX NUMBER.");
	   document.nhform.fax_num.focus();document.nhform.fax_num.select();	   	   
	   return false; }
	   for (var i = 0; i < fax3.length; i++){      
	   //new function -- can have space & dash    
                var faxchh3=fax3.charAt(i);
                if(i==0 || i==fax3.length-1){ //doesnt allow space OR dash on the 1st and last digit of the entered value
                    if(isNaN(faxchh3) || faxchh3==' '){
                      alert("Please use only numbers for Fax Number.  However, you may separate the numbers with space or dash.");
                      document.nhform.fax_num.focus();
				      document.nhform.fax_num.select();
				      //document.nhform.fax_num.value = '';
                      return false;
                    }
                }else{
                    if(faxchh3==" "){ //doesnt allow space AND dash on the 1st and last digit of the entered value
                    }else if(faxchh3=="-"){
                    }else if(faxchh3>=0){
                    }else if(faxchh3<=9){
                    }else{
                        alert("Please use only numbers for Fax Number.  However, you may separate the numbers with space or dash.");
                        document.nhform.fax_num.focus();
				        document.nhform.fax_num.select();
				        //document.nhform.fax_num.value = '';
                        return false;
                    }
				}
	   //end new function -- can have space & dash    	   
	   //OLD JS
		/*	var faxchh3 = fax3.substring(i, i + 1);      
			if (faxchh3 < "0" || "9" < faxchh3) { alert("\nThe FAX field accepts only numbers. \nPlease RE-ENTER a NUMBER.");         
			    document.nhform.fax_num.focus();document.nhform.fax_num.select();	   				
				return false; }      
		*/		
	   //END OLD JS					
	   				
		} //end  for (var i = 0; i < fax3.length; i++){  		   
   }
   // end fax nos.		
 return true;
}

//-->
