var LBI=window.LBI||{};LBI.common={version:1,identJSClass:"hasJS",dynamicInputSelector:"input.dyna-text",dynamicInputFocusClass:"focused",ajaxQueryParam:"rc=1",newWindowClass:"newwin",newWindowText:"This link will open a new window",webSafeChar:'<span class="webSafeChar"> </span>',printLinkClass:"printwin",printLinkText:"This link will open the Print dialog",identJS:function(){$("body").addClass(LBI.common.identJSClass)},sortNumeric:function(b,a){return a<b?-1:(a>b)?1:0},isUnsignedInteger:function(s){return(s.toString().search(/^[0-9]+$/)===0)},getStringQueries:function(theString){if(typeof theString!=="string"){return}if(theString.indexOf("?")>-1){theString=theString.split("?")[1]}var qs=theString,qsKey,qsValue,stringElements={};qs=qs.split("&");for(var i=qs.length-1;i>=0;i--){qsKey=qs[i].split("=")[0];qsValue=qs[i].split("=")[1];stringElements[qsKey]=qsValue}return stringElements},webSafeString:function(myString){var stringAsArray=myString.split("");var stringLength=stringAsArray.length;var newArray=[];for(var i=0;i<stringLength;i++){newArray.push(stringAsArray[i],LBI.common.webSafeChar)}var newString=newArray.join("");return newString},urlGetAnchor:function(anchor){if(anchor.href.indexOf("#")>=0){anchor.destination=anchor.href.slice(anchor.href.indexOf("#")+1);return anchor.destination}else{return false}},getNewWindowLinks:function(){$("a").each(function(i){if($(this).hasClass(LBI.common.newWindowClass)){$(this).title=$(this).title+" "+LBI.common.newWindowText;$(this).click(function(){var newWindow=window.open(this.getAttribute("href"),"_blank");if(newWindow){if(newWindow.focus){newWindow.focus()}}return false})}})},getPrintLinks:function(){$("a").each(function(i){if($(this).hasClass(LBI.common.printLinkClass)){$(this).title=$(this).title+" "+LBI.common.printLinkText;$(this).click(function(){var printWin=window.print();return false})}})},dynamicInputText:function(){$(LBI.common.dynamicInputSelector).each(function(i){var target=this;target.savedText=target.value;target.onfocus=function(){$(this)[0].value=jQuery.trim($(this)[0].value);if($(this)[0].value===this.savedText){$(this)[0].value=""}$(this).addClass(LBI.common.dynamicInputFocusClass)};target.onblur=function(){$(this)[0].value=jQuery.trim($(this)[0].value);if($(this)[0].value===""){$(this)[0].value=this.savedText}$(this).removeClass(LBI.common.dynamicInputFocusClass)}})},boxHeights:function(boxes){var heights=[];for(var i=0;i<boxes.length;i++){if(navigator.userAgent.toLowerCase().indexOf("opera")===-1){heights.push(boxes[i].scrollHeight)}else{heights.push(boxes[i].offsetHeight)}}heights.sort(this.sortNumeric);var maxh=heights[0];for(var j=0;j<boxes.length;j++){boxes[j].style.height=maxh+"px"}},ajax:{bufferFieldID:"ajaxVirtualBufferUpdate",prepareBuffer:function(){var objHidden=document.createElement("input");objHidden.setAttribute("type","hidden");objHidden.setAttribute("value","1");objHidden.setAttribute("id",LBI.common.ajax.bufferFieldID);objHidden.setAttribute("name",LBI.common.ajax.bufferFieldID);document.body.appendChild(objHidden)},updateBuffer:function(){var objHidden=document.getElementById(LBI.common.ajax.bufferFieldID);if(objHidden){if(objHidden.getAttribute("value")==="1"){objHidden.setAttribute("value","0")}else{objHidden.setAttribute("value","1")}}else{LBI.common.ajax.prepareBuffer();LBI.common.ajax.updateBuffer()}},tagUrl:function(url){var prefix=(url.indexOf("?")<0)?"?":"&";var ajaxURL=url+prefix+LBI.common.ajaxQueryParam;return ajaxURL}},parseVersionString:function(str){if(typeof(str)!=="string"){return false}var x=str.split(".");var maj=parseInt(x[0],10)||0;var min=parseInt(x[1],10)||0;var pat=parseInt(x[2],10)||0;return{major:maj,minor:min,patch:pat}},effects:{highlightElement:function(element,color,speed){color=(!color)?"#FFFFCC":color;speed=(!speed)?1000:speed;$(element).effect("highlight",{color:color},speed)}}};

(function($){var options=[],menuWidth=0;$.fn.mandsmenu=function(opts){var $menu=$(this);options=$.extend({delaySpeed:200,fadeInDuration:200,fadeOutDuration:50,menuShimTransparency:false,primaryNavItemsLength:null},opts||{});options.primaryNavItemsLength=$menu.children().size();$menu.children().eq(options.primaryNavItemsLength-2).css("background-image","none");var isIE6=(jQuery.browser.msie&&parseInt(jQuery.browser.version)==6);if(isIE6){var iframeShim=$(document.createElement("iframe")).addClass("shim").attr("src","javascript:false;");if(options.menuShimTransparency){iframeShim.css({filter:"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"})}}$menu.find('li[id^="menu"]').each(function(i,item){var t;var container;var shim;if($(item).hasClass("current")){$(item).prev().addClass("prev")}if(isIE6&&container!=null&&container.length>0){var shim=iframeShim.clone(true).width(container.outerWidth(true)).height(container.outerHeight(true)).appendTo(item)}$(item).hover(function(e){var $hoveritem=$(this);var hoveritemId=$hoveritem[0].id;var flyoutIndex=hoveritemId.substring(4)-1;ms.ui.gn.flyoutsController.buildFlyout("Main",flyoutIndex);$hoveritem.addClass("hovered").prev().addClass("prev");container=$(item).find(".shopByGroupContainer");if(isIE6&&container!=null&&container.length>0){shim=iframeShim.clone(true).width(container.outerWidth(true)).height(container.outerHeight(true)).appendTo(item)}if(!$hoveritem.hasClass("current")){$("li.current").removeClass("current").addClass("currentOut");$("li.currentOut").prev().removeClass("prev")}t=window.setTimeout(function(){if($hoveritem.find(".shopByGroupContainer").size()>0){if($hoveritem.find(".shopByGroupContainer").queue().length<=1){$hoveritem.find(".shopByGroupContainer").fadeIn(options.fadeInDuration);if(isIE6){shim.fadeIn(options.fadeInDuration)}}}},options.delaySpeed)},function(e){var $hoveritem=$(this);if(!$hoveritem.hasClass("current")){$hoveritem.removeClass("hovered").prev().removeClass("prev")}else{$hoveritem.removeClass("hovered")}$("li.currentOut").removeClass("currentOut").addClass("current").prev().addClass("prev");$hoveritem.find(".shopByGroupContainer").fadeOut(options.fadeOutDuration);if(isIE6&&shim!=null){shim.fadeOut(options.fadeOutDuration)}window.clearTimeout(t)})});$menu.find(".shopByGroupContainer").css("display","none");return this}})(jQuery);function showDropDownListForMenuOnLoad(){var menuItems=jQuery("#menu").children();var mouseX=0;var mouseY=0;if(typeof(event)!="undefined"&&event!=null){mouseX=event.clientX+document.body.scrollLeft;mouseY=event.clientY+document.body.scrollTop}menuItems.each(function(){var thisItem=jQuery(this);var top=thisItem.offset().top;var bottom=thisItem.height()+top;var left=thisItem.offset().left;var right=thisItem.width()+left;if(mouseX>=left&&mouseX<=right&&mouseY>=top&&mouseY<=bottom){thisItem.trigger("hover")}})}function setCookie(name,value){var curCookie=name+"="+value+"; path=/";document.cookie=curCookie}function getCookie(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0){return null}}else{begin+=2}var end=document.cookie.indexOf(";",begin);if(end==-1){end=dc.length}return(dc.substring(begin+prefix.length,end))}jQuery(document).ready(function(e){jQuery("#menu").mandsmenu();showDropDownListForMenuOnLoad();var isIE6=(jQuery.browser.msie&&parseInt(jQuery.browser.version)==6);var isIE7=(jQuery.browser.msie&&parseInt(jQuery.browser.version)==7);if(isIE6||isIE7){jQuery("ul#menu li a.heading").focus(function(){jQuery(this).addClass("focus")}).blur(function(){jQuery(this).removeClass("focus")})}jQuery("#CT").click(function(){var gnavCookie=getCookie("gnavexp");if(gnavCookie!=null){var tempo=gnavCookie.split(":");var cookieName=tempo[0];var cookieValue=tempo[1];if(cookieValue=="T1"){cookieValue="C"}else{if(cookieValue=="C"){cookieValue="T1"}}var newCookieValue=cookieName+":"+cookieValue;setCookie("gnavexp",newCookieValue);var sURL=unescape(window.location);sURL=sURL.replace(/&cacheBust=[^&]*/g,"");var time=new Date().getTime();sURL+="&cacheBust="+time;window.location=sURL}return false});jQuery(".smartfaqlink").click(function(event){var element=jQuery(this);var url=element.attr("href");var target=element.attr("target");window.open(url,target,"width=800,height=820,scrollbars=yes,resizable");return false});jQuery("#CT").css("font-size","16px");jQuery("#CT").css("font-weight","800");jQuery("#CT").css("color","blue")});

var pageType={BROWSE:"browse page",BROWSE_TIER3:"browse tier3 page",HOME:"home page",QUICK_ORDER:"quick order",SEARCH:"search page",DETAIL:"detail page",MINI_DETAIL:"mini detail page",ORDER_CONFIRM:"order confirmation page",HUC:"upsell cart",CART:"cart page",getPageType:function(){if(jQuery("#browsePage .layout-205").length>0||jQuery("#browsePage .layout-206").length>0){return this.BROWSE}else{if(jQuery("#browsePage .layout-202").length>0){return this.BROWSE_TIER3}else{if(jQuery("#searchPageContent").length>0){return this.SEARCH}else{if(jQuery("#browsePage .layout-203").length>0||jQuery("#browsePage .layout-201").length>0){return this.HOME}else{if(jQuery("#quickOrderHeaderTable").length>0){return this.QUICK_ORDER}else{if(jQuery("#detailPageContent").length>0){return this.DETAIL}else{if(typeof(orderDetailsJSON)!="undefined"){return this.ORDER_CONFIRM}else{if(jQuery("#pageId101").length>0){return this.HUC}else{if(jQuery("#pageId1000").length>0){return this.CART}}}}}}}}}}};

