function SearchFormCheck() { if (document.searchform.strKeyword.value == "" || document.searchform.strKeyword.value == " " || document.searchform.strKeyword.value.length < 3) { alert("Please specify a search string of 3 letters or more."); return false; } else { return true; } } function popwin(strUrl, strName, strArgs) { var appwin; appwin = window.open(strUrl, strName, strArgs); appwin.focus() } function roll_on(objItem, strClass) { if (objItem.selected != "On") { objItem.className = strClass } } function roll_off(objItem, strClass) { if (objItem.selected != "On") { objItem.className = strClass } } function validate(Form) { var AlertMsg = ""; var Error = 0; var Location1 = 0; var Location2 = 0; if (Form.Email.value > "") { //simple check for important email characters Location1 = Form.Email.value.indexOf('@'); Location2 = Form.Email.value.indexOf('.', Location1); if (Location1 == -1 || Location2 == -1) { AlertMsg = AlertMsg + "\n- Please enter an E-mail address in the format 'name@someplace.com'\n For example: 'jdoe@service.com'."; Form.Email.focus(); Form.Email.select(); Error = 1; } //simple check for any spaces if (Form.Email.value.indexOf (' ') > -1) { if (Error == 0) { AlertMsg = AlertMsg + ("\n- E-mail address cannot contain spaces.") ; Form.Email.focus(); Form.Email.select(); Error = 1; } } } else { AlertMsg = AlertMsg + "\n" + "- Please enter an E-Mail address."; Form.Email.focus(); Form.Email.select(); Error = 1; } if (Error == 1) { alert(AlertMsg); return false; } else { return true; } } function OpenPopup(url, name, width, height) { var attrib = 'left=0,top=10,scrollbars,width=' + width + ',height=' + height; var thePopup = window.open(url,name,attrib); thePopup.focus(); } function ClearForm(objForm) /*******************************************************************************/ /* Function: ClearForm */ /* */ /* Description: This function loops though all of the fields on a form */ /* and sets the value of all text fields to an empty */ /* string and the value of check boxes and radio buttons */ /* to unchecked. */ /* */ /* Inputs: A form */ /*******************************************************************************/ { var intElements = objForm.elements.length for (var i=0; i < intElements; i++) { switch (objForm.elements[i].type) { case "text": objForm.elements[i].value = ""; break; case "textarea": objForm.elements[i].value = ""; break; case "checkbox": objForm.elements[i].checked = false; break; case "radio": objForm.elements[i].checked = false; break; case "password": objForm.elements[i].value = ""; break; case "select-one": objForm.elements[i].selectedIndex = 0; break; default: }/* End Switch */ } /* End-For */ } /* End ClearForm() */