var NewWin;

function Genie(URL,width,height) {
  if (NewWin != null) {
    if (NewWin.open) NewWin.close();
  }
  NewWin = window.open(URL,"","width=" + width + ",height=" + height + ",top=0,left=0,scrollbars");
  return false;
}

function NoCopying() {
  return false;
}


function CheckForm(objForm) {
  var arrReq = objForm.Required.value.split(",");
  var objField;
  var strErrors = "";
  var strType = "";
  var strName = "";

  for (var i=0;i<arrReq.length;i++) {
    objField = eval("objForm." + arrReq[i]);
    strType = objField.type?objField.type:objField[0].type;

  CheckFields:
    switch (strType) {
      // Text boxes and Textareas
      case "textarea":
	strType = "text";

      case "text":
        if(objField.value=="") strErrors += "* " + (objField.title?objField.title:objField.name) + "\n";
	break;

      // Radio Buttons
      case "radio":
        if (objField.length) {
	  for (var j=0;j<objField.length;j++) {
	    if (objField[j].checked) break CheckFields;
          }
	  strErrors += "* " + (objField[0].title?objField[0].title:objField[0].name) + "\n";
 	} else {
	  if (!objField.checked) strErrors += "* " + (objField.title?objField.title:objField.name) + "\n";
        }
	break;

      // Check Boxes
      case "checkbox":
        if (objField.length) {
	  for (var j=0;j<objField.length;j++) {
	    if (objField[j].checked) break CheckFields;
          }
	  strErrors += "* " + (objField[0].title?objField[0].title:objField[0].name) + "\n";
 	} else {
	  if (!objField.checked) strErrors += "* " + (objField.title?objField.title:objField.name) + "\n";
        }
	break;

      // Select Boxes
      case "select-multiple":
        if (objField.selectedIndex < 0 ) {
	  strErrors += "* " + (objField.title?objField.title:objField.name) + "\n";
	  break;
        }

      case "select-one":
        if (objField.selectedIndex == 0 && !objField.options[objField.selectedIndex].value) {
	  strErrors += "* " + (objField.title?objField.title:objField.name) + "\n";
	  break;
        }
    }
  }


  if (strErrors) {
    alert("You must complete the fields marked with an asterisk (*):\n\n" + strErrors);
    return false;
  } else {
    objForm.Required.value="Email";
    return true;
  }
}
// document.oncontextmenu=NoCopying;