var codes=["p_4","p_91","p_10","p_93","p_94","p_36","p_MNS_65","p_16"];var names=["Collection","Size","Color","Fit","Style","Price","Dietary Information","Material"];jQuery(document).ready(function(){if(isRREnabled()=="true"){rrInfoGet.initialize()}else{if(pageType.DETAIL==pageType.getPageType()){jQuery("#browseMore .youMayAlsoLike").css("display","block")}}});var MAX_PRICE_POSSIBLE=999999;function getMinMaxFromArray(intArray){var range=new Array();range[0]=MAX_PRICE_POSSIBLE;range[1]=0;if(intArray.length>0){range[0]=intArray[0];range[1]=intArray[0];for(var i=1;i<intArray.length;i++){if(intArray[i]>range[1]){range[1]=intArray[i]}if(intArray[i]<range[0]){range[0]=intArray[i]}}}range[0]=range[0].toFixed(2);range[1]=range[1].toFixed(2);return range}var rrDefaultWidgetName={widget1:"Frequently Bought Together",widget2:"Customers who bought these also bought",widget3:"You May Also Like",widget4:"Customers who viewed this also viewed",widget5:"Bestselling Items",widget6:"Top Sellers"};var rrInfoGet={rrPDPMasterItemDataJSON:new Object,browseUrlIdentifier:"/b/",rrIndividualItemDataJSON:new Object,initialize:function(){page=pageType.getPageType();if(page==pageType.BROWSE){this.setUpRRInstrumentationForCategory(0)}if(page==pageType.HOME){this.setUpRRInstrumentationForHome()}if(page==pageType.QUICK_ORDER){this.setUpRRInstrumentationForQuickOrder()}if(page==pageType.DETAIL){this.setUpRRInstrumentationForPdp()}if(page==pageType.ORDER_CONFIRM){this.setUpRRInstrumentationForOrderConfirm()}if(page==pageType.HUC){this.setUpRRInstrumentationForHUC()}if(page==pageType.CART){this.setUpRRInstrumentationForCart()}},setAfterPagination:function(){var page=pageType.getPageType();if(page==pageType.BROWSE_TIER3){this.setUpRRInstrumentationForCategory(1)}if(page==pageType.SEARCH){this.setUpRRInstrumentationForSearch()}},getId:function(){return(omnitureJSON.asin!=null)?omnitureJSON.asin:""},getCategoryName:function(){return(omnitureJSON.categoryName!=null)?omnitureJSON.categoryName.replace(/\"/g,"''"):this.getLeafCategoryName().replace(/\"/g,"''")},getCategoryId:function(){return(omnitureJSON.categoryId!=null)?omnitureJSON.categoryId:this.getLeafCategoryId()},getMiniDetailCategoryName:function(){return(mdp_omnitureJSON.categoryName!=null)?mdp_omnitureJSON.categoryName:""},getMiniDetailCategoryId:function(){return(mdp_omnitureJSON.categoryId!=null)?mdp_omnitureJSON.categoryId:""},getUserSessionId:function(){var name="session-id";var start=document.cookie.indexOf(name+"=");var len=start+name.length+1;var end=document.cookie.indexOf(";",len);if(end==-1){end=document.cookie.length}return unescape(document.cookie.substring(len,end))},getCustomerId:function(){var customerID=null;var jObj=jQuery("input[name='hashedEncryptedCustId']");if(jObj.length>0){customerID=jObj.val()}return(customerID!=null&&customerID!="")?customerID:this.getUserSessionId()},getRecommendable:function(){if(typeof(omnitureJSON)!="undefined"&&typeof(Templates)!="undefined"&&(omnitureJSON.templateUsed==Templates.SUITS||omnitureJSON.templateUsed==Templates.LINGERIE)){var available=null;if(omnitureJSON.templateUsed==Templates.SUITS){available=jQuery("#products").find("."+this.getId()).find(".quantity")}if(omnitureJSON.templateUsed==Templates.LINGERIE){available=jQuery("#featured").find(".quantity")}if(available.length>0){return"true"}else{return"false"}}var length=jQuery(".addToBasket").length;if(length>0){return"true"}else{return"false"}},getR3Common:function(){var R3_COMMON=new r3_common();R3_COMMON.setApiKey("2a4f722e869d7c81");var domainOnPage=document.domain;if(domainOnPage.indexOf("marksandspencer.com")<0){R3_COMMON.setBaseUrl(window.location.protocol+"//integration.richrelevance.com/rrserver/")}else{R3_COMMON.setBaseUrl(window.location.protocol+"//recs.richrelevance.com/rrserver/")}R3_COMMON.setSessionId(rrInfoGet.getUserSessionId());R3_COMMON.setUserId(rrInfoGet.getCustomerId());return R3_COMMON},setGenreId:function(){var breadcrumb=jQuery("#breadcrumb li a");if(breadcrumb.length==0){this.rrPDPMasterItemDataJSON.genreId="42966030";return}var link=breadcrumb.eq(0).attr("href");if(breadcrumb.length>1){link=breadcrumb.eq(1).attr("href")}this.rrPDPMasterItemDataJSON.genreId=link.substring(link.indexOf(this.browseUrlIdentifier)+this.browseUrlIdentifier.length,link.indexOf("?"))},getLeafCategoryId:function(){var breadcrumb=jQuery("#breadcrumb li a");if(breadcrumb.length==0){return"42966030"}var link=breadcrumb.eq(0).attr("href");if(breadcrumb.length>1){link=breadcrumb.eq(breadcrumb.length-1).attr("href")}return link.substring(link.indexOf(this.browseUrlIdentifier)+this.browseUrlIdentifier.length,link.indexOf("?"))},getLeafCategoryName:function(){var breadcrumb=jQuery("#breadcrumb li a");if(breadcrumb.length==0){return"Homepage"}var linkName=breadcrumb.eq(0).html();if(breadcrumb.length>1){linkName=breadcrumb.eq(breadcrumb.length-1).html()}if(linkName==null){return"Homepage"}return linkName},setPricesFromPDP:function(){this.rrPDPMasterItemDataJSON={priceData:new Object,genreId:"42966030"};this.rrPDPMasterItemDataJSON.priceData={listPrice:0,salePrice:0,isOutOfStock:true,minListPrice:MAX_PRICE_POSSIBLE,maxListPrice:0,minSalePrice:MAX_PRICE_POSSIBLE,maxSalePrice:0,onSale:false,onSpecialOffer:false,isNew:false};var colData=window.collectionData;if(typeof(colData)!="undefined"){var isEmpty=true;for(var i in colData){if(isEmpty){isEmpty=false}this.setIndividualAsinBuyabilityData(i,colData[i])}if(isEmpty){return}if(typeof(omnitureJSON)!="undefined"&&typeof(Templates)!="undefined"&&omnitureJSON.templateUsed!=Templates.OUTFITS){if(typeof(currentAsin)!="undefined"&&typeof(this.rrIndividualItemDataJSON[currentAsin])!="undefined"){this.rrPDPMasterItemDataJSON.priceData=this.rrIndividualItemDataJSON[currentAsin]}if(this.rrPDPMasterItemDataJSON.priceData.onSpecialOffer){this.rrPDPMasterItemDataJSON.priceData.onSale=false}if(this.rrPDPMasterItemDataJSON.priceData.onSale||this.rrPDPMasterItemDataJSON.priceData.onSpecialOffer){this.rrPDPMasterItemDataJSON.priceData.isNew=false}}else{for(var i in this.rrIndividualItemDataJSON){var rrData=this.rrIndividualItemDataJSON[i];if(!this.rrPDPMasterItemDataJSON.priceData.onSale){this.rrPDPMasterItemDataJSON.priceData.onSale=rrData.onSale}if(!this.rrPDPMasterItemDataJSON.priceData.onSpecialOffer){this.rrPDPMasterItemDataJSON.priceData.onSpecialOffer=rrData.onSpecialOffer}if(!this.rrPDPMasterItemDataJSON.priceData.isNew){this.rrPDPMasterItemDataJSON.priceData.isNew=rrData.isNew}if(rrData.isOutOfStock){continue}if(this.rrPDPMasterItemDataJSON.priceData.isOutOfStock){this.rrPDPMasterItemDataJSON.priceData.isOutOfStock=false}if(rrData.onSale||rrData.onSpecialOffer){this.rrPDPMasterItemDataJSON.priceData.minSalePrice=(parseFloat(rrData.minSalePrice)<parseFloat(this.rrPDPMasterItemDataJSON.priceData.minSalePrice))?rrData.minSalePrice:this.rrPDPMasterItemDataJSON.priceData.minSalePrice;this.rrPDPMasterItemDataJSON.priceData.maxSalePrice=(parseFloat(rrData.maxSalePrice)>parseFloat(this.rrPDPMasterItemDataJSON.priceData.maxSalePrice))?rrData.maxSalePrice:this.rrPDPMasterItemDataJSON.priceData.maxSalePrice}else{this.rrPDPMasterItemDataJSON.priceData.minSalePrice=(parseFloat(rrData.minListPrice)<parseFloat(this.rrPDPMasterItemDataJSON.priceData.minSalePrice))?rrData.minListPrice:this.rrPDPMasterItemDataJSON.priceData.minSalePrice;this.rrPDPMasterItemDataJSON.priceData.maxSalePrice=(parseFloat(rrData.maxListPrice)>parseFloat(this.rrPDPMasterItemDataJSON.priceData.maxSalePrice))?rrData.maxListPrice:this.rrPDPMasterItemDataJSON.priceData.maxSalePrice}this.rrPDPMasterItemDataJSON.priceData.minListPrice=(parseFloat(rrData.minListPrice)<parseFloat(this.rrPDPMasterItemDataJSON.priceData.minListPrice))?rrData.minListPrice:this.rrPDPMasterItemDataJSON.priceData.minListPrice;this.rrPDPMasterItemDataJSON.priceData.maxListPrice=(parseFloat(rrData.maxListPrice)>parseFloat(this.rrPDPMasterItemDataJSON.priceData.maxListPrice))?rrData.maxListPrice:this.rrPDPMasterItemDataJSON.priceData.maxListPrice}if(this.rrPDPMasterItemDataJSON.priceData.onSpecialOffer){this.rrPDPMasterItemDataJSON.priceData.onSale=false}if(this.rrPDPMasterItemDataJSON.priceData.onSale||this.rrPDPMasterItemDataJSON.priceData.onSpecialOffer){this.rrPDPMasterItemDataJSON.priceData.isNew=false}else{this.rrPDPMasterItemDataJSON.priceData.minSalePrice=MAX_PRICE_POSSIBLE;this.rrPDPMasterItemDataJSON.priceData.maxSalePrice=0}}if(this.rrPDPMasterItemDataJSON.priceData.minListPrice==MAX_PRICE_POSSIBLE){this.rrPDPMasterItemDataJSON.priceData.minListPrice=-1}if(this.rrPDPMasterItemDataJSON.priceData.minSalePrice==MAX_PRICE_POSSIBLE){this.rrPDPMasterItemDataJSON.priceData.minSalePrice=-1}if(this.rrPDPMasterItemDataJSON.priceData.maxListPrice==0){this.rrPDPMasterItemDataJSON.priceData.maxListPrice=this.rrPDPMasterItemDataJSON.priceData.minListPrice}if(this.rrPDPMasterItemDataJSON.priceData.maxSalePrice==0){this.rrPDPMasterItemDataJSON.priceData.maxSalePrice=this.rrPDPMasterItemDataJSON.priceData.minSalePrice}this.rrPDPMasterItemDataJSON.listPrice=this.rrPDPMasterItemDataJSON.priceData.minListPrice;this.rrPDPMasterItemDataJSON.priceData.onSalePrice=this.rrPDPMasterItemDataJSON.priceData.minSalePrice}},setIndividualAsinBuyabilityData:function(asin,asinDAO){var isOnSale=false;var isOnSpecialOffer=false;var isOutOfStock=false;var isNew=false;var minListPrice=MAX_PRICE_POSSIBLE;var maxListPrice=0;var minSalePrice=MAX_PRICE_POSSIBLE;var maxSalePrice=0;var pricePattern=/[0-9,]+[.]?[0-9]{0,2}/g;var allBuyingPrices=new Object;var allHistoricalPrices=new Object;var prices=[];var isVariationalParent=false;if((typeof(asinDAO.asinData)=="undefined"||asinDAO.asinData==null)&&typeof(asinDAO.priceLabel)!="undefined"&&typeof(asinDAO.isVariationalParent)!="undefined"){prices.push(asinDAO.priceLabel);isVariationalParent=asinDAO.isVariationalParent;isOutOfStock=asinDAO.isOutOfStock}else{if(typeof(asinDAO.asinData.priceLabel)!="undefined"&&typeof(asinDAO.asinData.isVariationalParent)!="undefined"){prices.push(asinDAO.asinData.priceLabel);isVariationalParent=asinDAO.asinData.isVariationalParent;isOutOfStock=asinDAO.asinData.isOutOfStock}}if(isVariationalParent&&typeof(asinDAO.variationChildren)!="undefined"){for(var vc in asinDAO.variationChildren){var price=asinDAO.variationChildren[vc].priceLabel;if(price!=""){prices.push(price)}}}for(var p in prices){var onSale=false;var onSpecialOffer=false;var jPriceObj=jQuery(prices[p]);var priceClass=jPriceObj.attr("class");var priceString=jPriceObj.find(".priceString").eq(0).html();if(typeof(priceClass)!="undefined"&&priceClass.indexOf("SALE")!=-1||(priceString!=null&&priceString.indexOf("Sale")!=-1)){onSale=true}else{if(typeof(priceClass)!="undefined"&&priceClass.indexOf("SPECIAL_OFFER")!=-1||(priceString!=null&&priceString.indexOf("Special Offer")!=-1)){onSpecialOffer=true}}if(!isNew){isNew=(jPriceObj.find(".priceString").eq(0).find(".productIsNew").length>0)?true:false}if(!isOnSale&&onSale){isOnSale=true}if(!isOnSpecialOffer&&onSpecialOffer){isOnSpecialOffer=true}var variationPrices=jPriceObj.find(".priceString").eq(0).text().replace(/,/g,"").match(pricePattern);if(variationPrices!=null){for(var i=0;i<variationPrices.length;i++){allBuyingPrices[variationPrices[i]]=1}}if(onSale||onSpecialOffer){variationPrices=jPriceObj.find(".priceHistoryInner").eq(0).text().replace(/,/g,"").match(pricePattern);if(variationPrices!=null){for(var i=0;i<variationPrices.length;i++){allHistoricalPrices[variationPrices[i]]=1}}}}var allBuyingPriceList=[];var allHistoricalPriceList=[];for(var i in allBuyingPrices){allBuyingPriceList.push(parseFloat(i))}for(var i in allHistoricalPrices){allHistoricalPriceList.push(parseFloat(i))}if(isOnSale||isOnSpecialOffer){var prices=getMinMaxFromArray(allBuyingPriceList);minSalePrice=prices[0];maxSalePrice=prices[1];prices=getMinMaxFromArray(allHistoricalPriceList);minListPrice=prices[0];maxListPrice=prices[1]}else{var prices=getMinMaxFromArray(allBuyingPriceList);minListPrice=prices[0];maxListPrice=prices[1]}this.rrIndividualItemDataJSON[asin]={onSale:isOnSale,isOutOfStock:isOutOfStock,onSpecialOffer:isOnSpecialOffer,isNew:isNew,minListPrice:minListPrice,maxListPrice:maxListPrice,minSalePrice:minSalePrice,maxSalePrice:maxSalePrice}},getListPrice:function(){if(parseFloat(this.rrPDPMasterItemDataJSON.listPrice)>0){return this.rrPDPMasterItemDataJSON.listPrice}else{return this.getListPriceMin()}},getSalePrice:function(){if(parseFloat(this.rrPDPMasterItemDataJSON.priceData.onSalePrice)>0){return this.rrPDPMasterItemDataJSON.priceData.onSalePrice}else{return this.getSalePriceMin()}},getListPriceMin:function(){if(this.rrPDPMasterItemDataJSON.priceData.minListPrice<0){return null}return this.rrPDPMasterItemDataJSON.priceData.minListPrice},getSalePriceMin:function(){if(this.rrPDPMasterItemDataJSON.priceData.minSalePrice<0){return null}return this.rrPDPMasterItemDataJSON.priceData.minSalePrice},getListPriceMax:function(){return this.rrPDPMasterItemDataJSON.priceData.maxListPrice},getSalePriceMax:function(){return this.rrPDPMasterItemDataJSON.priceData.maxSalePrice},isSale:function(){return this.rrPDPMasterItemDataJSON.priceData.onSale},isSpecialOffer:function(){return this.rrPDPMasterItemDataJSON.priceData.onSpecialOffer},isNew:function(){return this.rrPDPMasterItemDataJSON.priceData.isNew},getGenreId:function(){return this.rrPDPMasterItemDataJSON.genreId},getDisplayListPrice:function(){if(this.rrPDPMasterItemDataJSON.priceData.minListPrice<0){return null}if(this.rrPDPMasterItemDataJSON.priceData.minListPrice==this.rrPDPMasterItemDataJSON.priceData.maxListPrice){return this.rrPDPMasterItemDataJSON.priceData.minListPrice+""}else{return this.rrPDPMasterItemDataJSON.priceData.minListPrice+" - "+this.rrPDPMasterItemDataJSON.priceData.maxListPrice}},getDisplaySalePrice:function(){if(this.rrPDPMasterItemDataJSON.priceData.minSalePrice<0){return null}if(this.rrPDPMasterItemDataJSON.priceData.minSalePrice==this.rrPDPMasterItemDataJSON.priceData.maxSalePrice){return this.rrPDPMasterItemDataJSON.priceData.minSalePrice+""}else{return this.rrPDPMasterItemDataJSON.priceData.minSalePrice+" - "+this.rrPDPMasterItemDataJSON.priceData.maxSalePrice}},setUpRRInstrumentationForHome:function(){if((typeof(r3_home)!="undefined")&&(typeof(r3)!="undefined")&&(typeof(r3_common)!="undefined")){R3_COMMON=this.getR3Common();R3_HOME=new r3_home();r3()}},setUpRRInstrumentationForMdp:function(asin){R3_COMMON=this.getR3Common();R3_ITEM=new r3_item();R3_ITEM.setId(asin);if(jQuery(".quickInfo").find("input.addToBasket").length>0){R3_ITEM.setRecommendable("true")}else{R3_ITEM.setRecommendable("false")}r3()},setUpRRInstrumentationForPdp:function(){var templateMatched=false;if((typeof(Templates)!="undefined"&&typeof(omnitureJSON)!="undefined")){for(var template in Templates){if(omnitureJSON.templateUsed==Templates[template]){templateMatched=true;break}}}if(!templateMatched){return}if((typeof(r3_item)!="undefined")&&(typeof(r3)!="undefined")&&(typeof(r3_common)!="undefined")){R3_COMMON=this.getR3Common();R3_COMMON.addPlacementType("item_page.api1");R3_COMMON.addPlacementType("item_page.api2");R3_ITEM=new r3_item();this.setPricesFromPDP();this.setGenreId();R3_ITEM.setId(this.getId());R3_ITEM.setTopLevelGenre(this.getGenreId());var recommended=this.getRecommendable();if(recommended=="true"){var lp=this.getListPrice();if(lp!=null&&lp>0){R3_ITEM.setPrice(lp)}var sp=this.getSalePrice();if(sp!=null&&sp>0){R3_ITEM.setSalePrice(sp)}var dlp=this.getDisplayListPrice();if(dlp!=null&&dlp.length>0){R3_ITEM.addAttribute("displayListPrice",dlp)}var dsp=this.getDisplaySalePrice();if(dsp!=null&&dsp.length>0){R3_ITEM.addAttribute("displaySalePrice",dsp)}}R3_ITEM.addAttribute("isSale",this.isSale());R3_ITEM.addAttribute("isNew",this.isNew());R3_ITEM.addAttribute("isSpecialOffer",this.isSpecialOffer());R3_ITEM.setRecommendable(recommended);R3_ITEM.addCategory(this.getCategoryId(),this.getCategoryName());if((typeof(Templates)!="undefined")&&(omnitureJSON.templateUsed==Templates.SUITS)){jQuery(".youMayAlsoLike .carousel .products li:visible input[name='asin']:lt(2)").each(function(index){var asins=jQuery(this).val();R3_ITEM.blockItemId(asins)})}if((typeof(Templates)!="undefined")&&(omnitureJSON.templateUsed==Templates.FLOWER)){jQuery(".addExtras .contents > .clearfix > li:visible input[name='asin']:lt(3)").each(function(index){var asins=jQuery(this).val();R3_ITEM.blockItemId(asins)})}if((typeof(Templates)!="undefined")&&(omnitureJSON.templateUsed==Templates.OUTFITS)){jQuery(".otherLooks .carousel .products li:visible input[name='asin']:lt(2)").each(function(index){var asins=jQuery(this).val();R3_ITEM.blockItemId(asins)})}for(var i=0;i<omnitureJSON.relatedAsins.length;i++){if(omnitureJSON.relatedAsins[i]!=this.getId()){R3_ITEM.blockItemId(omnitureJSON.relatedAsins[i])}}r3()}},setUpRRInstrumentationForSearch:function(){if((typeof(r3_search)!="undefined")&&(typeof(r3)!="undefined")&&(typeof(r3_common)!="undefined")){R3_COMMON=this.getR3Common();R3_COMMON.addPlacementType("search_page.api1");R3_COMMON.addPlacementType("search_page.api2");R3_SEARCH=new r3_search();if(typeof(searchJSON)!="undefined"){R3_SEARCH.setTerms(searchJSON.keywords)}jQuery(".searchResults .searchResultsRow input[name='asin']:lt(15)").each(function(index){var asins=jQuery(this).val();R3_SEARCH.addItemId(asins)});var searchString=document.location.search;if(typeof(searchJSON)!="undefined"&&searchJSON.hasRefinements!=false){this.addRefinement(searchString)}r3()}},setUpRRInstrumentationForCategory:function(kind){if((typeof(r3_category)!="undefined")&&(typeof(r3)!="undefined")&&(typeof(r3_item)!="undefined")&&(typeof(r3_common)!="undefined")){R3_COMMON=this.getR3Common();R3_CATEGORY=new r3_category();R3_CATEGORY.setId((document.location.pathname).split("/b/")[1]);var categoryName=jQuery("#vcsContent .leftNav .nonFloatedProduct .lNavHeader").text();R3_CATEGORY.setName(jQuery.trim(categoryName));if(kind==1){R3_COMMON.addPlacementType("category_page.api1");R3_COMMON.addPlacementType("category_page.api2");var searchString=document.location.search;if(searchString.indexOf("rh=")!=-1){this.addRefinement(searchString)}R3_ITEM=new r3_item();jQuery(".searchResults .searchResultsRow input[name='asin']").each(function(index){var asins=jQuery(this).val();R3_ITEM.blockItemId(asins)})}r3()}},addRefinement:function(refinementString){refinementString=unescape(refinementString.substring(refinementString.indexOf("rh=")));refinementString=refinementString.substring(0,refinementString.indexOf("&"));var startindex,endindex,value;for(var i=0;i<codes.length;i++){startindex=refinementString.indexOf(codes[i]);if(startindex!=-1){startindex=startindex+(codes[i].length)+1;endindex=refinementString.indexOf(",",startindex);if(endindex==-1){endindex=refinementString.length}value=refinementString.substring(startindex,endindex);R3_COMMON.addRefinement(names[i],value)}}},setUpRRInstrumentationForQuickOrder:function(){if((typeof(r3)!="undefined")&&(typeof(r3_common)!="undefined")){R3_COMMON=this.getR3Common();r3()}},setUpRRInstrumentationForHUC:function(){if((typeof(r3_addtocart)!="undefined")&&(typeof(r3)!="undefined")&&(typeof(r3_common)!="undefined")){R3_COMMON=this.getR3Common();R3_COMMON.addPlacementType("add_to_cart_page.api1");R3_COMMON.addPlacementType("add_to_cart_page.api2");R3_COMMON.addPlacementType("add_to_cart_page.api3");R3_COMMON.addPlacementType("add_to_cart_page.api4");R3_COMMON.addPlacementType("add_to_cart_page.api5");R3_COMMON.addPlacementType("add_to_cart_page.api6");R3_ADDTOCART=new r3_addtocart();var hucItems=jQuery(".recentlyAddedItems .cartItems .item");if(hucItems.length>0){hucItems.find(".itemFullInfo").each(function(index){var jObj=jQuery(this);var asin=jObj.find('input[name="asin"]').val();R3_ADDTOCART.addItemIdToCart(asin)})}r3()}},setUpRRInstrumentationForCart:function(){if((typeof(r3_cart)!="undefined")&&(typeof(r3)!="undefined")&&(typeof(r3_common)!="undefined")){R3_COMMON=this.getR3Common();var cartItems=jQuery(".cartItems .activeItemsBody .cartItemSummary");R3_COMMON.addPlacementType("cart_page.api1");R3_COMMON.addPlacementType("cart_page.api2");R3_CART=new r3_cart();if(cartItems.length>0){var parentAsins=new Array();cartItems.find(".itemInfo input[name^='cart.asin']").each(function(index){var jObj=jQuery(this);var parentAsin=jObj.val();parentAsins.push(parentAsin);var index=jQuery.inArray(parentAsin,parentAsins);var lastIndex=jQuery.inArray(parentAsin,parentAsins);if(index==lastIndex){R3_CART.addItemId(parentAsin)}})}r3()}},setUpRRInstrumentationForOrderConfirm:function(){if((typeof(r3_purchased)!="undefined")&&(typeof(r3)!="undefined")&&(typeof(r3_common)!="undefined")){R3_COMMON=this.getR3Common();R3_PURCHASED=new r3_purchased();if(typeof(orderDetailsJSON)!="undefined"){var purchaseId=(orderDetailsJSON.purchaseId!=null)?orderDetailsJSON.purchaseId:"";R3_PURCHASED.setOrderNumber(purchaseId);var purchasedItems=orderDetailsJSON.purchasedItems;for(var i=0;i<purchasedItems.length;++i){R3_PURCHASED.addItemIdPriceQuantity(purchasedItems[i].asin,purchasedItems[i].price,purchasedItems[i].quantity)}}r3()}}};var caraouselImages={caraouselNextDefault:"http://g-ecx.images-amazon.com/images/G/02/MandS/en_GB/images/js/arrow_right._V183755107_.gif",caraouselNextDisabled:"http://g-ecx.images-amazon.com/images/G/02/MandS/en_GB/images/js/disableRIGHT._V182899872_.jpg",caraouselNextHover:"http://g-ecx.images-amazon.com/images/G/02/MandS/en_GB/images/js/HOVERRIGHT._V182535709_.jpg",caraouselPrevDefault:"http://g-ecx.images-amazon.com/images/G/02/MandS/en_GB/images/js/arrow_left._V183755107_.gif",caraouselPrevDisabled:"http://g-ecx.images-amazon.com/images/G/02/MandS/en_GB/images/js/disableLEFT._V182899874_.jpg",caraouselPrevHover:"http://g-ecx.images-amazon.com/images/G/02/MandS/en_GB/images/js/HOVERLEFT._V182535683_.jpg"};var isSearchBrowse=false;var isRRWidgetData=false;var rrLayout={rrGlobalAsinInfoJson:new Object(),hasRRDataBeenDisplayed:false,isAmazonTreatment:false,showQuickInfo:1,removeWidget:function(type){var rrItems=jQuery(".rrRecommendedItems");rrItems.eq(type).css("display","none")},displayAmzData:function(){this.isAmazonTreatment=true;if(!this.hasRRDataBeenDisplayed){this.hasRRDataBeenDisplayed=true}else{return false}var page=pageType.getPageType();if(page==pageType.BROWSE){}if(page==pageType.HOME){}if(page==pageType.QUICK_ORDER){}if((page==pageType.DETAIL)&&(typeof(rrDetailPageLayoutComponent)!="undefined")){rrDetailPageLayoutComponent.hideRRData();rrDetailPageLayoutComponent.showAmazonData();if(typeof(detailOmniture)!="undefined"){detailOmniture.initialize()}}if(page==pageType.ORDER_CONFIRM){}if((page==pageType.HUC)&&(typeof(rrHucLayoutComponent)!="undefined")){rrHucLayoutComponent.showAmazonData();if(typeof(cartOmniture)!="undefined"){cartOmniture.initialize()}}if((page==pageType.CART)&&(typeof(rrCartLayoutComponent)!="undefined")){s.eVar35="Widget_AMZ";rrCartLayoutComponent.showAmazonData();if(typeof(cartOmniture)!="undefined"){cartOmniture.initialize()}}if(page==pageType.SEARCH){isSearchBrowse=true;if(typeof(searchOmniture)!="undefined"){searchOmniture.initialize()}}if(page==pageType.BROWSE_TIER3){isSearchBrowse=true;if(typeof(browseOmniture)!="undefined"){browseOmniture.initialize()}}},displayRRData:function(addQuickInfo){if(!this.hasRRDataBeenDisplayed){this.hasRRDataBeenDisplayed=true;this.showQuickInfo=addQuickInfo;this.renderRRWidgetsOnDifferentPages();if(addQuickInfo==1){s.eVar35="Widget_RR";isRRWidgetData=true;var rrItems=jQuery(".rrRecommendedItems .products")}}},getWidgetAcronym:function(str){return jQuery.map(str.split(/\s|_/),function(word){return word.charAt(0).toUpperCase()}).join("")},renderRRWidgetsOnDifferentPages:function(){var page=pageType.getPageType();if(page==pageType.BROWSE){}if(page==pageType.HOME){}if(page==pageType.QUICK_ORDER){}if(page==pageType.DETAIL){rrDetailPageLayoutComponent.initialize()}if(page==pageType.ORDER_CONFIRM){}if(page==pageType.HUC){rrHucLayoutComponent.initialize()}if(page==pageType.CART){rrCartLayoutComponent.initialize()}if(page==pageType.SEARCH){rrSearchLayout.initialize()}if(page==pageType.BROWSE_TIER3){rrBrowseLayout.initialize()}},getHTMLDataForPlacements:function(sourcePlacement,destinationPlacement,imgSizeNeeded,callingPlacementIdentifier,numberOfProducts,processHTMLData){if(sourcePlacement.length==0||destinationPlacement.length==0){return null}var asinJSON=new Object();sourcePlacement.each(function(index){var asin=jQuery(this).find(".asin").text();var url=jQuery(this).find(".url").text();var itemType=jQuery(this).find(".itemType").text();asinJSON[asin]={url:url,itemType:itemType}});this.rrGlobalAsinInfoJson=jQuery.extend(this.rrGlobalAsinInfoJson,asinJSON);var newURL=relatedItemsLoader.formTheSecureSingleAppURL(asinJSON);if(newURL==null){return null}if(typeof(imgSizeNeeded)!="undefined"&&imgSizeNeeded>0){newURL=relatedItemsLoader.addAttributeToURL(newURL,"thumbImageSize",imgSizeNeeded);destinationPlacement.css("min-height",imgSizeNeeded)}if(typeof(numberOfProducts)!="undefined"&&numberOfProducts>0){newURL=relatedItemsLoader.addAttributeToURL(newURL,"numProductsToDisplay",numberOfProducts)}if(destinationPlacement.find(".rrWidgetTitle").text().length==0){destinationPlacement.find(".rrWidgetTitle").text(rrDefaultWidgetName.widget1)}if(typeof(relatedItemsLoader)!="undefined"){destinationPlacement.show();if(destinationPlacement.find(".relatedItemsLoading").length==0){jQuery(".rrData .relatedItemsLoading").eq(0).clone().appendTo(destinationPlacement)}relatedItemsLoader.relatedItemsAjaxCall(newURL,processHTMLData,callingPlacementIdentifier)}return 1},putHTMLDataInPlacement:function(htmlObject,destinationContainer,carouselLimit,isHorizontal,attachQuickInfo){relatedItemsLoader.populateHMTLDataInContainer(jQuery(htmlObject),destinationContainer);if(carouselLimit>0){jQuery(destinationContainer).find(".carousel").attachCarousel(carouselLimit,isHorizontal)}rrLayout.applyClickThroughURL(destinationContainer);if(attachQuickInfo&&rrLayout.showQuickInfo){quickViewComponent.initialize(destinationContainer.find(".carousel").find("ul.products"),0)}},applyClickThroughURL:function(destinationContainer){destinationContainer.find("ul.products").find("li").each(function(index){var asin=jQuery(this).find("img").attr("name");var asinData=rrLayout.rrGlobalAsinInfoJson;if(typeof(asinData)!="undefined"&&typeof(asinData[asin])!="undefined"){jQuery(this).find("a").attr("href",asinData[asin].url)}})}};var rrCartLayoutComponent={numberOfPlcamentsDone:0,TOTAL_PLACEMENTS:2,preProcess:function(){jQuery("#pageId1000 .imagesColumn").css("border-top","1px solid #CCCCCC");jQuery("#pageId1000 div#breadcrumb").css("border-bottom","0 none")},initialize:function(){this.preProcess();var res_1=rrLayout.getHTMLDataForPlacements(jQuery("div#rr_placement_0").find("div.rrRecommendedItems li.product"),jQuery(".rrTop"),110,"CART_P1",3,rrCartLayoutComponent.processHTML);if(res_1==null){rrCartLayoutComponent.numberOfPlcamentsDone++}var res_2=rrLayout.getHTMLDataForPlacements(jQuery("div#rr_placement_1").find("div.rrRecommendedItems li.product"),jQuery(".rrBottom"),110,"CART_P2",2,rrCartLayoutComponent.processHTML);if(res_2==null){rrCartLayoutComponent.numberOfPlcamentsDone++}if(res_1==null&&res_2==null){rrCartLayoutComponent.hideRRData()}},processHTML:function(identifier,htmlObject){rrCartLayoutComponent.numberOfPlcamentsDone++;if(typeof(htmlObject)!="undefined"&&htmlObject!=null){if(identifier=="CART_P1"){var destinationContainer=jQuery(".rrTop");rrLayout.putHTMLDataInPlacement(htmlObject,destinationContainer,0,false,true)}if(identifier=="CART_P2"){var destinationContainer=jQuery(".rrBottom");rrLayout.putHTMLDataInPlacement(htmlObject,destinationContainer,0,false,true)}}else{if(identifier=="CART_P1"){jQuery(".rrTop").hide()}if(identifier=="CART_P2"){jQuery(".rrBottom").hide()}}if(rrCartLayoutComponent.numberOfPlcamentsDone==rrCartLayoutComponent.TOTAL_PLACEMENTS){if(jQuery(".rrWidget").find(".carousel").find("li").length==0){rrCartLayoutComponent.hideRRData();return 0}else{omnitureInitializerForRR.initialize()}}},showAmazonData:function(){if(jQuery("#cartFeatured .hproduct").find(".carousel").find("li").length>0){jQuery("#cartFeatured .hproduct .carousel").show();jQuery("div#breadcrumb").css("border-bottom","1px solid #CCCCCC");jQuery("#cartFeatured .imagesColumn").css("border-top","0 none")}},hideRRData:function(){jQuery(".rrWidget").css("display","none")},patchLayout:function(){var cartContainerHeight=jQuery("#cartFeatured .imagesColumn").height();var recContainerHeight=jQuery("#cartFeatured").height();if(recContainerHeight>cartContainerHeight){jQuery(".imagesColumn").height(recContainerHeight)}}};var rrHucLayoutComponent={numberOfPlcamentsDone:0,TOTAL_PLACEMENTS:6,initialize:function(){var res_1=rrLayout.getHTMLDataForPlacements(jQuery("div#rr_placement_0").find("div.rrRecommendedItems li.product"),jQuery(".rrLeft1"),165,"HUC_P1",4,rrHucLayoutComponent.processHTML);if(res_1==null){rrHucLayoutComponent.numberOfPlcamentsDone++}var res_2=rrLayout.getHTMLDataForPlacements(jQuery("div#rr_placement_1").find("div.rrRecommendedItems li.product"),jQuery(".rrLeft2"),165,"HUC_P2",4,rrHucLayoutComponent.processHTML);if(res_2==null){rrHucLayoutComponent.numberOfPlcamentsDone++}var res_3=rrLayout.getHTMLDataForPlacements(jQuery("div#rr_placement_2").find("div.rrRecommendedItems li.product"),jQuery(".rrLeft3"),165,"HUC_P3",4,rrHucLayoutComponent.processHTML);if(res_3==null){rrHucLayoutComponent.numberOfPlcamentsDone++}var res_4=rrLayout.getHTMLDataForPlacements(jQuery("div#rr_placement_3").find("div.rrRecommendedItems li.product"),jQuery(".rrLeft4"),165,"HUC_P4",4,rrHucLayoutComponent.processHTML);if(res_4==null){rrHucLayoutComponent.numberOfPlcamentsDone++}var res_5=rrLayout.getHTMLDataForPlacements(jQuery("div#rr_placement_4").find("div.rrRecommendedItems li.product"),jQuery(".rrLeft5"),165,"HUC_P5",4,rrHucLayoutComponent.processHTML);if(res_5==null){rrHucLayoutComponent.numberOfPlcamentsDone++}var res_6=rrLayout.getHTMLDataForPlacements(jQuery("div#rr_placement_5").find("div.rrRecommendedItems li.product"),jQuery(".rrLeft6"),165,"HUC_P6",4,rrHucLayoutComponent.processHTML);if(res_6==null){rrHucLayoutComponent.numberOfPlcamentsDone++}if(res_1==null&&res_2==null&&res_3==null&&res_4==null&&res_5==null&&res_6==null){rrHucLayoutComponent.hideRRData()}},processHTML:function(identifier,htmlObject){rrHucLayoutComponent.numberOfPlcamentsDone++;if(typeof(htmlObject)!="undefined"&&htmlObject!=null){if(identifier=="HUC_P1"){var destinationContainer=jQuery(".rrLeft1");rrLayout.putHTMLDataInPlacement(htmlObject,destinationContainer,0,true,true)}if(identifier=="HUC_P2"){var destinationContainer=jQuery(".rrLeft2");rrLayout.putHTMLDataInPlacement(htmlObject,destinationContainer,0,true,true)}if(identifier=="HUC_P3"){var destinationContainer=jQuery(".rrLeft3");rrLayout.putHTMLDataInPlacement(htmlObject,destinationContainer,0,true,true)}if(identifier=="HUC_P4"){var destinationContainer=jQuery(".rrLeft4");rrLayout.putHTMLDataInPlacement(htmlObject,destinationContainer,0,true,true)}if(identifier=="HUC_P5"){var destinationContainer=jQuery(".rrLeft5");rrLayout.putHTMLDataInPlacement(htmlObject,destinationContainer,0,true,true)}if(identifier=="HUC_P6"){var destinationContainer=jQuery(".rrLeft6");rrLayout.putHTMLDataInPlacement(htmlObject,destinationContainer,0,true,true)}}else{if(identifier=="HUC_P1"){jQuery(".rrLeft1").hide()}if(identifier=="HUC_P2"){jQuery(".rrLeft2").hide()}if(identifier=="HUC_P3"){jQuery(".rrLeft3").hide()}if(identifier=="HUC_P4"){jQuery(".rrLeft4").hide()}if(identifier=="HUC_P5"){jQuery(".rrLeft5").hide()}if(identifier=="HUC_P6"){jQuery(".rrLeft6").hide()}}if(rrHucLayoutComponent.numberOfPlcamentsDone==rrHucLayoutComponent.TOTAL_PLACEMENTS){if(jQuery(".imagesColumn").find(".rrWidget").find("li").length==0){rrHucLayoutComponent.hideRRData()}else{omnitureInitializerForRR.initialize()}}},showAmazonData:function(){jQuery("div#cartFeatured div.imagesColumn .carousel").show()},hideRRData:function(){jQuery("div#cartFeatured div.imagesColumn").find(".rrWidget").css("display","none")}};var rrDetailPageLayoutComponent={widgetContainer:null,YMALPlacementContainer:null,tabContainer:null,TOTAL_PLACEMENTS:2,numberOfPlacementsDone:0,hideRRData:function(){relatedItemsLoader.tabsContainer=jQuery("#browseMore .relatedItems").find("ul.tabs");var index=relatedItemsLoader.findTheTabIndex(relatedItemsLoader.tabsContainer,tabNameMap["#similarities"]);var rrTab=relatedItemsLoader.tabsContainer.find("li").eq(index);if(jQuery(rrTab).length>0){if(rrTab.hasClass("rrCreated")){jQuery(rrTab).remove()}var tabClass=".tab"+index;jQuery("#browseMore .relatedItems").find(tabClass).remove();relatedItemsLoader.setVariables()}},showAmazonData:function(){var index=relatedItemsLoader.findTheTabIndex(relatedItemsLoader.tabsContainer,tabNameMap["#otherCollectionPieces1"]);if(index>=0){relatedItemsLoader.tabsContainer.find("li").eq(index).show()}jQuery("#browseMore").find(".youMayAlsoLike").show();relatedItemsLoader.loadTab(0)},hideRRControlledTabData:function(index){var rrTab=relatedItemsLoader.tabsContainer.find("li").eq(index);if(jQuery(rrTab).length>0){jQuery(rrTab).remove();var tabClass=".tab"+index;jQuery("#browseMore .relatedItems").find(tabClass).remove();relatedItemsLoader.setVariables();relatedItemsLoader.loadTab(0)}},removeSofaExtraTab:function(){var sofaRemoveTabIndex=relatedItemsLoader.findTheTabIndex(relatedItemsLoader.tabsContainer,tabNameMap["#otherCollectionPieces1"]);if(sofaRemoveTabIndex>=0){relatedItemsLoader.tabsContainer.find("li").eq(sofaRemoveTabIndex).remove();relatedItemsLoader.relatedItemsContainer=jQuery("#browseMore .relatedItems");relatedItemsLoader.tabsContainer=relatedItemsLoader.relatedItemsContainer.find("ul.tabs");relatedItemsLoader.relatedItemsTabs=relatedItemsLoader.tabsContainer.find("li")}return 1},initialize:function(addQuickInfo){var parentThis=this;parentThis.widgetContainer=jQuery("div#browseMore");parentThis.YMALPlacementContainer=parentThis.widgetContainer.find(".youMayAlsoLike");if(parentThis.YMALPlacementContainer.length<=0&&parentThis.widgetContainer.length>0){parentThis.createYMAL(parentThis.widgetContainer);parentThis.widgetContainer=jQuery("div#browseMore");parentThis.YMALPlacementContainer=parentThis.widgetContainer.find(".youMayAlsoLike")}parentThis.YMALPlacementContainer.find(".carousel").remove();var res_YMAL=rrLayout.getHTMLDataForPlacements(jQuery("div#rr_placement_0").find("div.rrRecommendedItems li.product"),parentThis.YMALPlacementContainer,110,"DETAIL_YMAL",0,rrDetailPageLayoutComponent.processHTML);var YMALHeading=jQuery("#rr_placement_0_title").html();if(typeof YMALHeading=="undefined"||YMALHeading==null||YMALHeading==""){YMALHeading=rrDefaultWidgetName.widget1}parentThis.YMALPlacementContainer.addClass("rrWidget");parentThis.YMALPlacementContainer.find("h4").html(YMALHeading);if(res_YMAL==null){rrDetailPageLayoutComponent.numberOfPlacementsDone++;parentThis.YMALPlacementContainer.remove()}var rrTabbedWidgetDataContainer=jQuery("div#rr_placement_1").find("div.rrRecommendedItems").find("li.product");parentThis.tabContainer=jQuery("div#browseMore div#relatedItems").find("ul.tabs");var indexOfRRTab=relatedItemsLoader.findTheTabIndex(parentThis.tabContainer,tabNameMap["#similarities"]);if(indexOfRRTab>=0){var rrTab=parentThis.tabContainer.find("li").eq(indexOfRRTab);rrTab.show();var tabHeading=jQuery("#rr_placement_1_title").html();if(typeof tabHeading=="undefined"||tabHeading==null||tabHeading==""){tabHeading=rrDefaultWidgetName.widget2}rrTab.find("a").html(tabHeading);rrDetailPageLayoutComponent.replaceSecureURLOfTabbedWidget(indexOfRRTab);relatedItemsLoader.loadTab(indexOfRRTab)}},createYMAL:function(divContainer){divContainer.find(":first").before('<div class = "youMayAlsoLike"><h4 id="rr_title_0">You May Also Like ...</h4></div>')},processHTML:function(identifier,htmlObject){rrDetailPageLayoutComponent.numberOfPlacementsDone++;if(typeof(htmlObject)!="undefined"&&htmlObject!=null){if(identifier=="DETAIL_YMAL"){var destinationContainer=rrDetailPageLayoutComponent.YMALPlacementContainer;rrLayout.putHTMLDataInPlacement(htmlObject,destinationContainer,5,true,true)}}else{if(identifier=="DETAIL_YMAL"){rrDetailPageLayoutComponent.YMALPlacementContainer.remove()}}rrDetailPageLayoutComponent.initialiseOmnitureForDetail()},initialiseOmnitureForDetail:function(){if(rrDetailPageLayoutComponent.numberOfPlacementsDone==rrDetailPageLayoutComponent.TOTAL_PLACEMENTS){omnitureInitializerForRR.initialize()}},createRRControlledTab:function(){relatedItemsLoader.tabsContainer.find(":first").before('<li class="ui-state-default ui-corner-top rrCreated"><input type="hidden" value="A" class="secureProductFetchingURL"><a href="#similarities">Customers who viewed this item also viewed</a></li>');relatedItemsLoader.setVariables()},replaceSecureURLOfTabbedWidget:function(index){var asinJSON=new Object();jQuery("div#rr_placement_1").find(".rrRecommendedItems li").each(function(index){var asin=jQuery(this).find(".asin").text();var url=jQuery(this).find(".url").text();var itemType=jQuery(this).find(".itemType").text();asinJSON[asin]={url:url,itemType:itemType}});rrLayout.rrGlobalAsinInfoJson=jQuery.extend(rrLayout.rrGlobalAsinInfoJson,asinJSON);var newURL=relatedItemsLoader.formTheSecureSingleAppURL(asinJSON);relatedItemsLoader.tabsContainer.find("li").eq(index).find("input").attr("value",newURL)}};var rrSearchLayout={numberOfPlcamentsDone:0,TOTAL_PLACEMENTS:1,initialize:function(){rrSearchLayout.numberOfPlcamentsDone=0;this.createTopWidget();this.createBottomWidget();var rrWidget1=jQuery(".rrBottom");var resp_1=rrLayout.getHTMLDataForPlacements(jQuery("div#rr_placement_0").find("div.rrRecommendedItems li.product"),rrWidget1,165,"SEARCH_P1",0,rrSearchLayout.processHTML);if(resp_1==null){rrSearchLayout.numberOfPlcamentsDone++;rrSearchLayout.hideRRData()}},createTopWidget:function(){var jTopObj=jQuery(".rrTop");var centerDiv=jQuery("#centerColumn, .rightContent");var newjTopObj=jQuery("<div class='rrTop rrWidget'></div>");var titlehtml=jTopObj.find(".rrWidgetTitle");newjTopObj.append(titlehtml);centerDiv.prepend(newjTopObj);jTopObj.remove()},createBottomWidget:function(){var jBottomObj=jQuery(".rrBottom");var centerDiv=jQuery("#centerColumn, .rightContent");var newjBottomObj=jQuery("<div class='rrBottom rrWidget'></div>");var titlehtml=jBottomObj.find(".rrWidgetTitle");newjBottomObj.append(titlehtml);centerDiv.append(newjBottomObj);jBottomObj.remove()},hideRRData:function(){jQuery(".rrWidget").css("display","none")},processHTML:function(identifier,htmlObject){rrSearchLayout.numberOfPlcamentsDone++;if(typeof(htmlObject)!="undefined"&&htmlObject!=null){if(identifier=="SEARCH_P1"){var destinationContainer=jQuery(".rrBottom");rrLayout.putHTMLDataInPlacement(htmlObject,destinationContainer,4,true,true)}}if(rrSearchLayout.numberOfPlcamentsDone==rrSearchLayout.TOTAL_PLACEMENTS){if(jQuery(".rrWidget").find(".carousel").find("ul.products").find("li").length==0){rrSearchLayout.hideRRData()}else{omnitureInitializerForRR.initialize()}}}};var rrBrowseLayout={initialize:function(){rrSearchLayout.initialize()}};var rrQuickViewComponent={quickViewClicked:false};var omnitureInitializerForRR={initialize:function(){var page=pageType.getPageType();if(page==pageType.BROWSE){}if(page==pageType.HOME){}if(page==pageType.QUICK_ORDER){}if(page==pageType.DETAIL){if(typeof(detailOmniture)!="undefined"){detailOmniture.initialize()}jQuery("#browseMore #relatedItems .tab0").rrWidgetOmniture({quickinfo:"false",widgetVariant:"RR_",widgetType:"Car_",qvTitle:"Clickthrough",qvVariant:"_QV",pagetype:"PDP"});jQuery("#browseMore .youMayAlsoLike").rrWidgetOmniture({quickinfo:"true",widgetVariant:"RR_",widgetType:"Car_",qvTitle:"Clickthrough",qvVariant:"_QV",pagetype:"PDP"})}if(page==pageType.ORDER_CONFIRM){}if(page==pageType.HUC){cartOmniture.initialize();jQuery(".rrRecommendedItems").rrWidgetOmniture({quickinfo:"true",widgetVariant:"RR_",widgetType:"Car_",qvTitle:"Clickthrough",qvVariant:"_QV",pagetype:"HUC"})}if(page==pageType.CART){cartOmniture.initialize();jQuery(".rrRecommendedItems").rrWidgetOmniture({quickinfo:"true",widgetVariant:"RR_",widgetType:"Car_",qvTitle:"Clickthrough",qvVariant:"_QV",pagetype:"Cart"})}if(page==pageType.SEARCH){isSearchBrowse=true;if(typeof(searchOmniture)!="undefined"){searchOmniture.initialize()}jQuery(".rrRecommendedItems").rrWidgetOmniture({quickinfo:"true",widgetVariant:"RR_",widgetType:"Car_",qvTitle:"Clickthrough",qvVariant:"_QV",pagetype:"Search"})}if(page==pageType.BROWSE_TIER3){isSearchBrowse=true;if(typeof(browseOmniture)!="undefined"){browseOmniture.initialize()}jQuery(".rrRecommendedItems").rrWidgetOmniture({quickinfo:"true",widgetVariant:"RR_",widgetType:"Car_",qvTitle:"Clickthrough",qvVariant:"_QV",pagetype:"Browse"})}}};(function(jQuery){jQuery.fn.rrWidgetOmniture=function(o){o=jQuery.extend({},o||{});return this.each(function(index){var g=new RRWidgetOmniture(this,o,index)})};var RRWidgetOmniture=function(c,options,index){var carouselIndex=index;var that=this;this.carousel=jQuery(c);this.contents=this.carousel.find(".products");this.options=options;this.productsIndex=0;var widgetName="";var propVal="";if(that.options.pagetype=="PDP"){that.contents.find("li div.quickViewComponentContainer a").click(function(){s.eVar35="";s.prop34=that.options.widgetVariant+that.options.pagetype+that.options.qvVariant;s.prop41=that.options.widgetVariant+that.options.qvTitle+"_"+that.options.pagetype+that.options.qvVariant;s.prop42=that.options.widgetVariant+that.options.qvTitle;s.eVar14=that.options.widgetVariant+that.options.pagetype+that.options.qvVariant;s.eVar37=that.options.widgetVariant+that.options.pagetype+that.options.qvVariant});that.contents.find("li > a,li p a").click(function(){var jObject=jQuery(this);var quickInfoLink=(jObject.children("img").length>0)?"true":"false";s.eVar35="";s.prop42=that.options.widgetVariant+that.options.qvTitle;if(quickInfoLink=="true"&&that.options.quickinfo=="true"){s.prop34=that.options.widgetVariant+that.options.pagetype+that.options.qvVariant;s.prop41=that.options.widgetVariant+that.options.qvTitle+"_"+that.options.pagetype+that.options.qvVariant;s.eVar14=that.options.widgetVariant+that.options.pagetype+that.options.qvVariant;s.eVar37=that.options.widgetVariant+that.options.pagetype+that.options.qvVariant}else{var jObj=jQuery(this);var url=jObj.attr("href");var re=new RegExp("ct=([^&]*)");var attributeValue=url.match(re);if((typeof(attributeValue)!="undefined")&&(attributeValue!=null)){attributeValue=attributeValue[1];attributeValue=attributeValue+((attributeValue.indexOf("%3F")!=-1)?("%26rrClickthru="):("%3FrrClickthru="))+that.options.pagetype;jObj.attr("href",relatedItemsLoader.addAttributeToURL(url,"ct",attributeValue))}s.prop41=that.options.widgetVariant+that.options.qvTitle+"_"+that.options.pagetype;s.linkTrackVars="prop41,prop42";s.tl(true,"o","Click on RR Widget")}})}else{if(that.options.pagetype=="Cart"||that.options.pagetype=="HUC"){that.contents.find("li div.quickViewComponentContainer a,li img").click(function(){s.eVar35="";s.prop34=that.options.widgetVariant+that.options.pagetype+that.options.qvVariant;s.prop41=that.options.widgetVariant+that.options.qvTitle+"_"+that.options.pagetype+that.options.qvVariant;s.prop42=that.options.widgetVariant+that.options.qvTitle;s.eVar14=that.options.widgetVariant+that.options.pagetype+that.options.qvVariant;s.eVar37=that.options.widgetVariant+that.options.pagetype+that.options.qvVariant});that.contents.find("li p a").click(function(){s.linkTrackVars="prop41,prop42";var jObj=jQuery(this);var url=jObj.attr("href")+"?rrClickthru="+that.options.pagetype;jObj.attr("href",url);s.prop41=that.options.widgetVariant+that.options.qvTitle+"_"+that.options.pagetype;s.prop42=that.options.widgetVariant+that.options.qvTitle;s.tl(true,"o","Click on RR Widget")})}else{if((that.options.pagetype=="Search")||(that.options.pagetype=="Browse")){that.contents.find("li div.quickViewComponentContainer a,li img").click(function(){s.eVar35="";s.prop34=that.options.widgetVariant+that.options.pagetype+that.options.qvVariant;s.prop41=that.options.widgetVariant+that.options.qvTitle+"_"+that.options.pagetype+that.options.qvVariant;s.prop42=that.options.widgetVariant+that.options.qvTitle;s.eVar14=that.options.widgetVariant+that.options.pagetype+that.options.qvVariant;s.eVar37=that.options.widgetVariant+that.options.pagetype+that.options.qvVariant});that.contents.find("li p a").click(function(){s.eVar35="";var jObj=jQuery(this);var url=jObj.attr("href")+"?rrClickthru="+that.options.pagetype;jObj.attr("href",url);s.linkTrackVars="prop41,prop42";s.prop41=that.options.widgetVariant+that.options.qvTitle+"_"+that.options.pagetype;s.prop42=that.options.widgetVariant+that.options.qvTitle;s.tl(true,"o","Click on RR Widget")})}}}}})(jQuery);

var affiliateTracking={THANK_YOU_ORDER_CONFIRM:"ORDER_CONFIRM",THANK_YOU_SUBSCRIPTION:"ORDER_SUBSCRIPTION",getTrackingPageType:function(){var trackingPageType=null;if(typeof(pixelTrackingAllJSON)!="undefined"){trackingPageType=pixelTrackingAllJSON.pageType}return trackingPageType}};jQuery(document).ready(function(){if(typeof(affiliateTracking)!="undefined"){var trackingPage=affiliateTracking.getTrackingPageType();if(trackingPage!=null&&trackingPage!=""){sendTrackingInfo.initialize(trackingPage)}}});var sendTrackingInfo={initialize:function(trackingPageType){if(trackingPageType==affiliateTracking.THANK_YOU_SUBSCRIPTION){this.setUpTrackingForSubscription()}else{if(trackingPageType==affiliateTracking.THANK_YOU_ORDER_CONFIRM){this.setUpTrackingForOrderConfirm()}}},setUpTrackingForOrderConfirm:function(){this.setUpAllPixelTracking();this.setUpPixelTrackingAffiliate()},setUpTrackingForSubscription:function(){this.setUpPixelTrackingForSubcription();this.setUpPixelTrackingAffiliate()},setUpAllPixelTracking:function(){if(typeof(pixelTrackingAllJSON)!="undefined"){var merchantID=pixelTrackingAllJSON.merchantID;var pixelTrackingOrderDetails=pixelTrackingAllJSON.pixelTrackingOrderDetails;for(var i=0;i<pixelTrackingOrderDetails.length;++i){var orderID=pixelTrackingOrderDetails[i].orderID;var orderGrandTotal=pixelTrackingOrderDetails[i].orderGrandTotal;var orderTaxedAmount=pixelTrackingOrderDetails[i].orderTaxedAmount;var totalQuantity=pixelTrackingOrderDetails[i].totalQuantity;var amtNoDelivery=pixelTrackingOrderDetails[i].amtNoDelivery;var customerID=pixelTrackingOrderDetails[i].customerID;var itemsPrice=pixelTrackingOrderDetails[i].itemsPrice;var asins=pixelTrackingOrderDetails[i].asins;var itemsQuantity=pixelTrackingOrderDetails[i].itemsQuantity;var itemsTitle=pixelTrackingOrderDetails[i].itemsTitle;var nodeID=pixelTrackingOrderDetails[i].nodeID;var nodeName=pixelTrackingOrderDetails[i].nodeName;var atlasURLData=pixelTrackingOrderDetails[i].atlasURLData;var atlasURLData2=pixelTrackingOrderDetails[i].atlasURLData2;this.writeShoppingImageTag(merchantID);this.writeEffFrontierImageTag(orderID,orderTaxedAmount);this.writeMediaPlexTag(orderID,totalQuantity,amtNoDelivery);this.writeMediaPlexImageTag(orderID,totalQuantity,amtNoDelivery);this.writeOutRiderTag(orderID,amtNoDelivery);this.writeFlashtalkingTag(orderID,itemsPrice,asins,itemsQuantity,customerID)}}},setUpPixelTrackingForSubcription:function(){if(typeof(pixelTrackingAllJSON)!="undefined"){var merchantID=pixelTrackingAllJSON.merchantID;var pixelTrackingOrderDetails=pixelTrackingAllJSON.pixelTrackingOrderDetails;for(var i=0;i<pixelTrackingOrderDetails.length;++i){var subscriptionNumber=pixelTrackingOrderDetails[i].subscriptionNumber;var planID=pixelTrackingOrderDetails[i].planID;var planPrice=pixelTrackingOrderDetails[i].planPrice;var customerID=pixelTrackingOrderDetails[i].customerID;var atlasURLData=pixelTrackingOrderDetails[i].atlasURLData;var atlasURLData2=pixelTrackingOrderDetails[i].atlasURLData2;this.writeFlashtalkingTagForSubscribe(subscriptionNumber,customerID,planID,planPrice)}}},setUpPixelTrackingAffiliate:function(){if(typeof(pixelTrackingAffiliateJSON)!="undefined"){var merchantID=pixelTrackingAffiliateJSON.merchantID;var currency=pixelTrackingAffiliateJSON.currency;var testMode=pixelTrackingAffiliateJSON.testMode;var pixelTrackingOrderDetails=pixelTrackingAffiliateJSON.pixelTrackingOrderDetails;for(var i=0;i<pixelTrackingOrderDetails.length;++i){var orderID=pixelTrackingOrderDetails[i].orderID;var orderGrandTotal=pixelTrackingOrderDetails[i].orderGrandTotal;var ppData=pixelTrackingOrderDetails[i].ppData;var skuList=pixelTrackingOrderDetails[i].skuList;var qtyList=pixelTrackingOrderDetails[i].qtyList;var amtList=pixelTrackingOrderDetails[i].amtList;var saleParts=pixelTrackingOrderDetails[i].saleParts;var promoName=pixelTrackingOrderDetails[i].promoName;var awBasket=pixelTrackingOrderDetails[i].awBasket;var showBuyImage=pixelTrackingOrderDetails[i].showBuyImage;var showAffWinImage=pixelTrackingOrderDetails[i].showAffWinImage;var showLinkshareImage=pixelTrackingOrderDetails[i].showLinkshareImage;if(showBuyImage==1){this.writeBuyImageTag(orderID,orderGrandTotal,ppData)}if(showLinkshareImage==1){this.writeLinkshareImageTag(orderID,skuList,qtyList,amtList,currency)}if(showAffWinImage==1){this.writeNewAffWinImageTag(merchantID,orderID,orderGrandTotal,saleParts,promoName,testMode,currency,awBasket)}}}},writeAtlasImageTag:function(atlasURLData){var iframeSrc=window.location.protocol.toLowerCase()+"//switch.atdmt.com/action/wgrmas_mspurchaseconfirmationpage_7/v3"+atlasURLData+"|u";jQuery('<iframe height="1" width="1" frameborder="0" class="hide" style="opacity:0;" src="'+iframeSrc+'" ></iframe>').appendTo("body")},writeShoppingImageTag:function(merchantId){var javascriptSrc='<script language="JavaScript" src="https://stat.DealTime.com/ROI/ROI.js?mid='+merchantId+'"><\/script>';jQuery(javascriptSrc).appendTo("body")},writeEffFrontierImageTag:function(orderId,amount){var iframeSrcUrl1="https://pixel2750.everesttech.net/2750/p";var iframeSrc="?ev_transid="+(orderId?orderId:"")+"&ev_revenue="+(amount?amount:"")+"&ev_order=1";jQuery('<iframe height="1" width="1" frameborder="0" class="hide" style="opacity:0;" src="'+iframeSrcUrl1+iframeSrc+'" />').appendTo("body")},writeMediaPlexTag:function(orderId,totalQuantity,amtNoDelivery){var iframeSrc=window.location.protocol.toLowerCase()+"//secure.img-cdn.mediaplex.com/0/7216/universal.html?page_name=confirmation&confirmation=1&quantity="+(totalQuantity?totalQuantity:"")+"&revenue="+(amtNoDelivery?amtNoDelivery:"")+"&mpuid"+(orderId?orderId:"");jQuery('<iframe height="1" width="1" frameborder="0" class="hide" style="opacity:0;" src="'+iframeSrc+'" ></iframe>').appendTo("body")},writeMediaPlexImageTag:function(orderId,totalQuantity,amtNoDelivery){var imageSrc=window.location.protocol.toLowerCase()+"//altfarm.mediaplex.com/ad/bk/17591-121843-3840-0?Sales_Confirmation=1&Sales_Quantity="+(totalQuantity?totalQuantity:"")+"&Sales_Revenue="+(amtNoDelivery?amtNoDelivery:"")+"&mpuid="+(orderId?orderId:"");jQuery('<img height="1" width="1" alt="Mediaplex_tag" src="'+imageSrc+'" ></img>').appendTo("body")},writeOutRiderTag:function(orderId,amtNoDelivery){var iframeSrc=window.location.protocol.toLowerCase()+"//eu.link.decdna.net/n/56715/56716/MARSPECON/x/e?value="+(amtNoDelivery?amtNoDelivery:"")+"&trans="+(orderId?orderId:"")+"&domain=eu.link.decdna.net";jQuery('<iframe height="1" width="1" frameborder="0" class="hide" style="opacity:0;" src="'+iframeSrc+'" ></iframe>').appendTo("body")},writeFlashtalkingTag:function(orderId,itemsPrice,asins,itemsQuantity,customerID){var iframeSrc=window.location.protocol.toLowerCase()+"//flashtalking.secure.miisolutions.net/container/2331/2331_HTTPS_iFrame.html?OrderConfirmation&ftXValue="+(itemsPrice?itemsPrice:"")+"&ftXName="+(asins?asins+"|u":"")+"&ftXNumItems="+(itemsQuantity?itemsQuantity:"")+"&ftXType="+(asins?asins+"|u":"")+"&ftXRef="+(orderId?orderId+"|u":"");jQuery('<iframe height="1" width="1" frameborder="0" class="hide" style="opacity:0;" src="'+iframeSrc+'" ></iframe>').appendTo("body")},writeAtlasJavaScriptTag:function(atlasURLData,atlasURLData2){var javascriptSrc='<script type="text/javascript" language="JavaScript" src="'+window.location.protocol.toLowerCase()+"//view.atdmt.com/jaction/wgrmas_MSPurchaseConfirmationPageJS_1/v3"+atlasURLData+"|u"+atlasURLData2+'|u"><\/script>';jQuery(javascriptSrc).appendTo("body")},writeBuyImageTag:function(orderId,amount,ppData){var imageSrc=window.location.protocol.toLowerCase()+"//www.perfiliate.com/brains/transproc.php?PROGID=115&TYPE=sales&AMOUNT="+(amount?amount:"")+"&TRANSID="+(orderId?orderId:"")+"&PPDATA="+(ppData?ppData:"");jQuery('<img height="3" width="1" src="'+imageSrc+'" ></img>').appendTo("body")},writeLinkshareImageTag:function(orderId,skuList,qList,amtList,currency){var imageSrc=window.location.protocol.toLowerCase()+"//track.linksynergy.com/ep?mid=36632&ord="+(orderId?orderId:"")+"&skulist="+(skuList?skuList:"")+"&qlist="+(qList?qList:"")+"&amtlist="+(amtList?amtList:"")+"&cur="+(currency?currency:"");jQuery('<img height="3" width="1" src="'+imageSrc+'" class="hide" ></img>').appendTo("body")},writeNewAffWinImageTag:function(merchantId,orderId,amount,saleParts,promoName,testMode,currency,awBasket){var imageSrc=window.location.protocol.toLowerCase()+"//www.awin1.com/sread.img?tt=ns&tv=2&merchant="+(merchantId?merchantId:"")+"&amount="+(amount?amount:"")+"&ref="+(orderId?orderId:"")+"&parts="+(saleParts?saleParts:"")+"&vc="+(promoName?promoName:"")+"&testmode="+(testMode?testMode:"")+"&cr="+(currency?currency:"");jQuery('<img src="'+imageSrc+'" class="hide" ></img>').appendTo("body")},writeAtlasJavaScriptTagForSubscribe:function(atlasURLData,atlasURLData2){var iframeSrc=window.location.protocol.toLowerCase()+"//view.atdmt.com/jaction/wgrmas_MSPurchaseConfirmationPageJS_1/v3"+atlasURLData+"|u"+atlasURLData2+"|u";jQuery('<iframe width="1" height="1" frameborder="0" scrolling="No" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" src="'+iframeSrc+'" ></iframe>').appendTo("body")},writeFlashtalkingTagForSubscribe:function(subscriptionNumber,customerID,planID,planPrice){var iframeSrc=window.location.protocol.toLowerCase()+"//flashtalking.secure.miisolutions.net/container/2331/2331_HTTPS_iFrame.html?OrderConfirmation&ftXValue="+(planPrice?planPrice:"")+"&ftXName="+(planID?planID:"")+"&ftXNumItems=1&ftXType="+(subscriptionNumber?subscriptionNumber:"")+"&ftXRef="+(customerID?customerID:"");jQuery('<iframe width="1" height="1" frameborder="0" scrolling="No" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" src="'+iframeSrc+'" ></iframe>').appendTo("body")}};

/*
 * jQuery_1_6 UI 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI
 */
(function(jQuery_1_6,undefined){jQuery_1_6.ui=jQuery_1_6.ui||{};if(jQuery_1_6.ui.version){return}jQuery_1_6.extend(jQuery_1_6.ui,{version:"1.8.16",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});jQuery_1_6.fn.extend({propAttr:jQuery_1_6.fn.prop||jQuery_1_6.fn.attr,_focus:jQuery_1_6.fn.focus,focus:function(delay,fn){return typeof delay==="number"?this.each(function(){var elem=this;setTimeout(function(){jQuery_1_6(elem).focus();if(fn){fn.call(elem)}},delay)}):this._focus.apply(this,arguments)},scrollParent:function(){var scrollParent;if((jQuery_1_6.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){scrollParent=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(jQuery_1_6.curCSS(this,"position",1))&&(/(auto|scroll)/).test(jQuery_1_6.curCSS(this,"overflow",1)+jQuery_1_6.curCSS(this,"overflow-y",1)+jQuery_1_6.curCSS(this,"overflow-x",1))}).eq(0)}else{scrollParent=this.parents().filter(function(){return(/(auto|scroll)/).test(jQuery_1_6.curCSS(this,"overflow",1)+jQuery_1_6.curCSS(this,"overflow-y",1)+jQuery_1_6.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!scrollParent.length?jQuery_1_6(document):scrollParent},zIndex:function(zIndex){if(zIndex!==undefined){return this.css("zIndex",zIndex)}if(this.length){var elem=jQuery_1_6(this[0]),position,value;while(elem.length&&elem[0]!==document){position=elem.css("position");if(position==="absolute"||position==="relative"||position==="fixed"){value=parseInt(elem.css("zIndex"),10);if(!isNaN(value)&&value!==0){return value}}elem=elem.parent()}}return 0},disableSelection:function(){return this.bind((jQuery_1_6.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(event){event.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});jQuery_1_6.each(["Width","Height"],function(i,name){var side=name==="Width"?["Left","Right"]:["Top","Bottom"],type=name.toLowerCase(),orig={innerWidth:jQuery_1_6.fn.innerWidth,innerHeight:jQuery_1_6.fn.innerHeight,outerWidth:jQuery_1_6.fn.outerWidth,outerHeight:jQuery_1_6.fn.outerHeight};function reduce(elem,size,border,margin){jQuery_1_6.each(side,function(){size-=parseFloat(jQuery_1_6.curCSS(elem,"padding"+this,true))||0;if(border){size-=parseFloat(jQuery_1_6.curCSS(elem,"border"+this+"Width",true))||0}if(margin){size-=parseFloat(jQuery_1_6.curCSS(elem,"margin"+this,true))||0}});return size}jQuery_1_6.fn["inner"+name]=function(size){if(size===undefined){return orig["inner"+name].call(this)}return this.each(function(){jQuery_1_6(this).css(type,reduce(this,size)+"px")})};jQuery_1_6.fn["outer"+name]=function(size,margin){if(typeof size!=="number"){return orig["outer"+name].call(this,size)}return this.each(function(){jQuery_1_6(this).css(type,reduce(this,size,true,margin)+"px")})}});function focusable(element,isTabIndexNotNaN){var nodeName=element.nodeName.toLowerCase();if("area"===nodeName){var map=element.parentNode,mapName=map.name,img;if(!element.href||!mapName||map.nodeName.toLowerCase()!=="map"){return false}img=jQuery_1_6("img[usemap=#"+mapName+"]")[0];return !!img&&visible(img)}return(/input|select|textarea|button|object/.test(nodeName)?!element.disabled:"a"==nodeName?element.href||isTabIndexNotNaN:isTabIndexNotNaN)&&visible(element)}function visible(element){return !jQuery_1_6(element).parents().andSelf().filter(function(){return jQuery_1_6.curCSS(this,"visibility")==="hidden"||jQuery_1_6.expr.filters.hidden(this)}).length}jQuery_1_6.extend(jQuery_1_6.expr[":"],{data:function(elem,i,match){return !!jQuery_1_6.data(elem,match[3])},focusable:function(element){return focusable(element,!isNaN(jQuery_1_6.attr(element,"tabindex")))},tabbable:function(element){var tabIndex=jQuery_1_6.attr(element,"tabindex"),isTabIndexNaN=isNaN(tabIndex);return(isTabIndexNaN||tabIndex>=0)&&focusable(element,!isTabIndexNaN)}});jQuery_1_6(function(){var body=document.body,div=body.appendChild(div=document.createElement("div"));jQuery_1_6.extend(div.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});jQuery_1_6.support.minHeight=div.offsetHeight===100;jQuery_1_6.support.selectstart="onselectstart" in div;body.removeChild(div).style.display="none"});jQuery_1_6.extend(jQuery_1_6.ui,{plugin:{add:function(module,option,set){var proto=jQuery_1_6.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]])}},call:function(instance,name,args){var set=instance.plugins[name];if(!set||!instance.element[0].parentNode){return}for(var i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args)}}}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(el,a){if(jQuery_1_6(el).css("overflow")==="hidden"){return false}var scroll=(a&&a==="left")?"scrollLeft":"scrollTop",has=false;if(el[scroll]>0){return true}el[scroll]=1;has=(el[scroll]>0);el[scroll]=0;return has},isOverAxis:function(x,reference,size){return(x>reference)&&(x<(reference+size))},isOver:function(y,x,top,left,height,width){return jQuery_1_6.ui.isOverAxis(y,top,height)&&jQuery_1_6.ui.isOverAxis(x,left,width)}})})(jQuery_1_6);

/*
 * jQuery_1_6 UI Widget 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(jQuery_1_6,undefined){if(jQuery_1_6.cleanData){var _cleanData=jQuery_1_6.cleanData;jQuery_1_6.cleanData=function(elems){for(var i=0,elem;(elem=elems[i])!=null;i++){try{jQuery_1_6(elem).triggerHandler("remove")}catch(e){}}_cleanData(elems)}}else{var _remove=jQuery_1_6.fn.remove;jQuery_1_6.fn.remove=function(selector,keepData){return this.each(function(){if(!keepData){if(!selector||jQuery_1_6.filter(selector,[this]).length){jQuery_1_6("*",this).add([this]).each(function(){try{jQuery_1_6(this).triggerHandler("remove")}catch(e){}})}}return _remove.call(jQuery_1_6(this),selector,keepData)})}}jQuery_1_6.widget=function(name,base,prototype){var namespace=name.split(".")[0],fullName;name=name.split(".")[1];fullName=namespace+"-"+name;if(!prototype){prototype=base;base=jQuery_1_6.Widget}jQuery_1_6.expr[":"][fullName]=function(elem){return !!jQuery_1_6.data(elem,name)};jQuery_1_6[namespace]=jQuery_1_6[namespace]||{};jQuery_1_6[namespace][name]=function(options,element){if(arguments.length){this._createWidget(options,element)}};var basePrototype=new base();basePrototype.options=jQuery_1_6.extend(true,{},basePrototype.options);jQuery_1_6[namespace][name].prototype=jQuery_1_6.extend(true,basePrototype,{namespace:namespace,widgetName:name,widgetEventPrefix:jQuery_1_6[namespace][name].prototype.widgetEventPrefix||name,widgetBaseClass:fullName},prototype);jQuery_1_6.widget.bridge(name,jQuery_1_6[namespace][name])};jQuery_1_6.widget.bridge=function(name,object){jQuery_1_6.fn[name]=function(options){var isMethodCall=typeof options==="string",args=Array.prototype.slice.call(arguments,1),returnValue=this;options=!isMethodCall&&args.length?jQuery_1_6.extend.apply(null,[true,options].concat(args)):options;if(isMethodCall&&options.charAt(0)==="_"){return returnValue}if(isMethodCall){this.each(function(){var instance=jQuery_1_6.data(this,name),methodValue=instance&&jQuery_1_6.isFunction(instance[options])?instance[options].apply(instance,args):instance;if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue;return false}})}else{this.each(function(){var instance=jQuery_1_6.data(this,name);if(instance){instance.option(options||{})._init()}else{jQuery_1_6.data(this,name,new object(options,this))}})}return returnValue}};jQuery_1_6.Widget=function(options,element){if(arguments.length){this._createWidget(options,element)}};jQuery_1_6.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(options,element){jQuery_1_6.data(element,this.widgetName,this);this.element=jQuery_1_6(element);this.options=jQuery_1_6.extend(true,{},this.options,this._getCreateOptions(),options);var self=this;this.element.bind("remove."+this.widgetName,function(){self.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return jQuery_1_6.metadata&&jQuery_1_6.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(key,value){var options=key;if(arguments.length===0){return jQuery_1_6.extend({},this.options)}if(typeof key==="string"){if(value===undefined){return this.options[key]}options={};options[key]=value}this._setOptions(options);return this},_setOptions:function(options){var self=this;jQuery_1_6.each(options,function(key,value){self._setOption(key,value)});return this},_setOption:function(key,value){this.options[key]=value;if(key==="disabled"){this.widget()[value?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",value)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(type,event,data){var callback=this.options[type];event=jQuery_1_6.Event(event);event.type=(type===this.widgetEventPrefix?type:this.widgetEventPrefix+type).toLowerCase();data=data||{};if(event.originalEvent){for(var i=jQuery_1_6.event.props.length,prop;i;){prop=jQuery_1_6.event.props[--i];event[prop]=event.originalEvent[prop]}}this.element.trigger(event,data);return !(jQuery_1_6.isFunction(callback)&&callback.call(this.element[0],event,data)===false||event.isDefaultPrevented())}}})(jQuery_1_6);

(function(jQuery_1_6,undefined){jQuery_1_6.ui=jQuery_1_6.ui||{};var horizontalPositions=/left|center|right/,verticalPositions=/top|center|bottom/,center="center",_position=jQuery_1_6.fn.position,_offset=jQuery_1_6.fn.offset;jQuery_1_6.fn.position=function(options){if(!options||!options.of){return _position.apply(this,arguments)}options=jQuery_1_6.extend({},options);var target=jQuery_1_6(options.of),targetElem=target[0],collision=(options.collision||"flip").split(" "),offset=options.offset?options.offset.split(" "):[0,0],targetWidth,targetHeight,basePosition;if(targetElem.nodeType===9){targetWidth=target.width();targetHeight=target.height();basePosition={top:0,left:0}}else{if(targetElem.setTimeout){targetWidth=target.width();targetHeight=target.height();basePosition={top:target.scrollTop(),left:target.scrollLeft()}}else{if(targetElem.preventDefault){options.at="left top";targetWidth=targetHeight=0;basePosition={top:options.of.pageY,left:options.of.pageX}}else{targetWidth=target.outerWidth();targetHeight=target.outerHeight();basePosition=target.offset()}}}jQuery_1_6.each(["my","at"],function(){var pos=(options[this]||"").split(" ");if(pos.length===1){pos=horizontalPositions.test(pos[0])?pos.concat([center]):verticalPositions.test(pos[0])?[center].concat(pos):[center,center]}pos[0]=horizontalPositions.test(pos[0])?pos[0]:center;pos[1]=verticalPositions.test(pos[1])?pos[1]:center;options[this]=pos});if(collision.length===1){collision[1]=collision[0]}offset[0]=parseInt(offset[0],10)||0;if(offset.length===1){offset[1]=offset[0]}offset[1]=parseInt(offset[1],10)||0;if(options.at[0]==="right"){basePosition.left+=targetWidth}else{if(options.at[0]===center){basePosition.left+=targetWidth/2}}if(options.at[1]==="bottom"){basePosition.top+=targetHeight}else{if(options.at[1]===center){basePosition.top+=targetHeight/2}}basePosition.left+=offset[0];basePosition.top+=offset[1];return this.each(function(){var elem=jQuery_1_6(this),elemWidth=elem.outerWidth(),elemHeight=elem.outerHeight(),marginLeft=parseInt(jQuery_1_6.curCSS(this,"marginLeft",true))||0,marginTop=parseInt(jQuery_1_6.curCSS(this,"marginTop",true))||0,collisionWidth=elemWidth+marginLeft+(parseInt(jQuery_1_6.curCSS(this,"marginRight",true))||0),collisionHeight=elemHeight+marginTop+(parseInt(jQuery_1_6.curCSS(this,"marginBottom",true))||0),position=jQuery_1_6.extend({},basePosition),collisionPosition;if(options.my[0]==="right"){position.left-=elemWidth}else{if(options.my[0]===center){position.left-=elemWidth/2}}if(options.my[1]==="bottom"){position.top-=elemHeight}else{if(options.my[1]===center){position.top-=elemHeight/2}}position.left=Math.round(position.left);position.top=Math.round(position.top);collisionPosition={left:position.left-marginLeft,top:position.top-marginTop};jQuery_1_6.each(["left","top"],function(i,dir){if(jQuery_1_6.ui.position[collision[i]]){jQuery_1_6.ui.position[collision[i]][dir](position,{targetWidth:targetWidth,targetHeight:targetHeight,elemWidth:elemWidth,elemHeight:elemHeight,collisionPosition:collisionPosition,collisionWidth:collisionWidth,collisionHeight:collisionHeight,offset:offset,my:options.my,at:options.at})}});if(jQuery_1_6.fn.bgiframe){elem.bgiframe()}elem.offset(jQuery_1_6.extend(position,{using:options.using}))})};jQuery_1_6.ui.position={fit:{left:function(position,data){var win=jQuery_1_6(window),over=data.collisionPosition.left+data.collisionWidth-win.width()-win.scrollLeft();position.left=over>0?position.left-over:Math.max(position.left-data.collisionPosition.left,position.left)},top:function(position,data){var win=jQuery_1_6(window),over=data.collisionPosition.top+data.collisionHeight-win.height()-win.scrollTop();position.top=over>0?position.top-over:Math.max(position.top-data.collisionPosition.top,position.top)}},flip:{left:function(position,data){if(data.at[0]===center){return}var win=jQuery_1_6(window),over=data.collisionPosition.left+data.collisionWidth-win.width()-win.scrollLeft(),myOffset=data.my[0]==="left"?-data.elemWidth:data.my[0]==="right"?data.elemWidth:0,atOffset=data.at[0]==="left"?data.targetWidth:-data.targetWidth,offset=-2*data.offset[0];position.left+=data.collisionPosition.left<0?myOffset+atOffset+offset:over>0?myOffset+atOffset+offset:0},top:function(position,data){if(data.at[1]===center){return}var win=jQuery_1_6(window),over=data.collisionPosition.top+data.collisionHeight-win.height()-win.scrollTop(),myOffset=data.my[1]==="top"?-data.elemHeight:data.my[1]==="bottom"?data.elemHeight:0,atOffset=data.at[1]==="top"?data.targetHeight:-data.targetHeight,offset=-2*data.offset[1];position.top+=data.collisionPosition.top<0?myOffset+atOffset+offset:over>0?myOffset+atOffset+offset:0}}};if(!jQuery_1_6.offset.setOffset){jQuery_1_6.offset.setOffset=function(elem,options){if(/static/.test(jQuery_1_6.curCSS(elem,"position"))){elem.style.position="relative"}var curElem=jQuery_1_6(elem),curOffset=curElem.offset(),curTop=parseInt(jQuery_1_6.curCSS(elem,"top",true),10)||0,curLeft=parseInt(jQuery_1_6.curCSS(elem,"left",true),10)||0,props={top:(options.top-curOffset.top)+curTop,left:(options.left-curOffset.left)+curLeft};if("using" in options){options.using.call(elem,props)}else{curElem.css(props)}};jQuery_1_6.fn.offset=function(options){var elem=this[0];if(!elem||!elem.ownerDocument){return null}if(options){return this.each(function(){jQuery_1_6.offset.setOffset(this,options)})}return _offset.call(this)}}}(jQuery_1_6));

jQuery_1_6.noConflict();(function(jQuery_1_6,undefined){var requestIndex=0;jQuery_1_6.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var self=this,doc=this.element[0].ownerDocument,suppressKeyPress;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(event){if(self.options.disabled||self.element.propAttr("readOnly")){return}suppressKeyPress=false;var keyCode=jQuery_1_6.ui.keyCode;switch(event.keyCode){case keyCode.PAGE_UP:self._move("previousPage",event);break;case keyCode.PAGE_DOWN:self._move("nextPage",event);break;case keyCode.UP:self._move("previous",event);event.preventDefault();break;case keyCode.DOWN:self._move("next",event);event.preventDefault();break;case keyCode.ENTER:case keyCode.NUMPAD_ENTER:if(self.menu.active){suppressKeyPress=true;event.preventDefault()}else{jQuery_1_6("#globalMenu #quickSearchForm").submit()}case keyCode.TAB:if(!self.menu.active){return}self.menu.select(event);break;case keyCode.ESCAPE:self.element.setval(self.term);self.close(event);break;case keyCode.RIGHT:if(jQuery_1_6("#suggestion").getval().length>0){jQuery_1_6("#enteredInput").setval(jQuery_1_6("#suggestion").getval());break}default:clearTimeout(self.searching);self.searching=setTimeout(function(){if(self.term!=self.element.getval()){self.selectedItem=null;self.search(null,event)}},self.options.delay);break}}).bind("keypress.autocomplete",function(event){if(suppressKeyPress){suppressKeyPress=false;event.preventDefault()}}).bind("focus.autocomplete",function(){if(self.options.disabled){return}self.selectedItem=null;self.previous=self.element.getval()}).bind("blur.autocomplete",function(event){if(self.options.disabled){return}clearTimeout(self.searching);self.closing=setTimeout(function(){self.close(event);self._change(event)},150)});this._initSource();this.response=function(){return self._response.apply(self,arguments)};this.menu=jQuery_1_6("<ul></ul>").addClass("ui-autocomplete").appendTo(jQuery_1_6(this.options.appendTo||"body",doc)[0]).mousedown(function(event){var menuElement=self.menu.element[0];if(!jQuery_1_6(event.target).closest(".ui-menu-item").length){setTimeout(function(){jQuery_1_6(document).one("mousedown",function(event){if(event.target!==self.element[0]&&event.target!==menuElement&&!jQuery_1_6.ui.contains(menuElement,event.target)){self.close()}})},1)}setTimeout(function(){clearTimeout(self.closing)},13)}).menu({focus:function(event,ui){var item=ui.item.data("item.autocomplete");if(false!==self._trigger("focus",event,{item:item})){self.element.setval(item.value)}},selected:function(event,ui){var item=ui.item.data("item.autocomplete"),previous=self.previous;if(self.element[0]!==doc.activeElement){self.element.focus();self.previous=previous;setTimeout(function(){self.previous=previous;self.selectedItem=item},1)}if(false!==self._trigger("select",event,{item:item})){self.element.setval(item.value)}self.term=self.element.getval();self.close(event);self.selectedItem=item},blur:function(event,ui){if(self.menu.element.is(":visible")&&(self.element.getval()!==self.term)){self.element.setval(self.term)}}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");if(jQuery_1_6.fn.bgiframe){this.menu.element.bgiframe()}},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();jQuery_1_6.Widget.prototype.destroy.call(this)},_setOption:function(key,value){jQuery_1_6.Widget.prototype._setOption.apply(this,arguments);if(key==="source"){this._initSource()}if(key==="appendTo"){this.menu.element.appendTo(jQuery_1_6(value||"body",this.element[0].ownerDocument)[0])}if(key==="disabled"&&value&&this.xhr){this.xhr.abort()}},_initSource:function(){var self=this,array,url;if(jQuery_1_6.isArray(this.options.source)){array=this.options.source;this.source=function(request,response){response(jQuery_1_6.ui.autocomplete.filter(array,request.term))}}else{if(typeof this.options.source==="string"){url=this.options.source;this.source=function(request,response){if(self.xhr){self.xhr.abort()}self.xhr=jQuery_1_6.ajax({url:url,data:request,dataType:"json",autocompleteRequest:++requestIndex,success:function(data,status){if(this.autocompleteRequest===requestIndex){response(data)}},error:function(){if(this.autocompleteRequest===requestIndex){response([])}}})}}else{this.source=this.options.source}}},search:function(value,event){value=value!=null?value:this.element.getval();this.term=this.element.getval();if(value.length<this.options.minLength){jQuery_1_6("#suggestion").setval("");return this.close(event)}clearTimeout(this.closing);if(this._trigger("search",event)===false){return}return this._search(value)},_search:function(value){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:value},this.response)},_response:function(content){if(!this.options.disabled&&content&&content.length){content=this._normalize(content);this._suggest(content);this._trigger("open")}this.pending--;if(!this.pending){this.element.removeClass("ui-autocomplete-loading")}},close:function(event){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.deactivate();this._trigger("close",event)}},_change:function(event){if(this.previous!==this.element.getval()){this._trigger("change",event,{item:this.selectedItem})}},_normalize:function(items){if(items.length&&items[0].label&&items[0].value){return items}return jQuery_1_6.map(items,function(item){if(typeof item==="string"){return{label:item,value:item}}return jQuery_1_6.extend({label:item.label||item.value,value:item.value||item.label},item)})},_suggest:function(items){var ul=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(ul,items);this.menu.deactivate();this.menu.refresh();ul.show();ul.position(jQuery_1_6.extend({of:this.element},this.options.position));if(this.options.autoFocus){this.menu.next(new jQuery_1_6.Event("mouseover"))}this._resizeMenu()},_resizeMenu:function(){var ul=this.menu.element;jQuery_1_6(".ui-autocomplete").width(jQuery_1_6("#inputContainer").width());jQuery_1_6(".ui-autocomplete").css("left",jQuery_1_6("#inputContainer").offset().left);jQuery_1_6(".ui-autocomplete").css("top",jQuery_1_6("#inputContainer").offset().top+jQuery_1_6("#inputContainer").height())},_renderMenu:function(ul,items){var self=this;jQuery_1_6(".ui-menu").append("<span class='sideHeading'>Search suggestions</span><br>");jQuery_1_6.each(items,function(index,item){self._renderItem(ul,item)})},_renderItem:function(ul,item){var convertString1=jQuery_1_6("#enteredInput").getval().replace(/&nbsp;/g," ");var convertString2=convertString1.replace(/\s+/g," ");var convertString3=convertString2.replace(/^\s+/,"");typedString=convertString3;var typedLength=typedString.length;var lightString=item.label.substring(0,typedLength);var boldString=item.label.substring(typedLength);var agt=navigator.userAgent.toLowerCase();if(agt.indexOf("msie")!=-1){if((boldString.charAt(0)==" ")||(lightString.charAt(typedLength-1)==" ")){return jQuery_1_6("<li></li>").data("item.autocomplete",item).append(jQuery_1_6("<span class='lightC'></span>").text(lightString)).append(jQuery_1_6("<span class='spaceC'></span>").html("&nbsp")).append(jQuery_1_6("<span class='boldC'></span>").text(boldString)).appendTo(ul)}}if((boldString[0]==" ")||(lightString[typedLength-1]==" ")){return jQuery_1_6("<li></li>").data("item.autocomplete",item).append(jQuery_1_6("<span class='lightC'></span>").text(lightString)).append(jQuery_1_6("<span class='spaceC'></span>").html("&nbsp")).append(jQuery_1_6("<span class='boldC'></span>").text(boldString)).appendTo(ul)}return jQuery_1_6("<li></li>").data("item.autocomplete",item).append(jQuery_1_6("<span class='lightC'></span>").text(lightString)).append(jQuery_1_6("<span class='boldC'></span>").text(boldString)).appendTo(ul)},_move:function(direction,event){if(!this.menu.element.is(":visible")){this.search(null,event);return}if(this.menu.first()&&/^previous/.test(direction)||this.menu.last()&&/^next/.test(direction)){this.element.setval(this.term);this.menu.deactivate();return}this.menu[direction](event)},widget:function(){return this.menu.element}});jQuery_1_6.extend(jQuery_1_6.ui.autocomplete,{escapeRegex:function(value){return value.replace(/[-[\]{}()*+?.,\\^jQuery_1_6|#\s]/g,"\\jQuery_1_6&")},filter:function(array,term){var matcher=new RegExp(jQuery_1_6.ui.autocomplete.escapeRegex(term),"i");return jQuery_1_6.grep(array,function(value){return matcher.test(value.label||value.value||value)})}})}(jQuery_1_6));(function(jQuery_1_6){jQuery_1_6.widget("ui.menu",{_create:function(){var self=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(event){if(!jQuery_1_6(event.target).closest(".ui-menu-item span").length){return}event.preventDefault();self.select(event)});this.refresh()},refresh:function(){var self=this;var items=this.element.children("li:not(.ui-menu-item):has(span)").addClass("ui-menu-item").attr("role","menuitem").css("font-size",jQuery_1_6("#enteredInput").css("font-size")).css("font-family",jQuery_1_6("#enteredInput").css("font-family"));items.children("span").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(event){jQuery_1_6("#enteredInput").setval(this.term);self.activate(event,jQuery_1_6(this).parent())}).mouseleave(function(){self.deactivate()})},activate:function(event,item){this.deactivate();if(this.hasScroll()){var offset=item.offset().top-this.element.offset().top,scroll=this.element.scrollTop(),elementHeight=this.element.height();if(offset<0){this.element.scrollTop(scroll+offset)}else{if(offset>=elementHeight){this.element.scrollTop(scroll+offset-elementHeight+item.height())}}}this.active=item.eq(0).children("span").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",event,{item:item})},deactivate:function(){if(!this.active){return}this.active.children("span").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null},next:function(event){this.move("next",".ui-menu-item:first",event)},previous:function(event){this.move("prev",".ui-menu-item:last",event)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(direction,edge,event){if(!this.active){this.activate(event,this.element.children(edge));return}var next=this.active[direction+"All"](".ui-menu-item").eq(0);if(next.length){this.activate(event,next)}else{this.activate(event,this.element.children(edge))}},nextPage:function(event){if(this.hasScroll()){if(!this.active||this.last()){this.activate(event,this.element.children(".ui-menu-item:first"));return}var base=this.active.offset().top,height=this.element.height(),result=this.element.children(".ui-menu-item").filter(function(){var close=jQuery_1_6(this).offset().top-base-height+jQuery_1_6(this).height();return close<10&&close>-10});if(!result.length){result=this.element.children(".ui-menu-item:last")}this.activate(event,result)}else{this.activate(event,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))}},previousPage:function(event){if(this.hasScroll()){if(!this.active||this.first()){this.activate(event,this.element.children(".ui-menu-item:last"));return}var base=this.active.offset().top,height=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var close=jQuery_1_6(this).offset().top-base+height-jQuery_1_6(this).height();return close<10&&close>-10});if(!result.length){result=this.element.children(".ui-menu-item:first")}this.activate(event,result)}else{this.activate(event,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))}},hasScroll:function(){return this.element.height()<this.element[jQuery_1_6.fn.prop?"prop":"attr"]("scrollHeight")},select:function(event){this._trigger("selected",event,{item:this.active})}})}(jQuery_1_6));

/*
 * jQuery Tools v1.2.6 - The missing UI library for the Web
 * 
 * tooltip/tooltip.js
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/
 * 
 */
(function(a){a.tools=a.tools||{version:"v1.2.6"},a.tools.tooltip={conf:{effect:"toggle",fadeOutSpeed:"fast",predelay:0,delay:30,opacity:1,tip:0,fadeIE:!1,position:["top","center"],offset:[0,0],relative:!1,cancelDefault:!0,events:{def:"mouseenter,mouseleave",input:"focus,blur",widget:"focus mouseenter,blur mouseleave",tooltip:"mouseenter,mouseleave"},layout:"<div/>",tipClass:"tooltip"},addEffect:function(a,c,d){b[a]=[c,d]}};var b={toggle:[function(a){var b=this.getConf(),c=this.getTip(),d=b.opacity;d<1&&c.css({opacity:d}),c.show(),a.call()},function(a){this.getTip().hide(),a.call()}],fade:[function(b){var c=this.getConf();!a.browser.msie||c.fadeIE?this.getTip().fadeTo(c.fadeInSpeed,c.opacity,b):(this.getTip().show(),b())},function(b){var c=this.getConf();!a.browser.msie||c.fadeIE?this.getTip().fadeOut(c.fadeOutSpeed,b):(this.getTip().hide(),b())}]};function c(b,c,d){var e=d.relative?b.position().top:b.offset().top,f=d.relative?b.position().left:b.offset().left,g=d.position[0];e-=c.outerHeight()-d.offset[0],f+=b.outerWidth()+d.offset[1],/iPad/i.test(navigator.userAgent)&&(e-=a(window).scrollTop());var h=c.outerHeight()+b.outerHeight();g=="center"&&(e+=h/2),g=="bottom"&&(e+=h),g=d.position[1];var i=c.outerWidth()+b.outerWidth();g=="center"&&(f-=i/2),g=="left"&&(f-=i);return{top:e,left:f}}function d(d,e){var f=this,g=d.add(f),h,i=0,j=0,k=d.attr("title"),l=d.attr("data-tooltip"),m=b[e.effect],n,o=d.is(":input"),p=o&&d.is(":checkbox, :radio, select, :button, :submit"),q=d.attr("type"),r=e.events[q]||e.events[o?p?"widget":"input":"def"];if(!m){return}r=r.split(/,\s*/);if(r.length!=2){return}d.bind(r[0],function(a){clearTimeout(i),e.predelay?j=setTimeout(function(){f.show(a)},e.predelay):f.show(a)}).bind(r[1],function(a){clearTimeout(j),e.delay?i=setTimeout(function(){f.hide(a)},e.delay):f.hide(a)}),k&&e.cancelDefault&&(d.removeAttr("title"),d.data("title",k)),a.extend(f,{show:function(b){if(!h){l?h=a(l):k?h=a(e.layout).addClass(e.tipClass).appendTo(document.body).hide().append(k):(h=d.next(),h.length||(h=d.parent().next()));if(!h.length){return}}if(f.isShown()){return f}h.stop(!0,!0);var o=c(d,h,e);e.tip&&h.html(d.data("title")),b=a.Event(),b.type="onBeforeShow",g.trigger(b,[o]);if(b.isDefaultPrevented()){return f}o=c(d,h,e),h.css({position:"absolute",top:o.top,left:o.left}),n=!0,m[0].call(f,function(){b.type="onShow",n="full",g.trigger(b)});var p=e.events.tooltip.split(/,\s*/);h.data("__set")||(h.unbind(p[0]).bind(p[0],function(){clearTimeout(i),clearTimeout(j)}),p[1]&&!d.is("input:not(:checkbox, :radio), textarea")&&h.unbind(p[1]).bind(p[1],function(a){a.relatedTarget!=d[0]&&d.trigger(r[1].split(" ")[0])}),e.tip||h.data("__set",!0));return f},hide:function(c){if(!h||!f.isShown()){return f}c=a.Event(),c.type="onBeforeHide",g.trigger(c);if(!c.isDefaultPrevented()){n=!1,b[e.effect][1].call(f,function(){c.type="onHide",g.trigger(c)});return f}},isShown:function(a){return a?n=="full":n},getConf:function(){return e},getTip:function(){return h},getTrigger:function(){return d}}),a.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","),function(b,c){a.isFunction(e[c])&&a(f).bind(c,e[c]),f[c]=function(b){b&&a(f).bind(c,b);return f}})}a.fn.tooltip=function(b){var c=this.data("tooltip");if(c){return c}b=a.extend(!0,{},a.tools.tooltip.conf,b),typeof b.position=="string"&&(b.position=b.position.split(/,?\s/)),this.each(function(){c=new d(a(this),b),a(this).data("tooltip",c)});return b.api?c:this}})(jQuery);

jQuery_1_6(function(){var agt=navigator.userAgent.toLowerCase();if(agt.indexOf("firefox")!=-1){jQuery_1_6("#inputContainer").css("font-family","Arial,Helvetica,sans-serif");jQuery_1_6("#node").css("font-family","Arial,Helvetica,sans-serif")}jQuery_1_6("#enteredInput").bind("click",function(e){jQuery_1_6("#suggestion").setval("");jQuery_1_6("#enteredInput").setval("");jQuery_1_6("#enteredInput").css("color","black");e.stopImmediatePropagation()});function onSelection(message){jQuery_1_6("#enteredInput").setval(message);jQuery_1_6("#globalMenu #quickSearchForm").submit()}jQuery_1_6.fn.getval=function(){if(!this||!this.get(0)){return""}if(this.get(0).tagName=="SPAN"){return this.html()}else{return this.val()}};jQuery_1_6.fn.setval=function(str){if(!this||!this.get(0)){return}if(this.get(0).tagName=="SPAN"){return this.html(str)}else{return this.val(str)}};jQuery_1_6("#enteredInput").autocomplete({source:function(request,response){jQuery_1_6("#suggestion").setval("");var term=request.term;var queryWord=term.replace(/&nbsp;/g," ");var element=this.element;var cache=this.element.data("autocompleteCache")||{};var foundInCache=false;var convertedString=term.replace(/&nbsp;/g," ");convertedString=convertedString.replace(/\s+/g," ");convertedString=convertedString.replace(/^\s+/,"");jQuery_1_6.each(cache,function(key,data){if(term===key){if(data.length>0){jQuery_1_6("#suggestion").setval(jQuery_1_6("#enteredInput").getval()+data[0].label.substr(convertedString.length))}response(data);foundInCache=true;return}});if(foundInCache){return}var targetUrl="http://completion.amazon.co.uk/search/complete";if(location.protocol==="https:"){targetUrl="https://completion.amazon.co.uk/search/complete"}jQuery_1_6.ajax({url:targetUrl,dataType:"jsonp",data:{"search-alias":"marks-and-spencers",mkt:"5071",q:queryWord},success:function(data){var populated=false;var results=jQuery_1_6.map(data[1],function(item){if(item==="enter keyword or product code"){return}if(!populated){jQuery_1_6("#suggestion").setval(jQuery_1_6("#enteredInput").getval()+item.substr(convertedString.length));populated=true}return{label:item,value:item}});response(results);cache[term]=results;element.data("autocompleteCache",cache)}})},minLength:1,select:function(event,ui){onSelection(ui.item.label)},focus:function(event,ui){jQuery_1_6("#suggestion").setval("")},open:function(){jQuery_1_6(this).removeClass("ui-corner-all").addClass("ui-corner-top")},close:function(){jQuery_1_6(this).removeClass("ui-corner-top").addClass("ui-corner-all")}})});

(function(jQuery){renderDefaultTooltip=function(targetDivObj){targetDivObj.tooltip({tipClass:"customTooltip",fadeOutSpeed:100,predelay:400,position:"bottom right",offset:[5,-40]})}})(jQuery);


