/* $Revision: $
* $Id: $
*
* Author: Coremetrics/PSD 
* Coremetrics  v7.3, 2012/01/05
* COPYRIGHT 1999-2008 COREMETRICS, INC. 
* ALL RIGHTS RESERVED. U.S.PATENT PENDING
* Disclaimer: Coremetrics is not responsible for hosting or maintenance or this file
*
*/
var G_PS_DEBUG_MODE=2;var G_PS_ARR_DOMAIN=null;var G_PS_DOMAIN_REGEX=null;if(!psIsEqual(typeof(baseDomain),"undefined")&&psCheckArrayExist(baseDomain)){G_PS_ARR_DOMAIN=baseDomain;G_PS_DOMAIN_REGEX=baseDomain.replace(".","\\.")}if(G_PS_ARR_DOMAIN==null){G_PS_ARR_DOMAIN=new Array("mouser.com","mouser.lan","mouser.ebiz","mouser.cn","mouserlan.cn","mouserebiz.cn")
}if(G_PS_DOMAIN_REGEX==null){G_PS_DOMAIN_REGEX="mouser.(com|lan|ebiz|cn)"}var G_PS_URL_PATH=""+document.location.href.toLowerCase();var G_PS_PATHNAME=document.location.pathname.toLowerCase();var G_PS_QUERYSTRING=document.location.search.toLowerCase();var G_PS_URL_REFERRER=document.referrer.toLowerCase();var G_PS_COOKIE_LIFETIME=172800;var G_PS_COOKIE_PROD_CATID="PS_PROD_CATID";var G_PS_COOKIE_PROFILE="PS_PROFILE";var G_PS_COOKIE_PROFILE_TEMP="PS_PROFILE_TEMP";var G_PS_COOKIE_FLAG="PS_FLAG";var G_PS_COOKIE_CONVERSION="PS_CONVERSION_EVENT";
var pCurrencyArray=new Array("EUR","SEK","NOK","DKK");var uP=new psProfile();if(psGetDomain(G_PS_URL_PATH).search(new RegExp(G_PS_DOMAIN_REGEX,"gi"))>=0){psInitialFunctions();if(G_PS_PATHNAME.search(/^(\/|\/Home|\/search\/Default|\/supplierpage|\/Help\/Help|\/CatalogRequest\/Catalog|\/tools\/tools)(\/|\.aspx)?$/gi)>-1){switch((RegExp.$1).toString().toLowerCase()){case"/":case"/home":pPageId=pCatId="Home";psHijackHomeNewestProduct();break;case"/search/default":pPageId="All Products";pCatId="Products";psSetValueToCookie(G_PS_COOKIE_FLAG,"$1","");
break;case"/supplierpage":pPageId="All Suppliers";pCatId="Suppliers";break;case"/catalogrequest/catalog":pPageId="Catalog Home";pCatId="Catalog";if(psGetValueFromCookie(G_PS_COOKIE_FLAG,"account")=="subscribe"){psSendRegistrationTemp()}break;case"/tools/tools":pPageId="EZ BUY Home";pCatId="EZ BUY";break;case"/help/help":pPageId="Help Home";pCatId="Help";psHijackToSendConversion_byElementID("ctl00_ContentMain_CommentsForm_btnSubmit","Help Comments","Contact");break}psCreatePageviewTag(pPageId,pCatId,null,null)
}else{if(G_PS_PATHNAME.search(/^\/Search\/CompareProducts\.aspx/gi)>=0){psCreatePageviewTag("Compare Products","COMPARE",null,null);psHijackAddCompare()}else{if(G_PS_PATHNAME.search(/\/eNews\/eNewsConfirm\.aspx/gi)>-1){psCreatePageviewTag("eNews Signup","Subscriptions",null,null);psHijackToSendConversion_byElementID("ctl00_ContentMain_SubmitLinkButton1","eNews Subscribe","Subscriptions");psHijackToSendConversion_byElementID("ctl00_ContentMain_SubmitLinkButton2","eNews Unsubscribe","Subscriptions")}else{if(G_PS_PATHNAME.search(/\/ContactUs\/ContactUs\.aspx/gi)>-1){psCreatePageviewTag("Comments Form","Contact Us",null,null);
psHijackToSendConversion_byElementID("ctl00_ContentMain_CommentsForm_btnSubmit","Comments","Contact")}else{if(G_PS_PATHNAME.search(/\/Error\.aspx/gi)>-1){psCreatePageviewTag("Not found Page","Error",null,null)}else{if(G_PS_PATHNAME.search(/^\/library\//gi)>-1){if(G_PS_PATHNAME.search(/^\/library\/help\/?/gi)>-1){pPageId="Help"}if(G_PS_URL_PATH.search(/\/library\/([^\/\.]+)\/\#([^\/\.]+)/gi)>-1){pPageId=RegExp.$2}psCreatePageviewTag("Library "+pPageId,"Library",null,null)}else{if(G_PS_PATHNAME.search(/^\/news\/([^\/\.]+)\.\w+/gi)>-1){psCreatePageviewTag(RegExp.$1,"news")
}else{if(G_PS_PATHNAME.search(/^\/OrderHistory\/([^\/\.]+\/)*([^\/\.]+)\.aspx/gi)>-1){var pCatId="OrderHistory";pPageId=psGetValueFromTabs();var pRegex=RegExp.$2;if(psIsEqual(pRegex,"OrderHistoryLogin")){if(psAccExcError()){psSetValueToCookie(G_PS_COOKIE_FLAG,"account","login_error")}psHijackGeneralAcc("ctl00_ContentMain_OrderHistoryLogin_login_LoginButton",psSaveLogInInfo)}else{pPageId=psCheckArrayExist(pPageId)?pPageId:pRegex;if(psIsEqual(pRegex,"OrderDetail")){psHijackAddToCartOrderDetails("Reorder");psSetValueToCookie(G_PS_COOKIE_FLAG,"$3",pCatId)
}if(psIsEqual(pRegex,"QuoteDetail")){psCreateConversionEventTag("Quote View",2,"Quote",null);if(psCheckElementExist(pTable=document.getElementById("ctl00_ContentMain_CartGrid_grid"))){var pRow=pTable.rows;for(r=0;r<pRow.length;r++){if(pRow[r].innerHTML.search(/Order\s*Qty/gi)<0){psHijackQuoteToProductView(pRow[r])}}}}}psCreatePageviewTag(pPageId,pCatId,null,null)}else{if(G_PS_PATHNAME.search(/^\/MyMouser\/?/gi)>-1){psPostMyAccountView()}else{if(G_PS_PATHNAME.search(/^\/(parts|Manufacturer|ManufacturerPartNumber|Products_Featured_Index)\/([^\/\.]+)?\/?/gi)>-1){if(!psCheckArrayExist(RegExp.$2)){psCreatePageviewTag(RegExp.$1,RegExp.$1,null,null)
}else{var pB=document.getElementsByTagName("b");if(psCheckArrayExist(pB)){psCreatePageviewTag(pB[0].innerHTML,RegExp.$2,null,null)}}}else{if(psIsProductView()){psPostProductView()}else{if(psIsSearchView()){psSetValueToCookie(G_PS_COOKIE_FLAG,"$1","SEARCH");psHijackListLinkSearch();psHijackAddToCartSearch_ProList("SEARCH");psPostSearchView()}else{if(G_PS_PATHNAME.search(/^\/Cart\/Cart\.aspx/gi)>-1){psPostCartView();psSetValueToCookie(G_PS_COOKIE_FLAG,"bom","")}else{if(G_PS_PATHNAME.search(/\/Checkout\/OrderConfirmation\.aspx/gi)>-1){if(psCheckElementExist(document.getElementById("ctl00_ContentMain_divError"))){psSetValueToCookie(G_PS_COOKIE_FLAG,"account","")
}psHijackGeneralAcc("ctl00_ContentMain_btnCreateAccount",psSaveCheckoutRegister)}else{if(G_PS_PATHNAME.search(/^\/Checkout\/([^\/\.]+)\.aspx/gi)>-1){var pUrlItem=RegExp.$1;if(psIsEqual(pUrlItem,"AddBillingAddress")||psIsEqual(pUrlItem,"EditBillingAddress")){pPageId="Addresses";if(psCheckElementExist(document.getElementById("ctl00_ContentMain_AddressForm_divError"))){psSetValueToCookie(G_PS_COOKIE_FLAG,"account","")}psHijackGeneralAcc("ctl00_ContentMain_btnForward",psSaveBillInfo)}else{if(pUrlItem.search(/CheckoutLogin/gi)>=0){pPageId="Checkout Login";
if(psAccExcError()){psSetValueToCookie(G_PS_COOKIE_FLAG,"account","login_error")}psHijackGeneralAcc("ctl00_ContentMain_MyMouserLogin1_login_LoginButton",psSaveLogInInfo)}else{if(pUrlItem.search(/(ViewAddresses|ShippingMethods|AddShippingAddress|Payment)/gi)>-1){switch((RegExp.$1).toString().toLowerCase()){case"viewaddresses":pPageId="View Addresses";break;case"shippingmethods":pPageId="Shipping Method";break;case"addshippingaddress":pPageId="Add Shipping Address";break;case"payment":pPageId="Payment";break}if(psGetValueFromCookie(G_PS_COOKIE_FLAG,"account")=="save_bill"){uP.updateProfile();
psSetValueToCookie(G_PS_COOKIE_FLAG,"account","")}}else{if(psIsEqual(pUrlItem,"OrderReview")){pPageId="Review";uP.SaveLastBillingInfo();var pCartTable=document.getElementById("ctl00_ContentMain_CartGrid_grid");if(psCheckElementExist(pCartTable)){psHijackToSetCookie(pCartTable,"$2","1")}}else{pPageId=pUrlItem}}}}psCreatePageviewTag(pPageId,"CHECKOUT",null,null)}else{if(psHasBreadcrumb()||psCheckElementExist(document.getElementById("pkc_tags"))){var pPageId=psGetValueFromBreadCrumb("2last");var pAttb=psCheckArrayExist(pAttribute=psGetValueFromBreadCrumb("attribute"))?psTrim(psHtmlDecode(unescape(pAttribute))).toUpperCase():null;
if(psIsEqual(pPageId,"BOM Import Tool")){psHijackAddBom()}if(G_PS_PATHNAME.search(/\/([^\/\.\_]+)\/\_\/(N\-([^\/]+)\/?)?/gi)>-1){pCatId=psCheckArrayExist(catId=RegExp.$3)?catId.toUpperCase():null;if(!psCheckArrayExist(pCatId)){if(psCheckElementExist(pSearchLimit=document.getElementById("ctl00_ContentMain_CategorySearchLimits_pnlCategorySearchLimits"))){if(psCheckArrayExist(pInput=pSearchLimit.getElementsByTagName("input"))){if(pInput[pInput.length-1].id.search(/ctl00\_ContentMain\_CategorySearchLimits\_chkbx(\d+)/gi)>-1){pCatId=RegExp.$1
}}}}var pPage=psGetElementsByClassName(document,"span","paging-current");if(psCheckArrayExist(pPage)&&pPage[0].innerHTML>1){pPageId=pPageId+" PG"+pPage[0].innerHTML}}else{if(G_PS_PATHNAME.search(/\/([^\/\.]+)(\/|\/[^\/\.]+\.\w+)?$/gi)>-1){pCatId=RegExp.$1;if(G_PS_PATHNAME.search(/\/Catalogrequest\/editcatalog\.aspx/gi)>-1){pCatId="Catalog";if(psCheckElementExist(document.getElementById("ctl00_ContentMain_AddressForm1_divError"))){psSetValueToCookie(G_PS_COOKIE_FLAG,"account","")}if(psCheckElementExist(document.getElementById("ctl00_ContentMain_AddressForm1_divWarning"))){psSetValueToCookie(G_PS_COOKIE_FLAG,"account","")
}var pMode=psGetValueFromUrl(G_PS_URL_PATH,"mode");if(pMode=="change"||pMode=="cancel"){psHijackGeneralAcc("ctl00_ContentMain_btnSaveAddress",psSaveNewSubscribeInfo);psHijackToSendConversion_byElementID("ctl00_ContentMain_btnSaveAddress",(pMode=="cancel"?"Catalog Unsubscribe":"Catalog Update"),"Subscriptions")}else{if(pMode=="new"){psHijackGeneralAcc("ctl00_ContentMain_btnSaveAddress",psSaveNewSubscribeInfo);psHijackGeneralAcc("ctl00_ContentMain_btnSaveAddressAndColleagues",psSaveNewSubscribeInfo);psHijackToSendConversion_byElementID("ctl00_ContentMain_btnSaveAddress","Catalog Subscribe","Subscriptions");
psHijackToSendConversion_byElementID("ctl00_ContentMain_btnSaveAddressAndColleagues","Catalog Subscribe","Subscriptions")}}}if(G_PS_PATHNAME.search(/\/ProjectManager\/ProjectDetail\.aspx/gi)>-1){pPageId=document.body.innerHTML.search(/(Share\s*Your\s*Project\s*with\s*a\s*Colleague)/gi)>-1?RegExp.$1:"Modify Project";psHijackAddToCartOrderDetails(pCatId,"projectmanager");psSetValueToCookie(G_PS_COOKIE_FLAG,"$3",pCatId)}if(G_PS_PATHNAME.search(/\/localsites\/?/gi)>-1){var pOldCountry=psGetDomain(G_PS_URL_PATH).search(/www2/gi)>-1?"Mouser International":(psGetDomain(G_PS_URL_PATH).search(new RegExp("eu."+G_PS_DOMAIN_REGEX,"gi"))>-1)?"Mouser Europe":(psGetDomain(G_PS_URL_PATH).search(new RegExp("gb."+G_PS_DOMAIN_REGEX,"gi"))>-1)?"United Kingdom":"";
if(psCheckElementExist(pWrapper=document.getElementById("international"))){if(psCheckArrayExist(pATag=pWrapper.getElementsByTagName("a"))){for(i=0;i<pATag.length;i++){if(psIsEqual(psGetDomain(G_PS_URL_PATH),psGetDomain(pATag[i].href))){pOldCountry=pATag[i].title.search(/(Mouser\s*International|Mouser\s*Europe)/gi)>-1?RegExp.$1:pATag[i].title}}for(i=0;i<pATag.length;i++){psHijackToSendConversion(pATag[i],pOldCountry+" -> "+(pATag[i].title.search(/(Mouser\s*International|Mouser\s*Europe)/gi)>-1?RegExp.$1:pATag[i].title),"International",false)
}}}}if(!psCheckArrayExist(pPageId)&&psCheckElementExist(document.getElementById("pkc_tags"))){pPageId="Product Knowledge Center "+unescape("%20%BB%20")+" "+psTrim(psHtmlDecode(unescape(document.title)))}}else{if(G_PS_PATHNAME.search(/^\/([^\/\.]+)\.\w+$/gi)>-1){pCatId=RegExp.$1}}}if(G_PS_PATHNAME.search(/\/quote\/quote\.aspx/gi)>-1){psHijackToSendConversion_byElementID("ctl00_ContentMain_BtnQuoteSubmit","Quote Request","Quote")}if(G_PS_PATHNAME.search(/\/feedback\.aspx/gi)>-1){window.setInterval(function(){if(psCheckArrayExist(pError=psGetElementsByClassName(document,"span","error"))){pErr=false;
for(i=0;i<pError.length;i++){if(!psIsEqual(pError[i].style.visibility,"hidden")){pErr=true;break}}if(pErr){psSetValueToCookie(G_PS_COOKIE_FLAG,"$conversion","")}}},2000);psHijackToSendConversion_byElementID("ctl00_ContentMain_btnSubmit","Feedback","Contact")}if(G_PS_PATHNAME.search(/\/EZBuy\/EZBuy\.aspx/gi)>-1){psHijackAddToCartEZBuy(pCatId)}psHijackAddToCartSearch_ProList(pCatId);pPageId=psTrim(pPageId).replace(/\.$/,"");psCreatePageviewTag(pPageId,pCatId,null,null,pAttb)}else{if(G_PS_PATHNAME.search(/\/([^\/\.]+)\/?$/gi)>-1){psCreatePageviewTag(RegExp.$1,RegExp.$1,null,null)
}else{if(G_PS_PATHNAME.search(/^\/([^\/\.]+)\/([^\/\.]+)\.\w+$/gi)>-1){psCreatePageviewTag(RegExp.$2,RegExp.$2,null,null)}else{if(G_PS_PATHNAME.search(/^\/([^\/\.]+)\.\w+$/gi)>-1){psCreatePageviewTag(RegExp.$1,RegExp.$1,null,null)}else{psCreatePageviewTag(G_PS_PATHNAME,G_PS_PATHNAME,null,null)}}}}}}}}}}}}}}}}}}}psHijackConversionEvents()}function psHijackConversionEvents(){if(G_PS_PATHNAME.search(/\/Cart\/Cart\.aspx/i)>=0){psHijackConversion_BtnClick("ctl00_ContentMain_btnSaveCartTop","Cart to Project","Project Add",true)
}else{if(G_PS_PATHNAME.search(/\/EZBuy\/EZBuy\.aspx/i)>=0){psHijackConversion_BtnClick("ctl00_ContentMain_btnAddToOrder","EZ Buy to Project","Project Add",true)}else{if(G_PS_PATHNAME.search(/\/BOM\/Bom\.aspx/i)>=0){psHijackConversion_BtnClick("ctl00_ContentMain_btnSubmit","BOM to Project","Project Add",true)}else{if(G_PS_PATHNAME.search(/\/Search\/CompareProducts\.aspx/i)>=0){psHijackConversion_BtnClick("ctl00_ContentMain_AddToProjectTopButton","Compare to Project","Project Add",true);psHijackConversion_BtnClick("ctl00_ContentMain_AddToProjectBottomButton","Compare to Project","Project Add",true)
}else{if(G_PS_PATHNAME.search(/\/OrderHistory\/ProjectsView\.aspx/i)>=0){psHijackConversion_BtnClick("ctl00_ContentMain_btnNewProject","Create Project","Project Add",false)}}}}}if(G_PS_PATHNAME.search(/\/ProjectManager\/ProjectDetail\.aspx/i)>=0){psPostConversionEvent()}psSetCookie(G_PS_COOKIE_CONVERSION,"","delete")}function psPostConversionEvent(){var b=psGetValueFromCookie(G_PS_COOKIE_CONVERSION,"event_id");var a=psGetValueFromCookie(G_PS_COOKIE_CONVERSION,"event_cat");if(b!=null&&b!=""&&a!=null&&a!=""){psCreateConversionEventTag(b,2,a,null)
}psSetCookie(G_PS_COOKIE_CONVERSION,"","delete")}function psHijackConversion_BtnClick(e,c,a,b){var d=psGetEleByTagName_Id(document,"input",e);if(psCheckElementExist(d)){d.pEventID=c;d.pCategoryID=a;d.pSaveCookie=b;d.OldFunc=d.onclick;d.onclick=function(){if(b==false){if(this.id=="ctl00_ContentMain_SubmitLinkButton1"){if(psCheckEmail(psGetElementValueById("ctl00_ContentMain_EmailTextBox1"))){psCreateConversionEventTag(this.pEventID,2,this.pCategoryID,null)}}else{if(this.id=="ctl00_ContentMain_SubmitLinkButton2"){if(psCheckEmail(psGetElementValueById("ctl00_ContentMain_EmailTextBox2"))){psCreateConversionEventTag(this.pEventID,2,this.pCategoryID,null)
}}else{psCreateConversionEventTag(this.pEventID,2,this.pCategoryID,null)}}}else{psSetValueToCookie(G_PS_COOKIE_CONVERSION,"event_id",this.pEventID);psSetValueToCookie(G_PS_COOKIE_CONVERSION,"event_cat",this.pCategoryID)}if(this.OldFunc!=null){return this.OldFunc}}}}function psHasBreadcrumb(){var a=psGetElementsByClassName(document,"div","breadcrumb");a=psCheckArrayExist(a)?a[0]:document.getElementById("breadcrumb");a=psCheckElementExist(a)?a:document.getElementById("content-fixed-width");return psCheckElementExist(a)
}function psIsProductView(){return G_PS_PATHNAME.search(/^(\/search)?\/ProductDetail(\/|\.aspx)/gi)>-1}function psIsSignUpSuccess(){var a=document.getElementById("ctl00_ContentMain_divWelcome");if(psCheckElementExist(a)){a=psTrim(psHtmlDecode(unescape(a.innerHTML)));if(a.search(/your\s+My\s+Mouser\s+Account\s+has\s+been\s+created\s+and\s+you\s+are\s+logged\s+in/gi)>=0){return true}}return false}function psIsSearchView(){var c=document.getElementById("ctl00_ContentMain_uc2_txtPartKeywordSearch");var b=psTrim(G_PS_PATHNAME.replace(/\//g," "));
if(psCheckElementExist(c)&&psIsEqual(b,c.value)){psSetValueToCookie(G_PS_COOKIE_FLAG,"$5","");return true}if(psCheckArrayExist(G_PS_URL_REFERRER)){if(G_PS_PATHNAME.search(/\/Search\/(Refine|Default)\.aspx/gi)>-1||(G_PS_PATHNAME.search(/\/\_\//gi)>-1&&psCheckArrayExist(psGetValueFromCookie(G_PS_COOKIE_FLAG,"$1")))){return true}var a=document.getElementById("ctl00_ContentMain_lblNoResults");if(psCheckElementExist(a)&&psIsEqual(a.innerHTML,"No Results Found")){return true}}return false}function psIsSendConversion(){if(psCheckElementExist(document.getElementById("ctl00_ContentMain_divError"))||psCheckElementExist(document.getElementById("ctl00_ContentMain_CommentsForm_RequiredName"))||psCheckElementExist(document.getElementById("ctl00_ContentMain_CommentsForm_RequiredEmailAddress"))||psCheckElementExist(document.getElementById("ctl00_ContentMain_CommentsForm_ExprEmail"))||psCheckElementExist(document.getElementById("ctl00_ContentMain_CommentsForm_RequiredComments"))||psCheckElementExist(document.getElementById("ctl00_ContentMain_ExprEmail"))||psCheckElementExist(document.getElementById("ctl00_ContentMain_RequiredEmail"))||psCheckElementExist(document.getElementById("ctl00_ContentMain_AddressForm1_divWarning"))||psCheckElementExist(document.getElementById("ctl00_ContentMain_AddressForm1_lblNewNoteCountriesRequiredFor"))||psCheckElementExist(document.getElementById("ctl00_ContentMain_AddressForm1_divError"))){return false
}if(psCheckArrayExist(pError=psGetElementsByClassName(document,"span","error"))){for(i=0;i<pError.length;i++){if(pError[i].style.display!="none"){return false}}}return true}function psInitialFunctions(){if(psIsSendConversion()&&psCheckArrayExist(psGetValueFromCookie(G_PS_COOKIE_FLAG,"$conversion"))){var c=psGetValueFromCookie(G_PS_COOKIE_FLAG,"$conversion").split("-_-");if(c.length>1){psCreateConversionEventTag(c[0],2,c[1],null)}}psSetValueToCookie(G_PS_COOKIE_FLAG,"$conversion","");if(G_PS_PATHNAME.search(/^\/Cart\/Cart\.aspx/gi)<0){psSetValueToCookie(G_PS_COOKIE_FLAG,"bom","")
}a();if(psIsLogInSuccess()){psHijackLogOutLink()}if(!psIsSearchView()){psSetValueToCookie(G_PS_COOKIE_FLAG,"$5","");if(!psIsProductView()&&G_PS_PATHNAME.search(/\/MyMouser\/MouserLogin\.aspx/gi)<0){psSetValueToCookie(G_PS_COOKIE_FLAG,"$1","")}}f();b();if(!psIsProductView()&&G_PS_PATHNAME.search(/\/MyMouser\/MouserLogin\.aspx/gi)<0){psSetValueToCookie(G_PS_COOKIE_FLAG,"$2","");psSetValueToCookie(G_PS_COOKIE_FLAG,"$3","")}var e=0;window.setInterval(function(){var g=document.getElementById("TB_window");if(psCheckElementExist(g)&&psCheckArrayExist(psGetElementsByClassName(g,"div","currency-close"))&&e==0){e++
}if(e==1){psCreateConversionEventTag("Currency Window",2,"International",null);e++}if(!psCheckElementExist(g)&&e==2){e=0}},1000);d("ctl00_NavHeader_ddlLanguage");d("ctl00_Header1_ddlLanguage");d("ctl00_Header1_ddlCurrencies");d("ctl00_NavHeader_ddlCurrencies");function d(g){if(psCheckElementExist(pCbb=document.getElementById(g))){var h=psGetElementValueById(g);pCbb.oldFunc=pCbb.onchange;pCbb.onchange=function(){psCreateConversionEventTag(h+" -> "+psGetElementValueById(g),2,"International",null);if(this.oldFunc!=null){return this.oldFunc()
}}}}function a(){var g=psGetValueFromCookie(G_PS_COOKIE_FLAG,"account");if(g!=null){if(g=="login"&&psIsLogInSuccess()){psPostRegistration()}else{if(g=="register"&&psIsSignUpSuccess()){uP.updateProfile();psPostRegistration()}else{if(g=="update"&&psIsUpdateSuccess()){uP.writePrfUpdate();psPostRegistration()}else{if(g=="changeuser"&&document.body.innerHTML.search(/Your\s+User\s+Name\s+has\s+been\s+successfully\s+changed/gi)>=0){uP.SaveChangedUser();psPostRegistration()}else{if(g=="editbill"&&document.body.innerHTML.search(/Your\s+Billing\s+Address\s+has\s+been\s+successfully\s+(updated|added)/gi)>=0){uP.SaveEditBilling();
psPostRegistration()}else{if(g=="register_checkout"&&psIsLogInSuccess()){uP.updateProfile();psPostRegistration()}}}}}}}}function f(){var g=document.getElementById("search-bar");if(psCheckElementExist(g)){var h=g.getElementsByTagName("input");if(psCheckArrayExist(h)&&h.length>=2){psHijackSearch(h[1],"onclick","search");psHijackSearch(g,"onkeypress","search")}}}function b(){var m=document.getElementsByTagName("table");if(psCheckArrayExist(m)){var g=false;for(t=0;t<m.length;t++){if(m[t].innerHTML.search(/Limit\sProducts\sto\:/gi)>-1){psSetValueToCookie(G_PS_COOKIE_FLAG,"$4","")
}if(m[t].innerHTML.search(/Part\sNumber\s\/\sKeyword/gi)>-1&&m[t].innerHTML.search(/Limit\sProducts\sto\:/gi)<0&&m[t].innerHTML.search(/\<img/gi)<0){if(!g){var h=m[t].rows;for(i=0;i<h.length;i++){var l=h[i].getElementsByTagName("input");if(psCheckArrayExist(l)&&l.length>=2){psHijackSearch(l[1],"onclick","limitProduct,search");psHijackSearch(h[i],"onkeypress","limitProduct,search");break}}g=true}}if(m[t].innerHTML.search(/Part\sNumber\s\/\sKeyword/gi)<0&&m[t].innerHTML.search(/Limit\sProducts\sto\:/gi)>-1&&psIsSearchView()){h=m[t].rows;
for(k=0;k<h.length;k++){l=h[k].getElementsByTagName("input");if(psCheckArrayExist(l)){psHijackSearch(l[0],"onclick","limitProduct");psHijackSearch(h[k],"onkeypress","limitProduct");break}}break}}}}}function psHijackListLinkSearch(){var b=document.getElementById("tblSplitCategories");if(psCheckElementExist(b)){var a=b.getElementsByTagName("a");if(psCheckArrayExist(a)){for(i=0;i<a.length;i++){psHijackSearch(a[i],"onclick","listLink")}}}}function psHijackSearch(c,b,d){c.oldFunc=c[b];c[b]=function a(m){var f=true;
if(psIsEqual(b,"onkeypress")){var h=window.event?event.keyCode:m.keyCode;f=h==13?true:false}if(f){psSetValueToCookie(G_PS_COOKIE_FLAG,"$1","SEARCH");psSetValueToCookie(G_PS_COOKIE_FLAG,"$2","");psSetValueToCookie(G_PS_COOKIE_FLAG,"$3","");var g=psGetValueFromCookie(G_PS_COOKIE_FLAG,"$5");if(psCheckArrayExist(d)&&psIsEqual(d,"search")){psSetValueToCookie(G_PS_COOKIE_FLAG,"$4","")}if(psCheckArrayExist(d)&&(psIsEqual(d,"search")||psIsEqual(d,"limitProduct,search"))){psSetValueToCookie(G_PS_COOKIE_FLAG,"$5","")}if(psCheckArrayExist(d)&&(psIsEqual(d,"limitProduct")||psIsEqual(d,"limitProduct,search"))){psSetValueToCookie(G_PS_COOKIE_FLAG,"$5",g);
var l=psGetElementValueById("ctl00_ContentMain_uc3_ddlManufacturer",false);l=psCheckArrayExist(l)?l:psGetElementValueById("ctl00_ContentMain_ManufacturerControl1_ddlManufacturer",false);if(psCheckArrayExist(l)){psSetValueToCookie(G_PS_COOKIE_FLAG,"$4","-_-Limit Product("+l.replace(/\s*\(\d+\)/gi,"")+")")}}if(psCheckArrayExist(d)&&psIsEqual(d,"listLink")){psSetValueToCookie(G_PS_COOKIE_FLAG,"$5","-_-Category("+c.innerHTML+")")}}if(this.oldFunc!=null){return this.oldFunc()}}}function psGetValueFromTabs(){var a=psGetElementsByClassName(document,"ul","tabs");
if(psCheckArrayExist(a)){var b=a[0].getElementsByTagName("li");for(p=0;p<b.length;p++){if(psIsEqual(b[p].className,"active")){var c=b[p].getElementsByTagName("input");if(psCheckArrayExist(c)){return c[0].value}}}}return null}function psPostMyAccountView(){var c="";if(G_PS_PATHNAME.search(/MouserLogin\.aspx/gi)>-1){c="ACCOUNT LOGIN";if(psAccExcError()){psSetValueToCookie(G_PS_COOKIE_FLAG,"account","login_error")}psHijackGeneralAcc("ctl00_ContentMain_login_login_LoginButton",psSaveLogInInfo);psHijackGeneralAcc("ctl00_ContentMain_MyMouserLogin1_login_LoginButton",psSaveLogInInfo)
}else{if(G_PS_PATHNAME.search(/CreateAccount\.aspx/gi)>-1){c="CREATE ACCOUNT";if(psAccExcError()){psSetValueToCookie(G_PS_COOKIE_FLAG,"account","register_error")}psHijackGeneralAcc("ctl00_ContentMain_btnCreateAccount",psSaveSignUpInfo);psHijackToSendConversion_byElementID("ctl00_ContentMain_btnCreateAccount","Account Creation","Account")}else{if(G_PS_PATHNAME.search(/AccountSummary\.aspx/gi)>-1){c="ACCOUNT SUMMARY";psGetEmailAddress()}else{if(G_PS_PATHNAME.search(/LoginWordRequest\.aspx/gi)>-1){c="Forgot User Name or Password?"
}else{if(G_PS_PATHNAME.search(/\/MyMouser\/BillingAddressConfirmation\.aspx/gi)>=0){c="Billing Address Confirmation"}else{if(G_PS_PATHNAME.search(/\/MyMouser\/UserNameConfirmation\.aspx/gi)>=0){c="User Name Confirmation"}else{if(G_PS_PATHNAME.search(/\/MyMouser\/ShippingAddressConfirmation\.aspx/gi)>=0){c="Shipping Address Confirmation"}else{if(G_PS_PATHNAME.search(/\/MyMouser\/ShippingAddressSummary\.aspx/gi)>=0){c="Shipping Address Summary"}else{if(G_PS_PATHNAME.search(/\/MyMouser\/ContactConfirmation\.aspx/gi)>=0){c="Contact Confirmation"
}else{if(G_PS_PATHNAME.search(/\/MyMouser\/ChangeLoginWord\.aspx/gi)>=0){c="Change Password";psHijackToSendConversion_byElementID("ctl00_ContentMain_btnSave",c,"Account")}else{if(G_PS_PATHNAME.search(/\/MyMouser\/LoginWordConfirmation\.aspx/gi)>=0){c="Password Updated"}else{var a=document.getElementsByTagName("table");if(!psCheckArrayExist(a)){return}var b=a[0].getElementsByTagName("H4");b=psCheckArrayExist(b)?b:a[0].getElementsByTagName("b");if(psCheckArrayExist(b)){c=psTrim(psCleanHtmlTag(b[0].innerHTML));
if(psIsEqual(c,"Edit Contact Information")){if(psAccExcError()){psSetValueToCookie(G_PS_COOKIE_FLAG,"account","update_error")}psHijackGeneralAcc("ctl00_ContentMain_btnSave",psSaveUpdateInfo)}if(psIsEqual(c,"Add Billing Address")||psIsEqual(c,"Edit Billing Address")){if(psCheckElementExist(document.getElementById("ctl00_ContentMain_AddressForm1_divError"))||psCheckElementExist(document.getElementById("ctl00_ContentMain_AddressForm1_lblAddressWarning"))){psSetValueToCookie(G_PS_COOKIE_FLAG,"account","")}psHijackGeneralAcc("ctl00_ContentMain_btnSave",psCheckEditBilling)
}if(psIsEqual(c,"Change User Name")){if(psCheckElementExist(document.getElementById("ctl00_ContentMain_lblChangeUserNameError"))){psSetValueToCookie(G_PS_COOKIE_FLAG,"account","")}psHijackGeneralAcc("ctl00_ContentMain_btnSave",psSaveChangedUserName);psHijackToSendConversion_byElementID("ctl00_ContentMain_btnSave",c,"Account")}}}}}}}}}}}}}if(G_PS_PATHNAME.search(/\/MyMouser\/LoginWordRequest\.aspx/gi)>=0){psHijackToSendConversion_byElementID("ctl00_ContentMain_btnRetrieveUserName","Request User Name","Account");
psHijackToSendConversion_byElementID("ctl00_ContentMain_btnRetrievePassword","Request Password","Account")}if(G_PS_PATHNAME.search(/\/MyMouser\/EditContactInformation\.aspx/gi)>=0){psHijackToSendConversion_byElementID("ctl00_ContentMain_btnSave","Update Contact","Account")}if(G_PS_PATHNAME.search(/\/MyMouser\/EditBillingAddress\.aspx/gi)>=0){psHijackToSendConversion_byElementID("ctl00_ContentMain_btnSave","Update Billing","Account")}if(G_PS_PATHNAME.search(/\/MyMouser\/EditShippingAddress\.aspx/gi)>=0){psHijackToSendConversion_byElementID("ctl00_ContentMain_btnSave","Update Shipping","Account");
psHijackToSendConversion_byElementID("ctl00_ContentMain_btnDelete","Update Shipping","Account")}psCreatePageviewTag(c,"MYMOUSER",null,null)}function psPostSearchView(){var h=null;var l=0;var c=1;var d=document.getElementById("ctl00_ContentMain_uc2_txtPartKeywordSearch");d=psCheckElementExist(d)?d:document.getElementById("ctl00_ContentMain_PartKeywordSearchControl1_txtPartKeywordSearch");h=d.value;if(!psCheckArrayExist(psTrim(h))){if(G_PS_URL_PATH.search(/Ntt\=([^\&\=]+)/gi)>-1){h=RegExp.$1}}if(!psCheckArrayExist(psTrim(h))){h=psGetValueFromBreadCrumb("last")
}h=h+psGetRefinedForSearchTerm();var a=document.getElementById("ctl00_ContentMain_lblNoResults");a=psCheckElementExist(a)?a:document.getElementById("ctl00_ContentMain_lblNoResults2");if(psCheckElementExist(a)){pPageId="SEARCH UNSUCCESSFUL"}else{if(psCheckElementExist(document.getElementById("ctl00_ContentMain_lblSOPMsg1"))){var e=document.getElementById("ctl00_ContentMain_SearchResultsGrid_grid");if(psCheckElementExist(e)){var f=e.rows;if(psCheckArrayExist(f)&&f.length>=1){l=f.length-1}}}else{var g=document.getElementsByTagName("script");
if(psCheckArrayExist(g)){for(i=0;i<g.length;i++){if(g[i].innerHTML.search(/pageTracker\.\_trackPageview.+cnt\=(\d+).*/gi)>-1){l=RegExp.$1;break}}}}var b=psGetElementsByClassName(document,"span","paging-current");if(psCheckArrayExist(b)){c=b[0].innerHTML}pPageId="SEARCH SUCCESSFUL PG "+c}psCreatePageviewTag(pPageId,"SEARCH",psTrim(decodeHtml(h)),l);psSetValueToCookie(G_PS_COOKIE_FLAG,"$3","SEARCH")}function psGetRefinedForSearchTerm(){var b="";if(psCheckArrayExist(psGetValueFromCookie(G_PS_COOKIE_FLAG,"$5"))){b=b+psGetValueFromCookie(G_PS_COOKIE_FLAG,"$5")
}var e=document.getElementById("ctl00_ContentMain_uc2_chkStocked");e=psCheckElementExist(e)?e:document.getElementById("ctl00_ContentMain_PartKeywordSearchControl1_chkStocked");if(psCheckElementExist(e)&&e.checked){b=b+"-_-Stocked"}var d=document.getElementById("ctl00_ContentMain_uc2_chkRoHSCompliant");d=psCheckElementExist(d)?d:document.getElementById("ctl00_ContentMain_PartKeywordSearchControl1_chkRoHSCompliant");if(psCheckElementExist(d)&&d.checked){b=b+"-_-RoSH Compliant"}if(psCheckArrayExist(psGetValueFromCookie(G_PS_COOKIE_FLAG,"$4"))){b=b+psGetValueFromCookie(G_PS_COOKIE_FLAG,"$4")
}var c=document.getElementById("ctl00_ContentMain_AttributeSelectionControl_AttributeBreadcrumbList");if(psCheckElementExist(c)){var a=c.getElementsByTagName("td");if(psCheckArrayExist(a)){for(i=0;i<a.length;i++){b=b+"-_-"+psTrim(psCleanHtmlTag(a[i].innerHTML)).replace(/\s*\=\s*/gi,"(")+")"}}}return b}function psHijackAddToCartSearch_ProList(b){var c=document.getElementById("ctl00_ContentMain_SearchResultsGrid_grid");if(psCheckElementExist(c)){var e=c.rows;if(psCheckArrayExist(e)){for(i=0;i<e.length;i++){if(psCheckElementExist(e[i].cells[2])&&(e[i].cells[2].innerHTML.search(/Mouser\sPart\s\#/gi)>-1||!psCheckArrayExist(psTrim(e[i].cells[0].innerHTML)))){continue
}var g=e[i].getElementsByTagName("input");var h=e[i].cells;if(psCheckArrayExist(g)&&g.length>=3&&psCheckArrayExist(h)&&h.length>=11){var a=h[2].getElementsByTagName("a");if(psCheckArrayExist(a)){psHijackBuyProList(g[1],e,e[i],b,"onkeypress");psHijackBuyProList(g[2],e,e[i],b)}}}var f=document.getElementById("ctl00_ContentMain_tblHeaderWithButtons");if(psCheckElementExist(f)){f=f.getElementsByTagName("td")}var d=document.getElementById("ctl00_ContentMain_tblFooterWithButtons");if(psCheckElementExist(d)){d=d.getElementsByTagName("td")
}if(psCheckArrayExist(f)&&psCheckArrayExist(d)){psHijackBuySelected(f[0],e,b);psHijackBuySelected(d[0],e,b)}}}}function psHijackBuySelected(c,e,b,d){c.oldFunc=c.onclick;c.onclick=function a(l){var g=false;var n="select";for(i=0;i<e.length;i++){if(psCheckArrayExist(e[i].cells)&&psIsEqual(psTrim(e[i].cells[0].innerHTML),"Remove")){n="remove"}var h=e[i].getElementsByTagName("input");var m=e[i].cells;if(psCheckArrayExist(h)&&psCheckArrayExist(m)&&m.length>=3){if(h[0].checked||n=="remove"){if(!psCheckArrayExist(d)){var f=m[2].getElementsByTagName("a")
}else{f=m[1].getElementsByTagName("a")}if(psCheckArrayExist(f)){psSetValueToCookie(G_PS_COOKIE_PROD_CATID,psHtmlDecode(psCleanPageId(psTrim(psCleanHtmlTag(f[0].innerHTML)))),b)}g=true}}}if(g&&!psCheckArrayExist(d)){psCreateConversionEventTag("CATALOG ADD",2,"CART ADD",null)}if(this.oldFunc!=null){return this.oldFunc()}}}function psHijackBuyProList(d,e,f,a,c){d.oldFunc=d.onclick;d.onclick=function b(n){var h=true;if(psIsEqual(c,"onkeypress")){var l=window.event?event.keyCode:n.keyCode;h=l==13?true:false}if(h){for(i=0;
i<e.length;i++){var m=e[i].getElementsByTagName("input");var o=e[i].cells;if(psCheckArrayExist(m)&&psCheckArrayExist(o)&&o.length>=3){if(m[0].checked||psIsEqual(e[i].innerHTML,f.innerHTML)){var g=o[2].getElementsByTagName("a");if(psCheckArrayExist(g)){psSetValueToCookie(G_PS_COOKIE_PROD_CATID,psHtmlDecode(psCleanPageId(psTrim(psCleanHtmlTag(g[0].innerHTML)))),a)}}}}}if(this.oldFunc!=null){return this.oldFunc()}}}function psHijackAddToCartOrderDetails(b,e){var d=pOrderBottom=null;if(psCheckArrayExist(e)&&psIsEqual(e,"projectmanager")){var g=document.getElementById("ctl00_ContentMain_pnlCart");
if(psCheckElementExist(g)){var a=g.getElementsByTagName("div");if(psCheckElementExist(a)){for(i=0;i<a.length;i++){if(a[i].innerHTML.search(/ctl00\_ContentMain\_btnOrderProject/gi)>-1){pOrderBottom=a[i]}if(a[i].innerHTML.search(/ctl00\_ContentMain\_btnOrderProjectTop/gi)>-1){d=a[i]}}}}}else{d=document.getElementById("ctl00_ContentMain_pnlReorderTop");pOrderBottom=document.getElementById("ctl00_ContentMain_pnlReorderBottom")}var c=document.getElementById("ctl00_ContentMain_CartGrid_grid");if(psCheckElementExist(d)&&psCheckElementExist(pOrderBottom)&&psCheckElementExist(c)){var f=c.rows;
if(psCheckArrayExist(f)){psHijackBuySelected(d,f,b,"OrderDetail");psHijackBuySelected(pOrderBottom,f,b,"OrderDetail")}}}function psPostProductView(){var f=new psProduct();if(f.getProduct()){psCreateProductviewTag(f.id,f.name,f.catId,f.attribute);var e=f.attribute.substring(f.attribute.indexOf("-_-"),f.attribute.length);psCreatePageviewTag("Product: "+f.name+"("+f.id+")",f.catId,null,null,e);var b=document.getElementById("ctl00_ContentMain_tbl2");if(psCheckElementExist(b)){var d=b.getElementsByTagName("input");
if(psCheckArrayExist(d)&&d.length>=2){psHijackAddToCart(d[0],f.id,f.catId,"onkeypress");psHijackAddToCart(d[1],f.id,f.catId,"onclick")}}}var c=psGetElementsByClassName(document,"table","list");if(psCheckArrayExist(c)){for(i=0;i<c.length;i++){var a=c[i].getElementsByTagName("a");if(psCheckArrayExist(a)&&a.length>=2){psHijackToSetCookie(a[0],"$3","Customers who bought this item also bought");psHijackToSetCookie(a[1],"$3","Customers who bought this item also bought")}}}}function psHijackAddToCartEZBuy(a){var b=document.getElementById("ctl00_ContentMain_tblLines");
if(psCheckElementExist(b)){var c=document.getElementById("ctl00_ContentMain_btnAddToOrder");if(psCheckElementExist(c)){psHijackAddToCartEZ(c,b,a,"onclick")}psHijackAddToCartEZ(b,b,a,"onkeypress")}}function psHijackAddToCart(c,d,a,b){a=psIsEqual(a,"OrderHistory")?"Reorder":a;c.oldFunc=c[b];c[b]=function e(h){var f=true;if(psIsEqual(b,"onkeypress")){var g=window.event?event.keyCode:h.keyCode;f=g==13?true:false}if(f){psSetValueToCookie(G_PS_COOKIE_PROD_CATID,psHtmlDecode(psCleanPageId(d)),a)}if(this.oldFunc!=null){return this.oldFunc()
}}}function psHijackAddToCartEZ(d,c,a,b){d.oldFunc=d[b];d[b]=function e(n){var f=true;if(psIsEqual(b,"onkeypress")){var h=window.event?event.keyCode:n.keyCode;f=h==13?true:false}if(f){var g=c.rows;for(i=0;i<g.length;i++){var l=g[i].innerHTML;if(l.search(/Need\sHelp\sWith\sThis\sForm\?/gi)>-1||l.search(/Mouser\sPart\s\#/gi)>-1||l.search(/Quantity\sis\srequired\./gi)>-1){continue}var m=g[i].getElementsByTagName("input");if(psCheckArrayExist(m)&&m.length>=3){if(psCheckArrayExist(m[0].value)){psSetValueToCookie(G_PS_COOKIE_PROD_CATID,psHtmlDecode(psCleanPageId(m[0].value)),a)
}}}}if(this.oldFunc!=null){return this.oldFunc()}}}function psPostCartView(){window.setInterval(function(){if(psCheckElementExist(pSubmit=document.getElementById("ctl00_ContentMain_btnSubmit"))){if(pSubmit.onclick==null||pSubmit.onclick.toString().indexOf("HijackToSendConversion")<0){pSubmit.oldFunc=pSubmit.onclick;pSubmit.onclick=function l(){if(psCheckElementExist(pContent=document.getElementById("TB_ajaxContent"))){if(psCheckArrayExist(d=pContent.getElementsByTagName("input"))&&psCheckArrayExist(pLabel=pContent.getElementsByTagName("label"))){for(i=0,k=0;
i<d.length;i++){if(psIsEqual(d[i].type,"radio")){k++;if(d[i].checked){psCreateConversionEventTag(psHtmlDecode(unescape(escape(pLabel[k-1].innerHTML).replace(/\%u2122/gi,""))),2,"Packaging",null);break}}}}}if(this.oldFunc!=null){return this.oldFunc()}}}}},1000);var b=document.getElementById("ctl00_ContentMain_UcAccessNumber_lblSavedCartMessage");b=psCheckElementExist(b)?b:document.getElementById("ctl00_ContentMain_UcAccessNumber_lblShareNote");var g="Cart";if(!psCheckElementExist(b)){if(psCheckElementExist(document.getElementById("ctl00_ContentMain_UcAccessNumber_lblThankYou"))){g="Share cart successful"
}else{var f=document.getElementById("ctl00_ContentMain_CartGrid_grid");if(psCheckElementExist(f)){var c=f.rows;for(i=0;i<c.length;i++){if(psIsEqual(c[i].className,"cart")){continue}var e=new psProduct();e.getItem5(c[i])}psHijackToSetCookie(f,"$2","1")}var h=psGetElementsByClassName(document,"table","outerBorder");if(psCheckArrayExist(h)){c=h[0].rows;for(j=0;j<c.length;j++){var d=c[j].getElementsByTagName("input");if(psCheckArrayExist(d)){var a=document.getElementById("ctl00_ContentMain_txtPartNumber");if(psCheckElementExist(a)){d[d.length-1].oldFunc=d[d.length-1].onclick;
d[d.length-1].onclick=function(){psSetValueToCookie(G_PS_COOKIE_PROD_CATID,psHtmlDecode(psCleanPageId(a.value)),"add direct from Cart");if(this.oldFunc!=null){return this.oldFunc()}};c[j].oldFunc=c[j].onkeypress;c[j].onkeypress=function(m){var l=window.event?event.keyCode:m.keyCode;if(l==13){psSetValueToCookie(G_PS_COOKIE_PROD_CATID,psHtmlDecode(psCleanPageId(a.value)),"add direct from Cart");if(this.oldFunc!=null){return this.oldFunc()}}}}break}}}}}else{g=b.innerHTML.search(/(Share\sYour\sCart\swith\sa\sColleague)/gi)>-1?RegExp.$1:"Save Cart"
}}function psSendRegistrationTemp(){var b=psGetCookie(G_PS_COOKIE_PROFILE_TEMP);if(b==null||b==""){return}b=b.split("-_-");if(psCheckArrayExist(b)){for(var a=0;a<b.length;a++){if(b[a]=="null"){b[a]=null}}if(b[0]!=null){psCreateRegistrationTag(b[0],b[0],b[1],b[2],b[3],null,null)}psSetValueToCookie(G_PS_COOKIE_FLAG,"account","");psSetCookie(G_PS_COOKIE_PROFILE_TEMP,"","delete")}}function psSaveNewSubscribeInfo(){var d=psGetElementValueById("ctl00_ContentMain_AddressForm1_txtEmailAddress");if(d==null){d=psGetElementValueById("ctl00_ContentMain_AddressForm1_txtNonRequiredEmailAddress")
}if(d==null||d==""||!psCheckEmail(d)){psSetValueToCookie(G_PS_COOKIE_FLAG,"account","");return}var c=psGetElementValueById("ctl00_ContentMain_AddressForm1_txtCity");if(c==null||c==""){return}var a=psGetElementValueById("ctl00_ContentMain_AddressForm1_ddlState",true);if(a!=null&&a.search(/(SelectState|(\-)+)/gi)>=0){a=""}else{if(a.indexOf(",")>=0){a=a.substr(0,a.indexOf(","))}}var b=psGetElementValueById("ctl00_ContentMain_AddressForm1_txtPostalCode");psSetValueToCookie(G_PS_COOKIE_FLAG,"account","subscribe");
psSetCookie(G_PS_COOKIE_PROFILE_TEMP,d+"-_-"+c+"-_-"+a+"-_-"+b)}function psSaveCheckoutRegister(){uP.SaveCheckoutRegister()?psSetValueToCookie(G_PS_COOKIE_FLAG,"account","register_checkout"):psSetValueToCookie()}function psCheckEditBilling(){var b=psGetElementValueById("ctl00_ContentMain_AddressForm1_txtCity");var a=psGetElementValueById("ctl00_ContentMain_AddressForm1_txtPostalCode");if(b==null||b==""){psSetValueToCookie(G_PS_COOKIE_FLAG,"account","")}else{psSetValueToCookie(G_PS_COOKIE_FLAG,"account","editbill")
}}function psHijackHomeNewestProduct(){var a=document.getElementById("home-newproducts");if(psCheckElementExist(a)){psHijackToSetCookie(a,"$3","The Newest Products")}}function psHijackToSetCookie(c,b,a){c.oldFunc=c.onclick;c.onclick=function d(){psSetValueToCookie(G_PS_COOKIE_FLAG,b,a);if(this.oldFunc!=null){return this.oldFunc()}}}function psHijackLogOutLink(){var b=document.getElementById("account");if(!b){return}var d=b.getElementsByTagName("a");if(psCheckArrayExist(d)){for(var a=0;a<d.length;a++){var c=psTrim(psHtmlDecode(d[a].innerHTML));
if(c!=null&&unescape(c).search(/Log\s+Out/gi)>=0){d[a].Oldf=d[a].onclick;d[a].onclick=function(){psSetValueToCookie(G_PS_COOKIE_FLAG,"account","");psSetCookie(G_PS_COOKIE_PROFILE,"","delete");if(psCheckElementExist(this.Oldf)){return this.Oldf()}}}}}}function psIsUpdateSuccess(){var a=document.getElementById("ctl00_ContentMain_lblContactUpdated");if(psCheckElementExist(a)){a=psTrim(psHtmlDecode(unescape(a.innerHTML)));if(a.search(/Your\s+Contact\s+Information\s+has\s+been\s+successfully\s+updated/gi)>=0){return true
}}return false}function psGetEmailAddress(){uP.readProfile();if(uP.email==null){var a=psGetElementValueById("ctl00_ContentMain_lblDisplayContactEmail");if(a==null){return}uP.email=unescape(a);uP.writeProfile()}}function psIsLogInSuccess(){var c=document.getElementsByTagName("a");if(psCheckArrayExist(c)){for(var a=0;a<c.length;a++){var b=psTrim(psHtmlDecode(c[a].innerHTML));if(b!=null&&unescape(b).search(/Log\s+Out/gi)>=0){return true}}}return false}function psAccExcError(){var a=document.getElementById("ctl00_ContentMain_login_login_divError");
if(!psCheckElementExist(a)){a=document.getElementById("ctl00_ContentMain_divError")}if(psCheckElementExist(a)){return true}return false}function psSaveLogInInfo(){uP.writePrfLogin()?psSetValueToCookie(G_PS_COOKIE_FLAG,"account","login"):psSetValueToCookie(G_PS_COOKIE_FLAG,"account","")}function psSaveSignUpInfo(){uP.writePrfSignUp()?psSetValueToCookie(G_PS_COOKIE_FLAG,"account","register"):psSetValueToCookie(G_PS_COOKIE_FLAG,"account","")}function psSaveUpdateInfo(){psSetValueToCookie(G_PS_COOKIE_FLAG,"account","update")
}function psSaveBillInfo(){uP.SaveBillingInfo()?psSetValueToCookie(G_PS_COOKIE_FLAG,"account","save_bill"):psSetValueToCookie(G_PS_COOKIE_FLAG,"account","")}function psSaveChangedUserName(){var a=psGetElementValueById("ctl00_ContentMain_txtNewUserName");if(a==null||a==""){psSetValueToCookie(G_PS_COOKIE_FLAG,"account","")}else{psSetValueToCookie(G_PS_COOKIE_FLAG,"account","changeuser")}}function psHijackGeneralAcc(b,a){var c=document.getElementById(b);if(!psCheckElementExist(c)){return}c.Oldf=c.onclick;c.onclick=function(){a();
if(psCheckElementExist(this.Oldf)){return this.Oldf()}}}function psPostRegistration(){if(uP.readProfile()){psCreateRegistrationTag(uP.cusId,uP.email,uP.city,uP.state,uP.zipcode,uP.newsletter,uP.subscribe);psSetValueToCookie(G_PS_COOKIE_FLAG,"account","")}}function psPostSetCurrency(){psSetCurrencyCode(psGetCurrency())}function psGetCurrency(){var a=psGetElementValueById("ctl00_Header1_lblCurrencies");a=psCheckArrayExist(a)?a:psGetElementValueById("ctl00_NavHeader_lblCurrencies");a=psCheckArrayExist(a)?a:psGetElementValueById("ctl00_NavHeader_ddlCurrencies");
a=psCheckArrayExist(a)?a:psGetElementValueById("ctl00_Header1_ddlCurrencies");return psCheckArrayExist(a)?a:""}function psGetPrefix(b){var a=psGetDomain(G_PS_URL_PATH).split(".")[0];a=psIsEqual(a,"www")?"US":a.toUpperCase();a=psIsEqual(a,"mouser")?"US":a.toUpperCase();a=psIsEqual(a,"gb")?"UK":a.toUpperCase();a=psGetMainDomain(G_PS_URL_PATH).search(/mouser\.cn/gi)<0?a:"RMB";a=psGetMainDomain(G_PS_URL_PATH).search(/mouserlan\.cn/gi)<0?a:"RMB";a=psGetMainDomain(G_PS_URL_PATH).search(/mouserebiz\.cn/gi)<0?a:"RMB";
return psCheckArrayExist(b)?a:a+":"}function psHijackToSendConversion(c,d,a,b){if(c.onclick==null||c.onclick.toString().indexOf("HijackToSendConversion")<0){c.oldFunc=c.onclick;c.onclick=function e(){if(psCheckArrayExist(b)&&!b){psCreateConversionEventTag(d,2,a,null)}else{psSetValueToCookie(G_PS_COOKIE_FLAG,"$conversion",d+"-_-"+a)}if(this.oldFunc!=null){return this.oldFunc()}}}}function psHijackToSendConversion_byElementID(c,b,a){if(psCheckElementExist(pElement=document.getElementById(c))){psHijackToSendConversion(pElement,b,a)
}}function psProduct(){this.id=null;this.name=null;this.catId=null;this.price=null;this.quantity=null;this.attribute=null;this.reset=function(){this.id=null;this.name=null;this.catId=null;this.price=null;this.quantity=null;this.attribute=null};this.getProduct=function(){try{this.reset();var c=$("#product-desc>table tr:nth(0)>td:nth(1)").text().trim();var a=$("#product-desc>table tr:nth(3)>td:nth(1)").text().trim();if(c!=""&&a!=""){this.id=c;this.name=a}this.catId=psCheckArrayExist(pCatId=psGetValueFromBreadCrumb("productCatLink"))?pCatId.toUpperCase():pCatId;
if(psCheckArrayExist(G_PS_URL_REFERRER)){if(psCheckArrayExist(psGetValueFromCookie(G_PS_COOKIE_FLAG,"$3"))){this.catId=psGetValueFromCookie(G_PS_COOKIE_FLAG,"$3")}else{if(psCheckArrayExist(psGetValueFromCookie(G_PS_COOKIE_FLAG,"$2"))){this.catId=(this.catId=psGetValueFromCookie(G_PS_COOKIE_PROD_CATID,this.id))=="search:pd"?"SEARCH:PD":this.catId}else{if(psCheckArrayExist(psGetValueFromCookie(G_PS_COOKIE_FLAG,"$1"))){this.catId=psGetValueFromCookie(G_PS_COOKIE_FLAG,"$1")}}}}this.catId=!psCheckArrayExist(this.catId)?"UNKNOWN":this.catId=="search"?"SEARCH:PD":this.catId;
this.attribute=psGetManuFactAttForPrd()+"-_--_--_--_--_-"+psGetPrefix("att");return true}catch(b){return false}};this.getItem5=function(c){try{this.reset();this.id=psGetEleByTagName_Id(c,"a","lnkMouserPartNumber");if(this.id!=null){this.id=psTrim(unescape(psHtmlDecode(this.id.innerHTML)))}var a=psGetEleByTagName_Id(c,"a","lnkManufacturerPartNumber");a=psTrim(unescape(psHtmlDecode(psCleanProductName(a.innerHTML))));var d=document.getElementById("ctl00_ContentMain_lblErrorEzBtn");if(!psCheckElementExist(d)){this.catId=psGetValueFromCookie(G_PS_COOKIE_PROD_CATID,psHtmlDecode(psCleanPageId(this.id)));
if(this.catId==null){this.catId=psGetValueFromCookie(G_PS_COOKIE_PROD_CATID,psHtmlDecode(psCleanPageId(a)))}}if(this.catId==null){this.catId=psGetValueFromCookie(G_PS_COOKIE_PROD_CATID,psHtmlDecode(psCleanPageId(this.id)))}if(this.catId==null&&G_PS_PATHNAME.search(/\/Cart\/Cart\.aspx/gi)>=0&&psGetValueFromCookie(G_PS_COOKIE_FLAG,"bom")=="true"){this.catId="BOM";psSetValueToCookie(G_PS_COOKIE_PROD_CATID,this.id,"BOM")}if(this.catId==null||this.catId==""){this.catId="Unknown"}if(psCheckArrayExist(psGetEleByTagName_Id(c,"span","lblQuoteNumber"))){this.catId="QUOTE"
}psSetValueToCookie(G_PS_COOKIE_PROD_CATID,psHtmlDecode(psCleanPageId(this.id)),this.catId);return true}catch(b){return false}}}function psProfile(){this.cusId=null;this.email=null;this.city=null;this.state=null;this.zipcode=null;this.newsletter=null;this.subscribe=null;this.temp=null;this.reset=function(){this.cusId=null;this.email=null;this.city=null;this.state=null;this.zipcode=null;this.newsletter=null;this.subscribe=null;this.temp=null};this.readProfile=function(){try{this.cusId=psGetCookie(G_PS_COOKIE_PROFILE);
if(this.cusId!=null){var b=this.cusId.split("|");for(var d=0;d<b.length;d++){var a=b[d];b[d]=(a=="null"?null:a)}this.cusId=b[0];this.email=b[1];this.city=b[2];this.state=b[3];this.zipcode=b[4];this.newsletter=b[5];this.subscribe=b[6];this.temp=b[7]}if(!this.cusId){this.cusId=psGenerateRandomValue()}return true}catch(c){return false}};this.writeProfile=function(){try{if(this.cusId==null){return}var b=this.cusId+"|"+this.email+"|"+this.city+"|"+this.state+"|"+this.zipcode+"|"+this.newsletter+"|"+this.subscribe+"|"+this.temp;
psSetCookie(G_PS_COOKIE_PROFILE,b);return true}catch(a){return false}};this.updateProfile=function(){try{this.readProfile();if(this.temp!=null&&this.temp!="null"&&this.temp!=""){var c=this.temp.split("-_-");if(psCheckArrayExist(c)){for(var b=0;b<c.length;b++){c[b]=(c[b]=="null"?null:c[b])}this.cusId=c[0];this.email=c[1];this.city=c[2];this.state=c[3];this.zipcode=c[4];this.temp=null;return this.writeProfile()}}}catch(a){return false}};this.writePrfLogin=function(){try{this.reset();var b=psGetElementValueById("ctl00_ContentMain_login_login_UserName");
if(b==null){b=psGetElementValueById("ctl00_ContentMain_MyMouserLogin1_login_UserName")}if(b==null){b=psGetElementValueById("ctl00_ContentMain_OrderHistoryLogin_login_UserName")}if(b==null){return false}b=psTrim(unescape(b));this.cusId=b;return this.writeProfile()}catch(a){return false}};this.writePrfSignUp=function(){try{this.readProfile();var c=psGetElementValueById("ctl00_ContentMain_txtUserName");var b=psGetElementValueById("ctl00_ContentMain_txtConfirmEMail");if(c==null||b==null){return false}c=psTrim(unescape(c));
b=psTrim(unescape(b));this.temp=c+"-_-"+b+"-_-"+this.city+"-_-"+this.state+"-_-"+this.zipcode;return this.writeProfile()}catch(a){return false}};this.writePrfUpdate=function(){try{this.readProfile();var a=psGetElementValueById("ctl00_ContentMain_lblDisplayContactEmail");if(a==null){return false}this.email=psTrim(unescape(a));return this.writeProfile()}catch(b){return false}};this.SaveBillingInfo=function(){try{this.readProfile();var a=psGetElementValueById("ctl00_ContentMain_AddressForm_txtConfirmEmail");var e=psGetElementValueById("ctl00_ContentMain_AddressForm_txtCity");
var b=psGetElementValueById("ctl00_ContentMain_AddressForm_ddlState",true);var d=psGetElementValueById("ctl00_ContentMain_AddressForm_txtPostalCode");if(a==null||e==null||b==null||d==null){return false}if(b.search(/(SelectState|(\-)+)/gi)>=0){b=""}else{if(b.indexOf(",")>=0){b=b.substr(0,b.indexOf(","))}}if(!psIsLogInSuccess()){this.cusId=a}this.temp=this.cusId+"-_-"+a+"-_-"+e+"-_-"+b+"-_-"+d;return this.writeProfile()}catch(c){return false}};this.SaveChangedUser=function(){try{this.readProfile();var b=psGetElementValueById("ctl00_ContentMain_lblDisplayUserName");
if(b==null){return false}this.cusId=unescape(b);return this.writeProfile()}catch(a){return false}};this.SaveEditBilling=function(){try{this.readProfile();var d=psGetElementValueById("ctl00_ContentMain_lblDisplayCity");var c=psGetElementValueById("ctl00_ContentMain_lblDisplayPostalCode");if(d==null){return false}var a=psGetElementValueById("ctl00_ContentMain_lblState");this.state=null;if(psCheckElementExist(a)){if(a.search(/state/gi)>=0){a=psGetElementValueById("ctl00_ContentMain_lblDisplayState");if(a!=null){this.state=a
}}}this.city=d;this.zipcode=c;return this.writeProfile()}catch(b){return false}};this.SaveLastBillingInfo=function(){try{this.readProfile();var b=psGetElementValueById("ctl00_ContentMain_billingAddressDisplay_lblCityState");if(b==null){return false}b=psTrim(psHtmlDecode(unescape(b)));if(b.indexOf(",")>=0){this.city=psTrim(b.substr(0,b.indexOf(",")));this.state=psTrim(b.substr(b.indexOf(",")+1,b.length-1));var c=document.getElementById("ctl00_ContentMain_billingAddressDisplay_lblPostalCode");if(psCheckElementExist(c)){this.zipcode=psGetElementValueById("ctl00_ContentMain_billingAddressDisplay_lblPostalCode");
this.state=null}else{this.zipcode=psTrim(this.state.substr(this.state.lastIndexOf(" ")+1,this.state.length-1));this.state=psTrim(this.state.substr(0,this.state.lastIndexOf(" ")))}}else{this.city=b;this.state=null;this.zipcode=psGetElementValueById("ctl00_ContentMain_billingAddressDisplay_lblPostalCode")}return this.writeProfile()}catch(a){return false}};this.SaveCheckoutRegister=function(){try{this.readProfile();var b=psGetElementValueById("ctl00_ContentMain_txtUserName");if(b==null){return false}this.temp=psTrim(unescape(psHtmlDecode(b)))+"-_-"+this.email+"-_-"+this.city+"-_-"+this.state+"-_-"+this.zipcode;
return this.writeProfile()}catch(a){return false}}}function psIsEqual(){for(var a=0;a<arguments.length;a++){if(arguments[0]==null||arguments[a]==null){return false}else{if(arguments[0].toUpperCase()!=arguments[a].toUpperCase()){return false}}}return true}function psCleanCatId(a){return(a!=null)?a.replace(/[\'\":,\�\�\!\%\?]/g,""):null}function psCleanPageId(a){return(a!=null)?a.replace(/[\n\t\v\r\�\'\"\�\�\!\%\?]/gi,""):null}function psCleanProductName(a){return(a!=null)?a.replace(/[\n\t\v\r\�\'\"\�\�\!\%\@\?]/gi,""):null
}function psTrim(a){if(a==null||typeof(a)!="string"){return a}return(a!=null)?a.replace(/&nbsp;|\u00A0/gi," ").replace(/^\s+|\s+$/g,""):null}function psGetValueFromUrl(c,d){c=(c!=null)?"?"+psTrim(c.toLowerCase()):null;d=(d!=null)?psTrim(d.toLowerCase()):null;if(c==null||d==null||c.indexOf(d)==-1){return null}var e=c.indexOf("&"+d+"=");e=(e==-1)?c.indexOf("?"+d+"="):e;if(e>=0){e=e+d.length;var a=c.indexOf("&",e);if(a==-1){a=c.length}var b=c.indexOf("=",e);return c.substring(b+1,a)}return null}function psGetElementValueById(b,c){var a=document.getElementById(b);
return psGetElementValue(a,c)}function psGetElementValue(a,c){var b=null;if(a!=null){if(a.tagName.search(/^INPUT$/i)>-1){b=a.value}else{if(a.tagName.search(/^SELECT$/i)>-1){if(c==true){b=a.options[a.selectedIndex].value}else{b=psHtmlDecode(a.options[a.selectedIndex].innerHTML)}}else{b=psHtmlDecode(a.innerHTML)}}}return b}function psCheckEmail(b){if(b){var a=b.search(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/);return(a>-1)}return false}function psHtmlDecode(a){if(a){a=a.replace(/&nbsp;/gi," ");
a=a.replace(/&quot;/gi,'"');a=a.replace(/&amp;/gi,"&");a=a.replace(/&lt;/gi,"<");a=a.replace(/&gt;/gi,">")}return a}function psGetMainDomain(b){var d=/^https*\:\/\/([^\/\:]+)/gi;var c=(b.search(d)>-1)?RegExp.$1:null;if(c!=null){if(c.indexOf("www")==0){c=c.substring(4,c.length)}if(G_PS_ARR_DOMAIN!=null){for(var a=0;a<G_PS_ARR_DOMAIN.length;a++){d=new RegExp("[.]"+G_PS_ARR_DOMAIN[a]+"$","gi");if(("."+c).search(d)>-1){c=G_PS_ARR_DOMAIN[a];break}}}c="."+c}return c}function psGetDomain(a){var b=/^https*\:\/\/([^\/\:]+)/gi;
return(a.search(b)>-1)?RegExp.$1:null}function psCleanPrice(a){var b=psGetCurrency();for(var c in pCurrencyArray){if(pCurrencyArray[c].indexOf(b)>-1){a=a.replace(/\./g,"").replace(/\,/g,".");break}}var d=/[^0-9\.]/gi;return(a!=null?a.toString().replace(d,""):null)}function psGetCookie(c){var d=document.cookie;if(!c||!d){return null}d="; "+d.toLowerCase();var b="; "+c.toLowerCase()+"=";var e=d.lastIndexOf(b);if(e>=0){e=e+b.length;var a=d.indexOf(";",e);if(a==-1){a=d.length}return unescape(d.substring(e,a))}return null
}function psCookieBase(d,a,e){var c=psGetMainDomain(G_PS_URL_PATH);CC(d,c);if(e=="delete"){return true}var b=(e)?(new Date((new Date()).getTime()+(1000*e))).toGMTString():null;return CB(d,escape(a),b,c)}function encodeHtml(a){if(a!=null){a=escape(a);a=a.replace(/\//g,"%2F");a=a.replace(/\?/g,"%3F");a=a.replace(/=/g,"%3D");a=a.replace(/&/g,"%26");a=a.replace(/@/g,"%40")}return a}function decodeHtml(a){if(a!=null){a=a.replace(/\%2F/gi,"/");a=a.replace(/\%3F/gi,"?");a=a.replace(/\%3D/gi,"=");a=a.replace(/\%26/gi,"&");
a=a.replace(/\%40/gi,"@");a=a.replace(/\%20/gi," ")}return a}function psSetCookie(c,a,e){if(!c){return false}a=(a==null)?"null":a;if(e!="delete"){c=psTrim(c);var d=psGetCookie(c);d=(d==null)?"null":d;var b;if(document.cookie.indexOf(c)>-1){b=document.cookie.length+encodeHtml(a).length-encodeHtml(d).length}else{b=document.cookie.length+encodeHtml(a).length+encodeHtml(c).length}if(b>3500){return false}}psCookieBase(c,a,e)}function psSetValueToCookie(c,m,q){if(!c||!m){return false}c=psTrim(c);m=(m!=null)?"#"+psTrim(m).toLowerCase()+"~":m;
var l=psGetCookie(c);l=(l==null)?"":l;q=(q==null)?"null":q;var n=l;var b=l.indexOf(m);var g;if(b>=0){var a=psGetValueFromCookie(c,m.replace(/[\~\#]/gi,""));a=(a==null)?"null":a;var f=l.indexOf("#",b+m.length);if(f==-1){f=l.length}l=l.replace(l.substring(b,f),"");g=document.cookie.length+encodeHtml(m).length+encodeHtml(q).length-encodeHtml(a).length}else{g=document.cookie.length+encodeHtml(m).length+encodeHtml(q).length;if(document.cookie.indexOf(c)<0){g+=encodeHtml(c).length}}l=m+q+l;var o=null;var h=0;while(g>3500&&h<1000){var e=encodeHtml(l).length;
o=l.split("#");o.pop();l=o.join("#");var d=encodeHtml(l).length;g-=(e-d);h++}if(l==null||l==""){l=n}psCookieBase(c,l,G_PS_COOKIE_LIFETIME)}function psGetValueFromCookie(b,c){b=psTrim(b);c=(c!=null)?"#"+psTrim(c).toLowerCase()+"~":c;var d=psGetCookie(b);if(d!=null){var e=d.indexOf(c);if(e>=0){e=e+c.length;var a=d.indexOf("#",e);if(a==-1){a=d.length}return d.substring(e,a)}return null}return null}function psGenerateRandomValue(){var a=new Date();var b=(a.getTime()%10000000)+(Math.floor(Math.random()*10000));return b
}function psShorttenPageID(a){var b=a;if(b!=null){b=(b.length>255)?b.substr(0,255):b}return b}function psCheckArrayExist(a){return(typeof(a)=="undefined"||a==null||a.length<=0)?false:true}function psCheckElementExist(a){return(typeof(a)=="undefined"||a==null)?false:true}function psGetElementsByClassName(d,a,g){var c=new Array();var b=0;var f=d.getElementsByTagName(a);if(f==null){return null}for(var e=0;e<f.length;e++){if(f[e].className.toLowerCase()==g.toLowerCase()){c[b++]=f[e]}}return c}function psGetValueFromBreadCrumb(a){if(typeof(a)!="string"||(!psIsEqual(a,"last")&&!psIsEqual(a,"2last")&&!psIsEqual(a,"nextlast")&&!psIsEqual(a,"attribute")&&!psIsEqual(a,"productCatLink"))){return null
}var d=psGetElementsByClassName(document,"div","breadcrumb");d=psCheckArrayExist(d)?d[0]:document.getElementById("breadcrumb");d=psCheckElementExist(d)?d:document.getElementById("content-fixed-width");if(psCheckElementExist(d)){d=d.innerHTML;d=d.split(/\<hr\/?\>/gi)[0];d=d.split(/\<br\/?\>/gi);d=d[d.length-1];if(psIsEqual(a,"productCatLink")){d=escape(d).split(/%BB/i);if(d.length>1&&unescape(d[d.length-2]).search(/href\s*\=\s*.+\_\/N\-([^\/]+)\//gi)>-1){return RegExp.$1}}else{d=escape(psCleanHtmlTag(d));d=d.split(/%BB/i);
if(d[d.length-1].search(/^\s*(\%0A|\%20)*\s*$/gi)>-1){d.pop()}if(psIsEqual(a,"last")){return psTrim(psCleanPageId(unescape(d[d.length-1])))}if(psIsEqual(a,"2last")){if(d.length>=2){d=psTrim(psCleanPageId(unescape(d[d.length-2])))+unescape("%20%BB%20")+psTrim(psCleanPageId(unescape(d[d.length-1])))}else{d=psTrim(psCleanPageId(unescape(d[d.length-1])))}return d}if(psIsEqual(a,"nextlast")&&d.length>=2){return psTrim(psCleanPageId(unescape(d[d.length-2])))}if(psIsEqual(a,"attribute")){var g="";for(i=0;i<d.length-1;
i++){if(unescape(d[i]).search(/All\s*Suppliers/gi)>-1){g=d[i+1]}}var h=document.getElementById("pkc_tags");if(psCheckElementExist(h)){var c=psGetElementsByClassName(h,"li","supplier");c=psCheckArrayExist(c)?psTrim(psHtmlDecode(unescape(c[0].innerHTML))):"";var e=psGetElementsByClassName(h,"li","application");e=psCheckArrayExist(e)?psTrim(psHtmlDecode(unescape(e[0].innerHTML))):"";var b=psGetElementsByClassName(h,"li","category");b=psCheckArrayExist(b)?psTrim(psHtmlDecode(unescape(b[0].innerHTML))):"";var f=psGetValueFromBreadCrumb("last");
g+="-_-"+c+"-_-"+e+"-_-"+b+"-_-"+f}return g}}}else{if(psIsEqual(a,"attribute")&&psCheckElementExist(h=document.getElementById("pkc_tags"))){var c=psGetElementsByClassName(h,"li","supplier");c=psCheckArrayExist(c)?psTrim(psHtmlDecode(unescape(c[0].innerHTML))):"";var e=psGetElementsByClassName(h,"li","application");e=psCheckArrayExist(e)?psTrim(psHtmlDecode(unescape(e[0].innerHTML))):"";var b=psGetElementsByClassName(h,"li","category");b=psCheckArrayExist(b)?psTrim(psHtmlDecode(unescape(b[0].innerHTML))):"";var f=psTrim(psHtmlDecode(unescape(document.title)));
return"-_-"+c+"-_-"+e+"-_-"+b+"-_-"+f}}return null}function psHijackQuoteToProductView(a){a.oldFunc=a.onclick;a.onclick=function(){psSetValueToCookie(G_PS_COOKIE_FLAG,"$3","QUOTE");if(this.oldFunc!=null){return this.oldFunc()}}}function psCleanHtmlTag(a){return(typeof(a)=="string")?a.replace(/\<+.+?\>+/g,""):null}function psGetEleByTagName_Id(c,b,f){var a=c.getElementsByTagName(b);if(psCheckArrayExist(a)){for(var e=0;e<a.length;e++){var d=a[e].id;if(d!=null&&d.search(f)>=0){return a[e]}}}return null}function psGetManuFactAttForPrd(){return psCheckElementExist(pManu=document.getElementById("ctl00_ContentMain_hlnk10"))?psTrim(psHtmlDecode(unescape(pManu.innerHTML))):null
}function psGetManuFactAttForShop5(a){return psGetInnerText(a).replace(/\s+/gi," ").search(/Manufacturer\:\s*(.*)\s*Desc\.\:/gi)>=0?psTrim(psHtmlDecode(unescape(RegExp.$1))):null}function psGetInnerText(c){var b=/<script[\s\S]*?<\/script>/gi;if(c!=null){var a=(typeof(c)=="object")?c.innerHTML:c;while(a.search(b)>-1){a=a.replace(b,"")}return a.replace(/\<+.+?\>+/g,"")}return null}function psHijackAddBom(){var a=document.getElementById("ctl00_ContentMain_btnSubmit");if(!psCheckElementExist(a)){return}a.psOldFunc=a.onmousedown;
a.onmousedown=function(){psSetValueToCookie(G_PS_COOKIE_FLAG,"bom","true");if(psCheckElementExist(this.psOldFunc)){return this.psOldFunc()}}}function psHijackAddCompare(){var b=document.getElementById("productComparePlaceHolder");if(psCheckElementExist(b)){var o=-1,l=-1,q=-1,f=b.rows;if(psCheckArrayExist(f)){for(var g=0;g<f.length;g++){var s=psGetInnerText(f[g]);if(s.search(/(Check|Select)\s*All\:/gi)>=0){o=g}else{if(s.search(/Mouser\s*Part\s*(\#|No)\:/gi)>=0){l=g}else{if(s.replace(/\s+/g," ").search(/Buy\:(.*)Qty\:/gi)>=0){q=g
}}}}}if(o<0||l<0||q<0||!psCheckArrayExist(f[o].cells)||f[o].cells.length<2){return}var h=document.getElementById("ctl00_ContentMain_AddToCartTopButton");var d=document.getElementById("ctl00_ContentMain_AddToCartBottomButton");if(psCheckElementExist(h)&&psCheckElementExist(d)){h.psOldFunc=h.onclick;d.psOldFunc=d.onclick;h.onclick=d.onclick=function(){try{for(var n=1;n<f[o].cells.length;n++){var x=f[o].cells[n].getElementsByTagName("input");if(psCheckArrayExist(x)&&x[0].checked){var w=psTrim(psHtmlDecode(unescape(psGetInnerText(f[l].cells[n]))));
psSetValueToCookie(G_PS_COOKIE_PROD_CATID,w,"COMPARE")}}}catch(v){}if(psCheckElementExist(this.psOldFunc)){return this.psOldFunc()}}}for(var c=1;c<f[q].cells.length;c++){var a=f[q].cells[c].getElementsByTagName("input");if(psCheckArrayExist(a)&&a[0].innerHTML!=""){a[0].index=c;a[0].psOldFunc=a[0].onkeypress;a[0].onkeypress=function(y){try{var w=window.event?event.keyCode:y.keyCode;if(w==13){var v=f[o].cells[this.index].getElementsByTagName("input");if(psCheckArrayExist(v)&&v[0].checked){var x=psTrim(psHtmlDecode(unescape(psGetInnerText(f[l].cells[this.index]))));
psSetValueToCookie(G_PS_COOKIE_PROD_CATID,x,"COMPARE")}}}catch(n){}if(psCheckElementExist(this.psOldFunc)){return this.psOldFunc()}}}var e=f[l].cells[c].getElementsByTagName("a");var m=f[l+1].cells[c].getElementsByTagName("a");if(psCheckArrayExist(e)&&psCheckArrayExist(m)){for(var u=0;u<e.length;u++){e[u].psOldFunc=e[u].onclick;m[u].psOldFunc=m[u].onclick;e[u].onclick=m[u].onclick=function(){psSetValueToCookie(G_PS_COOKIE_FLAG,"$3","COMPARE");if(psCheckElementExist(this.psOldFunc)){return this.psOldFunc()}}}}}}}function psInsertAtt(c,a,b){c=(psCheckArrayExist(c)?c:"").split("-_-");
pAtt="";pAttLength=a<=c.length?c.length:a;for(i=0;i<pAttLength;i++){if(i!=0){pAtt+="-_-"}if(i!=a-1){pAtt+=(psCheckArrayExist(c[i])?c[i]:"")}else{pAtt+=(psCheckArrayExist(b)?b:"")}}return pAtt}function psAddMoreAttr_v7(a){if(psCheckElementExist(pUl=document.getElementById("cmsupplier_tags"))){if(psCheckArrayExist(pLi=psGetElementsByClassName(pUl,"li","supplier"))){a+="-_-"+pLi[0].innerHTML}else{a+="-_-"}a+="-_-SUPPLIER MICROSITE"}else{if(psCheckElementExist(pUl=document.getElementById("pkc_tags"))){if(psCheckArrayExist(pLi=psGetElementsByClassName(pUl,"li","supplier"))){a+="-_-"+pLi[0].innerHTML
}else{a+="-_-"}a+="-_-PKC"}else{if(psIsProductView()){if(psCheckElementExist(pProDesc=document.getElementById("product-desc"))&&psCheckArrayExist(pH2=pProDesc.getElementsByTagName("H2"))){a+="-_-"+pH2[0].innerHTML}else{a+="-_-"}a+="-_-PRODUCT DETAIL"}}}return psTrim(psCleanPageId(psCleanHtmlTag(psHtmlDecode(unescape(a)))))}function psCreatePageviewTag(c,a,d,b,e){c=psCleanPageId(c);c=psShorttenPageID(c);a=(a!="SEARCH:PD"?psCleanCatId(a):a);e=psCleanPageId(e);e=psInsertAtt(e,6,psGetPrefix("att"));e=psAddMoreAttr_v7(e);
if(b!=null){b+=""}if(G_PS_DEBUG_MODE==1||G_PS_DEBUG_MODE==3){alert("cmCreatePageviewTag("+psHtmlDecode(c)+", "+psHtmlDecode(a)+", "+psHtmlDecode(d)+", "+b+", "+e+")")}if(G_PS_DEBUG_MODE==2||G_PS_DEBUG_MODE==3){cmCreatePageviewTag(psHtmlDecode(c),psHtmlDecode(a),psHtmlDecode(d),b,e)}}function psCreateProductviewTag(d,b,a,c){b=psCleanProductName(b);a=(a!="SEARCH:PD"?psCleanCatId(a):a);if(G_PS_DEBUG_MODE==1||G_PS_DEBUG_MODE==3){alert("cmCreateProductviewTag("+psHtmlDecode(d)+", "+psHtmlDecode(b)+", "+psHtmlDecode(a)+", "+c+")")
}if(G_PS_DEBUG_MODE==2||G_PS_DEBUG_MODE==3){cmCreateProductviewTag(psHtmlDecode(d),psHtmlDecode(b),psHtmlDecode(a),c)}}function psCreateShopAction5Tag(e,c,f,b,a,d){c=psCleanProductName(c);a=(a!="search:pd"?psCleanCatId(a):a);if(G_PS_DEBUG_MODE==1||G_PS_DEBUG_MODE==3){alert("cmCreateShopAction5Tag("+psHtmlDecode(e)+", "+psHtmlDecode(c)+", "+f+", "+b+", "+psHtmlDecode(a)+", "+d+")")}if(G_PS_DEBUG_MODE==2||G_PS_DEBUG_MODE==3){cmCreateShopAction5Tag(psHtmlDecode(e),psHtmlDecode(c),f,b,psHtmlDecode(a),d)}}function psCreateShopAction9Tag(c,f,b,e,d,a,h,g,l){f=psCleanProductName(f);
g=(g!="search:pd"?psCleanCatId(g):g);if(G_PS_DEBUG_MODE==1||G_PS_DEBUG_MODE==3){alert("cmCreateShopAction9Tag("+psHtmlDecode(c)+", "+psHtmlDecode(f)+", "+b+", "+e+", "+psHtmlDecode(d)+", "+psHtmlDecode(a)+", "+h+", "+psHtmlDecode(g)+", "+l+")")}if(G_PS_DEBUG_MODE==2||G_PS_DEBUG_MODE==3){cmCreateShopAction9Tag(psHtmlDecode(c),psHtmlDecode(f),b,e,psHtmlDecode(d),psHtmlDecode(a),h,psHtmlDecode(g),l)}}function psCreateOrderTag(e,a,c,g,b,f,d){if(G_PS_DEBUG_MODE==1||G_PS_DEBUG_MODE==3){alert("cmCreateOrderTag("+psHtmlDecode(e)+", "+a+", "+c+", "+psHtmlDecode(g)+", "+psHtmlDecode(b)+", "+psHtmlDecode(f)+", "+psHtmlDecode(d)+")")
}if(G_PS_DEBUG_MODE==2||G_PS_DEBUG_MODE==3){cmCreateOrderTag(psHtmlDecode(e),a,c,psHtmlDecode(g),psHtmlDecode(b),psHtmlDecode(f),psHtmlDecode(d))}}function psCreateConversionEventTag(b,d,c,a){b=b;c=psCleanCatId(c);if(G_PS_DEBUG_MODE==1||G_PS_DEBUG_MODE==3){alert("cmCreateConversionEventTag("+psHtmlDecode(b)+", "+d+", "+psHtmlDecode(c)+", "+a+")")}if(G_PS_DEBUG_MODE==2||G_PS_DEBUG_MODE==3){cmCreateConversionEventTag(psHtmlDecode(b),d,psHtmlDecode(c),a)}}function psCreateRegistrationTag(g,a,c,f,e,d,b){if(G_PS_DEBUG_MODE==1||G_PS_DEBUG_MODE==3){alert("cmCreateRegistrationTag("+psHtmlDecode(g)+", "+psHtmlDecode(a)+", "+psHtmlDecode(c)+", "+psHtmlDecode(f)+", "+psHtmlDecode(e)+", "+psHtmlDecode(d)+", "+psHtmlDecode(b)+")")
}if(G_PS_DEBUG_MODE==2||G_PS_DEBUG_MODE==3){cmCreateRegistrationTag(psHtmlDecode(g),psHtmlDecode(a),psHtmlDecode(c),psHtmlDecode(f),psHtmlDecode(e),psHtmlDecode(d),psHtmlDecode(b))}}function psDisplayShop5s(){if(G_PS_DEBUG_MODE==1||G_PS_DEBUG_MODE==3){alert("cmDisplayShop5s()")}if(G_PS_DEBUG_MODE==2||G_PS_DEBUG_MODE==3){cmDisplayShop5s()}}function psDisplayShop9s(){if(G_PS_DEBUG_MODE==1||G_PS_DEBUG_MODE==3){alert("cmDisplayShop9s()")}if(G_PS_DEBUG_MODE==2||G_PS_DEBUG_MODE==3){cmDisplayShop9s()}}function psSetCurrencyCode(a){if(G_PS_DEBUG_MODE==1||G_PS_DEBUG_MODE==3){alert("cmSetCurrencyCode("+a+")")
}if(G_PS_DEBUG_MODE==2||G_PS_DEBUG_MODE==3){cmSetCurrencyCode(a)}};
