
function createCookie(name,value,days,dateexp){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else if(dateexp){var date=new Date();date.setTime(Date.parse(dateexp));var expires="; expires="+date.toGMTString();}
else var expires="";document.cookie=name+"="+value+expires+"; path=/; domain=nordstrom.com;";}
function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}
return null;}
function eraseCookie(name){createCookie(name,"",-1,"");}
function ReturnCountryCode(name){var startPosition=document.cookie.indexOf(name);if(startPosition<0)
return null;else{var endPosition=document.cookie.indexOf("&",startPosition);var strtemp=document.cookie.substring(startPosition,endPosition);var flagArray=new Array();flagArray=strtemp.split('=');return flagArray[1];}}
function openPopUp(poplocation,sizeWidth,sizeHeight,sentProperties,sentName,refocus)
{var width=sizeWidth!=null?sizeWidth:636;var height=sizeHeight!=null?sizeHeight:430;var properties=(sentProperties!=null&&sentProperties!="")?sentProperties:"toolbar=no,status=no,resize=yes,scrollbars=yes,menubar=no";var windowName=(sentName!=null&&sentName!="")?sentName:"new";var newWindow=window.open(poplocation,windowName,properties+',width='+width+',height='+height);if(refocus==true)
newWindow.focus();}
function openBI(arg1){window.open(PageParameters.storeUrl+"TS_NBO?tn=beauty_ingredients_popup&ingr="+arg1+"","new","toolbar=no,status=no,width=342,height=364,resize=yes,scrollbars=no,menubar=no");}
function deterOutdatedBrowsers(){if($.browser.msie&&parseInt($.browser.version)<=6&&PageParameters.isPos!==true){$('.global-header').prepend($('<div id="ie6">').html('<p><strong>It looks like you&#39;re using an older version of Internet Explorer.</strong><br /><br />The newly redesigned Nordstrom.com takes advantage of the latest technology and Web standards.<br />To ensure that you have the best shopping experience, we recommend that you <br />upgrade to a newer version of IE or to a different browser.<br /><br />Our site looks best when viewed with any of the browsers listed below.<br />Just click on one to go to the browser home page and begin downloading.</p><div class="browsers"><p><a href="http://www.mozilla.com/firefox/">Firefox</a><br />(version 3 or higher)</p><p><a href="http://www.apple.com/safari/">Safari</a><br />(version 3 or higher)</p><p><a href="http://www.google.com/chrome/">Google Chrome</a><br />(version 2 or higher)</p><p><a href="http://windows.microsoft.com/en-US/windows/products/internet-explorer/">Internet Explorer</a><br />(version 7 or higher)</p><div style="clear: both; height: 1px;"></div></div>'));}}
function setIntlShoppingURL(){var url=window.location.href;if(url.indexOf("previousUrl")<0){url=PageParameters.storeUrl+"c/international-shopping?origin=footer&previousUrl="+encodeURIComponent(url);}
$("#InternationalShoppingFooter, #ProceedUS, div.intl-shopping a").attr("href",url);}
function addPlusOne(el,opt){}
$(function(){buildTopNav();setIntlShoppingURL();deterOutdatedBrowsers();loadFooterPromoFromTNT();});$(window).load(function(){addLikeBox($('#footer .likebox'));$('div.connect_top').css('padding','10px 0 0 0 !important');});(function($){var signInOutSettings;$.fn.shopperGreeting=function(settings){var firstName=$.getShopperFirstName();var greeting;if(firstName.length>0)
greeting="<span id='SignedInShopperGreeting_content'><b>Hello, <span class='ShopperFirstName' id='ShopperFirstName1'>"+firstName+"</span>.</b> Not <span class='ShopperFirstName' id='ShopperFirstName2'>"+firstName+"</span>? Please <a id='GlobalSignOutLink' href='"+settings.signOutUrl+"?ReturnURL="+encodeURIComponent(window.location.href)+"'>sign out</a>.</span>";else
greeting="<span id='SignedOutShopperGreeting_content'>Welcome to Nordstrom.  Would you like to <a id='GlobalSignInLink' href='"+settings.signInUrl+"?ReturnURL="+encodeURIComponent(window.location.href)+"'>sign in</a>?</span>"
$(this).html(greeting);signInOutSettings=settings;}
$.fn.shopperGreetingForMbox=function(){$('#headerSigninZone .ShopperFirstName').html($.getShopperFirstName());$('#shoppingBagCount').html($.getBagCountMessage($.getShopperBagCount()));$('#GlobalSignInLink').attr('href',signInOutSettings.signInUrl+"?ReturnURL="+encodeURIComponent(window.location.href));$('#GlobalSignOutLink').attr('href',signInOutSettings.signOutUrl+"?ReturnURL="+encodeURIComponent(window.location.href));}
$.fn.shoppingBagCount=function(){var bagCount=$.getShopperBagCount();$(this).html($.getBagCountMessage(bagCount));}
$.fn.collapsibleList=function(newSettings){var context=this;var settings=$.extend({'linkSelector':'.toggleLink','collapsibleSelector':'.collapsible','speed':250,'showOnlyOne':false},newSettings);return $(this).each(function(){var list=$(this);list.find(settings.linkSelector).bind('click',function(e){e.preventDefault();var collapsible=$(this).nextAll(settings.collapsibleSelector);if(settings.showOnlyOne===true){list.find(settings.collapsibleSelector).filter(function(i){return i!=list.find(settings.collapsibleSelector).index(collapsible)}).slideUp(settings.speed)}
collapsible.slideToggle(settings.speed);});});};})(jQuery);var buildTopNav=function(){$(document).ready(function(){$('#topnav ul.clearfix li:not(.active):first ul').attr("id","shopByDepartment");$('#topnav ul.clearfix li:not(.active):nth-child(2) ul').attr("id","shopByBrand");$('#topnav ul.clearfix li.active ul:not(.column) > li:first:not(:contains("Shop Gifts"))').attr("id","firstTab");$('#topnav ul.clearfix li.active ul:not(.column) > li:nth-child(2)').attr("id","secondTab");$('#topnav ul.clearfix li.active ul:not(.column) > li:nth-child(3)').attr("id","thirdTab");$('#topnav li#secondTab div.menubar > div.menu ul.column:first-child').attr("id","firstCol");$('#topnav li#secondTab div.menubar > div.menu ul.column:nth-child(2)').attr("id","secondCol");$('#topnav li#secondTab div.menubar > div.menu ul.column:nth-child(3)').attr("id","thirdCol");$('#topnav li#secondTab div.menubar > div.menu ul.column:nth-child(4)').attr("id","fourthCol");$('#topnav li#secondTab div.menubar > div.menu ul.column:nth-child(5)').attr("id","fifthCol");var styleWatchSrc=PageParameters.imageUrl+"default/shop/image/common/2010/0821/stylewatch.png";var styleWatchImg="<img src='"+styleWatchSrc+"' width='93' height='11' alt='Style Watch'>";var replaceHeader=$("#topnav li#secondTab div.menubar > div.menu ul#firstCol li.sub-heading.first");if(replaceHeader.html()!==null&&replaceHeader.html().toLowerCase().indexOf('style watch')>-1){replaceHeader.html(styleWatchImg);}
if($('#secondTab').hasClass('leaf')){$('#firstTab').addClass('leaf');}
$("#topnav ul.clearfix li.tab:not(.active) h3:contains('Shop Gifts')").parent().parent().parent().attr("id","navShopGifts");});var animationSpeed=250;$('#topnav').removeClass('noscript').find('.menu a').each(function(){var $this=$(this),$trail=$this.closest('.tab').find('h3'),trail=[];$trail.each(function(){trail.push($(this).text()+' > ');});$this.attr('name','Top Nav / '+trail.join('')+$this.text());}).end().find('ul > li.tab').bind({'mouseenter':function(e){if(!$(e.target).closest('li').hasClass('tab')){return false;}
var li=$(this).find('> ul > li');if(li.length==1){li.click();}else{if(e.pageX<$(this).offset().left+li.first().outerWidth(true)){li.first().mouseenter();}else{li.last().mouseenter();}}},'mouseleave':function(e){hideTopNav($(this).find('.expanded'),animationSpeed);}}).find('> ul > li:not(.leaf)').bind({'mouseenter click':function(e){var firstTab=$('#topnav ul li.active ul:not(.column) li#firstTab');var thirdTab=$('#topnav ul li.active ul:not(.column) li#thirdTab');var divLeft=$('div.left');var divRight=$('div.right');var topNav=$('#topnav');e.stopPropagation();if(window.searchBar!=null){window.searchBar.hideSuggestions();}
clearActiveTimeout();var whichTabOver=($(this).hasClass("more"))?$(this).prev():$(this);var expanded=$('#topnav .expanded');if(expanded.length>0&&expanded[0]!=whichTabOver[0]){hideTopNav(expanded,animationSpeed);}
var leftOffset=whichTabOver.parentsUntil("li.tab").parent().hasClass("active")?3:16;var menuDiv=whichTabOver.find("div.menu");var offset=Math.floor(whichTabOver.position().left)-leftOffset+((whichTabOver.hasClass("primary"))?0:3);menuDiv.removeClass("cols-1 cols-2 cols-3 cols-4 cols-5").addClass("cols-"+menuDiv.find("ul.column").length);whichTabOver.addClass("expanded");var menuBarDiv=whichTabOver.find('div.menubar');if(parseInt(menuDiv.width())>0){menuBarDiv.width(menuDiv.width()+5);menuBarDiv.addClass('over');};menuBarDiv.height(menuDiv.height());menuBarDiv.css("left",offset+"px");if($("li.more>span").css("opacity")<1&&whichTabOver.next().hasClass("more")){$("li.more>span").hide();}else{whichTabOver.next("li.more").children("span").fadeOut(animationSpeed);}
if(whichTabOver.is("#firstTab")){divLeft.addClass("over");firstTab.bgy('-276px');}
if(whichTabOver.parent().is("#shopByDepartment")||whichTabOver.parent().is("#shopByBrand")){whichTabOver.parent().addClass('over');}
if(whichTabOver.is("#secondTab")||whichTabOver.is("#thirdTab")){firstTab.bgy('-500px');thirdTab.addClass("over");divRight.addClass("over");topNav.addClass("over").addClass("cols-"+menuDiv.find("ul.column").length);}
var animatedMenubar=$("div:animated");if(animatedMenubar.length>0){$("div.menubar").stop(false,true);whichTabOver.children("div.menubar").show();}else{delayTopNav=setTimeout(function(){whichTabOver.children("div.menubar").slideDown(animationSpeed);},300);}},'mouseleave':function(e){var $rel=$(e.relatedTarget).closest('li');if($rel.closest('.tab')[0]==$(this).closest('.tab')[0]&&!$rel.is('.tab ul li')){return false;}
hideTopNav($(this),animationSpeed);}})};var hideTopNav=function(openTab,speed){clearActiveTimeout();if(openTab.hasClass("more")){openTab=openTab.prev();}
openTab.removeClass("expanded").find("div.menubar").slideUp(speed).end().next("li.more").children("span").fadeIn(speed);$("#shopByDepartment").removeClass("over");$("#shopByBrand").removeClass("over");$("div.right").removeClass("over");$("div.left").removeClass("over");$("li#secondTab").removeClass("over");$("li#thirdTab").removeClass("over");$("li#firstTab").bgy('-244px');$('#topnav').removeClass("cols-1 cols-2 cols-3 cols-4 cols-5 over");};var clearActiveTimeout=function(){if(typeof(delayTopNav)=="number"&&delayTopNav>0){clearTimeout(delayTopNav);delayTopNav=0;}};$.fn.bgx=function(x){if(null==x){if($(this).css('background-position-x')){return $(this).css('background-position-x');}else{return $(this).css('background-position').split(' ')[0];};}else{y=$(this).bgy();$(this).css('background-position',x+' '+y);return $(this);}};$.fn.bgy=function(y){if(null==y){if($(this).css('background-position-y')){return $(this).css('background-position-y');}else{return $(this).css('background-position').split(' ')[1];};}else{x=$(this).bgx();$(this).css('background-position',x+' '+y);return $(this);}};var addLikeButton=function(target,settings){if(PageParameters.isPos!==true){var fullSettings={'href':document.location,'layout':'button_count','show_faces':'false','width':'100','height':'21','action':'like','font':'arial','colorscheme':'light'};if(settings){$.each(settings,function(name,value){fullSettings.name=value;});}
var src='http://www.facebook.com/plugins/like.php?';$.each(fullSettings,function(name,value){src+=name+'='+value+'&';});target.append('<iframe frameborder="0" allowTransparency="true" src="'+src+'" scrolling="no" frameborder="0" />');}};var addLikeBox=function(target,newSettings){if(PageParameters.isPos!==true){if(target.length>1){target=target.eq(0);}
var settings=$.extend({'id':'12854644836','connections':'0','showStream':'false','showHeader':'false','height':'62px','width':'208px','allowScrolling':'no','style':'border:none; overflow:hidden;'},newSettings);target.append($('<iframe frameborder="0" allowTransparency="true"/>').attr({'src':[document.location.protocol,'//www.facebook.com/plugins/likebox.php','?id=',settings.id,'&amp;connections=',settings.connections,'&amp;stream=',settings.showStream,'&amp;header=',settings.showHeader,'&amp;height=',parseInt(settings.height)+'','&amp;width=',parseInt(settings.width)+''].join(''),'scrolling':settings.allowScrolling,'style':['height:',settings.height,';','width:',settings.width,';',settings.style].join('')}));}};var getLatestPromo=function(promoList){var today=PageParameters.date!=null?new Date(PageParameters.date):new Date(PageParameters.serverDateTime);var latestPromo='';for(var liveDate in promoList){if(today>=new Date(liveDate)){latestPromo=promoList[liveDate];break;}}
return latestPromo;}
var getLeftAndRightHeaderLatestPromo=function(){var latestPromos=[getLatestPromo(currentHeaderPromosLeft),getLatestPromo(currentHeaderPromosRight)];for(var i=0;i<latestPromos.length;i++){if(latestPromos[i].constructor===Array){latestPromos[i]=latestPromos[i][latestPromos[i].length>1?Math.floor(Math.random()*latestPromos[i].length):0]}}
return latestPromos;}
loadTopHeaderPromo=function(){$("#topPromoBannerZone").find("div.promo").html(getLatestPromo(currentHeaderPromosTop));}
loadLeftHeaderPromo=function(){if($("#topPromoBannerZone").find("div.promo").children().size()>0)$("div.global-header").css('padding-top','0');if(PageParameters.isInternationalShipEnabled===true&&(PageParameters.countryCode!=null&&PageParameters.countryCode!="US"))
return;else{var latestPromos=getLeftAndRightHeaderLatestPromo();$("div.global-header div.left-side div.promo").html(latestPromos[0]);}};loadRightHeaderPromo=function(){if(PageParameters.isInternationalShipEnabled===true&&(PageParameters.countryCode!=null&&PageParameters.countryCode!="US")){$("div.global-header div.right-side div.promo").html(['<div class="intl-shopping">','<a href="',PageParameters.storeUrl,'c/international-shopping?origin=header-promo">','<img src="',PageParameters.imageUrl,'store/common/flagicons/',PageParameters.countryCode,'.gif" alt="',PageParameters.countryCode,'"/>','<span>Change Selections</span>','</a>','</div>'].join(''));}else{var latestPromos=getLeftAndRightHeaderLatestPromo();$("div.global-header div.right-side div.promo").html(latestPromos[1]);}};loadFooterPromo=function(){var latestPromo=getLatestPromo(currentFooterPromos);if(latestPromo.constructor===Array){latestPromo=latestPromo[latestPromo.length>1?Math.floor(Math.random()*latestPromo.length):0]}
$("div.global-footer").find("div.promo:first-child").html(latestPromo);};loadFooterPromoFromTNT=function(){$("#footerRightPromoZone").find("div.promo").hide();var allPromoDivs=$("#footerRightPromoZone").find("div.promo");var validPromoDivs=new Array();for(var i=0;i<allPromoDivs.length;i++){if($(allPromoDivs[i]).children().size()>0){validPromoDivs.push(allPromoDivs[i]);}}
validPromoDivs=validPromoDivs[validPromoDivs.length>1?Math.floor(Math.random()*validPromoDivs.length):0]
$(validPromoDivs).show();};if(typeof(TrackRatingsDisplayed)!='function'){TrackRatingsDisplayed=function(){};}
(function($){$.callSafe=function(functionName,args){var fn;if(window['TrialContent']){fn=window['TrialContent'][functionName];}
if(typeof(fn)!=="function")return;try{fn.apply(TrialContent,args);}catch(e){if(typeof($.log)==="function")$.log("Error invoking function "+functionName+": "+e.toString());}}})(jQuery);
