/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: wsabstract.com | http://www.wsabstract.com */
function checkrequired(formid) {
  var pass=true;
var formid = formid;
var which = document.getElementById(formid);
  for (i=0;i<which.length;i++) {
    var tempobj=which.elements[i];
    if (tempobj.id.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.id.substring(8,30).toUpperCase();
    alert("The "+shortFieldName+" field is a required field.");
    return false;
  } else {

    // Change the form action to the real submission page
    document.getElementById(formid).action = "email-"+formid+".php";
    // Submit the form
    document.getElementById(formid).submit();

  }
}

