function doChange(){ if (getObject('partGroup_field').value == "" || getObject('partDesc_field').value == "" ){ window.alert("Please select a part."); }else{ window.opener.document.getElementsByName('group')[0].value = getObject('partGroup_field').value; window.opener.document.getElementsByName('group')[0].onchange(); window.opener.document.getElementsByName('part')[0].value = getObject('partDesc_field').value; window.opener.document.getElementsByName('part')[0].onchange(); setTimeout("window.close()",1000); } } function doChange_params(group,part){ window.opener.document.getElementsByName('group')[0].value = group; window.opener.document.getElementsByName('group')[0].onchange(); window.opener.document.getElementsByName('part')[0].value = part; window.opener.document.getElementsByName('part')[0].onchange(); setTimeout("window.close()",1000); } function hidePartsTable(theTable){ var theTableTxt = theTable+"_txt"; if (document.getElementById(theTable).style.display == 'none'){ document.getElementById(theTable).style.display = 'block'; if (theTable != 'searchResult'){ document.getElementById(theTableTxt).innerHTML = "Hide Parts "; } }else{ document.getElementById(theTable).style.display = 'none'; if (theTable != 'searchResult'){ document.getElementById(theTableTxt).innerHTML = "View Parts "; } } } function getFormNum (formName) { var formNum = -1; for (i=0;i=0){ with (document.forms[formNum].elements[elementName]){ for(i=options.length-1;i>0;i--) options[i] = null; // null out in reverse order (bug workarnd) for(i=0;i Loading Please Wait"; getObject("searchResult").innerHTML = "
Loading Please Wait
"; // Internet Explorer try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch(oc) { req = null; } } // Mozailla/Safari if (req == null && typeof XMLHttpRequest != "undefined") { req = new XMLHttpRequest(); } // Call the processChange() function when the page has loaded if (req != null) { req.onreadystatechange = processChange; req.open("GET", url, true); req.send(''); //req.send(null); }else{ } } function processChange(evt) { //alert ("readyState - "+req.readyState + "status - "+req.status); // The page has loaded and the HTTP status code is 200 OK if (req.readyState == 4) { if ((req.status == 200) || (req.status == 0)) { // Write the contents of this URL to the searchResult layer if (req.responseText.match('Please Select') == null){ getObject("searchHelp").innerHTML = "
Please Select an Part Option below.
"; getObject("searchResult").innerHTML = "
"+req.responseText+"
"; }else{ getObject("searchHelp").innerHTML = "
"+req.responseText+"
"; getObject("searchResult").innerHTML = "

If you can't see the option you require select the \"Any\" option to view all possible matches.
"; } } } } function getObject(name) { if (document.getElementById) { //alert('getEelementByID'); return document.getElementById(name); } else if (document.all) { //alert('all'); return document.all[name]; } else if (document.layers) { //alert('layers'); return document.layers[name]; } } /* END OF AJAX DYNAMIC SCRIPTING*/ var Opera = (navigator.userAgent.indexOf('Opera') != -1); if (Opera && MSIE || Opera){var Opera="true"; MSIE="false";} var CCNre = /^\s*\d(\d|\s)*$/;//regular expression for the credit card number field var EMAILre = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;//regular expression for the email address field //generic re checker function genericTest(anyRE,title,stringToTest) { if(anyRE.test(stringToTest)) { return true; }else{ return false; } } //CHECK FIELDS FOR SPACES function spaces(elm) { if (elm.value.indexOf(" ") != "-1"){ return true; }else { return false; } } // CHECKS FOR BLANKS FIELDS function isfilled(elm) { if (elm.value=="" ||elm.value==null){ return false; }else{ return true; } } function checkPartSearchForm(form){ var errorfields= "";//used to stored the error messages of the form if (form.year.options[form.year.selectedIndex].value=="def"){ errorfields+="\n [+] Year not Selected"; } if (form.manu.options[form.manu.selectedIndex].value=="def"){ errorfields+="\n [+] Make not Selected"; } if (form.model.options[form.model.selectedIndex].value=="def"){ errorfields+="\n [+] Model not Selected"; } if (form.group.options[form.group.selectedIndex].value=="def"){ errorfields+="\n [+] Part Gategory not Selected"; } if (form.part.options[form.part.selectedIndex].value=="def"){ errorfields+="\n [+] Part not Selected"; } if (form.ic != null) { if (form.ic.options[form.ic.selectedIndex].value=="def"){ errorfields+="\n [+] Part Option not Selected"; } } return formattedFormFeedback(errorfields,'disable_no'); return true; } function checkPartRequestForm(form){ var errorfields= "";//used to stored the error messages of the form //NAME /*if (isfilled(form.customer_name) == false){ errorfields+="\n [+] Name not filled in"; }*/ //EMAIL if(genericTest(EMAILre,"useremail",form.customer_email.value) == false) { errorfields+="\n [+] Email Address must be in the format someone@domainname.com"; } //PHONE NUMBER /*if (isfilled(form.customer_phonenum) == false){ errorfields+="\n [+] Phone Number not filled in"; }*/ //CUSTOMER MESSAGE if (isfilled(form.customer_addmsg) == false){ errorfields+="\n [+] Additonal Message not filled in"; } return formattedFormFeedback(errorfields,'disable_yes'); return true; } function formattedFormFeedback(errorfields,disable_submit){ if (errorfields != "") { errorfields="The form contains an error/s or invalid information \n"+"________________________________________\n"+errorfields+"\n________________________________________\n"+"\nPlease enter correct information into the above fields.\n"+"\nAfter you have completed press Search again.\n"; window.alert(errorfields); return false; }else{ if (disable_submit == 'disable_yes'){ //set elements to inform user of sending //document.getElementById("submitmsg").innerHTML = "Sending Part Request Please wait "; document.getElementById("submitmsg").style.display = 'block'; document.getElementById('submit').disabled=true; } return true; } }