<!-- Hide Script from ancient browsers 

function checkForm(theForm) {
    var why = "";
    why += checkEmail(theForm.eaddress.value);
		why += checkPhone(theForm.phone.value);
		
		//check Your Name is not empty
		if (isEmpty(theForm.name.value) != "")  {
		   why += "Please complete the required field: Your Name \n";
			 setFieldHighlight( "yourname" )		 
		} else {
					 	unSetFieldHighlight("yourname");
						}
		
		//check Your Organization is not empty
			if (isEmpty(theForm.company.value) != "")  {
		   why += "Please complete the required field: Your Organization \n";
			 setFieldHighlight("yourorg");
			 	 
		} else {
					 	unSetFieldHighlight("yourorg");						
						}
		
				//check Country is not empty
			if (isEmpty(theForm.country.value) != "")  {
		   why += "Please complete the required field: Country \n";
			 setFieldHighlight("country");
		} else {
					  unSetFieldHighlight("country");
						}
		
			
		    
    if (why != "") {
       alert(why);
       return false;
    }
return true;
}

function setFieldHighlight( fieldID ) {       
			 document.getElementById(fieldID).style.color="red";
			 document.getElementById(fieldID).style.fontWeight="bold";	
			 return 0;	
}
function unSetFieldHighlight( fieldID ) {       
			 document.getElementById(fieldID).style.color="";
			 document.getElementById(fieldID).style.fontWeight="";	
			 return 0;	
}

// non-empty textbox

function isEmpty(strng) {
var stripped = strng.replace(/[\ ]/g, '');
var error = "";
  if (stripped.length == 0) {
     error = "The mandatory text area has not been filled in.\n"
  }
return error;	  
}


// phone number - strip out delimiters and check for 10 digits

function checkPhone (strng) {
var error = "";

var stripped = strng.replace(/[\[\]\(\)\.\-\+\ ]/g, '');
// alert (stripped);
if (stripped  == "") {
   error = "Please enter a phone number.\n";
	 setFieldHighlight("phone");
	 return error;
}	
				 
// alert (stripped.length); 
//strip out acceptable non-numeric characters
    if (isNaN(stripped)) {
       error = "The phone number contains illegal characters.\n"; 
			 setFieldHighlight("phone"); 
			 return error;
    } 
		
    if (stripped.length < 10) {
	     error = "The phone number is not long enough.\n";
			 setFieldHighlight("phone");
       return error;
			 }
	unSetFieldHighlight("phone");		 
 return error
} //end checkPhone()


function checkEmail (strng) {
var error="";
if (strng == "") {
   error = "Please enter an email address.\n";
	 setFieldHighlight("email");
	 return error;
}

    var emailFilter=/^.+@.+\..{2,3}$/;
    if (!(emailFilter.test(strng))) { 
       error = "Please enter a valid email address.\n";
			 setFieldHighlight("email");
			 return error;
    }
    else {
				 //test email for illegal characters
       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
         if (strng.match(illegalChars)) {
          error = "The email address contains illegal characters.\n"; 
					setFieldHighlight("email");  
					return error;    
					}					
    } // end else
unSetFieldHighlight("email");		
return error;    
}

// end hiding script -->


