// function to validate input


function checkInput() {
  var missing=focusVal=""
  df=document.forms[0]
  arg_num = arguments.length
  j=1
  for(i=0;i<arg_num;i=i+2) {
     current_val = eval("df."+arguments[i]+".value")
     if ( current_val == "" ) {
        missing += "- " + arguments[j] + "\n"
        if ( focusVal=="" ) focusVal = arguments[i]
     }
     j=j+2
  }

  if ( df.confirm ) {
     if ( df.confirm.value != df.password.value ) {
     	missing += "- Passwords do not match"
     	if ( focusVal=="" ) focusVal = "password"
     }
  }

// checkbox validator - disclaimer

  if (!document.form.agree.checked) {
  missing += "- You must agree to the terms";
  }
  if (missing != "") {
  missing =  "Required information is missing: \n\n" +
  missing + "\n\nPlease complete and resubmit.";
  alert(missing);
  return false;
  }

// end checkbox validator

if (missing != "") {
    alert("The following information is required:\n"+missing)
    eval("df."+focusVal+".focus()")
    return false
  }  else { 
  	return true
	  }
	  

}
