function readCookie(B){var D=B.toLowerCase()+"=";var A=document.cookie.split(";");for(var C=0;C<A.length;C++){var E=A[C].toLowerCase();while(E.charAt(0)==" "){E=E.substring(1,E.length)}if(E.indexOf(D)==0){return E.substring(D.length,E.length)}}return null}window.onunload=function(){if(window.parent.name="masterWin"){window.parent.scroll(0,0)}};function openpopupnotime(B,A,C){window.open(B,A,C)}function openpopup(B,A,C){window.open(B,A,C)}function get_focus(A){A.focus()}var pathname;pathname=location.hostname.toLowerCase();var bName=navigator.appName;var bVer=parseFloat(navigator.appVersion);function formatPhone(A){A=A.replace(" ","");return"("+A.substring(0,3)+") "+A.substring(3,6)+"-"+A.substring(6,10)}function SetCookie(E,D,C){var B=new Date();var A=new Date();if(C==null||C==0){C=1}A.setTime(B.getTime()+3600000*24*C);document.cookie=E+"="+escape(D)+";path=/;expires="+A.toGMTString()}function expireCookie(B){var A=new Date();document.cookie=B+"=;path=/;expires="+A.getTime()}function setDDL(A,B){var D=document.getElementById(A);for(var C=0;C<D.options.length;C++){if(D.options[C].value==B){D.selectedIndex=C;break}}}var updateCount=0;function checkRefreshTime(C,F,D,B){var E=document.getElementById("detect"+F);if(E.src&&E.src!=""){var A=E.offsetHeight;if(A==2){document.getElementById("a"+F+"on").style.display="none";document.getElementById("a"+F+"off").style.display=""}else{if(A==1){document.getElementById("a"+F+"on").style.display="";document.getElementById("a"+F+"off").style.display="none"}}}updateCount++;if((updateCount%B)==0){refreshImage(C,F,D)}setTimeout("checkRefreshTime('"+C+"','"+F+"','"+D+"',"+B+");",1000)}function refreshImage(A,D,B){date1=new Date();updateurl=A+"ChatScript.ashx?config="+B+"&refresh=1&time="+date1.getTime();var C=document.getElementById("detect"+D);C.src=updateurl}var currentDiv;function showDivDetail(D,E,B){currentDiv=B;var A=document.getElementById(B);A.style.display="block";A.innerHTML='<img src="/images/animated/indicator.gif"> Loading Manufacturer';var C=new ajaxRequestObjectCache(D,E,writeDetail);C.doGetCallback()}function writeDetail(A){document.getElementById(currentDiv).innerHTML=A}function hideDivDetail(A){document.getElementById(A).style.display="none"}function Right(B,C){if(C<=0){return""}else{if(C>String(B).length){return B}else{var A=String(B).length;return String(B).substring(A,A-C)}}}function readQuery(B){var D=B+"=";var A=location.search.substring(1).split("&");for(var C=0;C<A.length;C++){var E=A[C].toLowerCase();while(E.charAt(0)==" "){E=E.substring(1,E.length)}if(E.indexOf(D.toLowerCase())==0){return E.substring(D.length,E.length)}}return null}function getCheckedValue(B){if(!B){return""}var C=B.length;if(C==undefined){if(B.checked){return B.value}else{return""}}for(var A=0;A<C;A++){if(B[A].checked){return B[A].value}}return""}function toCurrency(dblMoney){currency=eval(dblMoney);workNum=Math.abs((Math.round(currency*100)/100));workStr=""+workNum;if(workStr.indexOf(".")==-1){workStr+=".00"}dStr=workStr.substr(0,workStr.indexOf("."));dNum=dStr-0;pStr=workStr.substr(workStr.indexOf("."));if(workNum>=1000){dLen=dStr.length;dStr=parseInt(""+(workNum/1000))+","+dStr.substring(dLen-3,dLen)}if(workNum>=1000000){dLen=dStr.length;dStr=parseInt(""+(workNum/1000000))+","+dStr.substring(dLen-7,dLen)}if(pStr.length==2){pStr+="0"}retval=dStr+pStr;if(currency<0){retval="- $"+retval}else{retval="$"+retval}return retval}function stripCurrency(A){A=A.replace(/[^0-9.]/g,"");A=A*1;return A}function toPercent(dblPercent){percent=eval(dblPercent);percent=percent*100;workNum=Math.abs((Math.round(percent*100)/100));workStr=""+workNum;if(workStr.indexOf(".")==-1){workStr+=".00"}dStr=workStr.substr(0,workStr.indexOf("."));dNum=dStr-0;pStr=workStr.substr(workStr.indexOf("."));retval=dStr+pStr;if(percent<0){retval="- "+retval+"%"}else{retval=retval+"%"}return retval}function AddTop(A,C,D,J){var E;var G=document.createElement("b");var I="r";var B=4;if(J&&J=="small"){I="rs";B=2}G.className="rtop";G.style.backgroundColor=C;for(E=1;E<=B;E++){var H=document.createElement("b");H.className=I+E;H.style.backgroundColor=D;G.appendChild(H)}try{A.insertBefore(G,A.firstChild)}catch(F){}}function AddBottom(A,C,D,J){var E;var G=document.createElement("b");var I="r";var B=4;if(J&&J=="small"){I="rs";B=2}G.className="rbottom";G.style.backgroundColor=C;for(E=B;E>0;E--){var H=document.createElement("b");H.className=I+E;H.style.backgroundColor=D;G.appendChild(H)}try{A.appendChild(G,A.firstChild)}catch(F){}}function getElementsBySelector(B){var C;var H=[];var A="";var E="";var I=B;var F=[];if(B.indexOf(" ")>0){H=B.split(" ");var D=H[0].split("#");if(D.length==1){return(F)}return(document.getElementById(D[1]).getElementsByTagName(H[1]))}if(B.indexOf("#")>0){H=B.split("#");I=H[0];A=H[1]}if(A!=""){F.push(document.getElementById(A));return(F)}if(B.indexOf(".")>0){H=B.split(".");I=H[0];E=H[1]}var G=document.getElementsByTagName(I);if(E==""){return(G)}for(C=0;C<G.length;C++){if(G[C].className==E){F.push(G[C])}}return(F)}function fnDefault(B,C){var A=(window.event)?C.keyCode:C.which;if(B!=undefined&&A==13){if(C.stopPropagation){C.stopPropagation();C.preventDefault()}C.returnValue=false;C.cancelBubble=true;B.click()}}function addLoadEvent(A){var B=window.onload;if(typeof window.onload!="function"){window.onload=A}else{window.onload=function(){B();A()}}}function clickButton(C,B){var A=document.getElementById(B);if(typeof A=="object"){if(C.keyCode){if(C.keyCode==13){A.click();return false}}else{if(event.keyCode){if(event.keyCode==13){A.click();return false}}}}}function insertAfter(C,A){var B=A.parentNode;if(B.lastChild==A){B.appendChild(C)}else{B.insertBefore(C,A.nextSibling)}}var hideDivAcct,hideDivSite,hideDivShop;function fnHide(A){document.getElementById(A+"subMenu").style.display="none"}function clearDiv(A){if(A=="acctLink"){hideDivAcct=setTimeout("fnHide('"+A+"')",300)}else{if(A=="hrefSite"){hideDivSite=setTimeout("fnHide('"+A+"')",300)}else{hideDivShop=setTimeout("fnHide('"+A+"')",300)}}}function showSub(B){var A=document.getElementById(B.id+"subMenu");if(A.style.display!="block"){A.style.display="block"}}function findPosX(A){var B=0;if(A.offsetParent){while(1){B+=A.offsetLeft;if(!A.offsetParent){break}A=A.offsetParent}}else{if(A.x){B+=A.x}}return B}function findPosY(B){var A=0;if(B.offsetParent){while(1){A+=B.offsetTop;if(!B.offsetParent){break}B=B.offsetParent}}else{if(B.y){A+=B.y}}return A}function rpLink(){if(readCookie("user%5Fid")!=null&&readCookie("lui%5Frep%5Fid")!=null&&readCookie("fullName")!=null){document.write("<a class='whiteNoUnderLine smallerText' href='/admin/orders/customer.asp?id="+readCookie("user%5Fid")+"'>"+readCookie("fullName")+"</a><a class='whiteNoUnderLine smallerText' href='/includes/logout.aspx'>Logout</a>")}}function loadCart(){if(readCookie("cartItem")!=null){if(readCookie("cartItem").indexOf("~")>0){SetCookie("cartItem",0+"-"+0,-1)}var A=readCookie("cartItem").split("-");if(A.length==2){if(A[0]==0){document.write("0 Items : <strong>$0.00")}else{document.write(A[0]+" Items : <strong>"+toCurrency(A[1]))}}}else{document.write("0 Items : <strong>$0.00")}}function showRecentViewed(){var C;C=readCookie("recentView");if(C!=null){var B=C.split("~");document.write('<div id="divRecentItem"><h2 class="separator">Your Recently Viewed Products</h2><ul>');for(var D=0;D<B.length;D++){var A=B[D].split("|");if(A[0].length>0){document.write("<li><a href='/products/view.aspx?sku="+A[0]+"&linkLoc=recent' style='width:75px;height:75px;border:1pt solid #CCC;'>");if(A[3].length>5){document.write("<img src='//hi.atgimg.com/img/t/"+A[3].replace(/\+/g,"%20")+"'>")}else{document.write("No Image")}document.write("</a>");if(A[2]){document.write("<p class='price'>"+toCurrency(A[2])+"</p></li>")}}}document.write("</ul></div>")}}function sendFeedBack(A){location.protocol+"//"+location.host+location.pathname+location.search;var C=document.getElementById("divFeedBackForm");if(A==""){A=0}if(document.getElementById("txtFeedBack").value!="We appreciate your suggestions. Please note that we are unable to respond directly to every suggestion."){var B=new ajaxRequestObject("/ajax/miniFeedBack.aspx","group_id="+A+"&feedback=Page: <a href='"+escape(location.protocol+"//"+location.host+location.pathname+location.search)+"'>"+escape(location.protocol+"//"+location.host+location.pathname+location.search)+"</a><br>"+escape(document.getElementById("txtFeedBack").value));B.doGetCallback()}C.innerHTML="<span style='color: green'>Thank you for your feedback.</span>"}function writeFeedBack2(A){document.write('<div id="miniFeedBack" style="clear:both;"><h2 class="separator">Suggestion Box</h2><p><strong>Need help</strong>? Have a <strong>question for customer service</strong>? Use our <a id="aControlIDon"  href="https://server.iad.liveperson.net/hc/51320037/?cmd=file&file=visitorWantsToChat&site=51320037&byhref=1&imageUrl=https://server.iad.liveperson.net/hcp/Gallery/ChatButton-Gallery/English/General/1a/" target="chat51320037"  onClick="javascript:window.open(\'https://server.iad.liveperson.net/hc/51320037/?cmd=file&file=visitorWantsToChat&site=51320037&imageUrl=https://server.iad.liveperson.net/hcp/Gallery/ChatButton-Gallery/English/General/1a/&referrer=\'+escape(document.location),\'chat51320037\',\'width=475,height=400,resizable=yes\');return false;" >Live Chat</a> or call '+sitePhone+'</p><div style="border-top:1pt solid #CCC;margin:10px;"></div><div id="divFeedBackForm"><p>Tell us how we can <strong>improve this page</strong><br><textarea rows="3" cols="66" id="txtFeedBack" onclick="this.value=\'\'">We appreciate your suggestions. Please note that we are unable to respond directly to every suggestion. If you need help please contact us using the links above.</textarea><br><input type="button" value="Send Suggestion" onClick="sendFeedBack(\''+A+"')\"/></p></div></div>")}function track(D,B,A){var C=new ajaxRequestObject("/ajax/track.aspx","name="+D+"&value1="+B+"&value2="+A);C.doGetCallback()}var cur=-1;var show=true;function $(){return document.getElementById(arguments[0])}function autoFillNav(){switch(event.keyCode){case 13:enter();break;case 38:move("up");break;case 40:move("down");break;default:var B=$("tbxsearchterm");if(B.value.length>3){var A=new ajaxRequestObjectCache("/ajax/fillSearch.aspx","term="+B.value,showFillNav);A.doGetCallback()}else{hideFNDelay()}}}function enter(){show=false;if(cur>-1){var D=$("tbxsearchterm");var B=$("divNavMatch");var A=B.getElementsByTagName("div");var C=A[cur].getElementsByTagName("a")[0].innerHTML.replace(new RegExp("^<span[^<]*","i"),D.value).replace(new RegExp("</span>","i"),"");window.location="/search/default.aspx?term="+C}}function move(D){var B=$("divNavMatch");var A=B.getElementsByTagName("div");if(D=="down"){cur++}else{cur--}if(cur>A.length-1){cur=-1}if(cur<-1){cur=A.length-1}for(var C=0;C<A.length;C++){if(C==cur){A[C].getElementsByTagName("a")[0].style.background="#DDD"}else{A[C].getElementsByTagName("a")[0].style.background="#FFF"}}}function showFillNav(F){if(show){var C=F.split("~");var A=$("divNavMatch");var E=$("tbxsearchterm");A.innerHTML="";currentLength=C.length;if(C.length>1){A.className="fillBoxNav";for(var D=0;D<C.length-1;D++){var B=C[D].replace(E.value.replace(/^\s+/,"").toLowerCase(),'<span style="color: #6699FF; padding: 0px; margin: 0px;">'+E.value.toLowerCase()+"</span>");A.innerHTML+='<div style="margin:5px"><a href="/search/default.aspx?term='+C[D]+'" class="smallerText" style="padding: 3px 3px; display: block; text-decoration:none;" onm=ouseout="this.style.background=\'#FFF\'" onm=ouseover="clearSelectNav(); this.style.background=\'#DDD\';this.style.color=\'#003399\'">'+B+"</a></div>"}}else{A.className="hide";A.innerHTML=""}}else{A.className="hide";A.innerHTML=""}}function clearSelectNav(){if(cur>-1){var B=$("divNavMatch");var A=B.getElementsByTagName("div");cur=-1;for(var C=0;C<A.length;C++){A[C].getElementsByTagName("a")[0].style.background="#FFF"}}}function hideFN(){setTimeout(hideFNDelay,1000)}function hideFNDelay(){var A=$("divNavMatch");A.className="hide";A.innerHTML=""}function ajaxRequestObject(C,F,E){var B=D();B.onreadystatechange=A;function D(){if(window.XMLHttpRequest){return new XMLHttpRequest()}else{if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP")}}}this.doGetCallback=function(){var G=new Date().getTime();B.open("get",C+"?"+F+"&rand="+G);B.send(null)};this.doPostCallback=function(G){var H=new Date().getTime();B.open("post",C+"?"+F+"&rand="+H);B.setRequestHeader("Content-Type","application/x-www-form-urlencoded");B.send(G)};function A(){if(B.readyState==4){if(E){E(B.responseText)}}}}function ajaxRequestObjectCache(C,F,E){var B=D();B.onreadystatechange=A;function D(){if(window.XMLHttpRequest){return new XMLHttpRequest()}else{if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP")}}}this.doGetCallback=function(){B.open("get",C+"?"+F);B.send(null)};this.doPostCallback=function(G){var H=new Date().getTime();B.open("post",C+"?"+F);B.setRequestHeader("Content-Type","application/x-www-form-urlencoded");B.send(G)};function A(){if(B.readyState==4){if(E){E(B.responseText)}}}}function flipSpinner(B){var A=document.getElementById(B);if(A.style.display=="none"){A.style.display=""}else{A.style.display="none"}}function hideElement(A){document.getElementById(A).style.display="none"}function showElement(A){document.getElementById(A).style.display=""};