// Arthur Wang 02/14/08 js/registration.js for /purchasing/vendor/registration.shtml function validate(frm) { var themessage = "You are required to complete the following fields: "; if (frm.vendorid.value=="") { themessage = themessage + "\n - Vendor ID"; } if (frm.firm_name.value=="") { themessage = themessage + "\n - Firm Info : Firm Name "; } if (frm.firm_address.value=="") { themessage = themessage + "\n - Firm Info : Firm Address "; } if (frm.firm_city.value=="") { themessage = themessage + "\n - Firm Info : City "; } if (frm.firm_state.value=="") { themessage = themessage + "\n - Firm Info : State "; } if (frm.firm_zip.value=="") { themessage = themessage + "\n - Firm Info : Zip "; } if (frm.firmphone_1.value==""||frm.firmphone_2.value==""||frm.firmphone_3.value=="") { themessage = themessage + "\n - Firm Info : Phone "; } if (frm.fax_1.value==""||frm.fax_2.value==""||frm.fax_3.value=="") { themessage = themessage + "\n - Firm Info : Fax "; } if (frm.contact_lname.value=="") { themessage = themessage + "\n - Contact Info : Last Name "; } if (frm.contact_fname.value=="") { themessage = themessage + "\n - Contact Info : First Name "; } if (frm.contact_email.value=="") { themessage = themessage + "\n - Contact Info : E-mail "; } //alert if fields are empty and cancel form submit if (themessage == "You are required to complete the following fields: ") { frm.submit(); } else { alert(themessage); return false; } } function LimitThis() { var myObject=event.srcElement; if (myObject.value.length==myObject.maxLength*1) return false; } function CountThis(visCnt) { var myObject=event.srcElement; if (myObject.value.length>myObject.maxLength*1) myObject.value=myObject.value.substring(0,myObject.maxLength*1); if (visCnt) visCnt.innerText=myObject.maxLength-myObject.value.length; } var downStrokeField; function autojump(fieldName,nextFieldName,fakeMaxLength) { var myForm=document.forms[document.forms.length - 1]; var myField=myForm.elements[fieldName]; myField.nextField=myForm.elements[nextFieldName]; if (myField.maxLength == null) myField.maxLength=fakeMaxLength; myField.onkeydown=autojump_keyDown; myField.onkeyup=autojump_keyUp; } function autojump_keyDown() { this.beforeLength=this.value.length; downStrokeField=this; } function autojump_keyUp() { if ( (this == downStrokeField) && (this.value.length > this.beforeLength) && (this.value.length >= this.maxLength) ) this.nextField.focus(); downStrokeField=null; } function changeDiv(the_div) { var the_style = getStyleObject(the_div); // alert("the style is " + the_style); if (the_style != false) { if (the_style.display == 'none'){ the_style.display = 'block'; }else{ the_style.display = 'none'; } } } function getStyleObject(objectId) { if (document.getElementById && document.getElementById(objectId)) { return document.getElementById(objectId).style; } else if (document.all && document.all(objectId)) { return document.all(objectId).style; } else { return false; } }