/* UI BUILD: Tuesday, Feb  4 2014 at  7:54:53 PM -- BUILD ID: BRANCH_NAME: release VERSION: 14.05.92 */
/* MD5: 745d5899c86cb1fa1f7d7c0ddeddfb14 */

var BBYAdSense,TaxonomyTag=function(){};TaxonomyTag.getPageName=function(){var e,t;return track.uberCatName&&(e=track.uberCatName),track.parentCatName&&(""!==e?e+=" "+track.parentCatName:e=track.parentCatName),t=track.catId||track.catName,t&&(""!==e?e+=" "+t:e=t),e},TaxonomyTag.encode=function(e){var t=e||"";return t=t.toLowerCase(),t=t.replace(/&/g,"x"),t=t.replace(/%26/g,"x"),t=t.replace(/ /g,"_"),t=t.replace(/%20/g,"_"),t=t.replace(/,/g,""),t=t.replace(/%2C/g,""),t=t.replace(/:/g,""),t=t.replace(/%3A/g,""),t=t.replace(/:/g,""),t=t.replace(/%3B/g,""),t=t.replace(/[^a-zA-z0-9\s&-]/g,"")},TaxonomyTag.getEncodedPageName=function(){var e,t=TaxonomyTag.getPageName();return t&&(e=TaxonomyTag.encode(t)),e},BBYAdSense=function(){var e,t=this;this._adUnitWide,this._contentWide,this._isSpanish,this._inDevelopMode,this._pageOptions,this._contentWide="<div id='gAdUnitWideAds'></div>",this._inDevelopMode=!1,this._isSpanish=!1,this._adUnitNarrow={container:"gAdUnitNarrowAds",number:3,width:"168px",titleBold:!0,colorDomainLink:"#004691",colorTitleLink:"#004691",sellerRatings:!0,adLoadedCallback:function(e,a){var s,n="#gAdUnitNarrow";if(a){s="completed";try{t.displayAdUnit(n)}catch(i){s="failed with "+i.message}}}},this._adUnitWide={container:"gAdUnitWideAds",number:4,colorBorder:"#C3C4C",colorDomainLink:"#004691",colorTitleLink:"#004691",longerHeadlines:!0,sellerRatings:!0,adLoadedCallback:function(e,a){var s,n="#gAdUnitWide";if(a){s="completed";try{t.displayAdUnit(n)}catch(i){s="failed with "+i.message}}}},this._pageOptions={adtest:"on",channel:"",domainLinkAboveDescription:!0,hl:"en",linkTarget:"_blank",oe:"ISO-8859-1",pubId:"",query:"",siteLinks:!0},"undefined"!=typeof imgServer&&null!==imgServer&&(e=imgServer.indexOf("espanol")>-1,e&&(this._isSpanish=e,this._pageOptions.hl="es")),this.loadAd()},BBYAdSense.doLog=!0,BBYAdSense.log=function(e,t,a){var s="";BBYAdSense.doLog&&"undefined"!=typeof console&&null!==console&&("undefined"!=typeof e&&null!==e&&0!==e.length&&(s+=e),"undefined"!=typeof t&&null!==t&&0!==t.length&&(s+="."+t),s+=": ["+(new Date).getTime()+"] ","undefined"!=typeof a&&null!==a&&0!==a.length&&(s+=a))},BBYAdSense.google_msg=function(){return errorpop.show('<a class="closePop" href="javascript:errorpop.hide()"><span>close</span></a><h3>Ads by Google</h3><p>The links below are sponsored links that are administered, sorted, and maintained by Google. Companies pay to have these links appear when particular keywords and phrases are searched. These Ads by Google are always clearly labeled.</p><p>Clicking on any of the sponsored links will take you away from BestBuy.com to an external Web site hosted and operated by its respective owner. Different terms and conditions will apply. Please consult each site&#39;s Privacy Policy. The Web site you link to is not endorsed by, nor affiliated with, Best Buy or BestBuy.com.</p>'),!1},BBYAdSense.prototype.displayAdUnit=function(e){$(e),$(e).removeClass("gAdUnitHidden")},BBYAdSense.prototype.getContentNarrow=function(){var e=['<div id="gAdUnitNarrow" class="gAdUnit narrow gAdUnitHidden"><div class="adTitle"><h2>Ads by Google</h2><h4><a class="google_explain" href="#" onclick="BBYAdSense.google_msg();return false;">What&#39;s this?</a></h4><div class="clearer">***</div></div><div id="',this._adUnitNarrow.container,'" class="narrowcontent gAds"></div><div class="clearer"></div></div>'].join("");return e},BBYAdSense.prototype.getContentWide=function(e){var t;return t="undefined"!=typeof e&&null!==e&&"PDP"===e?['<div id="gAdUnitWide" class="gAdUnit wide gAdUnitHidden"><div class="adTitle"><h4><a class="google_explain" href="#" onclick="BBYAdSense.google_msg();return false;">What&#39;s this?</a></h4></div><div id="',this._adUnitWide.container,'" class="widecontent gAds"></div><div class="clearer"></div></div>'].join(""):['<div id="gAdUnitWide" class="gAdUnit wide gAdUnitHidden"><div class="adTitle"><h3>Ads by Google</h3><h4><a class="google_explain" href="#" onclick="BBYAdSense.google_msg();return false;">What&#39;s this?</a></h4></div><div id="',this._adUnitWide.container,'" class="widecontent gAds"></div><div class="clearer"></div></div>'].join("")},BBYAdSense.prototype.log=function(e,t){BBYAdSense.doLog&&"undefined"!=typeof console&&null!==console&&console.log("BBYAdSense."+e+": "+t)},BBYAdSense.prototype.loadAd=function(){if(this._pageOptions.adtest=this._inDevelopMode?"on":"off",$("#btm-padbar").length>0&&void 0!==getQueryVariable("searchterm"))return this.searchCategoryPage(),void 0;if($("#btm-padbar").length>0&&"pcat17071"===catid)return this.loadSearchListing(),void 0;if($("#searchstatered").length>0&&-1!==$("#searchstatered").html().indexOf("newsearch"))return this.loadNoResultsPageAds(),!0;if($("#searchstate").length>0&&$("#btm-padbar").length>0){var e=$("#searchstate").html();return-1!=e.indexOf("Geek Squad")?!1:(this.loadBrowseBreadcrumbsPresent(),!0)}return $("#pdp-content").length>0?(this.loadPdpAd(),void 0):"Deal of the Day"==document.title?(this.loadDOTDAd(),void 0):void 0},BBYAdSense.prototype.loadNoResultsPageAds=function(){var e,t=getQueryVariable("st"),a=this.isSpanish?"bestbuy-alt1_js":"bestbuy-alt2_js",s=this.isSpanish?"searchnoresults-alt1":"searchnoresults";this._pageOptions.channel=s,this._pageOptions.pubId=a,this._pageOptions.query=t,e=this.getContentWide(),$("#newsearch").after(e),new google.ads.search.Ads(this._pageOptions,this._adUnitWide)},BBYAdSense.prototype.loadBrowseBreadcrumbsPresent=function(){var e,t,a,s,n,i,o,d;if("undefined"!=typeof catid&&null!==catid&&"undefined"!=typeof strCat&&null!==strCat){if(e=this.isSpanish?"bestbuy-alt1-browse_js":"bestbuy-alt2-browse_js",$("#searchstate").length>0)try{for(t=$("#searchstate").text().replace(/^\s*/,"").replace(/^\s*/,"").replace(new RegExp(String.fromCharCode(8250),"g"),">").replace(/\n/g," "),t=t.split(">"),a="",s="",n=t.length;n>1;n--)a+=t[n-1].replace(/^\s+|\s+$/g,""),2!==n&&(a+=" ");for(n=1;t.length-2>=n;n++)s+=t[n].replace(/^\s+|\s+$/g,""),n!==t.length-2&&(s+="|")}catch(r){a=$("#searchstate").text().replace(/\n/g," ").replace(/>/g," ").replace(/Best Buy/g,"").replace(/^\s*/,"").replace(/\s*$/,"")}i=this.isSpanish?"browsecatpage-alt1":"browsecatpage",""!==catid&&(i=i+","+catid),""!==strCat&&(i=i+","+strCat),this.isSpanish&&(i+="-alt1"),o=this.getContentWide(),d=this.getContentNarrow(),$("#listView").after(o),$("#leftcol .narrow").after(d),this._pageOptions.channel=i,this._pageOptions.pubId=e,this._pageOptions.query=a,new google.ads.search.Ads(this._pageOptions,this._adUnitWide,this._adUnitNarrow)}},BBYAdSense.prototype.searchCategoryPage=function(){var e=this.getContentWide(),t=this.getContentNarrow(),a=getQueryVariable("searchterm");a=TaxonomyTag.encode(a),this._pageOptions.channel=this._isSpanish?"searchcatpage-alt1":"searchcatpage",this._pageOptions.pubId=this._isSpanish?"bestbuy-alt1_js":"bestbuy-alt2_js",this._pageOptions.query=a,$("#listView").after(e),$("#leftcol .narrow").after(t),new google.ads.search.Ads(this._pageOptions,this._adUnitWide,this._adUnitNarrow)},BBYAdSense.prototype.loadSearchListing=function(){var e=getQueryVariable("sc"),t="",a="",s="",n="",i=0,o=0,d=this.getContentWide(),r=this.getContentNarrow();if($("#listView").after(d),$("#leftcol .narrow").after(r),t=getQueryVariable("st").replace(/\+/g," "),null==t&&(t=getQueryVariable("searchterm").replace(/\+/g," ")),-1!==t.indexOf("_"))t=null===$("#listView div.hproduct:first h3 a").html()?t.replace(/_/g," "):$("#listView div.hproduct:first h3 a").html(),a=this._isSpanish?"bestbuy-alt1_js":"bestbuy-alt2_js",n=this._isSpanish?"altcategory-alt1":"altcategory";else if(/^[0-9][0-9][0-9][0-9][0-9][0-9][0-9]/.test(t))t=$("#listView div.hproduct:first h3 a").html(),a=this._isSpanish?"bestbuy-alt1_js":"bestbuy-alt2_js",n=this._isSpanish?"search-alt1":"search";else{switch(e){case"TVVideoSP":t+=" TV Video";break;case"audioSP":t+=" Audio";break;case"carSP":t+=" Car";break;case"abCameraCamcorderSP":t+=" Cameras and Camcorders";break;case"abComputerSP":t+=" Computers";break;case"abSoftwareSP":t+=" Software";break;case"phoneOfficeSP":t+=" Phones and Office";break;case"musicSP":t+=" Music";break;case"artistSP":t+=" Music Artist";break;case"songSP":t+=" Music Song";break;case"albumTitleSP":t+=" Music Album";break;case"movieSP":t+=" Movies";break;case"titleSP":t+=" Movie Title";break;case"personSP":t+=" Movie Person";break;case"gameToySP":t+=" Games and Toys";break;case"abHomeAppSP":t+=" Home Appliances";break;default:}($("#searchstate a").length>0||$("#searchstate b").length>0)&&($("#searchstate a, #searchstate b").each(function(){i++,i>3&&(o=$(this).html().replace(/^\s+|\s+$/g,"").replace("|"," ").split(":&nbsp;",1)+"",o=o.replace(/&amp; /,"").replace(/All Categories /,"").replace(/Best Buy /,"").replace(/Name Brands /,"").replace(/&nbsp;/g," ").replace(/^\s+|\s+$/g,""),t+="|"+o)}),t=t.replace(/^\s+|\s+$/g,"").replace(/\|/g," ")),a=this._isSpanish?"bestbuy-alt1_js":"bestbuy-alt2_js",n=this._isSpanish?"search-alt1":"search"}s="csa-"+n,this._pageOptions.channel=s,this._pageOptions.pubId=a,this._pageOptions.query=t,new google.ads.search.Ads(this._pageOptions,this._adUnitWide,this._adUnitNarrow)},BBYAdSense.prototype.loadDOTDAd=function(){var e=this._adUnitWide,t=this.getContentWide("gAdUnitWideAds"),a="Deals of the day",s=this._pageOptions,n=this._isSpanish;s.channel=n?"searchcatpage-alt1":"searchcatpage",s.pubId=n?"bestbuy-alt1_js":"bestbuy-alt2_js",s.query=a,$("#google-ads").after(t),new google.ads.search.Ads(s,e)},BBYAdSense.prototype.loadPdpAd=function(){var e,t,a=$("#sku-title").text();this._pageOptions,e=this._isSpanish,this._pageOptions.channel=e?"searchcatpage-alt1":"searchcatpage",this._pageOptions.pubId="bestbuy-pdp",this._pageOptions.query=a,t=this.getContentWide("PDP"),$("#google-ads").after(t),new google.ads.search.Ads(this._pageOptions,this._adUnitWide)},BBYAdSense.adLoaded=!1,BBYAdSense.loadAds=function(){if(BBYAdSense.log("BBYAdSense","loadAds","BBYAdSense.adLoaded:"+BBYAdSense.adLoaded),BBYAdSense.adLoaded)return BBYAdSense.log("BBYAdSense","loadAds","BBYAdSense.adLoaded:"+BBYAdSense.adLoaded+", RETURN"),void 0;try{BBYAdSense.log("BBYAdSense","loadAds","EventManager- google:"+typeof google);var e={};e.Track=function(){},e.Track.prototype.setDebug=function(){},e.Track.prototype.elementBind=function(){},BBYAdSense.log("BBYAdSense","loadAds","Cloud"),new BBYAdSense,BBYAdSense.adLoaded=!0}catch(t){BBYAdSense.log("BBYAdSense","loadAds","error:"+t)}},BBYAdSense.TrackEventReady=function(){BBYAdSense.log("BBYAdSense","TrackEventReady"," typeof(google) === 'undefined'), typeof(EventManager):"+typeof EventManager),BBYAdSense.log("BBYAdSense","TrackEventReady","typeof(EventManager):"+typeof EventManager),"undefined"!=typeof EventManager&&"unknown"!=typeof EventManager&&"undefined"!=typeof EventManager.on&&EventManager.on("dio.trackEvent.ready",function(){BBYAdSense.log("BBYAdSense","TrackEventReady"," typeof(google) === 'undefined'), eventManagerCallback"),"undefined"!=typeof google?(BBYAdSense.log("BBYAdSense","TrackEventReady"," typeof(google) === 'undefined'), google object exists"),BBYAdSense.loadAds()):(BBYAdSense.log("BBYAdSense","TrackEventReady"," typeof(google) === 'undefined'), waiting for google object to exist."),setTimeout(BBYAdSense.loadAds,1500))})},BBYAdSense.loadGoogleCSA=function(){var e=document.createElement("script");e.type="text/javascript",e.src="http://www.google.com/adsense/search/async-ads.js",$("head").append(e)},BBYAdSense.loadGoogleCSA(),BBYAdSense.waitForGoogleCount=0,BBYAdSense.waitForGoogle=function(){"undefined"==typeof google||null===google?(20>BBYAdSense.waitForGoogleCount&&setTimeout(BBYAdSense.waitForGoogle,100),BBYAdSense.waitForGoogleCount++):BBYAdSense.loadAds()},"undefined"==typeof google||null===google?BBYAdSense.waitForGoogle():BBYAdSense.loadAds();