var cds=cds||{includes:{},accessManager2:{},textLabels:{"global.unit_english_label":"English","global.unit_metric_label":"Metric","global.ok_button_label":"OK","global.cancel_button_label":"Cancel","attribute_search.advanced_search_button_text":"Advanced Search","attribute_search.advanced_search_dialog_title":"Advanced Search","attribute_search.advanced_search_header_text":"Select all Attributes which you would like to display " +"within the attributes search table.","attribute_search.record_count_select_label":"Number of records to display","attribute_search.attribute_select_default_text":"Select","attribute_search.attribute_select_none_text":"None","attribute_search.compare_button_text":"Compare","attribute_search.compare_product_limit_text":"Select up to %count% products to compare.","attribute_search.description_column_label":"Description","attribute_search.error_missing_parent_element":"Missing parent element.","attribute_search.error_no_products":"There are no products classified within this category","attribute_search.error_no_filtered_products":"There are no products that match your criteria.  Click here to reset your search.","attribute_search.error_server_response":"Unable to load attribute search table.","attribute_search.error_too_many_compare_products":"You may compare up to %count% products.","attribute_search.error_invalid_min_range_value":"Please enter a number.","attribute_search.error_invalid_max_range_value":"Please enter a number.","attribute_search.image_column_label":"Image","attribute_search.product_column_label":"Product Number","attribute_search.range_max_input_box_text":"Max","attribute_search.range_min_input_box_text":"Min","attribute_search.record_count_text":"Showing records %start-row% to %end-row% of %row-count%","attribute_search.record_page_next_text":"Next","attribute_search.record_page_previous_text":"Previous","attribute_search.record_page_text":"Page: ","attribute_search.reset_button_text":"Reset","attribute_search.reset_link_text":"Reset","attribute_search.sort_link_text":"Sort","product_compare.error_missing_parent_element":"Missing parent element.","product_compare.error_not_enough_products":"Please select two or more products to compare.","product_compare.error_no_products_given":"No products were selected to compare.","product_compare.error_server_response":"Unable to load product compare table.","product_compare.header_text":"Comparing %count% Products.","product_home.download_select_default_text":"Choose a CAD format","product_home.error_no_download_format_selected":"Please select a CAD format to download.","product_home.cad_generating_dialog_title":"Generating CAD Model","product_home.cad_generating_dialog_text":"The model you requested is being generated. This could take up to a minute, please wait...","product_home.cad_complete_dialog_title":"Generation Complete!","product_home.cad_complete_dialog_text":"The model you requested has been successfully generated.","product_home.cad_complete_link_drag_drop":"Drag & Drop into Your CAD System","product_home.cad_complete_link":"Download CAD Model","product_home.cad_complete_link_view":"Click Here to View Model","product_home.cad_error_title":"Error!","product_home.cad_error_text":"There was an error generating the model you have requested.  Please wait a few minutes and try again.","product_home.cad_pdf_adobe_help_label":"Adobe 3D PDF help","product_home.cad_attachment_complete_dialog_text":"The document you requested has been successfully generated.","product_home.cad_attachment_complete_dialog_title":"Generation Complete!","product_home.cad_attachment_complete_link":"Download Document","product_home.cad_attachment_error_text":"There was an error generating the document you have requested.  Please wait a few minutes and try again.","product_home.cad_attachment_error_title":"Error!","product_home.cad_attachment_generating_dialog_text":"The document you requested is being generated. This could take up to a minute, please wait...","product_home.cad_attachment_generating_dialog_title":"Generating Document","product_home.cart_button_text":"Add to Cart","product_home.download_button_text":"Download CAD","product_home.view_3d_button_text":"View 3D Model","product_home.view_2d_button_text":"View 2D Model","cart.submit_button_text":"Submit RFQ","cart.submit_dialog_title":"Submitting RFQ","cart.submit_dialog_text":"Your request for quote is being submitted.  Please wait...","cart.submit_dialog_success_title":"RFQ Submitted","cart.submit_dialog_success_text":"Thank you.  Your request has been submitted.","cart.submit_dialog_error_text":"There was an error submitting your RFQ.  Please wait a few minutes and try again.","login.dialog_title":"Sign In","login.header_text":"Returning users please sign in.","login.email_label":"Email Address:","login.password_label":"Password:","login.submit_button_text":"Sign In","login.forgot_password_link_text":"Forgot your password?","login.new_user_header_text":"Are you a new user?","login.new_user_link_text":"Click here to create a new sign in profile","login.error_account_does_not_exist":"No account exists for this email address.","confirm.dialog_title":"Add to Cart","confirm.content_text":" product(s) have been added to the cart.","registration.agree_service_text":"You must agree to these terms to use this service.","registration.confirm_read_terms":"I have read and agree to the ","registration.header_text":"New user? Please create your sign in profile.","registration.required_notification_text":"An * indicates a required field.","registration.contact_details_label":"Contact Details","registration.email_label":"Email Address:","registration.first_name_label":"First Name:","registration.last_name_label":"Last Name:","registration.company_label":"Company:","registration.contact_ok_label":"Subscribe to newsletter and/or product update emails","registration.address_details_label":"Address Details","registration.address_1_label":"Address 1:","registration.address_2_label":"Address 2:","registration.address_3_label":"Address 3:","registration.city_label":"City:","registration.state_label":"State/Province:","registration.state_default_selection_text":"Please select a state/province","registration.country_label":"Country:","registration.country_default_selection_text":"Please select a country","registration.postal_code_label":"Postal Code:","registration.phone_label":"Phone:","registration.fax_label":"Fax:","registration.salesperson_label":"Salesperson:","registration.submit_button_text":"Create Account","registration.error_required_field":"Please complete all required fields before submitting.","registration.error_invalid_email":"Please enter a valid email address.","registration.error_account_exists":"An account already exists for this email address.","registration.error_unknown":"There was an error creating this account. Please try again in a few " +"minutes.","registration.agree_tos_text_prefix":"Check here to indicate that you have read and agree to the ","registration.agree_tos_text_anchor":"terms of using this service","registration.agree_tos_text_suffix":".","registration.tos_link":"https://www.cdsvisual.com/privacy-policy/","registration.contact_me_text":"I want to be the first to know about the latest products, exclusives and offers. Feel free to contact me.","registration.gdpr_disclaimer_text":"We do not sell your personal information","keyword_search_results.error_no_results":"No results found.","keyword_search_results.product_column_label":"Product","keyword_search_results.category_column_label":"Category","keyword_search_results.description_column_label":"Description","keyword_search_results.product_column_label":"Product Number","keyword_search_results.category_column_label":"Category","keyword_search_results.description_column_label":"Product","keyword_search_results.long_description_column_label":"Description","keyword_search_results.attribute_column_label":"Attribute","keyword_search_results.value_column_label":"Value","search.table_column_label_product":"Product","search.min_max_separator":"to","search.show_more_label":"Show 15 More","search.sort_default_label":"Default","search.sort_low_high_label":"Low to High","search.sort_high_low_label":"High to Low","search.sort_section_label":"Sort by:","search.compare_button_label":"Compare","search.add_to_cart_button_label":"Add to Cart","search.category_browse_label":"Category Browse","search.narrow_results_label":"Narrow Results","search.show_category_hierarchy_label":"Show Category Hierarchy","search.hide_category_hierarchy_label":"Hide Category Hierarchy","search.start_end_total_products_label":"%start%-%end% of %total% Products","search.show_more_categories_label":"+ show more","search.show_less_categories_label":"- show less","search.clear_label":"Clear","search.clear_all_label":"Clear all","search.power_grid_link_label":"Power Grid Search","search.loading_products_text":"Loading products..."},domainId:null,dataDomainId:null,templateDomainId:null,user:null,isInputBlocked:false,cdsu:null,fname:null,lname:null,company:null,address1:null,address2:null,address3:null,city:null,country:null,state:null,zip:null,phone:null,fax:null,agreetos:null,unitSystem:"metric",defaultRegistrationCountry:"United States",useCDSdialogs:false,dialogOverlay:null,productQueue:null,cadViewerBaseURL:"https://www.product-config.net/cadviewer/",setDomain:function(dataDomainId,templateDomainId){cds.dataDomainId=dataDomainId;cds.templateDomainId=(templateDomainId)?templateDomainId:dataDomainId;},getDataDomain:function(){if(!cds.dataDomainId){cds.dataDomainId=cds.domainId;} if(!cds.templateDomainId){cds.templateDomainId=cds.dataDomainId;} return cds.dataDomainId;},getTemplateDomain:function(){if(!cds.dataDomainId){cds.dataDomainId=cds.domainId;} if(!cds.templateDomainId){cds.templateDomainId=cds.dataDomainId;} return cds.templateDomainId;},getDataDomainURI:function(url){var u=url;if(cds.getTemplateDomain()!==cds.getDataDomain()){if(u&&u.indexOf("?")===-1){u+="?dd="+cds.getDataDomain();}else{u+="&dd="+cds.getDataDomain();}} if(cds.cdsu){if(u&&u.indexOf("?")===-1){u+="?cdsu="+cds.cdsu;}else{u+="&cdsu="+cds.cdsu;}} return u;},domainProperties:{},remoteServerBaseURL:"https://www.product-config.net/catalog3",setRemoteServerBaseURL:function(url){cds.remoteServerBaseURL=url;if(cds.remoteServerBaseURL&&cds.remoteServerBaseURL.length){if(cds.remoteServerBaseURL[cds.remoteServerBaseURL.length-1]==="/"){cds.remoteServerBaseURL=cds.remoteServerBaseURL.substring(0,cds.remoteServerBaseURL.length-1);} if(cds.remoteServerBaseURL.indexOf("/service")==cds.remoteServerBaseURL.length-8){cds.remoteServerBaseURL=cds.remoteServerBaseURL.substring(0,cds.remoteServerBaseURL.length-8);}}},bin2octet:function(s){let buf=new ArrayBuffer(s.length);let view=new Uint8Array(buf);for(let i=0;i=values.length)?parameters.length:values.length;for(i=0;i",all[0]);return(v>4&&v<9)?true:false;},loadRemoteScript:function(source,callback){var script=document.createElement("script"),parent=document.getElementsByTagName("script")[0];script.src=source;script.type="application/javascript";if(cds.isIElt9()){script.type="text/javascript";} script.async=true;script.onerror=function(){script.onload=script.onreadystatechange=null;script=undefined;};parent.parentNode.insertBefore(script,parent);script.onload=script.onreadystatechange=function(_,isAbort){if(isAbort||!script.readyState||/loaded|complete/.test(script.readyState)){script.onload=script.onreadystatechange=null;script=undefined;if(!isAbort){if(callback){if(cds.isIElt9()){setTimeout(function(){callback();},100);}else{callback();}}}}};},loadRemoteJSONP:function(url,args,callback,callbackOnError,callbackOnTimeout,timeout,excludeUser){var i,qs,to,tof,u,source,callbackName,script=document.createElement("script"),parent=document.getElementsByTagName("script")[0];source=url.replace("callback=?","");qs="";i=source.indexOf("?");if(i!==-1){qs=source.substring(i+1);source=source.substring(0,i);} for(i in args){if(args.hasOwnProperty(i)&&args[i]!==null){if(qs.length){qs+="&";} qs+=encodeURIComponent(i)+"="+encodeURIComponent(args[i]);}} if(!cds._callback_count){cds._callback_count=0;} cds._callback_count++;callbackName="_cds_callback_"+cds._callback_count;if(qs.length){source+="?"+qs+"&callback="+callbackName;}else{source+="?callback="+callbackName;} if(!excludeUser){u=cds.getUser();if(u){source+="&cdsu="+encodeURIComponent(u);}} source+="&_="+Math.floor(Math.random()*1000000000000);script.src=source;script.type="application/javascript";if(cds.isIElt9()){script.type="text/javascript";script.cds_callback_name=callbackName;} script.async=true;script.onerror=function(){if(callbackOnError){callbackOnError();} if(tof){window.clearTimeout(tof);} script.parentNode.removeChild(script);window[callbackName]=undefined;try{delete window[callbackName];}catch(ignored){} script=undefined;};parent.parentNode.insertBefore(script,parent);if(callbackOnTimeout||callbackOnError){to=timeout||20000;tof=window.setTimeout(function(){if(callbackOnTimeout){callbackOnTimeout();}else{callbackOnError();} script.parentNode.removeChild(script);window[callbackName]=function(){};script=undefined;},to);} window[callbackName]=function(data){if(callback){callback(data);} if(tof){window.clearTimeout(tof);} script.parentNode.removeChild(script);window[callbackName]=undefined;try{delete window[callbackName];}catch(ignored){} script=undefined;};},loadXHR:function(method,url,args,callback,callbackOnError,contentType,preventResponseParsing){let data=null;if(args){if(contentType==="application/json"){data=JSON.stringify(args);}else{for(let a in args){if(args.hasOwnProperty(a)){if(data===null){data="";}else{data+="&";} data+=encodeURIComponent(a)+"="+encodeURIComponent(args[a]);}}}} xhttp=new XMLHttpRequest();xhttp.onreadystatechange=function(){if(this.readyState===4){if(this.status===200){if(callback){if(preventResponseParsing){callback(xhttp.responseText);}else{callback(JSON.parse(xhttp.responseText));}}}else{if(callbackOnError){callbackOnError(this);}}}};if(method.toUpperCase()==="GET"&&data!==null){xhttp.open(method,url+(url.indexOf("?")===-1?"?":"&")+data,true);}else{xhttp.open(method,url,true);} if(contentType){xhttp.setRequestHeader("Content-Type",contentType);}else if(method.toUpperCase()!=="GET"&&data!==null){xhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");} xhttp.send(data);},isWebGLAvailable:function(){var i,e,canvas,context,names;if(!window.WebGLRenderingContext){return false;} canvas=document.createElement("canvas");if(!canvas){return false;} names=["webgl","experimental-webgl","webkit-3d","moz-webgl"];for(i=0;i0){i=document.cookie.indexOf(k+"=");if(i!==-1){i+=k.length+1;j=document.cookie.indexOf(";",i);if(j===-1){j=document.cookie.length;} return decodeURIComponent(document.cookie.substring(i,j));}} return null;},setUser:function(user){this.user=user;},getUser:function(){if(this.user){return this.user;}else{let user=cds.getCookie("cds."+cds.getTemplateDomain()+".user");if(user){return user;}} return null;},emailPage:function(){s="mailto:?subject="+encodeURIComponent(document.title)+"&body=" +encodeURIComponent(document.title+" at: "+location.href);location.href=s;},addBookmark:function(atitle,aurl){var e,title=atitle,url=aurl;if(!url){url=location.href;} if(!title){title=document.title;} if(window.sidebar&&window.sidebar.addPanel){window.sidebar.addPanel(title,url,"");}else if(window.external&&window.external.AddFavorite){window.external.AddFavorite(url,title);}else if(window.opera&&window.print){e=document.createElement('a');e.setAttribute('href',url);e.setAttribute('title',title);e.setAttribute('rel','sidebar');e.click();}else{alert("This browser does not support automatic bookmarking. Please bookmark this page manually.");}},getViewportWidth:function(){var docElement=(document.compatMode==="CSS1Compat")?document.documentElement:document.body;return(window["innerWidth"]>docElement["clientWidth"])?window["innerWidth"]:docElement["clientWidth"];},getViewportHeight:function(){var docElement=(document.compatMode==="CSS1Compat")?document.documentElement:document.body;return(window["innerHeight"]>docElement["clientHeight"])?window["innerHeight"]:docElement["clientHeight"];},addUnitSystemToggle:function(elementId,currentUnitSystem){var ee,e=document.getElementById(elementId),u=currentUnitSystem;if(!u){u=this.getCookie("cds.catalog.unit");if(!u){u="english";}} if(e){ee=document.createElement("input");ee.setAttribute("type","radio");ee.setAttribute("name","cds-unit-toggle");ee.setAttribute("id","cds-unit-toggle-english");ee.setAttribute("value","english");if(u==="english"){ee.setAttribute("checked","checked");} e.appendChild(ee);ee=document.createElement("label");ee.setAttribute("for","cds-unit-toggle-english");ee.appendChild(document.createTextNode(cds.getTextLabel("global.unit_english_label")));e.appendChild(ee);ee=document.createElement("input");ee.setAttribute("type","radio");ee.setAttribute("name","cds-unit-toggle");ee.setAttribute("id","cds-unit-toggle-metric");ee.setAttribute("value","metric");if(u==="metric"){ee.setAttribute("checked","checked");} e.appendChild(ee);ee=document.createElement("label");ee.setAttribute("for","cds-unit-toggle-metric");ee.appendChild(document.createTextNode(cds.getTextLabel("global.unit_metric_label")));e.appendChild(ee);jQuery("input[name='cds-unit-toggle']").change(function(){var url=location.href.replace(/(&)?unit=(english|metric)/,"").replace("?&","?").replace(/\?$/,""),unit=jQuery("input[name='cds-unit-toggle']:checked").val();if(unit){if(url.indexOf("?")===-1){url+="?unit="+unit;}else{url+="&unit="+unit;} cds.setCookie("cds.catalog.unit",unit,365);location.href=url;}});}},submitCADAttachment:function(url){var format=null,a=/(?:f|format)=([^&]+)/.exec(url);if(a.length<2){alert("Invalid CAD url, no format.");} format=a[1];cds.CADRequester.attachmentFormat=format;cds.CADRequester.getCAD(format);return false;},makeSameHeight:function(elements,padding,staticHeight){var h=(!isNaN(staticHeight))?staticHeight:-1;if(h===-1){elements.each(function(index,element){if(jQuery(this).height()>h){h=jQuery(this).height();}});if(!isNaN(padding)){h+=padding;}} elements.each(function(index,element){jQuery(this).height(h);});},makeSameWidth:function(elements,padding,staticWidth){var w=(!isNaN(staticWidth))?staticWidth:-1;if(w===-1){elements.each(function(index,element){if(jQuery(this).width()>w){w=jQuery(this).width();}});if(!isNaN(padding)){w+=padding;}} elements.each(function(index,element){jQuery(this).width(w);});},access:new(function(){this.registerDialogHeight=680;this.registerDialogWidth=500;this.login=function(callback,cArgs,callbackOnError,coeArgs,callbackURL){if(!cds.accessManager2.loaded){cds.loadRemoteScript(cds.remoteServerBaseURL+"/js/cds-access-2.0-min.js",function(){cds.accessManager2.login(callback,cArgs,callbackOnError,coeArgs,callbackURL);});}else{cds.accessManager2.login(callback,cArgs,callbackOnError,coeArgs,callbackURL);}};this.logout=function(callback,cArgs,callbackOnError,coeArgs,callbackURL){if(!cds.accessManager2.loaded){cds.loadRemoteScript(cds.remoteServerBaseURL+"/js/cds-access-2.0-min.js",function(){cds.accessManager2.logout(callback,cArgs,callbackOnError,coeArgs,callbackURL);});}else{cds.accessManager2.logout(callback,cArgs,callbackOnError,coeArgs,callbackURL);}};this.myaccount=function(callback,cArgs,callbackOnError,coeArgs,callbackURL){if(!cds.accessManager2.loaded){cds.loadRemoteScript(cds.remoteServerBaseURL+"/js/cds-access-2.0-min.js",function(){cds.accessManager2.myaccount(callback,cArgs,callbackOnError,coeArgs,callbackURL);});}else{cds.accessManager2.myaccount(callback,cArgs,callbackOnError,coeArgs,callbackURL);}};this.loadRegistrationProperties=function(callback){if(!cds.accessManager2.loaded){cds.loadRemoteScript(cds.remoteServerBaseURL+"/js/cds-access-2.0-min.js",function(){cds.accessManager2.loadRegistrationProperties(callback);});}else{cds.accessManager2.loadRegistrationProperties(callback);}};})(),authenticationManager:new(function(){this.loginDialog=null;this.registerDialog=null;this.source=null;this.callback=null;this.callbackParameters=null;this.registerDialogWidth=500;this.registerDialogHeight=680;this.isInitialLoginAttempt=true;this.error=null;this.handleSignIn=function(){var e,email,agreedTOS=false,contactOk=false;e=document.getElementById("cds-login-agreedtos-input");if(e&&e.checked){agreedTOS=true;} if(!agreedTOS){e=document.getElementById("cds-login-agreedtos-error");if(e){e.style.display="block";} return;} e=document.getElementById("cds-login-contactok-input");if(e&&e.checked){contactOk=true;} var email=document.getElementById("cds-login-email").value;jQuery.ajax({url:cds.remoteServerBaseURL+"/access?callback=?",dataType:"jsonp",data:{"c":"agree-tos","agreedtos":agreedTOS,"contactok":contactOk,"d":cds.getTemplateDomain(),"email":email},context:this});cds.setCookie("cds."+cds.getTemplateDomain()+".user",email,365);if(this.loginDialog){this.loginDialog.dialog("close");} this.isInitialLoginAttempt=false;if(typeof cdsHandlePostLogin==="function"){cdsHandlePostLogin(email);} if(this.callback!=null){this.callback(this.callbackParameters);}else{if(this.source==="cad"&&cds.CADRequester.resultCADFormat){cds.CADRequester.getCAD(cds.CADRequester.resultCADFormat);}else if(this.source==="spec-sheet"){cds.specSheet.submit();}else if(this.source==="cart-update"){cds.cart.handleUpdate();}else if(this.source==="cart-submit"){cds.cart.handleSubmit();}else if(this.source==="cart-add"){cds.cart.addProduct();}else if(this.source==="cart-load"){cds.cart.load();}else if(this.source==="myaccount"){cds.access.myaccount();}}};this.handleNewUser=function(){jQuery.ajax({url:cds.remoteServerBaseURL+"/access?callback=?",dataType:"jsonp",data:{"c":"get-registration-properties","d":cds.getTemplateDomain()},context:this,success:function(data){var i;for(i in data){if(data.hasOwnProperty(i)){cds.domainProperties[i]=data[i];}} this.loginDialog.dialog("close");this.register(cds.getTemplateDomain());}});};this.handleRegister=function(){var e,estate=document.getElementById("cds-registration-state"),ecountry=document.getElementById("cds-registration-country"),o={"c":"register","d":cds.getTemplateDomain()};if(document.getElementById("cds-registration-email").value&&document.getElementById("cds-registration-email").value.length){o["email"]=document.getElementById("cds-registration-email").value;} if(cds.domainProperties["authentication.displayedfield.firstname"]&&document.getElementById("cds-registration-firstname")&&document.getElementById("cds-registration-firstname").value&&document.getElementById("cds-registration-firstname").value.length){o["fname"]=document.getElementById("cds-registration-firstname").value;} if(cds.domainProperties["authentication.displayedfield.lastname"]&&document.getElementById("cds-registration-lastname")&&document.getElementById("cds-registration-lastname").value&&document.getElementById("cds-registration-lastname").value.length){o["lname"]=document.getElementById("cds-registration-lastname").value;} if(cds.domainProperties["authentication.displayedfield.company"]&&document.getElementById("cds-registration-company")&&document.getElementById("cds-registration-company").value&&document.getElementById("cds-registration-company").value.length){o["company"]=document.getElementById("cds-registration-company").value;} if(cds.domainProperties["authentication.displayedfield.phone"]&&document.getElementById("cds-registration-phone")&&document.getElementById("cds-registration-phone").value&&document.getElementById("cds-registration-phone").value.length){o["phone"]=document.getElementById("cds-registration-phone").value;} if(cds.domainProperties["authentication.displayedfield.address1"]&&document.getElementById("cds-registration-address1")&&document.getElementById("cds-registration-address1").value&&document.getElementById("cds-registration-address1").value.length){o["address1"]=document.getElementById("cds-registration-address1").value;} if(cds.domainProperties["authentication.displayedfield.address2"]&&document.getElementById("cds-registration-address2")&&document.getElementById("cds-registration-address2").value&&document.getElementById("cds-registration-address2").value.length){o["address2"]=document.getElementById("cds-registration-address2").value;} if(cds.domainProperties["authentication.displayedfield.address3"]&&document.getElementById("cds-registration-address3")&&document.getElementById("cds-registration-address3").value&&document.getElementById("cds-registration-address3").value.length){o["address3"]=document.getElementById("cds-registration-address3").value;} if(cds.domainProperties["authentication.displayedfield.city"]&&document.getElementById("cds-registration-city")&&document.getElementById("cds-registration-city").value&&document.getElementById("cds-registration-city").value.length){o["city"]=document.getElementById("cds-registration-city").value;} if(cds.domainProperties["authentication.displayedfield.zip"]&&document.getElementById("cds-registration-zip")&&document.getElementById("cds-registration-zip").value&&document.getElementById("cds-registration-zip").value.length){o["zip"]=document.getElementById("cds-registration-zip").value;} if(estate){if(estate.options){if(estate.options[estate.selectedIndex]&&estate.options[estate.selectedIndex].value.length){o["state"]=estate.options[estate.selectedIndex].value;}}else if(cds.domainProperties["authentication.displayedfield.state"]&&document.getElementById("cds-registration-state").value&&document.getElementById("cds-registration-state").value.length){o["state"]=document.getElementById("cds-registration-state").value;}} if(ecountry&&ecountry.options[ecountry.selectedIndex]&&ecountry.options[ecountry.selectedIndex].value.length){o["country"]=ecountry.options[ecountry.selectedIndex].value;} if(cds.templateDomainId==="gam"||cds.templateDomainId==="ruland"){e=document.getElementById("cds-registration-source");if(e){o["source"]=e.options[e.selectedIndex].value;if(o["source"]==="Other"||o["source"]==="Salesperson"){e=document.getElementById("cds-registration-source-other");if(e&&e.value&&e.value.length){o["source"]=e.value;}else{delete o["source"];}}}} e=document.getElementById("cds-registration-variable1");if(e&&e.value&&e.value.length){o["var1"]=document.getElementById("cds-registration-variable1").value;} e=document.getElementById("cds-registration-variable2");if(e&&e.value&&e.value.length){o["var2"]=document.getElementById("cds-registration-variable2").value;} e=document.getElementById("cds-registration-variable3");if(e&&e.value&&e.value.length){o["var3"]=document.getElementById("cds-registration-variable3").value;} e=document.getElementById("cds-registration-agreedtos");if(e&&e.checked){o["agreedtos"]="true";}else{document.getElementById("cds-registration-error").innerHTML="You must agree to the terms of service to register.";return;} e=document.getElementById("cds-registration-contactok");if(e&&e.checked){o["contactok"]="true";} if(!o["email"]||(cds.domainProperties["authentication.displayedfield.firstname"]&&cds.domainProperties["authentication.requiredfield.firstname"]&&!o["fname"])||(cds.domainProperties["authentication.requiredfield.lastname"]&&!o["lname"])||(cds.domainProperties["authentication.requiredfield.company"]&&!o["company"])||(cds.domainProperties["authentication.requiredfield.phone"]&&!o["phone"])||(cds.domainProperties["authentication.requiredfield.address1"]&&!o["address1"])||(cds.domainProperties["authentication.requiredfield.address2"]&&!o["address2"])||(cds.domainProperties["authentication.requiredfield.address3"]&&!o["address3"])||(cds.domainProperties["authentication.requiredfield.city"]&&!o["city"])||(cds.domainProperties["authentication.requiredfield.state"]&&!o["state"])||(cds.domainProperties["authentication.requiredfield.country"]&&!o["country"])||(cds.domainProperties["authentication.requiredfield.zip"]&&!o["zip"])||(cds.domainProperties["authentication.requiredfield.variable1"]&&!o["var1"])||(cds.domainProperties["authentication.requiredfield.variable2"]&&!o["var2"])||(cds.domainProperties["authentication.requiredfield.variable3"]&&!o["var3"])||((cds.templateDomainId==="gam"||cds.templateDomainId==="ruland")&&!o["source"])){document.getElementById("cds-registration-error").innerHTML=cds.getTextLabel("registration.error_required_field");return;} if(typeof cdsHandlePreRegister==="function"){if(!cdsHandlePreRegister(o)){return;}} jQuery.ajax({url:cds.remoteServerBaseURL+"/access?callback=?",dataType:"jsonp",data:o,context:this,success:function(data){if(!data.ok){if(data.error==="account exists"){document.getElementById("cds-registration-error").innerHTML=cds.getTextLabel("registration.error_account_exists");}else{document.getElementById("cds-registration-error").innerHTML=cds.getTextLabel("registration.error_unknown");}}else{cds.setCookie("cds."+cds.getTemplateDomain()+".user",data.email,365);if(typeof cdsHandlePostRegister==="function"){cdsHandlePostRegister(data);} if(cds.authenticationManager.registerDialog){cds.authenticationManager.registerDialog.dialog("close");} if(cds.domainProperties["authentication.validateEmail"]===true){alert("A verification email has been sent to the account you just registered.\n\n"+"Please check your email account and click on the link contained within the "+"verification email message to access CAD download functionality. Please check "+"your spam filter if you do not receive the verification email message.");} if(cds.authenticationManager.source==="cad"&&cds.CADRequester.resultCADFormat){cds.CADRequester.getCAD(cds.CADRequester.resultCADFormat);}else if(this.source==="spec-sheet"){cds.specSheet.submit();}else if(this.source==="cart-update"){cds.cart.handleUpdate();}else if(this.source==="cart-submit"){cds.cart.handleSubmit();}else if(this.source==="cart-add"){cds.cart.addProduct();}else if(this.source==="cart-load"){cds.cart.load();}}}});};this.getRegistrationFieldText=function(attribute,label,required){var s="";if(required||cds.domainProperties["authentication.displayedfield."+attribute]){s+="" +"" +"";if(required||cds.domainProperties["authentication.requiredfield."+attribute]){s+="*";} s+="";} return s;},this.getRegisterHTML=function(){var s="
"+cds.getTextLabel("registration.header_text")+"
" +"" +"" +"" +"" +"";if(cds.domainProperties["authentication.displayedfield.address1"]||cds.domainProperties["authentication.displayedfield.address2"]||cds.domainProperties["authentication.displayedfield.address3"]||cds.domainProperties["authentication.displayedfield.city"]||cds.domainProperties["authentication.displayedfield.state"]||cds.domainProperties["authentication.displayedfield.country"]||cds.domainProperties["authentication.displayedfield.zip"]){s+="";} s+=this.getRegistrationFieldText("email","email",true);s+=this.getRegistrationFieldText("firstname","first_name");s+=this.getRegistrationFieldText("lastname","last_name");s+=this.getRegistrationFieldText("company","company");s+=this.getRegistrationFieldText("phone","phone");if(cds.domainProperties["authentication.displayedfield.address1"]||cds.domainProperties["authentication.displayedfield.address2"]||cds.domainProperties["authentication.displayedfield.address3"]||cds.domainProperties["authentication.displayedfield.city"]||cds.domainProperties["authentication.displayedfield.state"]||cds.domainProperties["authentication.displayedfield.country"]||cds.domainProperties["authentication.displayedfield.zip"]){s+="";} s+=this.getRegistrationFieldText("address1","address_1");s+=this.getRegistrationFieldText("address2","address_2");s+=this.getRegistrationFieldText("address3","address_3");s+=this.getRegistrationFieldText("city","city");if(cds.domainProperties["authentication.displayedfield.state"]){s+="";if(cds.domainProperties["authentication.requiredfield.state"]){s+="";} s+="";} if(cds.domainProperties["authentication.displayedfield.country"]){s+="";if(cds.domainProperties["authentication.requiredfield.country"]){s+="";} s+="";} s+=this.getRegistrationFieldText("zip","postal_code");if(cds.templateDomainId==="gam"||cds.templateDomainId==="ruland"){s+="" +"" +" " +" " +" " +"" +"" +" " +" " +" " +"" +"";} s+="" +"" +"";s+="" +"" +"";s+="" +"" +"";s+="
"+cds.getTextLabel("registration.required_notification_text") +"
"+cds.getTextLabel("registration.contact_details_label") +"
"+cds.getTextLabel("registration.address_details_label") +"
" +"*
" +"*
Where did you hear about us?
 " +" " +" *
*
" +cds.getTextLabel("registration.gdpr_disclaimer_text") +"
" +"
";return s;},this.register=function(domain,source,error){var js;this.registerDialog=jQuery("
").html(this.getRegisterHTML()).dialog({title:"New User Registration",width:this.registerDialogWidth,height:this.registerDialogHeight,modal:true,resizable:false,autoOpen:false,close:function(){jQuery(this).remove();cds.authenticationManager.registerDialog=null;}});this.registerDialog.dialog("open");if(location.href.indexOf("product-config.net")!==-1||location.href.indexOf("cdsvisual.net")!==-1||location.href.indexOf("localhost:8080")!==-1){url="/catalog3/js/cds-access-min.js";}else{url="https://www.product-config.net/catalog3/js/cds-access-min.js";} jQuery.getScript(url,function(){cds.registration.populateCountrySelect();});};this.login=function(domain,source,isInvalid){var s;if(typeof source==="string"){this.source=source;}else{this.callback=source;} s="
" +cds.getTextLabel("login.header_text") +"
";if(isInvalid){s+="
" +cds.getTextLabel("login.error_account_does_not_exist") +"
";} s+="
" +"" +"
" +"
" +cds.getTextLabel("registration.agree_service_text") +"
" +"
" +"" +cds.getTextLabel("registration.confirm_read_terms") +"" +cds.getTextLabel("registration.agree_tos_text_anchor") +"" +cds.getTextLabel("registration.agree_tos_text_suffix") +"
" +"
" +"" +cds.getTextLabel("registration.contact_me_text") +"
" +"" +"
" +"
" +"
" +cds.getTextLabel("login.new_user_header_text") +"
" +"" +cds.getTextLabel("login.new_user_link_text") +"" +"
";this.loginDialog=jQuery("
").html(s).dialog({title:cds.getTextLabel("login.dialog_title"),width:500,height:350,modal:true,resizable:false,autoOpen:false,close:function(){jQuery(this).remove();cds.authenticationManager.loginDialog=null;}});this.loginDialog.dialog("open");};})(),ProductCompareCart:function(){this.products={};this.categoryID=null;this.productCount=0;this.maxProducts=10;this.comparePageURL=null;this.comparePageTarget=null;this.setMaxProducts=function(maxProducts){this.maxProducts=maxProducts;};this.setComparePageURL=function(comparePageURL){this.comparePageURL=comparePageURL;} this.setComparePageTarget=function(comparePageTarget){this.comparePageTarget=comparePageTarget;} this.getProductCount=function(){return this.productCount;};this.getMaxProducts=function(){return this.maxProducts;} this.getComparePageURL=function(){return this.comparePageURL;};this.getComparePageTarget=function(){return this.comparePageTarget;};this.isFull=function(){return this.productCount>=this.maxProducts;};this.addProduct=function(productId){if(!this.products[productId]){if(this.productCount1){url+="|";} url+=encodeURIComponent(p);}} if(this.categoryID!==null){url+="&cid="+encodeURIComponent(this.categoryID);} if(this.comparePageTarget){window.open(url,this.comparePageTarget);}else{window.location.href=url;} return false;};this.addToRFQCart=function(facetedSearch){var products=[];product_keys=Object.keys(this.products) for(var i in product_keys){id=product_keys[i] var product={"id":id,"qty":1};for(var j in facetedSearch.products){item=facetedSearch.products[j] if(item.id==id){product["label"]=item.label;product["description"]=item.description;break;}} product["url"]=facetedSearch.productURLTemplate.replace(/%DOMAIN%/g,encodeURIComponent(cds.getTemplateDomain())).replace(/%CATEGORY%/g,encodeURIComponent(facetedSearch.category.id)).replace(/%PRODUCT%/g,id);products.push(product);} cds.cart.addMultipleProducts(products,false,"index.jsp?c=cart");};},productCompareTable:new(function(){this.parentElementId=null;this.unit=null;this.productURLTemplate=null;this.products=[];this.showAttachments=true;this.setDomain=function(domain){cds.setDomain(domain);};this.setParentElementId=function(parentElementId){this.parentElementId=parentElementId;};this.setServerURL=function(serverURL){cds.setRemoteServerBaseURL(serverURL);};this.setUnit=function(unit){this.unit=unit;} this.setProductURLTemplate=function(productURLTemplate){this.productURLTemplate=productURLTemplate;};this.getParentElementId=function(){return this.parentElementId;};this.getServerURL=function(){return cds.remoteServerBaseURL;};this.getUnit=function(){return unit;} this.getProductURLTemplate=function(){return this.productURLTemplate;};this.load=function(){var r,i,ids,cid,o,u;r=(new RegExp("ids=([^&#]*)")).exec(window.location.search);if(r.length<2){alert(cds.getTextLabel("product_compare.error_no_products_given"));return;} ids=decodeURIComponent(r[1]).split("|");if(ids.length===0){alert(cds.getTextLabel("product_compare.error_no_products_given"));return;} cid=null;r=/cid=([^&#]+)/.exec(window.location.search);if(r&&r.length>0){cid=decodeURIComponent(r[1]);} o={o:"compare",d:cds.getDataDomain()};for(i=0;i0){e.className+=" hovered";}else{e.className="hovered";}};this.handleMouseOutRow=function(e){e.className=e.className.replace(/( )?hovered/,"");};this.display=function(){var table,thead,tbody,tr,td,e,i,j,s,a,v,l,found,diff,url,container=document.getElementById(this.parentElementId);if(!container){alert(cds.getTextLabel("product_compare.error_missing_parent_element"));return;} while(container.hasChildNodes()){container.removeChild(container.lastChild);} table=document.createElement("table");container.appendChild(table);table.setAttribute("id","cds-product-compare-table");thead=document.createElement("thead");table.appendChild(thead);tr=document.createElement("tr");thead.appendChild(tr);td=document.createElement("td");tr.appendChild(td);td.className="nowrap";td.setAttribute("rowspan","2");e=document.createElement("h3");td.appendChild(e);e.appendChild(document.createTextNode(cds.getTextLabel("product_compare.header_text").replace(/%count%/g,this.products.length)));for(i=0;i=1.0){tmp=decimal%1;wp=decimal-tmp;decimal=tmp;} fp=decimal;d1=0;denominator=1;dd=decimal*denominator;numerator=dd-dd%1;delta=numerator/denominator-decimal;while((delta>0&&delta>1.0E-12)||(delta<0&&delta<-1.0E-12)){fp=1.0/fp;tmp=fp%1;ip=fp-tmp;fp=tmp;tmp=denominator;denominator=ip*denominator+d1;d1=tmp;dd=decimal*denominator;numerator=dd-dd%1;delta=numerator/denominator-decimal;} var ret='';if(wp>0.5){if(numerator<0.5){ret=(sign*wp)+'';}else{ret=(sign*wp)+' '+numerator+'/'+denominator;}}else{if(numerator<0.5){ret='0';}else{ret=(sign*numerator)+'/'+denominator;}} return ret;};this.getDisplayValue=function(attribute,value){var v=value;if(!v){return"";}else if(attribute.dataType==="fraction"&&(!this.unit||this.unit==="english"||!document.getElementById("cds-unit-toggle-english"))){v=this.toFraction(v);} if(typeof cdsGetDisplayValue==="function"){v=cdsGetDisplayValue(attribute,v);} return v;};this.preDisplayCallback=function(){};this.postDisplayCallback=function(){};this.handleChangePage=function(newPage){this.page=newPage;this.load();};this.handleChangeRowsPerPage=function(select){var v=parseInt(select.options[select.selectedIndex].innerHTML);if(!isNaN(v)&&v>=0&&v<=250){this.rowsPerPage=v;this.load();}};this.handleSelectAttributeValue=function(e,i){var v=e.options[e.selectedIndex].value,sv=this.storedDistinctValues[i][e.selectedIndex-1];if(v!=="all"){if(v==="none"){this.addFilter(this.attributes[i].id,null,null,null);}else{this.addFilter(this.attributes[i].id,sv,null,null);} this.page=0;this.load();}};this.handleMinAttributeValue=function(e,i){var v=e.value;if(v!==cds.getTextLabel("attribute_search.range_min_input_box_text")){v=parseFloat(e.value);if(isNaN(v)){alert(cds.getTextLabel("attribute_search.error_invalid_min_range_value"));e.value=cds.getTextLabel("attribute_search.range_min_input_box_text");if(this.filter[this.attributes[i].id]){delete this.filter[this.attributes[i].id];this.page=0;this.load();}}else{this.addFilter(this.attributes[i].id,null,v,null);this.page=0;this.load();}}};this.handleMaxAttributeValue=function(e,i){var v=e.value;if(v!==cds.getTextLabel("attribute_search.range_max_input_box_text")){v=parseFloat(e.value);if(isNaN(v)){alert(cds.getTextLabel("attribute_search.error_invalid_max_range_value"));e.value=cds.getTextLabel("attribute_search.range_max_input_box_text");if(this.filter[this.attributes[i].id]){delete this.filter[this.attributes[i].id];this.page=0;this.load();}}else{this.addFilter(this.attributes[i].id,null,null,v);this.page=0;this.load();}}};this.handleMinKeypress=function(e,i,evt){var c;evt=(evt)?evt:window.event;c=(evt.charCode)?evt.charCode:((evt.which)?evt.which:evt.keyCode);if(c===13||c===3){this.handleMinAttributeValue(e,i);return false;} return true;};this.handleMaxKeypress=function(e,i,evt){var c;evt=(evt)?evt:window.event;c=(evt.charCode)?evt.charCode:((evt.which)?evt.which:evt.keyCode);if(c===13||c===3){this.handleMaxAttributeValue(e,i);return false;} return true;};this.handleResetAttributeValue=function(i){delete this.filter[this.attributes[i].id];this.page=0;this.load();};this.handleSortAttribute=function(i){if(this.sortAttribute===this.attributes[i].id){this.sortAscending=!this.sortAscending;}else{this.sortAttribute=this.attributes[i].id;this.sortAscending=true;} this.page=0;this.load();};this.handleCompareProducts=function(){this.compareCart.showComparePage();};this.handleResetAll=function(){this.sortAttribute=null;this.sortAscending=true;this.page=0;this.filter={};if(this.compareCart){this.compareCart.reset();} this.load();};this.handleChooseAttributes=function(){var i,s,a,container,div,e;if(!this.chooseAttributeDialog){container=document.createElement("div");container.setAttribute("id","cds-choose-attributes-dialog");e=document.createElement("p");container.appendChild(e);e.appendChild(document.createTextNode(cds.getTextLabel("attribute_search.advanced_search_header_text")));for(i=2;i0){e.className+=" selected";}else{e.className="selected";}};this.handleMouseOutRow=function(e){e.className=e.className.replace(/( )?selected/,"");};this.init=function(){var i,j,a,empty;if(this.allRowsCount>0){this.attributes[0].visible=false;this.attributes[1].visible=true;for(i=2;i"+cds.getTextLabel("attribute_search.error_no_filtered_products") +"";}else{parentElement.innerHTML="

"+cds.getTextLabel("attribute_search.error_no_products")+"

";} return;} while(parentElement.hasChildNodes()){parentElement.removeChild(parentElement.lastChild);} if(this.reverseHeaderControlsOrder){this.displayPagingControls(parentElement);this.displayHeaderControls(parentElement);}else{this.displayHeaderControls(parentElement);this.displayPagingControls(parentElement);} table=document.createElement("table");table.setAttribute("id","cds-attribute-search-table");parentElement.appendChild(table);this.displayHeader(table);this.displayRows(table);this.displayPagingControls(parentElement);for(i=0;i0){anchor=document.createElement("a");anchor.appendChild(document.createTextNode(cds.getTextLabel("attribute_search.record_page_previous_text")));anchor.setAttribute("href","#");anchor.onclick=function(){cds.attributeSearchTable.handleChangePage(cds.attributeSearchTable.page-1);return false;};div.appendChild(anchor);div.appendChild(document.createTextNode(" "));} startPage=this.page-2;if(startPage<0){startPage=0;} endPage=startPage+4;if(this.endRow>=(this.allRowsCount-1)){endPage=this.page;}else{rowsPerPage=this.endRow-this.startRow+1;if(endPage*rowsPerPage>=this.allRowsCount){endPage=Math.floor(this.allRowsCount/rowsPerPage);}} for(i=startPage;i<=endPage;i++){if(i>startPage){div.appendChild(document.createTextNode(" "));} if(i===this.page){div.appendChild(document.createTextNode(i+1));}else{anchor=document.createElement("a");anchor.appendChild(document.createTextNode(i+1));anchor.setAttribute("href","#");anchor.page=i;anchor.onclick=function(){cds.attributeSearchTable.handleChangePage(this.page);return false;};div.appendChild(anchor);}} if(this.endRow<(this.allRowsCount-1)){div.appendChild(document.createTextNode(" "));anchor=document.createElement("a");anchor.appendChild(document.createTextNode(cds.getTextLabel("attribute_search.record_page_next_text")));anchor.setAttribute("href","#");anchor.onclick=function(){cds.attributeSearchTable.handleChangePage(cds.attributeSearchTable.page+1);return false;};div.appendChild(anchor);}};this.displayHeader=function(parent){var thead,tr,td,div,inp,sel,opt,anchor,i,j,a,s,dv;thead=document.createElement("thead");parent.appendChild(thead);tr=document.createElement("tr");thead.appendChild(tr);for(i=0;i31){this.cadResultFileName=this.cadResultFileName.substring(0,31);}};this.setParameters=function(parameters){this.parameters=parameters;};this.addParameter=function(name,value,type){var i,found;if(!this.parameters){this.parameters=[];} found=false;for(i=0;i0){s+=", ";} s+=this.parameters[i].name+"("+this.parameters[i].type+")="+this.parameters[i].value;} return s;};this.setPreventParameters=function(preventParameters){this.preventParameters=preventParameters;};this.addPreventParameter=function(name){if(!this.preventParameters){this.preventParameters=[];} this.preventParameters.push(name);};this.addNote=function(key,url){if(!this.notes){this.notes=[];} this.notes.push({"key":key,"url":url});};this.setComponentPrefix=function(componentPrefix){this.componentPrefix=componentPrefix;};this.setCADAvailable=function(cadAvailable){this.cadAvailable=cadAvailable;};this.setCADDownloadAvailable=function(cadDownloadAvailable){this.cadDownloadAvailable=cadDownloadAvailable;} this.setCAD3DViewAvailable=function(cad3DViewAvailable){this.cad3DViewAvailable=cad3DViewAvailable;} this.setCAD2DViewAvailable=function(cad2DViewAvailable){this.cad2DViewAvailable=cad2DViewAvailable;} this.setAvailableFormats=function(availableFormats){this.availableFormats=availableFormats;};this.setViewFormat3D=function(viewFormat3D){this.viewFormat3D=viewFormat3D;};this.setViewFormat2D=function(viewFormat2D){this.viewFormat2D=viewFormat2D;};this.setView3DStaticURL=function(view3DStaticURL){this.view3DStaticURL=view3DStaticURL;};this.setView2DStaticURL=function(view2DStaticURL){this.view2DStaticURL=view2DStaticURL;};this.setResultCADUrl=function(resultCADUrl){this.resultCADUrl=resultCADUrl;};this.setContainerElementId=function(containerElementId){this.containerElementId=containerElementId;};this.setFormatSelectElementId=function(formatSelectElementId){this.formatSelectElementId=formatSelectElementId;};this.setDownloadButtonElementId=function(downloadButtonElementId){this.downloadButtonElementId=downloadButtonElementId;};this.setView2DButtonElementId=function(view2DButtonElementId){this.view2DButtonElementId=view2DButtonElementId;};this.setView3DButtonElementId=function(view3DButtonElementId){this.view3DButtonElementId=view3DButtonElementId;};this.setStaticView3DElementId=function(staticView3DElementId){this.staticView3DElementId=staticView3DElementId;this.objViewerElementId=staticView3DElementId;};this.setObjViewerElementId=function(objViewerElementId){this.objViewerElementId=objViewerElementId;} this.setDialogElementId=function(dialogElementId){this.dialogElementId=dialogElementId;};this.setOriginalReferrer=function(originalReferrer){this.originalReferrer=originalReferrer;} this.setAttributes=function(attributes){this.attributes=attributes;} this.setServerURL=function(serverURL){cds.setRemoteServerBaseURL(serverURL);};this.getProduct=function(){return this.product;};this.getProductLabel=function(){return this.productLabel;};this.getCADResultFileName=function(){return this.cadResultFileName;};this.getParameters=function(){return this.parameters;} this.printParameters=function(){var i,a,s="";for(i=0;i0){s+="\n";} a=this.parameters[i];s+=a.name+" ("+a.type+"): "+a.value;} alert(s);} this.getNotes=function(){return this.notes;} this.getPreventParameters=function(){return this.preventParameters;} this.getComponentPrefix=function(){return this.componentPrefix;} this.isCADAvailable=function(){return this.cadAvailable;};this.isCADDownloadAvailable=function(){return this.cadDownloadAvailable;} this.isCAD3DViewAvailable=function(){return this.cad3DViewAvailable;} this.isCAD2DViewAvailable=function(){return this.cad2DViewAvailable;} this.getAvailableFormats=function(){return this.availableFormats;};this.getViewFormat3D=function(){return this.viewFormat3D;};this.getViewFormat2D=function(){return this.viewFormat2D;};this.getView3DStaticURL=function(){return this.view3DStaticURL};this.getView2DStaticURL=function(){return this.view2DStaticURL};this.getresultCADUrl=function(){return this.resultCADUrl;};this.getContainerElementId=function(){return this.containerElementId;};this.getFormatSelectElementId=function(){return this.formatSelectElementId;} this.getDownloadButtonElementId=function(){return this.downloadButtonElementId;} this.getView2DButtonElementId=function(){return this.view2DButtonElementId;} this.getView3DButtonElementId=function(){return this.view3DButtonElementId;} this.getStaticView3DElementId=function(){return this.staticView3DElementId;} this.getServerURL=function(){return cds.remoteServerBaseURL;};this.getOriginalReferrer=function(){return this.originalReferrer;} this.getAttributes=function(){return this.attributes;} this.isDownloadInProgress=function(){return this.downloadInProgress;};this.hasStatic3DView=function(){return typeof this.view3DStaticURL==="string"&&this.view3DStaticURL.length>0;};this.isViewRequest=function(format){return format===this.viewFormat3D||format===this.viewFormat2D;};this.load=function(){var u,o={d:cds.getDataDomain(),id:this.product};u=cds.getUser();if(u){o["cds-user"]=u;}else{if(this.email!==null){o["cds-user"]=this.email;} if(this.fname!==null){o["cds-fname"]=this.fname;} if(this.lname!==null){o["cds-lname"]=this.lname;} if(this.company!==null){o["cds-company"]=this.company;} if(this.address1!==null){o["cds-address1"]=this.address1;} if(this.address2!==null){o["cds-address2"]=this.address2;} if(this.address3!==null){o["cds-address3"]=this.address3;} if(this.city!==null){o["cds-city"]=this.city;} if(this.country!==null){o["cds-country"]=this.country;} if(this.state!==null){o["cds-state"]=this.state;} if(this.zip!==null){o["cds-zip"]=this.zip;} if(this.phone!==null){o["cds-phone"]=this.phone;} if(this.fax!==null){o["cds-fax"]=this.fax;} if(this.agreetos!==null){o["cds-agree-tos"]=this.agreetos;}} if(cds.getTemplateDomain()!==cds.getDataDomain()){o["td"]=cds.getTemplateDomain();} if(this.originalReferrer){o["oref"]=this.originalReferrer;} cds.loadXHR("GET",cds.remoteServerBaseURL+"/cad",o,function(data){var i,j,a,v,vv,found;let self=cds.CADRequester;if(data.error){self.cadAvailable=false;self.cadDownloadAvailable=false;self.cad3DViewAvailable=false;self.cad2DViewAvailable=false;self.view3DStaticURL=null;self.view2DStaticURL=null;if(typeof cdsHandlePreInitCAD==="function"){cdsHandlePreInitCAD();}}else{self.cadAvailable=data.cadAvailable;self.cadDownloadAvailable=data.cadDownloadAvailable;self.cad3DViewAvailable=data.cad3DViewAvailable;self.cad2DViewAvailable=data.cad2DViewAvailable;self.availableFormats=data.availableFormats;self.viewFormat3D=data.viewFormat3D;self.viewFormat2D=data.viewFormat2D;self.viewObjStaticURL=data.viewObjStaticURL;self.view3DStaticURL=data.view3DStaticURL;self.view2DStaticURL=data.view2DStaticURL;self.authenticatedDownload=data.authenticatedDownload;self.authenticatedView=data.authenticatedView;self.attributes=data.attributes||[];if(data.attributes){for(i=0;i=i+1)&&data.attributeValues[i];if(v&&a.cadParameterName&&a.cadDataType){if(a.dataType==="range"){vv=v.split("|");if(vv.length>=3){self.addParameter(a.cadParameterName,vv[2],a.cadDataType);self.attributes[i].value=vv[2];}}else if(a.dataType==="list"){vv=v.split("|");found=false;for(j=0;j" if(navigator.appName==="Microsoft Internet Explorer"){s+=""} s+="";e.innerHTML=s;e=document.getElementById(this.view3DButtonElementId);if(e){e.style.display="none";}} if(typeof cdsHandlePostInitCAD==="function"){cdsHandlePostInitCAD();}} this.initialized=true;};this.checkCAD=function(format){};this.getCAD=function(format,checkOnly){var u,o,i,p,a,e,v,min,max;if(cds.isInputBlocked){return;} this.resultCADFormat=format;if((format==="obj"||format==="json"||format==="webgl")&&!cds.isWebGLAvailable()){this.resultCADFormat="pdf";if(cds.getDataDomain()==="heyco"){this.resultCADFormat="23-pdf";}} if(typeof cdsHandlePreGetCAD==="function"){if(cdsHandlePreGetCAD()===false){return;}} this.resultCADUrl=null;this.resultCADError=null;this.downloadInProgress=true;cds.isInputBlocked=true;o={d:cds.getDataDomain(),id:this.product,f:this.resultCADFormat};u=cds.getUser();if(u){o["cds-user"]=u;}else{if(this.email!==null){o["cds-user"]=this.email;} if(this.fname!==null){o["cds-fname"]=this.fname;} if(this.lname!==null){o["cds-lname"]=this.lname;} if(this.company!==null){o["cds-company"]=this.company;} if(this.address1!==null){o["cds-address1"]=this.address1;} if(this.address2!==null){o["cds-address2"]=this.address2;} if(this.address3!==null){o["cds-address3"]=this.address3;} if(this.city!==null){o["cds-city"]=this.city;} if(this.country!==null){o["cds-country"]=this.country;} if(this.state!==null){o["cds-state"]=this.state;} if(this.zip!==null){o["cds-zip"]=this.zip;} if(this.phone!==null){o["cds-phone"]=this.phone;} if(this.fax!==null){o["cds-fax"]=this.fax;} if(this.agreetos!==null){o["cds-agree-tos"]=this.agreetos;}} if(cds.getTemplateDomain()!==cds.getDataDomain()){o["td"]=cds.getTemplateDomain();} if(this.productLabel){o["pn"]=this.productLabel;} if(this.cadResultFileName){o["o"]=this.cadResultFileName;} if(this.originalReferrer){o["oref"]=this.originalReferrer;} if(this.componentPrefix){o["cprefix"]=this.componentPrefix;} if(this.ms4Environment){o["environment"]=this.ms4Environment;} if(this.useStaticCADIfAvailable){o["usestatic"]="true";} let op={};if(this.parameters&&this.parameters.length>0){for(i=0;i0){for(i=0;i0){for(i=0;i0){for(i=0;i" +"
"+cds.getTextLabel("product_home.cad_generating_dialog_text")+"
";}}else{this.generatingDialog=jQuery("
").html(""+"
"+cds.getTextLabel("product_home.cad_generating_dialog_text")+"
").dialog({title:cds.getTextLabel("product_home.cad_generating_dialog_title"),width:400,modal:true,resizable:false,beforeClose:function(event,ui){return!cds.CADRequester.downloadInProgress;}});}}};this.showDialogWaiting=function(count){if(count===0){document.getElementById("cds-dialog-label-step1").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step2").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step3").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step4").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step5").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step6").classList.remove("cds-selected");document.getElementById("cds-dialog-progress").setAttribute("value","0");document.getElementById("cds-dialog-label-step1").classList.add("cds-selected");document.getElementById("cds-dialog-image-step1").setAttribute("src","https://www.product-config.net/catalog3/images/globewait.gif");}else if(count===1){document.getElementById("cds-dialog-label-step1").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step2").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step3").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step4").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step5").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step6").classList.remove("cds-selected");document.getElementById("cds-dialog-progress").setAttribute("value","20");document.getElementById("cds-dialog-label-step1").classList.add("cds-completed");document.getElementById("cds-dialog-label-step2").classList.add("cds-selected");document.getElementById("cds-dialog-image-step1").setAttribute("src","https://www.product-config.net/catalog3/images/checkmark.png");document.getElementById("cds-dialog-image-step2").setAttribute("src","https://www.product-config.net/catalog3/images/globewait.gif");}else if(count===8){document.getElementById("cds-dialog-label-step1").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step2").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step3").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step4").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step5").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step6").classList.remove("cds-selected");document.getElementById("cds-dialog-progress").setAttribute("value","40");document.getElementById("cds-dialog-label-step2").classList.add("cds-completed");document.getElementById("cds-dialog-label-step3").classList.add("cds-selected");document.getElementById("cds-dialog-image-step2").setAttribute("src","https://www.product-config.net/catalog3/images/checkmark.png");document.getElementById("cds-dialog-image-step3").setAttribute("src","https://www.product-config.net/catalog3/images/globewait.gif");}else if(count===13){document.getElementById("cds-dialog-label-step1").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step2").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step3").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step4").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step5").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step6").classList.remove("cds-selected");document.getElementById("cds-dialog-progress").setAttribute("value","60");document.getElementById("cds-dialog-label-step3").classList.add("cds-completed");document.getElementById("cds-dialog-label-step4").classList.add("cds-selected");document.getElementById("cds-dialog-image-step3").setAttribute("src","https://www.product-config.net/catalog3/images/checkmark.png");document.getElementById("cds-dialog-image-step4").setAttribute("src","https://www.product-config.net/catalog3/images/globewait.gif");}else if(count===22){document.getElementById("cds-dialog-label-step1").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step2").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step3").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step4").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step5").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step6").classList.remove("cds-selected");document.getElementById("cds-dialog-progress").setAttribute("value","80");document.getElementById("cds-dialog-label-step4").classList.add("cds-completed");document.getElementById("cds-dialog-label-step5").classList.add("cds-selected");document.getElementById("cds-dialog-image-step4").setAttribute("src","https://www.product-config.net/catalog3/images/checkmark.png");document.getElementById("cds-dialog-image-step5").setAttribute("src","https://www.product-config.net/catalog3/images/globewait.gif");}else if(count===-1){document.getElementById("cds-dialog-label-step1").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step2").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step3").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step4").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step5").classList.remove("cds-selected");document.getElementById("cds-dialog-label-step6").classList.remove("cds-selected");document.getElementById("cds-dialog-progress").setAttribute("value","100");document.getElementById("cds-dialog-label-step5").classList.add("cds-completed");document.getElementById("cds-dialog-label-step6").classList.add("cds-selected");document.getElementById("cds-dialog-image-step5").setAttribute("src","https://www.product-config.net/catalog3/images/checkmark.png");document.getElementById("cds-dialog-image-step6").setAttribute("src","https://www.product-config.net/catalog3/images/checkmark.png");document.getElementById("cds-dialog-download-link").style.display="";} if(this.resultCADError){if(this.generatingDialog){this.generatingDialog.parentNode.removeChild(this.generatingDialog);} if(this.dialogOverlay){this.dialogOverlay.style.display="none";} alert("Error: "+this.resultCADError);}else if(this.resultCADUrl&&!this.downloadInProgress){let a=document.getElementById("cds-dialog-download-link");a.setAttribute("href",this.resultCADUrl);if(count>-1&&count<25){setTimeout(function(){cds.CADRequester.showDialogWaiting(count+1);},100);}else if(count>-1){cds.CADRequester.showDialogWaiting(-1);}}else{setTimeout(function(){cds.CADRequester.showDialogWaiting(count+1);},1000);}};this.showDialogResults=function(){if(cds.useCDSdialogs||this.useCDSdialogsCad){;}else{var s,o,remoteServerBaseURL;remoteServerBaseURL=cds.remoteServerBaseURL.replace(/^(https?)?:?\/\//,"http://");if(typeof cdsHandlePostGetCAD==="function"){cdsHandlePostGetCAD();} let format=this.resultCADFormat;if(format.match(/^\d\d-/)){format=format.substring(3);} s="
"+cds.getTextLabel("product_home.cad_complete_dialog_text")+"
";if(format==="pdf"||format==="23-pdf"||format==="obj"||format==="pview"||format==="json"||format==="webgl"||format==="2dpdf"||format===this.viewFormat2D||format===this.attachmentFormat){if(cds.getTemplateDomain()==="heyco"&&format===this.viewFormat2D){s+="";}else if(format==="pdf"||format==="23-pdf"||format==="2dpdf"||format===this.viewFormat2D){s+="";}else if(format==="obj"&&this.noGoogleJQuery){s+="";}else if(format==="obj"){s+="";}else if(format==="webgl"||format==="json"){if(cds.getDataDomain()==="ni"){s+="";}else{s+="";}}else if(format===this.attachmentFormat){s+="";}}else{s+="";if(navigator.userAgent.indexOf("ProE-Datecode")!==-1){s+="
";s+="
";}else if(this.thankYouURL!==null){s+="" +"";}else{s+="";s+="";} if(this.debug){s+="

