//<!--
function validfield() 
{
	if (document.nhform.medianame.value == "") { alert ("Please fill in the Name of Media"); document.nhform.medianame.focus(); return false; }	
	//checkbox
	varprint =  document.nhform.medianature1.checked;    	   	   	   	   
	varonline =  document.nhform.medianature2.checked;  
	vartv =  document.nhform.medianature3.checked;  
	varradio =  document.nhform.medianature4.checked;  
	varother =  document.nhform.medianature5.checked;  		
	
	if ((varprint) || (varonline) || (vartv) || (varradio) || (varother) == true ) { document.nhform.medianature1.focus();} 
	else { alert("Please select the nature of media"); document.nhform.medianature1.focus(); return false; }
	//checkbox	
	
	if (document.nhform.industry.value == "") { alert ("Please fill in the Industry field"); document.nhform.industry.focus(); return false; }	
	if (document.nhform.address.value == "") { alert ("Please fill in the Address field"); document.nhform.address.focus(); return false; }	

	if (document.nhform.country.value == "") { alert ("Please fill in the Country field"); document.nhform.country.focus(); return false; }				
	if (document.nhform.contact.value == "") { alert ("Please fill in the Contact Person field"); document.nhform.contact.focus(); return false; }				
	if (document.nhform.position.value == "") { alert ("Please fill in the Position field"); document.nhform.position.focus(); return false; }				
   //start phone nos.
  
	   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++){ 		   
   
   	   var tel4 = document.nhform.tel_ext.value;
	   if (tel4 != "") { 
	   //if (tel4 == "") { alert("Please enter your EXT NUMBER.");
	   //document.nhform.tel_num.focus();document.nhform.tel_num.select();	   	   
	   //return false; }
	   for (var i = 0; i < tel4.length; i++){      
			var telchh4 = tel4.substring(i, i + 1);      
			if (telchh4 < "0" || "9" < telchh4) { alert("\nThe EXTENSION field accepts only numbers. \nPlease RE-ENTER a NUMBER.");         
			    document.nhform.tel_ext.focus();document.nhform.tel_ext.select();	   				
				return false; }      
		 }	 
 	   }
   //end phone nos.
   //start fax nos.
	   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.		
  //email	
   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)) {
   if ((document.nhform.usermail.value.indexOf ('@', 2) == -1) || (document.nhform.usermail.value.indexOf ('.', 4) == -1)) {
	alert('Please enter a valid E-mail Address.');  
        document.nhform.usermail.focus(); document.nhform.usermail.select();
		return false; } 	  
   // an at sign (@) that is at least the third character and a period (.) that is at least the fifth character 
   
   	//added mar 22,2005 - multiple e-mail address is not accepted - more than 1 @ sign isnt accepted
	var email = document.nhform.usermail.value;
	var index = email.indexOf("@");
	index = email.indexOf("@",index+1);
	
	//added comma,semicolon validation
	indexcomma = email.indexOf(",");
	indexsemicolon = email.indexOf(";");	
	//added comma,semicolon validation
		
	//if(index !=-1){
	if((index !=-1) || (indexcomma > 0 )|| (indexsemicolon> 0 )){
		alert("Please enter only one E-mail Address.");
		document.nhform.usermail.focus();
		return false;
	}
   
	//end email	
	
	if (document.nhform.content.value == "") { alert ("Please fill in the Inquiry content"); document.nhform.content.focus(); return false; }	
	if (document.nhform.content.value.length > 500) { alert ("Your Inquiry content field has exceeded the maximum number of characters allowed.\n Please reduce it to 500 characters or less."); document.nhform.content.focus();	return false; }		
		
 return true;
}

//-->
