// <!-- Begin
var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e) {
var keyCode = (isNN) ? e.which : e.keyCode; 
var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
if(input.value.length >= len && !containsElement(filter,keyCode)) {
input.value = input.value.slice(0, len);
input.form[(getIndex(input)+1) % input.form.length].focus();
}
function containsElement(arr, ele) {
var found = false, index = 0;
while(!found && index < arr.length)
if(arr[index] == ele)
found = true;
else
index++;
return found;
}
function getIndex(input) {
var index = -1, i = 0, found = false;
while (i < input.form.length && index == -1)
if (input.form[i] == input)index = i;
else i++;
return index;
}
return true;
}
//  End -->

// this scripts is checking required fields

function checkrequired(which){
    var pass=true;
    for (i=0;i<which.elements.length;i++){
      var tempobj=which.elements[i];
      if (tempobj.name.substring(0,8)=="required"){
        if (((tempobj.type=="text"||tempobj.type=="textarea")&&tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&tempobj.selectedIndex==0)){
          pass=false;
          break;
        }
      }
    }
    if (!pass){
      shortFieldName=tempobj.name.substring(8,30).toUpperCase();
      alert("Please make sure the "+shortFieldName+" field was properly completed.");
      return false;
    }else{
      return true;
    }
}

function doublesubmit(which){
  ccform="creditcardform";ccform=eval("document."+ccform);
  userform="myform";userform=eval("document."+userform);
  chargetotal="total";chargetotal=eval("userform."+chargetotal+".value");chargetotal=chargetotal.substring(1,chargetotal.length);
if (userform.subtotal.value!="$0"){
  if (checkrequired(userform)){
    if (userform.creditcard_payment.checked){
    	if (which!=0){
    	  userform.target="hidden";
    	  userform.submit();
      	}else{
    	  ccform.chargetotal.value=chargetotal+".00";
    	  ccform.target="main";
    	  ccform.submit();
      	}
    }else{
      userform.target="main";
      userform.submit();
    }
  }
  }else{
  	alert("Please select an Event and meal");
  }
}

<!-- begin cloaking from non-JavaScript browsers. 

var form_subtotal=0;
var form_radio=0; 
        
function CheckChoice(whichbox){
    if (whichbox!=null){
      if (whichbox.type == "radio"){
        form_radio=eval(whichbox.value.slice(whichbox.value.indexOf("(")+3,whichbox.value.lastIndexOf(")")));
      }
      if (whichbox.type == "checkbox"){
        if (whichbox.checked){
          form_subtotal+=eval(whichbox.value);
        }else{
          form_subtotal-=eval(whichbox.value);
        }
      }
    }
    document.myform.subtotal.value = "$"+eval(form_subtotal);
    document.myform.total.value = "$"+(eval(form_subtotal)+eval(form_radio));
}

function InitForm()
{
document.myform.subtotal.value='$'+form_subtotal;
document.myform.total.value='$'+form_radio;

for (xx=0; xx < document.myform.elements.length; xx++)
{
if (document.myform.elements[xx].type == 'checkbox')
{ 
document.myform.elements[xx].checked = false;
}
}
}

        // end cloaking -->