function returnObjById( id ) 
{ 
      if(document.getElementById) 
      var returnVar = document.getElementById(id);
      else if (document.all)
      var returnVar = document.all[id];
      else if (document.layers)
      var returnVar = document.layers[id];
      return returnVar;
}

function isEmailAddr (s){ 
	var rv = false
	if ((s == null) || (s.length == 0)) 
       	rv = false;
 	 else {
		var reEmail =/([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		//reEmail = /.+\@.+\..+$/
		
		rv = reEmail.test(s)
    }
	if(rv){
		return rv
	}else{
		return false
	}
}

function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
}

function validateRadio(theRadio){
	// set var radio_choice to false
	var radio_choice = false;

	// Loop from zero to the one minus the number of radio button selections
	for (counter = 0; counter < theRadio.length; counter++){
		// If a radio button has been selected it will return true
		// (If not it will return false)
		if (theRadio[counter].checked){
			radio_choice = true; 
			strRadioValue = theRadio[counter].value;
		}
	}
	if(!radio_choice){
		return (false);
	}
	    return (true);
}

function validation(theForm){
	if (theForm.company.value == ""){
    	alert("Please enter your company name.");
    	theForm.company.focus();
    	return (false);
  	}
	if (theForm.date.value == ""){
    	alert("Please enter the date of the function.");
    	theForm.date.focus();
    	return (false);
  	}
	if (theForm.time.value == ""){
    	alert("Please enter the time of the function.");
    	theForm.time.focus();
    	return (false);
  	}
	if (theForm.pax.value == ""){
    	alert("Please enter the pax.");
    	theForm.pax.focus();
    	return (false);
  	}

	if (!theForm.yes_i_agree_to_criteria.checked){
    	alert("Please make sure you read and understand these criteria and agree to abide by them, please check the box.");
    	theForm.yes_i_agree_to_criteria.focus();
    	return (false);
 	}
	
	return (true);
}