var skuInfo=[],skuId;var quickViewSkus=[],currentPosition,totalResults=0,resultsPerPage=0,currentPage=0,totalPages=0;$(function(){$("#jQueryCnetSkusAddToCartForm input").keypress(function(k){return od_utils.defaultSubmit(k)});$("#relatedSkusHorizontalForm input").keypress(function(k){return od_utils.defaultSubmit(k)});$("#productView #gridList li#tabGrid").click(function(k){k.preventDefault();$("#productView").removeClass("list_view").addClass("grid_view");$("li#tabList").removeClass("current");$("li#tabGrid").addClass("current");od_utils.setCookie("skuList","grid_view")});$("#productView #gridList li#tabList").click(function(k){k.preventDefault();$("#productView").removeClass("grid_view").addClass("list_view");$("li#tabGrid").removeClass("current");$("li#tabList").addClass("current");od_utils.setCookie("skuList","list_view")});if($("#bulkPricingCollapseEnabled").exists()){$("table.breaks","#searchRefine").each(function(){if($("tr",this).size()>4){$(this).find(".moreLink").show();$(".more a",this).toggle(function(){$(this).parent().parent().parent().find("tr:gt(1):not(.outside):not(:last)").toggleClass("trhide");$(this).find(".moreLink").hide();$(this).find(".lessLink").show()},function(){$(this).parent().parent().parent().find("tr:gt(1):not(.outside):not(:last)").toggleClass("trhide");$(this).find(".lessLink").hide();$(this).find(".moreLink").show()})}else{$(".more",this).css("visibility","hidden")}})}$(".pppHeader").click(function(k){k.preventDefault();$(this).next().slideToggle("slow");$(this).children("a").toggleClass("pppShown")});$(".pppAddedItems .pppContents").show();$("a#learnmore").click(function(){openDescriptionTab();return true});$("#mainqtybox").keyup(function(){newVal=$(this).val().trim();if(validQuantity(newVal)){$("#secondaryqtybox").val($("#mainqtybox").val());$("#originalchecked").attr("checked",true)}});$(".related_qty, #secondaryqtybox").keyup(function(){newVal=$(this).val().trim();if(validQuantity(newVal)){$(this).next().attr("checked",true)}});$(".related_checkbox, #originalchecked").click(function(){if($(this).attr("checked")){qtyval=$(this).prev().val().trim();if(qtyval.length<1){$(this).prev().val("1")}}});if($("#pageVersionIndicator").text()=="1"){if($("li#relatedTab.li3").length){$("ul#navTabs li").removeClass("defaultTab");$("li#relatedTab.li3").addClass("defaultTab");$("#navTabContent > div").removeClass("show").addClass("hide");$("#navTabContent > div.related_tab").addClass("show").removeClass("hide")}}$("#productTourLinkTrack","#product").click(function(){throwElementTag("Product Tour","Product Page Entity")});$("#deliveryFeeLinkTrack","#product").click(function(){throwElementTag("Delivery Fee","Product Page Entity")});$("#sameDayLinkTrack","#product").click(function(){throwElementTag("Same Day Delivery","Product Page Entity")});$("#hubLinkTrack","#product").click(function(){throwElementTag("HUB","Product Page Entity")});$("#clearanceLinkTrack","#product").click(function(){throwElementTag("Clearance","Product Page Entity")});$("#zoomEntityLinkTrack","#product").click(function(){throwElementTag("Zoom","Product Page Entity")});$("#msdsEntityLinkTrack","#product").click(function(){throwElementTag("MSDS","Product Page Entity")});$(".pictureEntityLinkTrack","#product").click(function(){throwElementTag("Dynamic Zoom","Product Page Entity")});$("#navTabs li.defaultTab").click();var j=$("#cnetUpSellBaseUrl").html();if(j!=undefined){var d="";$(".side_item .cnettracking","#refinementsection").each(function(){if(d!=""){d+=","+$(this).attr("rel")}else{d=$(this).attr("rel")}});$("body").append('<img src="'+j+d+'" width="1" height="1"/>')}var h=document.location.toString();if(h.match("#reviewTab")){$("#reviewTab").click()}$(".cnettracking").click(function(){var k=new Date();$("body").append('<img src="http://xs.ics0.com/click.gif?ts='+k.getTime()+"&csid="+$(this).attr("rel")+'" width="1" height="1"/>');var l=$(this).attr("href");var m=$(this).attr("rel");$("body").append("<form id='trackingForm' method='POST' action='"+l+"'><input name='csidclk' value='"+m+"' type='hidden'></form>");$("#trackingForm")[0].submit();return false});if(!$(".skudetailbox #navTabContent .show li").parent().is("ul")){$(".skudetailbox #navTabContent .show li").wrapAll("<ul></ul>")}var a=0;var b=$("#siteBreadcrumb a");var g=b.length;b.each(function(){a=a+$(this).html().length});if(a>210){var c=a;for(i=1;i<g;i++){var e=b.eq(i).html();b.eq(i).html("...");expandBreadcrumb(e,b.eq(i));c=c-e.length;if(c<=210){break}}}$(".paginationRecordsPerPage").change(function(m){var k=$(".paginationRecordsPerPageLink").attr("href");var l=k.replace(/recordsPerPageNumber=(\d*)/,"recordsPerPageNumber="+this.value);var l=l.replace(/viewAll=(\d*)/,"");window.location.href=l});$(":checkbox","#refinementsection").css("visibility","visible");$("#refinementsection .more").css("visibility","visible");$("#refinementsection label").css("color","#111");$(".narrowByLink").click(function(){throwSearchRefinementElementTag($("#refinementForm").attr("action"),"Narrow By",$(this).text().trim());return true});$(".expandKeywordLink").click(function(){window.location=$(this).attr("href");return true});$(":checkbox","#refinementsection").click(function(){od_uielements.lightboxLoader($("#refinementsLoading").html());if($(this).attr("class").indexOf("expandKeywordCheckBox")>-1){$(this).siblings("a").click();return false}$(":checkbox","#refinementsection").not(":checked").attr("disabled","disabled");if($("#coreMetricsEnabled").exists()){if($(this).attr("checked")){var k=$(this).parent();var l=k.text().trim();if(l.length<1){l=k.parent().find("img").attr("alt")}throwSearchRefinementElementTag($("#refinementForm").attr("action"),k.parents().filter("div:eq(0)").attr("id"),l)}}setTimeout(function(){$("#refinementForm").submit()},800)});$(".styleAcc").addClass("accOpen").toggle(function(){$(this).removeClass("accOpen").next().hide()},function(){$(this).addClass("accOpen").next().show()}).each(function(){var k=$(".styleAcc").index(this);var l=$(this).next().find(".refinement:checked").size();if(k>2&&l===0){$(this).click()}});$("a.more","#refinementsection").click(function(o){o.preventDefault();var n=$(this);var l=n.attr("href");var m="";var k=n.parent().parent();k.find("input.refinement").each(function(){m+=this.value+"|"});DWRDelegate.getMoreInfo(l,m,function(p){for(var q=0;q<p.length;q++){k.append('<li><input type="checkbox" class="refinement" value="'+p[q].id+'" name="cbxRefine" style="visibility: visible;"/><label style="color: rgb(17, 17, 17);">'+p[q].name+" ("+p[q].hitCount+")</label></li>")}$(":checkbox","#refinementsection").click(function(){$(":checkbox","#refinementsection").not(":checked").attr("disabled","disabled");$(":submit",".refinementSubmit").click()});n.remove()})});$(".pppSkuPage a").not(".pppRemoveLink").not(".a_ppp a").click(function(k){k.preventDefault();if($(".pppSect2re").is(":visible")){return}if($(this).children(".pppSkuSpan").html()==""){$("input[name$=selectDecline]").val("1");$("input[name$=pppSku]").val("")}else{$("input[name$=pppSku]").val($(this).children(".pppSkuSpan").html())}$(".self_radio_on").show();$(".pppSect2re").show();$(".pppSect1").addClass("pppSect1re f_left").removeClass("radio_off pppSect1");$(".pppSect2").addClass("pppSect3re").removeClass("pppSect2");$(".pppContents a").not(this).parent().not(".pppSect2re").hide()});$(".pppRemoveLink").click(function(k){k.preventDefault();$("input[name$=pppSku]").val("");$("input[name$=selectDecline]").val("0");$(".self_radio_on").hide();$(".pppSect1re").addClass("radio_off pppSect1").removeClass("pppSect1re f_left");$(".pppSect3re").addClass("pppSect2").removeClass("pppSect3re");$(".pppContents a").parent().show();$(".pppSect2re").hide()});$("#sharelinks").hoverIntent(function(){$(".hover_menu").fadeIn("fast");$(".hover_menu").data("hidden",false);$(this).addClass("sfhover");if($.browser.msie){$("#sku").addClass("socialMediaPage");$("#productTabs").addClass("socialMediaTabs")}},function(){$(".hover_menu").fadeOut("medium");$(".hover_menu").data("hidden",true);$(this).removeClass("sfhover")});$(".share_twitter").click(function(){shareurl="http://"+top.location.host+"/catalog/catalogSku.do?id="+$("#skuId").attr("value");var k="http://twitter.com/home?status="+shareurl;window.open(k,"","toolbar=0, resizable=yes, scrollbars=yes, status=0, width=795, height=700");return false});$("#showWalkInStoreMore").click(function(){$("#walkInStoreMore").toggleClass("hide")});$("#showcaseAnchor","#showcasetours").toggle(function(){$("#showcaseOptions").slideDown("fast");$("#showcase").addClass("active")},function(){$("#showcaseOptions").slideUp("medium");$("#showcase").removeClass("active")});if($("#s_images","#showcasetours").length>0||$("#sellpoint","#showcasetours").length>0){$("#showcasetours").show()}$("#skuListFormID input[type=text]").keypress(od_utils.addToCartDefaultSubmit);for(var f=0;f<5;f++){$("#skuListFormID_"+f+" input[type=text]").keypress(od_utils.addToCartDefaultSubmit)}if($(".jqQuickView","#searchRefine").exists()){totalResults=parseInt($("#qvTotalCount").html());resultsPerPage=($(".paginationRecordsPerPage","#skuListFormID").exists())?parseInt($(".paginationRecordsPerPage","#skuListFormID").val()):1;currentPage=($(".searchPagePagination .off").exists())?parseInt($(".searchPagePagination .off").html()):1;totalPages=Math.ceil(totalResults/resultsPerPage);quickViewSkus[currentPage]=[];$(".photo","#productView").not("#couponDetails .photo").append('<div class="quickViewTrigger"><div class="quickViewTriggerBg trans30"></div><div class="qvbutton"><div class="b2"><a class="button">'+$("#qvQuickView").html()+"</a></div></div></div>");$(".photo > a","#productView").not("#couponDetails .photo a").mouseover(function(){$(".quickViewTrigger","#searchRefine").hide();$(this).siblings(".quickViewTrigger").show()});$(".photo","#productView").not("#couponDetails .photo").mouseleave(function(){$(".quickViewTrigger","#searchRefine").hide()});$(".skuPageEntity","#productView").not("#couponDetails .skuPageEntity").mouseover(function(){$(".quickViewTrigger","#searchRefine").hide()});$('#productView.jqQuickView input[id^="sku_"]',"#searchRefine").not("#couponDetails input").each(function(){quickViewSkus[currentPage].push(this.value)});$(".quickViewTrigger a","#searchRefine").live("click",function(){skuId=$(this).closest(".products").children().find("input[id^='sku_']").val();currentPage=($(".searchPagePagination .off").exists())?parseInt($(".searchPagePagination .off").html()):1;if($("#coreMetricsEnabled").exists()){cmCreatePageElementTag(skuId,"Quickview")}for(currentPosition=0;currentPosition<quickViewSkus[currentPage].length;currentPosition++){if(quickViewSkus[currentPage][currentPosition]==skuId){break}}if(!$("#quickViewContainer").exists()){$("body").append('<div id="quickViewContainer"></div>');var k=od_utils.appendSessionId("/ajaxhtml/quickView.do");$("#quickViewContainer").load(k,function(l){if(l.indexOf("jspFrag")>0){if(quickViewSkus[currentPage].length>=1){$("skuNavigation","#quickViewContainer").hide()}quickView(skuId)}else{$(this).remove()}})}else{quickView(skuId)}})}});function expandBreadcrumb(a,b){b.hover(function(){b.html(a)},function(){b.html("...")})}function showTab(){$("#reviewTab").click()}function callDwrForMore(a){DWRDelegate.getMoreInfo(a.val(),{callback:function(b){validateSku(b,a)}})}function throwElementTag(b,c){var a=$("#skuId").val();if(c!="firstTab"){cmCreatePageElementTag(b,c,a)}}function throwSearchRefinementElementTag(c,e,d){var a="Search";var b="";if(typeof c=="undefined"||c.indexOf("browse")>-1){a="Browse"}if(e.indexOf("ref_el_")>-1){e=e.substring(7,e.length)}b=$(".lastBreadCrumb:last","#siteBreadcrumb").text();cmCreatePageElementTag(a,"Refinements","''","''","''"," -_-"+e+"-_-"+d+"-_- -_-"+b)}function throwProductViewTag(d,c){var b=$("#productViewTag").text();b=b.replace("*rating*",c);b=b.replace("*count*",d);$("#mainSkuForm").append("<input type='hidden' name='avgRating' value='"+c+"'>");$("#mainSkuForm").append("<input type='hidden' name='totalReviewCount' value='"+d+"'>");var a=b.split("|||");cmCreateProductviewTag(a[0],a[1],a[2],a[3],a[4],a[5])}function openDescriptionTab(){$("ul#navTabs li").removeClass("defaultTab");$("li#firstTab.li1").addClass("defaultTab");$("#navTabContent > div").removeClass("show").addClass("hide");$("#navTabContent > div.sku_desc").addClass("show").removeClass("hide")}function getShareURL(){return window.location.href}function getShareTitle(){return $("#skuHeading").children("h1").text()}function validQuantity(b){var c=new RegExp("^[0-9]+$");var a=c.test(b);return a}function wcContentReady(b){var c=true;if(typeof(b.officedepot.miniSiteUrl)!="undefined"&&b.officedepot.miniSiteUrl.length>0){$("a","#showcasetours #tours").attr("href",b.officedepot.miniSiteUrl);$("#tours","#showcasetours").show();c=false}if(typeof(b.officedepot.showcaseUrl)!="undefined"&&b.officedepot.showcaseUrl.length>0){$("<li><a href="+b.officedepot.showcaseUrl+' target="_blank">View Product Showcase</a></li>').appendTo("ul.showcase_menu","#showcasetours #showcase")}if(typeof(b.officedepot.supplementaryMiniSiteUrls)!="undefined"){for(var a=0;a<b.officedepot.supplementaryMiniSiteUrls.length;++a){if(typeof(b.officedepot.supplementaryMiniSiteUrls[a].url!="undefined")&&b.officedepot.supplementaryMiniSiteUrls[a].url.length>0){$("<li><a href="+b.officedepot.supplementaryMiniSiteUrls[a].url+' target="_blank">'+b.officedepot.supplementaryMiniSiteUrls[a].caption+"</a></li>").appendTo("ul.showcase_menu","#showcasetours #showcase");$("#showcase","#showcasetours").show()}}c=false}if(!c){$("#showcasetours").show()}}function quickView(a){$("#details-quickViewContent div, #qvImg, #qvEntities, #qvDesc, #qvRating, #qvPrice, #qvPriceBreaks, .note, #qvAvail","#quickViewContent").hide();$("#quickViewContent","#quickViewContainer").addClass("loadingSku");$("#quickViewContainer").dialog({bgiframe:true,modal:true,resizable:false,draggable:false,position:"center",width:530,dialogClass:"hide-title-bar",overlay:{opacity:0.5,background:"black"},hide:"fade"}).dialog("open");window.scrollTo(0,0);if(!skuInfo[a]){DWRDelegate.getExtendedAjaxSkuInfo(a,function(b){skuInfo[b.sku]=b;loadQuickViewSku(b.sku)})}else{loadQuickViewSku(a)}skuId=a}function getBVRatingImage(a){return $("#bvPath").html()+"/"+$("#bvContext").html()+"/"+a+"/ratings.gif"}function loadQuickViewSku(a){$("#zoom-quickViewTab","#quickViewContainer").hide();$("#qvCurrentSku","#skuNavigation").html((currentPosition+((currentPage-1)*resultsPerPage))+1);$("#qvTotalResults","#skuNavigation").html(totalResults);if($.browser.msie&&parseInt($.browser.version)==6){$("#qvAddToCart input, #qvSaveToList input").css("font-size","10px");$("#qvAddToCart input[type=text]").css("border","1px solid #ccc").css("padding","2px").width("20px").height("14px")}var c="cm_cat=2000000020";if(skuInfo[a].link.indexOf("?")>-1){c="&"+c}else{c="?"+c}skuURL="http://"+window.location.host+od_utils.appendSessionId(skuInfo[a].link+c);$("#qvImg a","#quickViewContainer").attr("href",skuURL);$("#qvImg img","#quickViewContainer").attr("src",skuInfo[a].imageFileNameLg).height("250px").width("auto").attr("alt",skuInfo[a].description.substring(0,30));$("#qvDesc","#quickViewContainer").html('<a href="'+skuURL+'">'+skuInfo[a].description+"</a>");$("#qvItemNum","#quickViewContainer").html(skuInfo[a].sku);if(!skuInfo[a].customizable){$("#qvCustomize","#quickViewContainer").hide();$("#qvAddToCart, #qvSaveToList","#quickViewContainer").show();$(".qvSkuId","#quickViewContainer").val(skuInfo[a].sku)}else{$("#qvCustomize","#quickViewContainer").show();$("#qvAddToCart, #qvSaveToList","#quickViewContainer").hide();$("a","#qvCustomize").attr("href","/catalog/vendorRouter.do?configurableItemType="+skuInfo[a].configurableItemType+"&id="+skuInfo[a].sku)}$("#qvEntities","#quickViewContainer").html(skuInfo[a].entityHtml);if(skuInfo[a].entityHtml.indexOf("s7.officedepot")>0){$('#qvEntities img[alt="Image Zoom"]',"#quickViewContainer").parent().hide();$("#zoom-quickViewTab","#quickViewContainer").show();flashObject="";flashObject+='<div class="flashObjContainer"><OBJECT ID="'+skuInfo[a].sku+'" HEIGHT="100%" WIDTH="100%">';flashObject+=' <PARAM NAME="movie" VALUE="http://s7.officedepot.com/is-viewers/flash/genericzoom.swf?serverUrl=http://s7.officedepot.com/is/image/&contentRoot=http://s7.officedepot.com%2fskins&image=officedepot%2F'+skuInfo[a].sku+'&config=officedepot/RenderSetConfigDefaults">';flashObject+=' <PARAM NAME="menu" VALUE=false> <PARAM NAME="quality" VALUE="high"><PARAM NAME="scale" VALUE="noscale"><PARAM NAME="wmode" VALUE="opaque">';flashObject+=' <EMBED wmode="opaque" src="http://s7.officedepot.com/is-viewers/flash/genericzoom.swf?serverUrl=http://s7.officedepot.com/is/image/&contentRoot=http://s7.officedepot.com%2fskins&image=officedepot%2F'+skuInfo[a].sku+'&config=officedepot/RenderSetConfigDefaults"';flashObject+=' QUALITY="high"  HEIGHT="100%" WIDTH="100%" SWLIVECONNECT="true"';flashObject+=' NAME="'+skuInfo[a].sku+'" >';flashObject+=" </EMBED></OBJECT></div>";$("#zoom-quickViewContent").html(flashObject)}else{if($(".qvSelectedTab","#quickViewTabsContainer").attr("id")=="zoom-quickViewTab"){$("#overview-quickViewTab","#quickViewTabsContainer").click()}}$("#qvRating a","#quickViewContainer").html('<img src="'+getBVRatingImage(a)+'" />').attr("href",skuURL+"#reviewTab");$("#qvSkuLink","#quickViewContainer").attr("href",skuURL);var b="";for(x=0;x<skuInfo[a].availabilityIconList.length;x++){b+='<div><img src="'+$("#imgPath").html()+skuInfo[a].availabilityIconList[x].iconSrc+'" /> <span class="availibilityText">'+skuInfo[a].availabilityIconList[x].msg+"</span></div>"}$("#qvAvail","#quickViewContainer").html(b);b="";for(x=0;x<skuInfo[a].attributes.length;x++){b+='<div class="qvTitle">'+skuInfo[a].attributes[x].name+"</div><div>"+skuInfo[a].attributes[x].value+"</div>"}$("#details-quickViewContent","#quickViewContainer").html(b);b='<table class="pricing_block" cellspacing="0">';if(skuInfo[a].rebateDisplayData.numOfRebates>0){b+="<tr><th>Original Savings:</th><td>$"+skuInfo[a].rebateDisplayData.regPrice.toFixed(2)+"</td></tr>";if(skuInfo[a].rebateDisplayData.numOfInstantRebates>0){b+="<tr><th>Instant Savings:</th><td>-$"+skuInfo[a].rebateDisplayData.amtOfAllInstantRebates.toFixed(2)+"</td></tr>";b+="<tr><th>Checkout Price:</th><td>$"+skuInfo[a].rebateDisplayData.priceAfterInstantRebate.toFixed(2)+"</td></tr>"}if(skuInfo[a].rebateDisplayData.numOfMailInRebates>0){b+="<tr><th><a>"+((skuInfo[a].rebateDisplayData.numOfMailInRebates>=2)?"("+skuInfo[a].rebateDisplayData.numOfMailInRebates+") ":"")+"Mail-in Savings:</a></th><td>-$"+skuInfo[a].rebateDisplayData.amtOfAllMailInRebates.toFixed(2)+"</td></tr>"}}b+='<tr class="your_price"><th class="your_price_nt">'+$("#qvYourPrice").text()+'</th><td class="main_price">'+((skuInfo[a].rebateDisplayData.numOfRebates>0)?"$"+skuInfo[a].rebateDisplayData.priceAfterRebates.toFixed(2):skuInfo[a].sellPrice)+"</td></tr>";if(skuInfo[a].rebateDisplayData.numOfRebates>0){b+='<tr><td class="rebatePrice" colspan="2"><div class="f_left strongColor">after'+skuInfo[a].rebateDisplayData.jspText+'<p class="note textblock">Savings apply to 1 item per order</p></div></td></tr>'}b+="</table>";$("#qvPrice","#quickViewContainer").html(b);if(skuInfo[a].bulkPricing&&skuInfo[a].bulkPrices.length>=1){b='<div class="price_breaks"><table class="breaks" cellspacing="0">';b+='<tr class="tr0"><th class="th1" colspan="2">Buy More and Save</th></tr>';for(x=0;x<skuInfo[a].bulkPrices.length;x++){b+='<tr class="outside"><th>'+skuInfo[a].bulkPrices[x].range+"</th><td>"+skuInfo[a].bulkPrices[x].price+"</td></tr>"}b+="</table>";$("#qvPriceBreaks","#quickViewContainer").html(b)}$("#details-quickViewContent div, #qvImg, #qvEntities, #qvDesc, #qvRating, #qvPrice, #qvPriceBreaks, .smTxt, #qvAvail","#quickViewContent").show();$("#quickViewContent","#quickViewContainer").removeClass("loadingSku")};