CAD Debug Information

";s+="";if(this.product){s+=" ";} if(this.productLabel){s+=" ";} if(format){s+=" ";} if(this.cadResultFileName){s+=" ";} if(this.parameters){s+=" ";for(i=0;i";}} if(this.preventParameters){s+=" ";} if(this.componentPrefix){s+=" ";} if(this.notes){s+=" ";} s+="
Product:"+this.product+"
Product Label:"+this.productLabel+"
Format:"+format+"
File Name:"+this.cadResultFileName+"
Parameters: 
 "+this.parameters[i].name+", " +this.parameters[i].value+"
Prevent Parameters:"+this.preventParameters+"
Component Prefix:"+this.componentPrefix+"
Notes:"+this.notes+"
";}} if(this.resultCADError==="authentication required"){this.generatingDialog.dialog("close");if(cds.authenticationManager.isInitialLoginAttempt){cds.authenticationManager.login(cds.getTemplateDomain(),"cad");}else{cds.authenticationManager.login(cds.getTemplateDomain(),"cad",true);} return;}else if(this.resultCADError==="access denied"||this.resultCADError==="authentication error"){this.generatingDialog.dialog("close");cds.deleteCookie("cds."+cds.getTemplateDomain()+".user");cds.authenticationManager.login(cds.getTemplateDomain(),"cad",true);return;}else if(this.resultCADError==="restricted access"&&(cds.getDataDomain()==="raf"||cds.getDataDomain()==="asm"||cds.getDataDomain()==="century")){if(this.dialogElementId){e=document.getElementById(this.dialogElementId);if(e){e.innerHTML="You have exceeded the maximum number of downloads per day. Please try again later.";}}else{this.generatingDialog.html("You have exceeded the maximum number of downloads per day. Please try again later.").dialog("option","title",cds.getTextLabel("product_home.cad_error_title"));}}else if(this.resultCADUrl){if(cds.dataDomainId==='amc'&&format==="datasheet"){location.href=this.resultCADUrl;} if(this.dialogElementId){e=document.getElementById(this.dialogElementId);if(e){e.innerHTML=s;}}else{this.generatingDialog.html(s).dialog("option","title",cds.getTextLabel("product_home.cad_complete_dialog_title"));}}else{if(this.dialogElementId){e=document.getElementById(this.dialogElementId);if(e){e.innerHTML=cds.getTextLabel("product_home.cad_error_text");}}else{this.generatingDialog.html(cds.getTextLabel("product_home.cad_error_text")).dialog("option","title",cds.getTextLabel("product_home.cad_error_title"));}}}};this.redirectToModel=function(){if(this.generatingDialog){this.generatingDialog.dialog("close");} if(this.resultCADFormat==="pview"){window.open(cds.remoteServerBaseURL+"/viewpvl.html?ms=" +encodeURIComponent(this.resultCADUrl),"cad_view");}else if(this.resultCADFormat==="edrawings"){window.open(cds.remoteServerBaseURL+"/viewedr.html?ms=" +encodeURIComponent(this.resultCADUrl),"cad_view");}else if(this.resultCADFormat==="pdf"||this.resultCADFormat==="23-pdf"){window.open(this.resultCADUrl,"cad_view");}else{location.href=this.resultCADUrl;}};this.loadInlineCADDialog=function(domain,pid){if(cds.hasOwnProperty("facetedSearch")){cds.facetedSearch.closePopupFacet();} let div=document.getElementById("cds-inline-cad-overlay");if(!div){div=document.createElement("div");document.body.appendChild(div);div.setAttribute("id","cds-inline-cad-overlay");div.onclick=function(){cds.CADRequester.hideInlineCADDialog();};} let container=document.getElementById("cds-inline-cad-container");if(!container){container=document.createElement("div");document.body.appendChild(container);container.setAttribute("id","cds-inline-cad-container");}else{while(container.hasChildNodes()){container.removeChild(container.lastChild);}} this.renderInlineCADDialog(container,domain,pid);cds.CADRequester.setDomain(domain);cds.CADRequester.setProduct(pid);cds.loadXHR("GET",cds.remoteServerBaseURL+"/cad",{"d":domain,"id":pid},function(data){if(data.cadAvailable){cds.CADRequester.setContainerElementId("cds-inline-cad-controls");cds.CADRequester.setFormatSelectElementId("cds-cad-download-formats");cds.CADRequester.setDownloadButtonElementId("cds-cad-download-button");cds.CADRequester.setView2DButtonElementId("cds-cad-view-2D-button");cds.CADRequester.setView3DButtonElementId("cds-cad-view-3D-button");if(data.hasOwnProperty("view3DStaticURL")&&data["viewFormat3D"]==="json"){cds.CADRequester.webglViewerElementId="cds-inline-cad-viewer-container";document.getElementById("cds-inline-cad-viewer-container").style.display="block";} document.getElementById("cds-inline-cad-container").style.display="block";document.getElementById("cds-inline-cad-overlay").style.display="block";if(data.hasOwnProperty("attributes")&&data.attributes.length>0){let container=document.getElementById("cds-inline-cad-attributes") for(let i=0;i=2){let label=document.createElement("label");div.appendChild(label);label.textContent=a.label+" ("+v[0]+" to "+v[1]+")";let input=document.createElement("input");div.appendChild(input);input.setAttribute("id","cds-dv-"+a.id);input.setAttribute("data-id",a.id);input.setAttribute("data-min",v[0]);input.setAttribute("data-max",v[1]);input.setAttribute("data-prec",a.precision);input.setAttribute("data-cad",a.cadParameterName);if(v.length>2){input.value=v[2];input.setAttribute("data-default",v[2]);}else{input.value=v[0];input.setAttribute("data-default",v[0]);} input.onchange=function(){let id=this.getAttribute("data-id");let v=parseFloat(this.value);let min=parseFloat(this.getAttribute("data-min"));let max=parseFloat(this.getAttribute("data-max"));let precision=parseInt(this.getAttribute("data-prec"));if(isNaN(v)||vmax){alert("Please enter a value between "+min+" and "+max+".");e.value=this.getAttribute("data-default");e.focus();}else{v=(Math.round(v*Math.pow(10,precision))/Math.pow(10,precision)).toFixed(precision);this.value=v;} cds.CADRequester.addParameter(this.getAttribute("data-cad"),v);};}else{let label=document.createElement("label");div.appendChild(label);label.textContent=a.label;let select=document.createElement("select");div.appendChild(select);for(let j=0;j0){qs+="|";} if(e&&e.value){qs+=e.value;}else{qs+=0;} e=document.getElementById("cds-cart-variable1-"+this.items[i].productId);if(e){if(e.tagName.toUpperCase()==="INPUT"){v=e.value;}else if(e.tagName.toUpperCase()==="SELECT"){v=e.options[e.selectedIndex].value;} if(v1s.length>0){v1s+="|";} v1s+=v;} e=document.getElementById("cds-cart-variable2-"+this.items[i].productId);if(e){if(e.tagName.toUpperCase()==="INPUT"){v=e.value;}else if(e.tagName.toUpperCase()==="SELECT"){v=e.options[e.selectedIndex].value;} if(v2s.length>0){v2s+="|";} v2s+=v;} e=document.getElementById("cds-cart-variable3-"+this.items[i].productId);if(e){if(e.tagName.toUpperCase()==="INPUT"){v=e.value;}else if(e.tagName.toUpperCase()==="SELECT"){v=e.options[e.selectedIndex].value;} if(v3s.length>0){v3s+="|";} v3s+=v;} if(ps.length>0){ps+="|";} ps+=this.items[i].productId;} o={o:"cart-update",d:cds.getDataDomain(),pid:ps,qty:qs};u=cds.getUser();if(u){o["cds-user"]=u;}else{if(cds.cdsu!==null){o["cds-user"]=cds.cdsu;} if(cds.fname!==null){o["cds-fname"]=cds.fname;} if(cds.lname!==null){o["cds-lname"]=cds.lname;} if(cds.company!==null){o["cds-company"]=cds.company;} if(cds.address1!==null){o["cds-address1"]=cds.address1;} if(cds.address2!==null){o["cds-address2"]=cds.address2;} if(cds.address3!==null){o["cds-address3"]=cds.address3;} if(cds.city!==null){o["cds-city"]=cds.city;} if(cds.country!==null){o["cds-country"]=cds.country;} if(cds.state!==null){o["cds-state"]=cds.state;} if(cds.zip!==null){o["cds-zip"]=cds.zip;} if(cds.phone!==null){o["cds-phone"]=cds.phone;} if(cds.fax!==null){o["cds-fax"]=cds.fax;} if(cds.agreetos!==null){o["cds-agree-tos"]=cds.agreetos;}} if(cds.getDataDomain()!==cds.getTemplateDomain()){o["td"]=cds.getTemplateDomain();} if(v1s.length>0){o["var1"]=v1s;} if(v1s.length>0){o["var2"]=v2s;} if(v1s.length>0){o["var3"]=v3s;} jQuery.ajax({url:cds.remoteServerBaseURL+"/service?callback=?",dataType:"jsonp",data:o,context:this,success:function(data){if(data.error){if(data.error==="authentication required"){cds.authenticationManager.login(cds.getTemplateDomain(),"cart-update");return;}else{cds.deleteCookie("cds."+cds.getTemplateDomain()+".user");cds.authenticationManager.login(cds.getTemplateDomain(),"cart-update",true);return;}}else{cds.cart.items=data.items;cds.cart.display();}}});return false;};this.handleSubmitIsValid=function(o){return true;};this.modifySubmitData=function(o){return o;};this.handleSubmit=function(){var o,u,e,v;if(cds.isInputBlocked){return;} o={o:"cart-submit",d:cds.getDataDomain()};u=cds.getUser();if(u){o["cds-user"]=u;}else{if(cds.cdsu!==null){o["cds-user"]=cds.cdsu;} if(cds.fname!==null){o["cds-fname"]=cds.fname;} if(cds.lname!==null){o["cds-lname"]=cds.lname;} if(cds.company!==null){o["cds-company"]=cds.company;} if(cds.address1!==null){o["cds-address1"]=cds.address1;} if(cds.address2!==null){o["cds-address2"]=cds.address2;} if(cds.address3!==null){o["cds-address3"]=cds.address3;} if(cds.city!==null){o["cds-city"]=cds.city;} if(cds.country!==null){o["cds-country"]=cds.country;} if(cds.state!==null){o["cds-state"]=cds.state;} if(cds.zip!==null){o["cds-zip"]=cds.zip;} if(cds.phone!==null){o["cds-phone"]=cds.phone;} if(cds.fax!==null){o["cds-fax"]=cds.fax;} if(cds.agreetos!==null){o["cds-agree-tos"]=cds.agreetos;}} if(cds.getDataDomain()!==cds.getTemplateDomain()){o["td"]=cds.getTemplateDomain();} e=document.getElementById("cds-cart-comments");if(e){o["comments"]=e.value;} e=document.getElementById("cds-cart-variable1");if(e){if(e.tagName.toUpperCase()==="INPUT"){v=e.value;}else if(e.tagName.toUpperCase()==="SELECT"){v=e.options[e.selectedIndex].value;} if(v&&v.length){o["var1"]=v;}} e=document.getElementById("cds-cart-variable2");if(e){if(e.tagName.toUpperCase()==="INPUT"){v=e.value;}else if(e.tagName.toUpperCase()==="SELECT"){v=e.options[e.selectedIndex].value;} if(v&&v.length){o["var2"]=v;}} e=document.getElementById("cds-cart-variable3");if(e){if(e.tagName.toUpperCase()==="INPUT"){v=e.value;}else if(e.tagName.toUpperCase()==="SELECT"){v=e.options[e.selectedIndex].value;} if(v&&v.length){o["var3"]=v;}} if(this.handleSubmitIsValid(o)){o=this.modifySubmitData(o);this.submitInProgress=true;this.dialog=jQuery("
").html(""+"
"+cds.getTextLabel("cart.submit_dialog_text")+"
").dialog({title:cds.getTextLabel("cart.submit_dialog_title"),width:400,modal:true,resizable:false,beforeClose:function(event,ui){return!cds.cart.submitInProgress;},close:function(){cds.cart.items=[];cds.cart.display();}});jQuery.ajax({url:cds.remoteServerBaseURL+"/service?callback=?",dataType:"jsonp",data:o,context:this,success:function(data){cds.cart.submitInProgress=false;if(data.error){if(data.error==="authentication required"){cds.authenticationManager.login(cds.getTemplateDomain(),"cart-submit");return;}else if(data.error==="access denied"||data.error==="authentication error"){cds.deleteCookie("cds."+cds.getTemplateDomain()+".user");cds.authenticationManager.login(cds.getTemplateDomain(),"cart-submit",true);return;}else{cds.cart.dialog.html(cds.getTextLabel("cart.submit_dialog_error_text")).dialog("option","title","Error!");}}else{if(typeof cdsHandlePostSubmitRFQ==="function"){cdsHandlePostSubmitRFQ(data);} if(!this.bypassThankYou){if(cds.cart.thankYouURL===null){cds.cart.dialog.html(cds.getTextLabel("cart.submit_dialog_success_text")).dialog("option","title",cds.getTextLabel("cart.submit_dialog_success_title"));} if(cds.cart.thankYouURL!==null){location.href=this.thankYouURL;}}}}});}} this.display=function(){var i,d,desc,c,s="",e=document.getElementById(this.parentElementId);if(e){s="" +"" +" " +" " +" " +" " +" " +" " +" " +" " +" ";for(i=0;i");c=(i%2!==0)?" class=\"odd-row\"":"";s+=" ";if(d["productUrl"]){s+=" ";}else{s+=" ";} s+=" " +" " +" " +" ";} s+=" " +" " +" " +" " +" " +" " +"
Product IDDescriptionQuantity 
"+(d["productLabel"]||d["productId"]||"")+""+(d["productLabel"]||d["productId"]||"")+""+desc+"remove
 
