function setPageSize(n){document.srform.page.value=1,document.srform.pageSize.value=n,methodChooser(document.srform)&&document.srform.submit()}function gotoPage(n){document.srform.page.value=n,methodChooser(document.srform)&&document.srform.submit()}function sort(n){document.srform.page.value=1,document.srform.ColumnSort.value=n,methodChooser(document.srform)&&document.srform.submit()}function methodChooser(n){var t=$(n).serialize();return n.method=t.length<1800?"get":"post",!0}function anyChecked(){for(var t=2,n=0;n<document.compform.part.length;n++)if(document.compform.part[n].checked&&!--t)return!0;return!1}function partClick(){$("#compare-button").each(function(){this.disabled=!anyChecked(),anyChecked()?$("#products-compare").show():$("#products-compare").hide()})}function allPartClick(n){$(document.compform.part).each(function(){this.checked=n}),$('input[name="allpart"]').each(function(){this.checked=n}),$("#compare-button").each(function(){this.disabled=!anyChecked(),anyChecked()?$("#products-compare").show():$("#products-compare").hide()})}function resetSelect(n){for(var t=0;t<n.options.length;t++)n.options[t].selected=n.options[t].defaultSelected;$('[name="btn'+n.name+'"]').hide(),verifyRecordCounts()}function invalidQty(){var n={};n[txtOk]=function(){$(this).dialog("close")},$("#dlgInvalidQty").dialog({resizable:!1,modal:!0,closeOnEscape:!0,buttons:n})}function verifyQuantity(n){return n.match("^[0-9]*$")!=null?!0:(invalidQty(),!1)}function msgBox(n){var t={};t[txtClose]=function(){$(this).dialog("close")},$(n).dialog({resizable:!1,modal:!0,closeOnEscape:!0,buttons:t})}function showRoHSnotWithSubs(n){$("#dlgRohsNotWithSubs #hrefsub").attr("href",n),msgBox("#dlgRohsNotWithSubs")}function setupAttForm(){var n=$('[name="attform"]'),t,i;n.contextId=0,n.updateEnabled=!0,n.oldRecordCount=$(".matching-records").html(),n.resetRecordCount=function(){$(".matching-records").html(n.oldRecordCount),n.find(":submit").each(function(){this.disabled=!1})},n.updateRecordCount=function(){this.updateEnabled&&(this.contextId++,$.ajax({type:"POST",url:summaryUrl,data:$(this).serialize()+"&contextId="+this.contextId,timeout:summaryTimeout,success:function(t){t.contextId==n.contextId&&$(".matching-records").html(t.msg),n.find(":submit").each(function(){this.disabled=!t.nMatches,t.nMatches?$("#btn-apply-filters").removeClass("disabled"):$("#btn-apply-filters").addClass("disabled"),verifyRecordCounts()})},error:function(){n.resetRecordCount(),n.updateEnabled=!1}}))},n.bind("reset",function(){$("a[name^='btn']").hide(),$(".matching-records").hide(),$("#btn-apply-filters").removeClass("disabled"),n.resetRecordCount()}),$("a[name^='btn']").click(function(){n.updateRecordCount()}),t=n.find("input:not([type=reset], [type=checkbox])"),t.focus(function(){n.updateRecordCount()}),t.blur(function(){n.updateRecordCount()}),i=n.find("input:checkbox"),i.click(function(){n.updateRecordCount()}),n.find("select").each(function(){selectionVerification(this),this.onchange=function(){n.updateRecordCount(),selectionVerification(this)}}),n.updateRecordCount()}function verifyColumnSort(){var n=$(".quantity-form input[name=ColumnSort]").val(),t;n!="0"&&(n="ColSort"+n,$("[id$='"+n+"']").css("background-color","gray"),$("[id$='"+n+"'] .sorted").css("display","inline"),$("[id$='"+n+"'] .nonsorted").css("display","none"),t=$("[id$='"+n+"']").parent().parent().index(),$("[id$='"+n+"']").closest("table").find("tr td:nth-child("+(t+1)+"):even").css("background-color","#999999"),$("[id$='"+n+"']").closest("table").find("tr td:nth-child("+(t+1)+"):odd").css("background-color","#CCCCCC"))}function verifyRecordCounts(){var n=parseInt($("#matching-records-count").text().replace(/[^0-9\s]/gi,""),10)||0,t=parseInt($("#moving-count").text().replace(/[^0-9\s]/gi,""),10)||0;n===t?$(".matching-records").hide():$(".matching-records").css("display","inline")}function sdsHelp(n){var i="/classic/dialog/SupplierDirectShip.aspx?partNumber="+encodeURIComponent(n),t={};$.get(i,function(n){var r=$(n);t[r.attr("close")]=function(){$(this).dialog("close")},r.dialog({resizable:!1,modal:!0,closeOnEscape:!0,close:function(){$(this).dialog("destroy").remove()},buttons:t})})}function addCookieTrack(n,t){var i="ref_page_type="+utag_data.page_type+";ref_page_sub_type="+utag_data.page_sub_type+";ref_page_id="+utag_data.page_id+";ref_page_event="+t;$(n).attr("cookie-tracking",i)}function addEventTrack(n,t){var i="ref_page_type="+utag_data.page_type+";ref_page_sub_type="+utag_data.page_sub_type+";ref_page_id="+utag_data.page_id+";ref_page_event="+t;$(n).attr("track-data",i)}function selectionVerification(n){$(n).find("option:selected").length>0?$('[name="btn'+n.name+'"]').css("display","inline"):$('[name="btn'+n.name+'"]').css("display","none")}function reRenderAddthis(n){addthis.update("share","url",n),addthis.url=n,addthis.toolbox(".addthis_toolbox")}function buildShortyRequest(n,t,i,r){var f=location.protocol+"//"+location.host,e={longUrl:n,ipAddress:t,httpMethod:i,postBody:r};$.ajax({type:"POST",url:f+"/short/fetch-url",data:e,dataType:"json",success:function(n){n?($("#shortUrlValue").val(f+n),reRenderAddthis(f+n),shortDialog(f+n)):shortDialog("error")},error:function(){shortDialog("error")}})}function shortInit(n){var t,i,f=$("#ipPH").val(),r=$("#methodPH").val(),u=$("#shortUrlValue").val();return location.href.match(/short/)?(reRenderAddthis(location.href),shortDialog(location.href)):u.length!=0?(reRenderAddthis(u),shortDialog(u)):r==0?(t=window.location.pathname+window.location.search,i="",buildShortyRequest(t,f,r,i,n)):r==1&&(t=window.location.pathname,i=$("#earlPH").val(),buildShortyRequest(t,f,r,i,n)),!1}function shortDialog(n){n.match(/error/)?$("#shortUrlPopupError").dialog({modal:!0,closeOnEscape:!0}):($("#shortUrlTextbox").val(n),$("#shortUrlPopup").dialog({modal:!0,closeOnEscape:!0,open:function(){$("#shortUrlTextbox").focus(function(){$(this).select()}),$("#shortUrlTextbox").focus()}})),$(".ui-widget-overlay").click(function(){$(".ui-dialog-titlebar-close").trigger("click")})}function filterSelect(){$("select[name=v] option").size()==2?($("select[name=v] option:eq(1)").attr("selected","selected"),$("select[name=v]").trigger("chosen:updated")):($("select[name=v] option:eq(0)").attr("selected","selected"),$("select[name=v]").trigger("chosen:updated"))}function checkEnter(n){var t=n.which;t==13&&($(".chosen-results li").length>=1||$("#search-keyword").val())&&$("#keywordSearchForm").submit()}function addWebtrendCookieTrack(n,t){var i="ref_page_type="+utag_data.page_type+";ref_page_sub_type="+utag_data.page_sub_type+";ref_page_id="+utag_data.page_id+";";utag_data.part_search_term&&(i+="ref_part_search_term="+utag_data.part_search_term+";"),i+=utag_data.page_id=="CTN"?"ref_page_event=Select Family - New Prod;":"ref_page_event="+t+";",$(n).attr("cookie-tracking",i)}function CreateFloatingHeader(){var t=$("#productTable"),h=$(t).clone(!0).empty().removeClass("stickyHeader"),f,n,r,e,v,i,y,s;h.css("margin-bottom",""),f=$(t).find("thead").clone(!0),f.addClass("stickyThead"),n=$("<div><\/div>").addClass("stickyHeader hide").attr("aria-hidden","true"),n.append(h).find("table").append(f),$(t).after(n);var c=["padding-left","padding-right","border-left-width","border-right-width"],l=$(t).width(),b=$(t).height();for(r=0;r<c.length;r++)e=Number($("#productTable").css(c[r]).replace(/px/ig,"")),isNaN(e)||(l+=e);var o=$(t).find("thead th"),k=$(o[0]).height(),a=n.find("th");for(n.css("width",l),v=("WebkitAppearance"in document.documentElement.style),i=0,y=o.length;i<y;i++)s=$(o[i]).width(),v&&(s+=1),$(a[i]).css("width",s),$(a[i]).css("background-color","#333333");var p=$(t).offset().top,d=b+p-k,w=$(t).offset().left,u=$(window).scrollTop();$(n).offset({left:w,top:u}),u>p&&u<d?(n.removeClass("hide"),$(n).offset({left:w,top:u})):n.addClass("hide")}function UpdateFloatingHeader(){for(var t=$("div.stickyHeader"),r=$("#productTable").find("thead th"),v=$(r[0]).height(),s=["padding-left","padding-right","border-left-width","border-right-width"],h=$("#productTable").width(),y=$("#productTable").height(),u,f,c,n,l,e,i=0;i<s.length;i++)u=Number($("#productTable").css(s[i]).replace(/px/ig,"")),isNaN(u)||(h+=u);for(f=t.find("th"),t.css("width",h),c=("WebkitAppearance"in document.documentElement.style),n=0,l=r.length;n<l;n++)e=$(r[n]).width(),c&&(e+=1),$(f[n]).css("width",e),$(f[n]).css("background-color","#333333");var a=$("#productTable").offset().top,p=y+a-v,o=$(window).scrollTop(),w=$("#productTable").offset().left;o>a&&o<p?(t.removeClass("hide"),$(t).offset({left:w,top:o})):t.addClass("hide")}function dlgHelp(n,t){var r="/products/helpdialog/"+n+"/"+encodeURIComponent(t),i={};$.get(r,function(n){var r=$(n);i[r.attr("close")]=function(){$(this).dialog("close")},r.dialog({resizable:!1,modal:!0,draggable:!1,closeOnEscape:!0,close:function(){$(this).dialog("destroy").remove()},buttons:i,width:400}),$(".ui-widget-overlay").click(function(){$("#helpPopUp").dialog("destroy").remove(),$(".ui-dialog-titlebar-close").trigger("click")})})}var addthis_config,isScrolledIntoView;$(document).ready(function(){$(".pszoomer").hover(function(){var n=Math.min(640,.8*Math.min($(window).width(),$(window).height()));$("#pszoomie").attr("src",$(this).attr("zoomimg")).css("height",n).css("width",n).css("left",($(window).width()-n)/2).css("top",($(window).height()-n)/2).show()},function(){$(".pszoomie").hide()}),$(".pszoomie").hide(),typeof CurrencySetter!="undefined"&&(CurrencySetter.refresh=function(){document.srform.submit()}),partClick(),$(".method-chooser").submit(function(){methodChooser(this)}),setupAttForm(),verifyColumnSort(),$("#lnkPart").each(function(){addCookieTrack($(this),"Select Part")}),$("#btn-apply-filters").each(function(){addCookieTrack($(this),"Parametric Search")}),$(".quantity-form").each(function(){addCookieTrack($(this),"Sort Table")}),$("#search-within-results").each(function(){addCookieTrack($(this),"Search Within Results")}),$(".ps-sortButtons").each(function(){addEventTrack($(this),"Sort Table")}),$("#deapplySearch").each(function(){addCookieTrack($(this),"Remove Search within Result")}),$("#deapplyFilter").each(function(){addCookieTrack($(this),"Clear Search Parameters")})}),addthis_config=addthis_config||{},addthis_config.pubid="ra-5238723d69253f5b",addthis_config.data_track_clickback=!1,addthis_config.data_track_addressbar=!1,$(document).ready(function(){if($(".dk-sharelink").click(function(){shortInit(this.id)}),$(".chosen-select").length){$(".chosen-select").chosen({allow_single_deselect:!0,disable_search_threshold:5});$(".chosen-select").on("chosen:no_results",function(){$(".no-results").remove()});$(".chosen-container").bind("keyup",function(n){checkEnter(n)}),$(".chosen-select").change(function(){$("#keywordSearchForm").submit()}),$(".catfilters").each(function(){addWebtrendCookieTrack($(this),"Select Family")}),$("#catfiltersubid").each(function(){addWebtrendCookieTrack($(this),"Select Family")}),$("#qpLinkList").each(function(){addWebtrendCookieTrack($(this),"Select Family")}),$("#exactPartList").each(function(){addWebtrendCookieTrack($(this),"Exact Match")}),filterSelect(),$(".search-form").submit(function(){$(".primarykeyword").val($(".search-input").val())})}}),isScrolledIntoView=function(n){var t=$(n),i=$(window),r=i.scrollTop(),f=r+i.height(),u=t.offset().top,e=u+t.height();return e<=f&&u>=r},$(window).load(function(){isScrolledIntoView(".btm-wrapper")?$("#products-compare").removeClass("products-compare-fixed"):$("#products-compare").addClass("products-compare-fixed")}),$(window).scroll(function(){isScrolledIntoView(".btm-wrapper")?$("#products-compare").removeClass("products-compare-fixed"):$("#products-compare").addClass("products-compare-fixed")}),$(document).ready(function(){$(window).load(function(){CreateFloatingHeader()}),$(window).scroll(function(){UpdateFloatingHeader()}),$(window).resize(function(){UpdateFloatingHeader()})})