var agt = navigator.userAgent.toLowerCase(); var ie_7 = ((agt.indexOf("msie 7.0") != -1)); function changeLogoLink(id) { var logo_link = document.getElementById(id); if (logo_link != null && logo_link.href != "http://www.partstown.com") { logo_link.href = "http://www.partstown.com"; } } function style() { if (ie_7) { return ''; } else { return ''; } } var countryElement = document.getElementById('country'); var stateElement = document.getElementById('states'); var rememberedStates = [0, 0, 0]; var canadianStates = new Array( 'Select One', 'Alberta', 'British Columbia', 'Manitoba', 'New Brunswick', 'Newfoundland and Labrador', 'Nova Scotia', 'Ontario', 'Prince Edward Island', 'Quebec', 'Saskatchewan', 'Northwest Territories', 'Nunavut', 'Yukon'); var americanStates = new Array( 'Select One', 'Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'District of Columbia', 'West Virginia', 'Wisconsin', 'Wyoming'); function remember_st() { var index = (countryElement.selectedIndex >= 0 && countryElement.selectedIndex <= 2) ? countryElement.selectedIndex : 2; rememberedStates[index] = stateElement.selectedIndex; } function createOption(optionText) { var option = document.createElement('OPTION'); option.text = optionText; if(optionText!="Select One") option.value = optionText; else option.value = ""; return option; } function setStates(states) { for (var i = 0; i < states.length; i++) stateElement.options.add(createOption(states[i])); if (rememberedStates[countryElement.selectedIndex] != 0) stateElement.selectedIndex = rememberedStates[countryElement.selectedIndex] ? rememberedStates[countryElement.selectedIndex] : 0; } function change_states() { stateElement = document.getElementById('states'); if (stateElement == null) return; while (stateElement.options.length > 0) { stateElement.remove(stateElement.length-1); } countryElement = document.getElementById('country'); if (countryElement == null) return; switch (countryElement.value) { case 'US': setStates(americanStates); break; case 'CA': setStates(canadianStates); break; default: stateElement.options.add(createOption('N/A')); break; } } document.write(style()); //****** p_cache_js function checkcache(){ x=document.getElementById('flogin'); return returnto(x,true); } function checkcache_logout(){ x=document.getElementById('logout_form'); returnto(x,false); } function returnto(x,y){ if(document.getElementById('cache1')!=null){ qq=document.getElementById('cache1').page.value; for (var i=0;i< x.length; i++) { if(x.elements[i].name!='LoginForm_Password' && x.elements[i].name!='LoginForm_Login' && x.elements[i].name!='LoginCalledFromReq' && x.elements[i].name!='remember' && x.elements[i].name!='TemplateName1' && x.elements[i].name!='ignorefield' && x.elements[i].name!='TargetPipeline1'){ x.elements[i].name="xxx"; x.elements[i].value="yyy"; } if(qq=='Welcome'){ if(x.elements[i].name=='TargetPipeline1'){ x.elements[i].name='TargetPipeline'; x.elements[i].value='Default-Start'; } }else if(qq=='linecard'){ if(x.elements[i].name=='TemplateName1'){ x.elements[i].name='page'; x.elements[i].value='LineCard'; } if(x.elements[i].name=='TargetPipeline1'){ x.elements[i].name='TargetPipeline'; x.elements[i].value='ViewStaticPage-Start'; } }else if(qq=='landing'){ if(x.elements[i].name=='TargetPipeline1'){ x.elements[i].name='TargetPipeline'; x.elements[i].value='ViewLandingPage-Start'; } if(x.elements[i].name=='TemplateName1'){ x.elements[i].name='CatID'; x.elements[i].value=document.getElementById('cache1').pageid.value; } }else if(qq=='pip'){ if(x.elements[i].name=='TargetPipeline1'){ x.elements[i].name='TargetPipeline'; x.elements[i].value='ViewOfferDetail-Start'; } if(x.elements[i].name=='TemplateName1'){ x.elements[i].name='ProductUUID'; x.elements[i].value=document.getElementById('cache1').pageid.value; } }else{ if(x.elements[i].name=='TemplateName1'){ x.elements[i].name='TemplateName'; x.elements[i].value=qq; } if(x.elements[i].name=='TargetPipeline1'){ x.elements[i].name='TargetPipeline'; x.elements[i].value='ptExtraPage-Start'; } } } } if(!y) { x.submit(); return false; } else { return true; } } // p_show function show(id1, id2) { if (document.getElementById(id1).checked == true) { document.getElementById(id2).style.visibility="visible"; } else { document.getElementById(id2).style.visibility="hidden"; } } function credit_card() { document.getElementById('content_1').style.display="none"; document.getElementById('content').style.display="block"; document.getElementById('card').checked=true; } function bill_account() { document.getElementById('content').style.display="none"; document.getElementById('content_1').style.display="block"; document.getElementById('bill').checked=true; } function setElementVisibleById(id, visible) { var element = document.getElementById(id); if (element) { element.style.display = (!visible) ? 'none' : ((typeof visible).toLowerCase == 'string') ? visible : 'block'; } } var fie = (navigator.userAgent.toLowerCase().indexOf('msie') > 0); function setAddToCatalogMode() { setElementVisibleById('order_confirm_header', false); setElementVisibleById('add_to_cat_header', true); setElementVisibleById('add_to_cat_btn_container', true); var TDs = document.getElementsByTagName('td'); for (var i = 0; i < TDs.length; i++) { if (TDs[i].className.indexOf('selection_column') >= 0) { TDs[i].style.display = (fie ? 'block' : 'table-cell'); } } document.getElementById('order_items_table').style.width = '880px'; document.getElementById('totals_div').style.width = '880px'; document.getElementById('page_header').innerHTML = 'Add to My Catalog'; document.getElementById('breadcrumbs_page_name').innerHTML = 'Add to My Catalog'; } function setOrderConfirmationMode() { setElementVisibleById('order_confirm_header', true); setElementVisibleById('add_to_cat_header', false); setElementVisibleById('add_to_cat_btn_container', false); var TDs = document.getElementsByTagName('td'); for (var i = 0; i < TDs.length; i++) { if (TDs[i].className.indexOf('selection_column') >= 0) { TDs[i].style.display = 'none'; } } document.getElementById('order_items_table').style.width = '880px'; document.getElementById('totals_div').style.width = '880px'; document.getElementById('page_header').innerHTML = 'Order Confirmation'; document.getElementById('breadcrumbs_page_name').innerHTML = '  >  Order Confirmation'; document.getElementById('h51').innerHTML = 'Selected items were successfully added to catalog.'; } function ccinfo(i) { var addLocalized = document.getElementById('add_localized'); var add; if(typeof(addLocalized.innerText)!='undefined') { add = addLocalized.innerText; } else { add = addLocalized.textContent; } if(i==0){ document.getElementById('saved_card').style.display="none"; document.getElementById('delete').style.display="none"; document.getElementById('type').style.paddingTop="20px"; document.getElementById('bot').style.paddingBottom="30px"; document.getElementById('f1').selectedIndex=0; document.getElementById('f3').value=""; document.getElementById('f4').value=""; document.getElementById('f5').value="1"; document.getElementById('f6').value="2007"; document.getElementById('UpdateOrAdd').value=add; document.getElementById('VerificationCode').value=""; }else{ document.getElementById('saved_card').style.display="none"; document.getElementById('delete').style.display="none"; document.getElementById('type').style.paddingTop="20px"; document.getElementById('bot').style.paddingBottom="30px"; document.getElementById('UpdateOrAdd').value=add; } } function ccinfo_back() { var updateLocalized = document.getElementById('update_localized'); var update; if(typeof(updateLocalized.innerText)!='undefined') { update = updateLocalized.innerText; } else { update = updateLocalized.textContent; } document.getElementById('saved_card').style.display="block"; document.getElementById('UpdateOrAdd').value=update; document.getElementById('bock').selectedIndex=0; document.getElementById('delete').style.display="block"; document.getElementById('type').style.paddingTop="0px"; document.getElementById('bot').style.paddingBottom="0px"; } if(window.addEventListener) { window.addEventListener('load', qqqload, false); } else { window.attachEvent('onload', qqqload); } function qqqload(){ countryElement = document.getElementById('country'); stateElement = document.getElementById('states'); } function leftpanheight() { var m=190; var lmenu=document.getElementById('left_bar'); if (lmenu!=null) { var r=parseInt(document.getElementById('main_body_EA').offsetHeight); if(m < r){m=r;} if (m< lmenu) {m=lmenu;} lmenu.style.height=m+'px'; } //alert(lmenu); document.getElementById('lmenu').style.backgroundImage="/is-bin/intershop.static/WFS/Reedy-PartsTown-Site/-/en_US/images/hp/left_back.png"; document.getElementById('lmenu').style.backgroundRepeat="repeat-y"; } function showHide(targetName) { var target1; // short list var target2; // full list if( document.getElementById ) { // NS6+ target1 = document.getElementById(targetName + "_short"); target2 = document.getElementById(targetName + "_long"); } else if( document.all ) { // IE4+ target1 = document.all[targetName + "_short"]; target2 = document.all[targetName + "_long"]; } if( target1 && target2 ) { if ( target1.style.display == "none" ) { target1.style.display = "block"; target2.style.display = "none"; } else { target1.style.display = "none"; target2.style.display = "block"; } } return false; } function chkit(){ document.getElementById("frm").submit(); } function click(){ var s1=""; var s2=""; var s3=""; var s4=""; var s5=""; var s6=""; if(document.getElementById("q1").value!="Qty") s1=document.getElementById("q1").value if(document.getElementById("q3").value!="Qty") s3=document.getElementById("q3").value if(document.getElementById("q5").value!="Qty") s5=document.getElementById("q5").value if(document.getElementById("q2").value!="Item") s2=document.getElementById("q2").value if(document.getElementById("q4").value!="Item") s4=document.getElementById("q4").value if(document.getElementById("q6").value!="Item") s6=document.getElementById("q6").value window.location.href="http://www.partstown.com/is-bin/INTERSHOP.enfinity/WFS/Reedy-PartsTown-Site/en_US/-/USD/InstantBuy-Start"+"?s1="+s1+"&s2="+s2+"&s3="+s3+"&s4="+s4+"&s5="+s5+"&s6="+s6; } function change_description() { document.getElementById('description').style.backgroundImage="url(/is-bin/intershop.static/WFS/Reedy-PartsTown-Site/-/en_US/images/grey_tab.gif)"; document.getElementById('description').style.color="#575757"; document.getElementById('description_content').style.display="block"; document.getElementById('specs').style.backgroundImage="none"; document.getElementById('specs').style.color="#898989"; document.getElementById('specs_content').style.display="none"; if(document.getElementById('models') != null){ document.getElementById('models').style.backgroundImage="none"; document.getElementById('models').style.color="#898989"; document.getElementById('models_content').style.display="none"; } } function change_specs() { document.getElementById('specs').style.backgroundImage="url(/is-bin/intershop.static/WFS/Reedy-PartsTown-Site/-/en_US/images/grey_tab.gif)"; document.getElementById('specs').style.color="#575757"; document.getElementById('specs_content').style.display="block"; document.getElementById('description').style.backgroundImage="none"; document.getElementById('description').style.color="#898989"; document.getElementById('description_content').style.display="none"; if(document.getElementById('models') != null){ document.getElementById('models').style.backgroundImage="none"; document.getElementById('models').style.color="#898989"; document.getElementById('models_content').style.display="none"; } } function change_models(aa) { if(aa==1) document.location.href = '#docs'; document.getElementById('models').style.backgroundImage="url(/is-bin/intershop.static/WFS/Reedy-PartsTown-Site/-/en_US/images/grey_tab.gif)"; document.getElementById('models').style.color="#575757"; document.getElementById('models_content').style.display="block"; document.getElementById('description').style.backgroundImage="none"; document.getElementById('description').style.color="#898989"; document.getElementById('description_content').style.display="none"; document.getElementById('specs').style.backgroundImage="none"; document.getElementById('specs').style.color="#898989"; document.getElementById('specs_content').style.display="none"; } function createCP(form) { form.FromLP.value = form.txtVal.value; if(form.Manuf.value == ""){ form.Question.value = form.txtVal.value; form.Action.value = ""; form.CategoryPath.value = ""; } else { form.Question.value = form.Manuf.value; if(form.txtVal.value == "Enter keyword or item#"){ form.CategoryPath.value = ""; } else{ form.CategoryPath.value = "All Products////UserSearch=" + form.txtVal.value; } } return true; } function openInfo() { var windowWidth; var windowHeight; var browser = navigator.appName; if ( browser == 'Microsoft Internet Explorer' ) { windowWidth = 525; windowHeight = 340; } else { windowWidth = 505; windowHeight = 320; } var params='width='+windowWidth+',height='+windowHeight+',scrollbars=1'; var secInfo = window.open('http://www.partstown.com/is-bin/INTERSHOP.enfinity/WFS/Reedy-PartsTown-Site/en_US/-/USD/ViewCCInfo-Popup','card_security_id_popup',params); } function getCartByAjax(id){ document.getElementById(id).style.visibility="hidden"; if (!xmlhttp){ initXMLHTTP (); } var prms = ''; if (document.URL.indexOf("ViewSpecialPage-Models") != -1 || document.URL.indexOf("ViewSpecialPage-Show") != -1 || document.getElementById(id).getAttribute("isold") != null) { prms = '?LandingPageID='; } var xmlhttpUrl = "//www.partstown.com/is-bin/INTERSHOP.enfinity/WFS/Reedy-PartsTown-Site/en_US/-/USD/ViewCurrentReq-GetCartByAjax" + prms; xmlhttpUrl = ('https:' == document.location.protocol ? 'https:' : 'http:') + xmlhttpUrl; xmlhttp.open("GET",xmlhttpUrl,true); xmlhttp.onreadystatechange = function(){if(xmlhttp.readyState == 4){ if ( xmlhttp.responseText.indexOf('invalid') == -1 ) { if (xmlhttp.responseText.indexOf("empty_cart") == -1){ document.getElementById(id).innerHTML = xmlhttp.responseText; document.getElementById(id).style.visibility="visible"; } } } } xmlhttp.send(null); } //***** p_drops var NN = (document.layers) ? true : false; var IE = (document.all) ? true : false; var OP = (window.opera) ? true : false; var DOM = (document.getElementById) ? true : false; var showLayer = NN ? "show" : "visible"; var hideLayer = NN ? "hide" : "hidden"; function hideControls() { if (IE == false) return; var re = new RegExp("select", "i"); var re2 = new RegExp("Manufacturer|Model"); for (var i = 0; i < document.forms.length; i++) { for (var j = 0; j < document.forms[i].length; j++) { var ide = document.forms[i].elements[j].name; if (re.test(document.forms[i].elements[j].type) && !re2.test(ide)) { document.forms[i].elements[j].style.visibility = hideLayer; } } } } function hideControls1() { if (IE == false) return; var re = new RegExp("select", "i"); var re2 = new RegExp("Manufacturer|Model"); for (var i = 0; i < document.forms.length; i++) { for (var j = 0; j < document.forms[i].length; j++) { var ide = document.forms[i].elements[j].name; if (re.test(document.forms[i].elements[j].type) && !re2.test(ide)) { document.forms[i].elements[j].style.visibility = hideLayer; } } } } function showControls() { var re = new RegExp("select","i"); var re2 = new RegExp("Manufacturer|Model"); for (var i = 0; i < document.forms.length; i++) { if (i==0) { document.getElementById('tableidselect').style.visibility="visible"; } for (var j = 0; j < document.forms[i].length; j++) { var ide = document.forms[i].elements[j].name; if (re.test(document.forms[i].elements[j].type) && !re2.test(ide)) { document.forms[i].elements[j].style.visibility=showLayer; } } } } //******** p_rollover function highlight(link) {link.className = "nav1_highlighted"; } function fade(link) { link.className = "nav1"; } function highlight_cart(link) { link.className = "nav1_highlighted"; document.cart.src="/is-bin/intershop.static/WFS/Reedy-PartsTown-Site/-/en_US/images/cart_dark.gif";} function fade_cart(link) { link.className = "nav1"; document.cart.src="/is-bin/intershop.static/WFS/Reedy-PartsTown-Site/-/en_US/images/cart.gif";} function highlight_bg(link) { link.className = "top_nav_link_highlited"; } function fade_bg(link) { link.className = "top_nav_link"; } function change_color_advanced() {document.getElementById("advansed_search").style.color="#FFFFFF"; document.getElementById("a_advansed_search").style.textDecoration="underline"; document.getElementById("a_advansed_search").style.color="#D88E90";} function change_back_adanced() {document.getElementById("advansed_search").style.color="#E9AEAB"; document.getElementById("a_advansed_search").style.textDecoration="none"; document.getElementById("a_advansed_search").style.color="#D5615C";} function change_color_help() {document.getElementById("a_search_help").style.color="#FFFFFF"; document.getElementById("a_search_help").style.textDecoration="underline"; document.getElementById("a_search_help").style.color="#D88E90";} function change_back_help() {document.getElementById("a_search_help").style.color="#E9AEAB"; document.getElementById("a_search_help").style.textDecoration="none"; document.getElementById("a_search_help").style.color="#D5615C";} function change_link(link) {link.style.textDecoration='underline'; link.style.color='#EFC6C7'} function back_change_link(link) {link.style.textDecoration='none'; link.style.color='#D5615C'} function change_span(tagName) {tagName.style.color='#C01d21'; } function back_change_span(tagName) {tagName.style.color='#D5615C'; } function change_manufacturers(tagName) { tagName.src='/is-bin/intershop.static/WFS/Reedy-PartsTown-Site/-/en_US/images/hp/manufactures.png'; } function back_change_manufacturers(tagName) {tagName.src='/is-bin/intershop.static/WFS/Reedy-PartsTown-Site/-/en_US/images/hp/manufactures.png'; } function change_inews(tagName) {tagName.src='/is-bin/intershop.static/WFS/Reedy-PartsTown-Site/-/en_US/images/hp/industry_news.png'; } function back_change_inews(tagName) {tagName.src='/is-bin/intershop.static/WFS/Reedy-PartsTown-Site/-/en_US/images/hp/industry_news.png'; } function change_resources(tagName) {tagName.src='/is-bin/intershop.static/WFS/Reedy-PartsTown-Site/-/en_US/images/top_menu/resources_0.gif'; } function back_change_resources(tagName) {tagName.src='/is-bin/intershop.static/WFS/Reedy-PartsTown-Site/-/en_US/images/top_menu/resources_1.gif'; } function change_about_us(tagName) {tagName.src='/is-bin/intershop.static/WFS/Reedy-PartsTown-Site/-/en_US/images/top_menu/about_us_0.gif'; } function back_change_about_us(tagName) {tagName.src='/is-bin/intershop.static/WFS/Reedy-PartsTown-Site/-/en_US/images/top_menu/about_us_1.gif'; } //***** p_myequipment function newOnLoad() { var check = initXMLHTTP(); if (!check) return; isBusy=true; if(document.getElementById('btn1') != null) { document.getElementById('btn1').enabled=false; } } if(window.addEventListener) { window.addEventListener('load', newOnLoad, false); } else { window.attachEvent('onload', newOnLoad); } var xmlhttp; var divelement; var selectelement; function initXMLHTTP () { try { xmlhttp=new ActiveXObject("Msxml2.XMLHTTP") } catch (e) { try { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP") } catch (e) { xmlhttp=false } } if (!xmlhttp) { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp=false; } } return xmlhttp; } var oldQueryString,isBusy,zending; function getXmlHttpRequest(){ var request; try { request = new ActiveXObject("Msxml2.XMLHTTP"); Msxml2.XMLHTTP return request; } catch (e) {} try { request = new ActiveXObject("Microsoft.XmlHttp"); return request; } catch (e) {} try { request = new ActiveXObject("MSXML.XmlHttp"); return request; } catch (e) {} try { request = new ActiveXObject("MSXML3.XmlHttp"); return request; } catch (e) {} if (window.XMLHttpRequest && window.DOMParser && document.implementation && document.implementation.createDocument) { request = new XMLHttpRequest(); return request; } } function doajax() { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); } catch (e) {} if (isBusy) { xmlhttp.onreadystatechange = function () {}; xmlhttp.abort(); isBusy = false; } var messageID=document.getElementById('mfr').options[document.getElementById('mfr').selectedIndex].id; if(messageID == ""){ document.getElementById('mtd').style.visibility="hidden"; document.getElementById('mop').style.visibility="hidden"; return; } xmlhttp.open("GET","http://www.partstown.com/is-bin/INTERSHOP.enfinity/WFS/Reedy-PartsTown-Site/en_US/-/USD/getEquipment-Start?CSSClass=select_chk"+"&CatId="+messageID,true); var td=document.getElementById('mtd'); td.innerHTML="Loading..."; td.style.visibility="visible"; document.getElementById('btn1').enabled=false; document.getElementById('mop').style.visibility="hidden"; isBusy = true; xmlhttp.onreadystatechange = processResponse; xmlhttp.send(null); } function processResponse() { if ( xmlhttp.readyState == 4 ) { var td=document.getElementById('mtd'); td.style.visibility="hidden"; if ( xmlhttp.responseText.indexOf('invalid') == -1 ) { document.getElementById('btn1').enabled=true; td.style.visibility="visible"; td.innerHTML=xmlhttp.responseText; document.getElementById('mop').style.visibility="visible"; } } } function getModelAjax() { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); } catch (e) {} if (isBusy) { xmlhttp.onreadystatechange = function() {}; xmlhttp.abort(); isBusy = false; } var mfrSelectedOption = document.getElementById('mfr').options[document.getElementById('mfr').selectedIndex]; var messageID = mfrSelectedOption.id; var mfrspan = document.getElementById('mfrspan'); mfrspan.innerHTML = mfrSelectedOption.innerHTML; if (messageID == "") { document.getElementById('mtd').style.visibility = "hidden"; document.getElementById('serialNumber').style.display = "none"; document.getElementById('modelNotes').style.display = "none"; document.getElementById('mop').style.display = "none"; return; } xmlhttp.open("GET","http://www.partstown.com/is-bin/INTERSHOP.enfinity/WFS/Reedy-PartsTown-Site/en_US/-/USD/getEquipment-Start?IsEquipmentList=true&onchange=toggleModelFieldsVisibility%28%29%3BaddNoTranslateClass%28%22mdlspan%22%29" + "&CatId=" + messageID, true); var td = document.getElementById('mtd'); td.innerHTML = "Loading..."; td.style.visibility = "visible"; isBusy = true; xmlhttp.onreadystatechange = processGetModelResponse; xmlhttp.send(null); } function addNoTranslateClass(eltId) { var elt = document.getElementById(eltId); var hasClass = (" " + elt.className + " ").indexOf("notranslate") > -1; if (hasClass == false) { elt.className = elt.className + " notranslate "; } } function getModelAjaxForLandingPage() { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); } catch (e) {} if (isBusy) { xmlhttp.onreadystatechange = function() {}; xmlhttp.abort(); isBusy = false; } var mfrSelectedOption = document.getElementById('mfr').options[document.getElementById('mfr').selectedIndex]; var manufactuererName = mfrSelectedOption.id; var mfrspan = document.getElementById('mfrspan'); mfrspan.innerHTML = mfrSelectedOption.innerHTML; if (manufactuererName == "") { document.getElementById('mtd').style.visibility = "hidden"; document.getElementById('serialNumber').style.display = "none"; document.getElementById('modelNotes').style.display = "none"; document.getElementById('mop').style.display = "none"; return; } xmlhttp.open("GET","http://www.partstown.com/is-bin/INTERSHOP.enfinity/WFS/Reedy-PartsTown-Site/en_US/-/USD/getEquipment-ForSpecialPage?IsEquipmentList=true&onchange=toggleModelFieldsVisibility%28%29%3BaddNoTranslateClass%28%22mdlspan%22%29" + "&ManufacturerName=" + manufactuererName, true); var td = document.getElementById('mtd'); td.innerHTML = "Loading..."; td.style.visibility = "visible"; isBusy = true; xmlhttp.onreadystatechange = processGetModelResponse; xmlhttp.send(null); } function processGetModelResponse() { if (xmlhttp.readyState == 4) { var td = document.getElementById('mtd'); td.style.visibility = "hidden"; if (xmlhttp.responseText.indexOf('invalid') == -1 ) { td.style.visibility = "visible"; td.innerHTML = xmlhttp.responseText; } } } function toggleModelFieldsVisibility() { var $ = jQuery, $model = $('#modelatr'), btn1 = $('#btn1')[0] || {}; if (!$model.val()) { $('#serialNumber,#modelNotes,#mop').hide(); btn1.enabled = false; } else { $('#serialNumber,#modelNotes,#mop').show(); btn1.enabled = true; } $('#mdlspan').html($model.find(':selected').text()); } function limitText(limitField, limitNum) { if (limitField.value.length > limitNum) { limitField.value = limitField.value.substring(0, limitNum); } } function dosearchajax(requestToHost, lpID) { requestToHost = requestToHost || "http://www.partstown.com/is-bin/INTERSHOP.enfinity/WFS/Reedy-PartsTown-Site/en_US/-/USD/getEquipment-StartEquipSearch"; lpID = lpID || ''; try { netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); } catch (e) {} if (isBusy) { xmlhttp.onreadystatechange = function () {}; xmlhttp.abort(); isBusy = false; } var dtElt = document.getElementById('dt'); dtElt.disabled = true; dtElt.selectedIndex = 0; dtElt.options[0].text = "Select document type"; var dtSpan = document.getElementById('selectCatName'); if (dtSpan) { dtSpan.style.color = "#ccc"; } var index = document.getElementById('manfr').selectedIndex; var messageID=document.getElementById('manfr').options[index].id; if(messageID == "" || index == "0") { document.getElementById('atrg').disabled = true; document.getElementById('atrg').selectedIndex = 0; document.getElementById('go').disabled = true; return; } xmlhttp.open("GET",requestToHost+"?CatId="+messageID+(lpID != '' ? ('&LandingPageID='+lpID) : ''),true); //var td=document.getElementById('modeld'); var td=document.getElementById('selectCatUUID'); td.style.color = '#000'; td.childNodes[0].nodeValue= "Loading..."; isBusy = true; divelement = 'modeld'; selectelement = 'atrg'; xmlhttp.onreadystatechange = processResp; xmlhttp.send(null); } function processResp() { if ( xmlhttp.readyState == 4 ) { var td=document.getElementById(divelement); if ( xmlhttp.responseText.indexOf('invalid') == -1 ) { td.innerHTML=xmlhttp.responseText; var select=document.getElementById(selectelement); select.disabled = false; if( selectelement == 'atrg') { //document.getElementById(selectelement).onchange=viewalldocs; document.getElementById("selectCatName").childNodes[0].nodeValue = "Select document type"; } else { var sel = document.getElementById('dt'); /* if( sel.length == 2 ) { sel.options[0] = null; }*/ document.getElementById('go').onclick=viewmanual; } Custom.init(); } } } function viewalldocs() { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); } catch (e) {} if (isBusy) { xmlhttp.onreadystatechange = function () {}; xmlhttp.abort(); isBusy = false; } var index = document.getElementById('atrg').selectedIndex; var messageID=document.getElementById('atrg').options[index].value; if(messageID == "" || index == "0") { document.getElementById('dt').options[0].text = "Select document type"; document.getElementById('dt').selectedIndex = 0; document.getElementById('dt').disabled=true; document.getElementById('go').disabled=true; return; } //replace spaces var allSpacesRe = /\s+/g; var rightSpacesRe = /^\s+/; var leftSpacesRe = /\s+$/; //define manufacture var manufactureIndex = document.getElementById('manfr').selectedIndex; var manufactureName = document.getElementById('manfr').options[manufactureIndex].text; var manufactureNameDecoded = escape(manufactureName.replace(rightSpacesRe, "").replace(leftSpacesRe, "")); xmlhttp.open("GET","http://www.partstown.com/is-bin/INTERSHOP.enfinity/WFS/Reedy-PartsTown-Site/en_US/-/USD/ViewAllDocs-Start"+"?CatId=" + messageID + "&manID=" + manufactureNameDecoded + "&search=true",true); var td=document.getElementById('selectCatName'); td.style.color = '#000'; td.childNodes[0].nodeValue= "Loading..."; isBusy = true; divelement = 'typedoc'; selectelement = 'dt'; document.getElementById('go').disabled=false; xmlhttp.onreadystatechange = processResp; xmlhttp.send(null); } function viewmanual() { var index = document.getElementById('dt').selectedIndex; var option = document.getElementById('dt').options[index].text; var value = document.getElementById('dt').options[index].value; var optionID = document.getElementById('dt').options[index].id; if(option.indexOf("Select document type") == -1 && option.indexOf("No documents found") == -1 && value.indexOf("Select document type") == -1 && value.indexOf("No documents found")) { if (value == "snLookup") { var modelId = $('#atrg').val(); var mfrId = $('#manfr').val(); var serialNumber = $('.select-input input[name="serialNumber"]').val(); window.location.href = "http://www.partstown.com/is-bin/INTERSHOP.enfinity/WFS/Reedy-PartsTown-Site/en_US/-/USD/ViewSearchResults-Start" + "?mfrID=" + mfrId + "&modelID=" + modelId + "&sn=" + serialNumber; } else if(value == "listOfReplacement") { //replace spaces var allSpacesRe = /\s+/g; var rightSpacesRe = /^\s+/; var leftSpacesRe = /\s+$/; //define model var modelIndex = document.getElementById('atrg').selectedIndex; var modelName = document.getElementById('atrg').options[modelIndex].text; var modelNameDecoded = modelName.replace(rightSpacesRe, "").replace(leftSpacesRe, ""); //define manufacture var manufactureIndex = document.getElementById('manfr').selectedIndex; var manufactureName = document.getElementById('manfr').options[manufactureIndex].text; var manufactureNameDecoded = manufactureName.replace(rightSpacesRe, "").replace(leftSpacesRe, ""); //Google analytics event tracking for the document finder // ga('send', 'event', 'Document Finder', 'List of Replacement Parts', modelName); window.location.href = "http://www.partstown.com/is-bin/INTERSHOP.enfinity/WFS/Reedy-PartsTown-Site/en_US/-/USD/ViewEasyAskSearch-Start" + "?Action=CA_AttributeSelected" + "&Question=Model=" + encodeURIComponent("'" + modelNameDecoded + "'") + "&CategoryPath=" + encodeURIComponent("All Products////AttribSelect=Manufacturer=" + "'" + manufactureNameDecoded + "'") + "&CatalogCategoryID="; } else { var url = "http://www.partstown.com/is-bin/INTERSHOP.enfinity/WFS/Reedy-PartsTown-Site/en_US/-/USD/ViewStaticPage-LoadManual"; //Google analytics event tracking for the document finder if(option == "Interactive Parts Diagram" || optionID == "CategoryID") { value1 = jsStringReplace(value,"&","%26"); window.open(url+"?CategoryID="+value1); } else { // ga('send', 'event', 'Document Finder', 'Download', value); value1 = jsStringReplace(value,"&","%26"); window.open(url+"?value="+value1); } } } } function searchForModelsAndDocsByManufacturer(catId, textDivId) { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); } catch (e) {} if (isBusy) { xmlhttp.onreadystatechange = function () {}; xmlhttp.abort(); isBusy = false; } xmlhttp.open("GET","http://www.partstown.com/is-bin/INTERSHOP.enfinity/WFS/Reedy-PartsTown-Site/en_US/-/USD/getEquipment-GetModelsAndManuals"+"?CatId="+catId,true); document.getElementById(textDivId).innerHTML = "

Loading...

"; isBusy = true; xmlhttp.onreadystatechange = function() { if ( xmlhttp.readyState == 4 ) { if ( xmlhttp.responseText.indexOf('invalid') == -1 ) { document.getElementById(textDivId).innerHTML = xmlhttp.responseText; } } }; xmlhttp.send(null); } function viewManualDocs(value) { var url = "http://www.partstown.com/is-bin/INTERSHOP.enfinity/WFS/Reedy-PartsTown-Site/en_US/-/USD/ViewStaticPage-LoadManual"; //Google analytics event tracking for the document finder // ga('send', 'event', 'Document Finder', 'Download', value); value1 = jsStringReplace(value,"&","%26"); window.open(url+"?value="+value1); } function jsStringReplace(text,searchString, replaceString) { lengthSearchString=searchString.length; lengthReplaceString=replaceString.length; rezultText=text; start_poz=0; while ((poz=rezultText.indexOf(searchString,start_poz))!=-1) { firstPart=rezultText.substring(0,poz); lengthRezultText=rezultText.length; endPart=rezultText.substring(poz+lengthSearchString, lengthRezultText ); rezultText=firstPart+replaceString+endPart; start_poz=poz+lengthReplaceString; } return (rezultText); } var shoppingCartPopupTimer; function prepareGoBtn() { var mfrAgentSelect = document.getElementById("mfrAgentSelect"); var index = mfrAgentSelect.selectedIndex; var option = mfrAgentSelect.options[index].value; var mfrGo = document.getElementById("mfrGo"); var mfrName = document.getElementById("mfrName"); mfrName.innerHTML = mfrAgentSelect.options[index].innerHTML; if (option.indexOf("Manufacturer") == -1) { mfrGo.href = option; mfrGo.target = "_blank"; } else { mfrGo.removeAttribute("href"); mfrGo.removeAttribute("target"); } } (function($){ $(function() { if ($.fn.delegate) { $('#main_content').delegate('table.equipment-list-box td.edit_cell input.editbtn', 'click', function() { var editbtn = this, editFrm = document.getElementById($(this).attr('frmId')), $popup = $('#editEquipmentPopup'), $tr = $(editbtn).closest('tr').prev(), $serial = $popup.find('input.serial'), $notes = $popup.find('textarea.notes'), $errors = $popup.find('div.errors'); $serial.val($.trim($tr.find('div.serialNumber').text())); $notes.val($.trim($tr.find('div.itemNotes').text())); $popup.find('input.saveButton').unbind('click').click(function(){ $errors.hide(); $.ajax({ url: "http://www.partstown.com/is-bin/INTERSHOP.enfinity/WFS/Reedy-PartsTown-Site/en_US/-/USD/ViewB2BWishlist-UpdateMyEquipmentItem", type: 'POST', dataType: 'json', data: { note: $notes.val(), serialNumber: $serial.val(), SelectedObjectUUID: editFrm && editFrm.SelectedObjectUUID.value }, error: function(xhr, status, e) { $errors.text('No connection').show(); }, success: function(data) { if (data && data.head) { if (data.head.status == 'OK') { var $serialContainer = $tr.find('div.serialNumberContainer'), $notesContainer = $tr.find('div.itemNotesContainer'), $serialNumber = $serialContainer.find('div.serialNumber'), $itemNotes = $notesContainer.find('div.itemNotes'); if (!$serialNumber.length) { $serialContainer.html('Serial #'); $serialNumber = $('
', {'class':'serialNumber'}).appendTo($serialContainer); } if (!$itemNotes.length) { $itemNotes = $('
', {'class':'itemNotes'}).appendTo($notesContainer); } $serialNumber.html($serial.val()); $itemNotes.html($notes.val()); $popup.find('input.cancelButton').click(); } else if (data.head.status == 'ERROR') { $errors.text(data.head.errorMessage).show(); } } } }); }); $popup.modal({overlayClose:true, closeClass:'cancelButton'}); }); } }); })(jQuery);