";if(this.items.length>0){s+="
" +" " +"
";} while(e.hasChildNodes()){e.removeChild(e.lastChild);} e.innerHTML=s;}};this.addProductsConfirmation=function(quantity){var s;s="
" +String(quantity) +cds.getTextLabel("confirm.content_text") +"
";this.confirmDialog=jQuery("
").html(s).dialog({title:cds.getTextLabel("confirm.dialog_title"),width:500,height:150,modal:true,resizable:false,autoOpen:false,close:function(){jQuery(this).remove();cds.authenticationManager.confirmDialog=null;}});this.confirmDialog.dialog("open");};this.addMultipleProducts=function(products,display,displayURL){if(cds.isInputBlocked){return;} if(products){this.currentProduct=products;this.currentDisplay=display;this.currentDisplayURL=displayURL;} let o={o:"cart-add",d:cds.getDataDomain(),};let u=cds.getUser();if(u){o["cds-user"]=u;}else{if(cds.cdsu!==null){o["cds-user"]=cds.cdsu;} if(cds.fname!==null){o["cds-fname"]=cds.fname;} if(cds.lname!==null){o["cds-lname"]=cds.lname;} if(cds.company!==null){o["cds-company"]=cds.company;} if(cds.address1!==null){o["cds-address1"]=cds.address1;} if(cds.address2!==null){o["cds-address2"]=cds.address2;} if(cds.address3!==null){o["cds-address3"]=cds.address3;} if(cds.city!==null){o["cds-city"]=cds.city;} if(cds.country!==null){o["cds-country"]=cds.country;} if(cds.state!==null){o["cds-state"]=cds.state;} if(cds.zip!==null){o["cds-zip"]=cds.zip;} if(cds.phone!==null){o["cds-phone"]=cds.phone;} if(cds.fax!==null){o["cds-fax"]=cds.fax;} if(cds.agreetos!==null){o["cds-agree-tos"]=cds.agreetos;}} if(cds.getDataDomain()!==cds.getTemplateDomain()){o["td"]=cds.getTemplateDomain();} if(this.originalReferrer){o["oref"]=this.originalReferrer;} for(var i=0;i0){o["var1"]=variable1;} if(variable2&&variable2.length>0){o["var2"]=variable2;} if(variable3&&variable3.length>0){o["var3"]=variable3;} if(typeof cdsCartPreAddProductCallback!=="undefined"){if(!cdsCartPreAddProductCallback(o)){return;}} this.displayAfterAdd=this.currentDisplay;jQuery.ajax({url:cds.remoteServerBaseURL+"/service?callback=?",dataType:"jsonp",data:o,context:this,success:function(data){if(typeof cdsCartPostAddProductCallback!=="undefined"){cdsCartPostAddProductCallback(data);} if(data.error){if(data.error==="authentication required"){cds.authenticationManager.login(cds.getTemplateDomain(),"cart-add");return false;}else{cds.deleteCookie("cds."+cds.getTemplateDomain()+".user");cds.authenticationManager.login(cds.getTemplateDomain(),"cart-add",true);return false;}}else{if(this.displayAfterAdd){cds.cart.items=data.items;if(cds.cart.currentDisplayURL){location.href=cds.cart.currentDisplayURL;}else{cds.cart.display();}} return true;}}});};this.load=function(){var u,pid,plabel,purl,pdesc,pimg,pqty,o={o:"cart-get",d:cds.getDataDomain()};u=cds.getUser();if(u){o["cds-user"]=u;}else{if(cds.cdsu!==null){o["cds-user"]=cds.cdsu;} if(cds.fname!==null){o["cds-fname"]=cds.fname;} if(cds.lname!==null){o["cds-lname"]=cds.lname;} if(cds.company!==null){o["cds-company"]=cds.company;} if(cds.address1!==null){o["cds-address1"]=cds.address1;} if(cds.address2!==null){o["cds-address2"]=cds.address2;} if(cds.address3!==null){o["cds-address3"]=cds.address3;} if(cds.city!==null){o["cds-city"]=cds.city;} if(cds.country!==null){o["cds-country"]=cds.country;} if(cds.state!==null){o["cds-state"]=cds.state;} if(cds.zip!==null){o["cds-zip"]=cds.zip;} if(cds.phone!==null){o["cds-phone"]=cds.phone;} if(cds.fax!==null){o["cds-fax"]=cds.fax;} if(cds.agreetos!==null){o["cds-agree-tos"]=cds.agreetos;}} if(cds.getDataDomain()!==cds.getTemplateDomain()){o["td"]=cds.getTemplateDomain();} if(this.originalReferrer){o["oref"]=this.originalReferrer;} pid=cds.getQueryStringParameter("add-id");plabel=cds.getQueryStringParameter("add-label");purl=cds.getQueryStringParameter("add-url");pdesc=cds.getQueryStringParameter("add-desc");pimg=cds.getQueryStringParameter("add-img");pqty=cds.getQueryStringParameter("add-qty");pvar1=cds.getQueryStringParameter("add-var1");pvar2=cds.getQueryStringParameter("add-var2");pvar3=cds.getQueryStringParameter("add-var3");if(pid!==""&&plabel!==""&&pqty!==""){o["pid"]=pid;o["plabel"]=plabel;if(purl){o["purl"]=purl;} if(pdesc){o["desc"]=pdesc;} if(pimg){o["img"]=pimg;} o["qty"]=pqty;} if(pvar1){o["var1"]=pvar1;} if(pvar2){o["var2"]=pvar2;} if(pvar3){o["var3"]=pvar3;} jQuery.ajax({url:cds.remoteServerBaseURL+"/service?callback=?",dataType:"jsonp",data:o,context:this,error:function(jqXHR,textStatus,errorThrown){alert(jqXHR+'\n'+textStatus+'\n'+errorThrown);},success:function(data){if(data.error){if(data.error==="authentication required"){cds.authenticationManager.login(cds.getTemplateDomain(),"cart-load");return;}else{cds.deleteCookie("cds."+cds.getTemplateDomain()+".user");cds.authenticationManager.login(cds.getTemplateDomain(),"cart-load",true);return;}}else{cds.cart.items=data.items;cds.cart.display();}}});};})(),specSheet:new(function(){this.params={};this.name="specsheet";this.unit=null;this.generatingDialog=null;this.downloadInProgress=false;this.resultURL=null;this.resultError=null;this.load=function(elementId){var e=document.getElementById(elementId);if(e){jQuery("#"+elementId).click(this,function(event){event.data.submit();});}};this.preSubmitCallback=null,this.getSubmitParameters=function(){var i,u,s,v,found,a,customo,o={o:"pdf",name:this.name,d:cds.getDataDomain(),su:true};if(this.preSubmitCallback!==null){customo=this.preSubmitCallback(o);if(customo){for(i in customo){o[i]=customo[i];}}} u=cds.getUser();if(u){o["cds-user"]=u;}else{if(cds.cdsu!==null){o["cds-user"]=cds.cdsu;} if(cds.fname!==null){o["cds-fname"]=cds.fname;} if(cds.lname!==null){o["cds-lname"]=cds.lname;} if(cds.company!==null){o["cds-company"]=cds.company;} if(cds.address1!==null){o["cds-address1"]=cds.address1;} if(cds.address2!==null){o["cds-address2"]=cds.address2;} if(cds.address3!==null){o["cds-address3"]=cds.address3;} if(cds.city!==null){o["cds-city"]=cds.city;} if(cds.country!==null){o["cds-country"]=cds.country;} if(cds.state!==null){o["cds-state"]=cds.state;} if(cds.zip!==null){o["cds-zip"]=cds.zip;} if(cds.phone!==null){o["cds-phone"]=cds.phone;} if(cds.fax!==null){o["cds-fax"]=cds.fax;} if(cds.agreetos!==null){o["cds-agree-tos"]=cds.agreetos;}} if(cds.getDataDomain()!==cds.getTemplateDomain()){o["td"]=cds.getTemplateDomain();} if(this.originalReferrer){o["oref"]=this.originalReferrer;} u=this.unit;if(!u){u=cds.getCookie("cds.catalog.unit");if(!u){u="english";}} o["unit"]=u;for(i in this.params){o[i]=this.params[i];} if(cds.productAttributes){found=false;s="";for(i in cds.productAttributes){a=cds.productAttributes[i];v=null;if(a.dataType==="range"){e=document.getElementById("cds-dv-"+i);if(e){v=e.value;if(isNaN(parseFloat(v))){v=null;}}}else if(a.dataType==="list"){var e=document.getElementById("cds-dv-"+i);if(e){v=e.options[e.selectedIndex].value;if(v!==null&&v.toLowerCase()==="none"){v=null;}}}else if(a.dataType==="multilist"){v="";for(var j=0;j<100;j++){e=document.getElementById("cds-dv-"+i+"-"+j);if(e){if(e.checked){if(v.length){v+=", ";} v+=e.value;}}else{break;}} if(!v.length){v=null;}}else if(a.dataType==="text"){var e=document.getElementById("cds-dv-"+i);if(e){v=e.value;if(v&&!v.length){v=null;}}} if(v){if(!found){found=true;}else{s+=";";} s+=a.label+":"+v;}} if(found){o["ca"]=s;}} return o;};this.getSubmitURL=function(){var url,i,o=this.getSubmitParameters();url=cds.remoteServerBaseURL+"/service?";for(i in o){if(o.hasOwnProperty(i)&&i!=="su"){url+=i+"="+o[i]+"&";}} return url.substring(0,url.length-2);};this.submit=function(){var o=this.getSubmitParameters();this.resultURL=null;this.downloadInProgress=true;cds.isInputBlocked=true;document.body.style.cursor="wait";this.showDialogGenerating();jQuery.ajax({url:cds.remoteServerBaseURL+"/service?callback=?",dataType:"jsonp",data:o,context:this,error:function(jqXHR,textStatus,errorThrown){alert(jqXHR+'\n'+textStatus+'\n'+errorThrown);cds.isInputBlocked=false;document.body.style.cursor="default";},success:function(data){if(data.error){cds.specSheet.resultError=data.error;cds.specSheet.resultURL=null;}else{cds.specSheet.resultError=null;cds.specSheet.resultURL=data.resultPath;} cds.specSheet.downloadInProgress=false;cds.isInputBlocked=false;document.body.style.cursor="default";cds.specSheet.showDialogResults();}});};this.showDialogGenerating=function(){var e,generatingTitle="Generating Document",generatingText="The document you requested is being generated. This could take up to a minute, please wait...";if(this.dialogElementId){e=document.getElementById(this.dialogElementId);if(e){e.innerHTML="" +"
"+generatingText+"
";}}else{this.generatingDialog=jQuery("
").html(""+"
"+generatingText+"
").dialog({title:generatingTitle,width:400,modal:true,resizable:false,beforeClose:function(event,ui){return!cds.specSheet.downloadInProgress;}});}};this.showDialogResults=function(){var s,o,remoteServerBaseURL,completeTitle="Generation Complete!",completeText="The document you requested has been successfully generated.",completeLinkText="Click Here to Download Document",errorTitle="There was an error generating the document you have requested.  Please wait a few minutes and try again.",errorText="Error!";s="
"+completeText+"
";if(this.resultError==="authentication required"){this.generatingDialog.dialog("close");cds.authenticationManager.login(cds.getTemplateDomain(),"spec-sheet");return;}else if(this.resultError==="access denied"||this.resultError==="authentication error"){this.generatingDialog.dialog("close");cds.deleteCookie("cds."+cds.getTemplateDomain()+".user");cds.authenticationManager.login(cds.getTemplateDomain(),"spec-sheet",true);return;}else if(this.resultURL){if(this.dialogElementId){e=document.getElementById(this.dialogElementId);if(e){e.innerHTML=s;}}else{this.generatingDialog.html(s).dialog("option","title",completeTitle);}}else{if(this.dialogElementId){e=document.getElementById(this.dialogElementId);if(e){e.innerHTML=errorText;}}else{this.generatingDialog.html(errorText).dialog("option","title",errorTitle);}}};})(),explode:new(function(){this.productId=null;this.categoryId=null;this.containerElementId=null;this.explodeURLTemplate="?c=explode&id=%PRODUCT%&cid=%CATEGORY%";this.productURLTemplate="?c=products&id=%PRODUCT%";this.url=null;this.components=null;this.error=null;this.load=function(){if(this.productId===null){return;} var o={o:"explode",d:cds.getDataDomain(),id:this.productId};if(this.categoryId){o.cid=this.categoryId;} jQuery.ajax({url:cds.remoteServerBaseURL+"/service?callback=?",dataType:"jsonp",data:o,context:this,error:function(jqXHR,textStatus,errorThrown){alert("Request object: "+jqXHR+"\nStatus: "+textStatus+"\nError: "+errorThrown);},success:function(data){if(data.error){this.error=data.error;}else{this.url=data.url;this.components=data.components;if(!this.components||!this.components.length){this.error="Unable to load components";}} this.display();}});};this.display=function(){var i,purl,eurl,url,container,h,div,img,table,thead,tbody,tr,td,a,c;container=document.getElementById(this.containerElementId);if(container){while(container.hasChildNodes()){container.removeChild(container.lastChild);} if(this.error){h=document.createElement("h3");container.appendChild(h);h.appendChild(document.createTextNode("Unable to load exploded diagram."));return;} if(this.url){div=document.createElement("div");div.setAttribute("id","cds-explode-image");container.appendChild(div);img=document.createElement("img");img.setAttribute("src",this.url);div.appendChild(img);} table=document.createElement("table");table.setAttribute("id","cds-explode-table");table.className="attribute-table";container.appendChild(table);thead=document.createElement("thead");table.appendChild(thead);tr=document.createElement("tr");thead.appendChild(tr);td=document.createElement("td");tr.appendChild(td);td.appendChild(document.createTextNode("Product Number"));td=document.createElement("td");tr.appendChild(td);td.appendChild(document.createTextNode("Description"));td=document.createElement("td");tr.appendChild(td);td.appendChild(document.createTextNode("Reference Number"));td=document.createElement("td");tr.appendChild(td);td.appendChild(document.createTextNode("Quantity"));tbody=document.createElement("tbody");table.appendChild(tbody);purl=this.productURLTemplate.replace(/%DOMAIN%/g,encodeURIComponent(cds.getTemplateDomain()));purl=cds.getDataDomainURI(purl);eurl=this.explodeURLTemplate.replace(/%DOMAIN%/g,encodeURIComponent(cds.getTemplateDomain()));eurl=cds.getDataDomainURI(eurl);for(i=0;i"+cds.getTextLabel("login.header_text")+"";s+="
";s+="
" +" " +" " +" " +"
" +"
" +"
"+cds.getTextLabel("login.new_user_header_text")+"
" +" " +cds.getTextLabel("login.new_user_link_text")+"" +"
";this.loginDialog=jQuery("
").html(s).dialog({title:cds.getTextLabel("login.dialog_title"),width:500,height:350,modal:true,resizable:false,autoOpen:false,close:function(){jQuery(this).remove();cds.accessManager.loginDialog=null;}});this.loginDialog.dialog("open");jQuery.getScript(cds.remoteServerBaseURL+"/js/cds-access.js",function(){document.getElementById("cds-login-new-user-container").style.display="block";});};this.handleLogin=function(){var email=document.getElementById("cds-login-email").value;if(!email||!/.+@.+\..+/.exec(email)){document.getElementById("cds-login-error").innerHTML="Invalid email address. Please try again.";return;} jQuery.ajax({url:cds.remoteServerBaseURL+"/access?callback=?",dataType:"jsonp",data:{"d":cds.getTemplateDomain(),"email":email,"c":"login"},context:this,success:function(data){var s;if(data.ok){if(this.loginDialog){this.loginDialog.dialog("close");} if(typeof this.callback==="function"){this.callback(this.callbackParameters);}}else{switch(data.error){case"authentication required":case"authentication unsuccessfull":case"insufficient permissions":s="Either no account exists for this email address or you do not have permission for this" +" action.

If you recently created this account, a verification request should have" +" been sent to your email account.

";break;case"no request submitted":case"exception thrown":s="There was an error logging in, please try again";break;} document.getElementById("cds-login-error").innerHTML=s;if(typeof this.errorCallback==="function"){this.errorCallback(data.error,this.errorCallbackParameters);}}}});};this.logout=function(callback,callbackParameters,errorCallback,errorCallbackParameters){this.callback=callback;this.callbackParameters=callbackParameters;this.errorCallback=errorCallback;this.errorCallbackParameters=errorCallbackParameters;jQuery.ajax({url:cds.remoteServerBaseURL+"/access?callback=?",dataType:"jsonp",data:{"d":cds.getTemplateDomain(),"c":"logout"},context:this,success:function(data){if(data.ok&&typeof this.callback==="function"){this.callback(this.callbackParameters);}else if(typeof this.errorCallback==="function"){this.errorCallback(data.error,this.errorCallbackParameters);}}});};})()};