window.addEvent("load",function(){if(Browser.Engine.trident&&(typeof Garbage!="undefined")&&(Garbage.elements.length>500)){Garbage.elements=[]
}});
var ProfileUtility=new Class({Implements:[Options],defaultOptions:{profileUtility:_CONTEXT_ROOT+"/common/profile.util.jsp",cslotUtility:_CONTEXT_ROOT+"/common/itemFinderContent.util.jsp",scenarioSlotUtility:_CONTEXT_ROOT+"/common/ajaxSlotLoader.util.jsp",bagCountContainer:"shoppingBagCount",loginContainer:"loginZone",welcomeMessage:"Hi",firstNameContainers:"userFirstName",cookiePrefix:"DSW",sessionCookieName:"session",storageCookieName:"storage",sessionDuration:0,storageDuration:365,cookiePath:"/",atgSlotClass:"atg-cslot"},initialize:function(options){this.setOptions($merge(this.defaultOptions,options));
this._session=new Hash.Cookie(this.options.cookiePrefix+this.options.sessionCookieName,{duration:this.options.sessionDuration,path:this.options.cookiePath,autoSave:true});
this._storage=new Hash.Cookie(this.options.cookiePrefix+this.options.storageCookieName,{duration:this.options.storageDuration,path:this.options.cookiePath,autoSave:true});
this.loginContainer=$(this.options.loginContainer);
if(this.loginContainer){this.getProfile()
}if(this._session.get("expiredPassword")&&document.location.href.indexOf("expiredLogin.jsp")==-1&&document.location.href.indexOf("logout")==-1){document.location.href="/dsw_shoes/user/expiredLogin.jsp"
}},get:function(name,type){var value;
if(!type){if(this._storage.get(name)){value=this._storage.get(name)
}else{if(this._session.get(name)){value=this._session.get(name)
}}}else{if(type&&type.toLowerCase()=="storage"){value=this._storage.get(name)
}else{if(type&&type.toLowerCase()=="session"){value=this._session.get(name)
}}}if(!value){value=false
}return(value)
},set:function(name,value,type){var size=0;
if(type!=null&&type!="undefined"&&type.toLowerCase()=="storage"){this._storage.set(name,value)
}else{this._session.set(name,value)
}return(this.size(type))
},remove:function(name,type){var size=0;
if(type!=null&&type!="undefined"&&type.toLowerCase()=="storage"){this._storage.erase(name)
}else{this._session.erase(name)
}return(this.size(type))
},extend:function(obj,type){var size=0;
if(type!=null&&type!="undefined"&&type.toLowerCase()=="storage"){this._storage.extend(obj)
}else{this._session.extend(obj)
}return(this.size(type))
},size:function(type){if(!type){type="session"
}var bytes=Cookie.read(this.options.cookiePrefix+type).length*2;
return(bytes)
},getProfile:function(){var complete=function(responseText){if(responseText!=""){this.loginContainer.empty();
var tmpProfile=eval("("+responseText+")");
this.extend(tmpProfile.store,"storage");
this.extend(tmpProfile.session,"session");
this.checkShedding();
this.updateHeaderLogin();
this.updateFirstName();
this.updateBagCount();
this.getCSlots();
this.getScenarioSlots();
tmpProfile=null
}}.bind(this);
new Request({method:"get",url:this.options.profileUtility,onSuccess:complete}).send()
},checkShedding:function(){if(this.get("shedding")){document.location.href="/lounge"
}},updateHeaderLogin:function(){var name=this.get("fn");
var anon=(this.get("ldw")=="A01")?true:false;
var auth=this.get("auth");
if(auth){anon=false
}var welcomeSpan=new Element("span",{id:"welcomeMessage"});
var loginAnchor=new Element("a",{html:"Log In",href:"/dsw_shoes/user/loginAccount.jsp","class":"topNavLink"});
var notYouAnchor=new Element("a",{href:"#","class":"topNavLink"}).addEvent("click",function(){$("globalNotYou").submit();
return(false)
}).set("html","Not You?");
var logoutAnchor=new Element("a",{html:"Log Out","class":"topNavLink"}).addEvent("click",function(){$("globalLogout").submit();
return(false)
});
if(!anon){if(name){welcomeSpan.set("html",this.options.welcomeMessage+" "+name+"!")
}else{welcomeSpan.set("html",this.options.welcomeMessage+"!")
}welcomeSpan.inject(this.loginContainer);
if(auth){logoutAnchor.inject(welcomeSpan,"after")
}else{loginAnchor.inject(welcomeSpan,"after");
notYouAnchor.inject(welcomeSpan,"after")
}}else{loginAnchor.inject(this.loginContainer)
}},updateFirstName:function(){var name=this.get("fn");
if(name&&name!=""){$$("."+this.options.firstNameContainers).each(function(el){el.set("html",name)
}.bind(this))
}},updateBagCount:function(){var bagCount=this.get("bagcount");
if(bagCount&&bagCount!=""&&$(this.options.bagCountContainer)){var bagCountHTML="";
if(parseInt(this.bagCount)==1){bagCountHTML='<a id="shoppingBagCountLink" rel="nofollow" "href="/dsw_shoes/checkout/shoppingBag.jsp">BAG [1]</a>'
}else{bagCountHTML='<a id="shoppingBagCountLink" rel="nofollow" href="/dsw_shoes/checkout/shoppingBag.jsp">BAG ['+bagCount+"]</a>"
}$(this.options.bagCountContainer).set("html",bagCountHTML)
}},getCSlots:function(){$$("."+this.options.atgSlotClass).each(function(cslot){var html=cslot.innerHTML.replace(/\n/g,"");
var reKeywords=/^.*<\!--\[(.*)\]-->.*$/;
if(reKeywords.test(html)){var url=this.options.cslotUtility+"?keywords="+escape(html.replace(reKeywords,"$1"))+"&ldw="+escape(this.get("ldw"));
var complete=function(responseText){if(responseText!=""){cslot.set("html",responseText)
}}.bind(this);
new Request({method:"get",url:url,onSuccess:complete}).send()
}}.bind(this))
},getScenarioSlots:function(){var slots=$$(".ajaxSlot");
if(!slots.length==0){var postSlots="";
slots.each(function(slot){postSlots+="slotName="+slot.getProperty("id")+"&"
});
var complete=function(responseText){var slotLoader=new Element("div",{id:"slotLoaderContainer",html:responseText});
var slots=slotLoader.getChildren();
slots.each(function(newSlotContent){var slotId=newSlotContent.get("id");
var oldSlotContent=$(slotId);
newSlotContent.replaces(oldSlotContent)
})
}.bind(this);
new Request({method:"post",url:this.options.scenarioSlotUtility,onSuccess:complete,data:postSlots}).send()
}}});
ProfileUtility.implement(new Events,new Options);
function mouseoverSetup(image){var extlist=[".gif",".jpg",".jpeg",".png","?fmt=gif","?fmt=jpg","?fmt=png","?fmt=png-alpha"];
var ext=null;
var re=null;
var klass=null;
var clickklass=null;
var key=null;
var src=null;
var oversrc=null;
var init=function(el){src=el.src.replace(/_on\.gif$/,".gif");
klass=el.className;
if(klass.contains("mouseclick_")){re=new RegExp(".*(mouseclick_[a-zA-Z0-9-]+).*");
clickklass=klass.replace(re,"$1");
extlist.each(function(x){re=new RegExp("\\"+x+"$");
if(src.match(re)){ext=x
}});
if(ext!=null){re=new RegExp("mouseclick(_[a-zA-Z0-9-]+)");
key=clickklass.replace(re,"$1");
re=new RegExp("\\."+ext+"$");
el.activesrc=src.replace(re,key+"."+ext);
el.addEvent("click",function(){this.removeEvents("mouseenter");
this.removeEvents("mouseleave");
this.setProperty("src",this.activesrc)
})
}}if(klass.contains("mouseover_")){re=new RegExp(".*(mouseover_[a-zA-Z0-9-]+).*");
klass=klass.replace(re,"$1");
extlist.each(function(x){re=new RegExp("\\"+x+"$");
if(src.match(re)){ext=x
}});
if(ext!=null){re=new RegExp("mouseover(_[a-zA-Z0-9-]+)");
key=klass.replace(re,"$1");
if(ext.contains("png")&&(document.all)&&(navigator.userAgent.toUpperCase().indexOf("OPERA")<0)&&(navigator.userAgent.indexOf("MSIE 7")<0)){re=new RegExp("\\"+ext+"$");
oversrc=src.replace(re,key+ext);
el.overImage=new Image();
el.overImage.src=oversrc;
el.outImage=new Image();
el.outImage.src=el.src;
width=el.getProperty("width");
height=el.getProperty("height");
el.setProperty("src",_SPACER_IMAGE);
el.overFilter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+oversrc+"', sizingMethod=scale);alpha(opacity=100)";
el.outFilter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod=scale);alpha(opacity=100)";
el.style.filter=el.outFilter;
el.style.width=width+"px";
el.style.height=height+"px";
el.addEvent("mouseenter",function(){this.setStyle("filter",this.overFilter)
});
el.addEvent("mouseleave",function(){this.setStyle("filter",this.outFilter)
})
}else{re=new RegExp("\\"+ext+"$");
oversrc=src.replace(re,key+ext);
el.overImage=new Image();
el.overImage.src=oversrc;
el.outImage=new Image();
el.outImage.src=el.src;
el.addEvent("mouseenter",function(){this.setProperty("src",this.overImage.src)
});
el.addEvent("mouseleave",function(){this.setProperty("src",this.outImage.src)
})
}}}ext=null;
re=null;
klass=null;
clickklass=null;
key=null;
src=null;
oversrc=null
};
if(image!=undefined){init($(image))
}else{$$("img").each(init)
}}var AlphaPng=new Class({Implements:[Options],defaultOptions:{debug:0,clearImage:"/dsw_shoes/images/spacer.gif",backgroundTags:["div","table","td","a"]},initialize:function(options){if(Browser.Engine.trident4){this.setOptions($merge(this.defaultOptions,options));
this.fixElements()
}},fixElements:function(){if(Browser.Engine.trident4){var rs7png=new RegExp("url\\((.*fmt=png-alpha)\\)");
var rpng=new RegExp("url\\(([.a-zA-Z0-9_/:-]+.png)\\)");
var rgif=new RegExp("url\\((/spacer.gif$/i)\\)");
for(var i=0;
i<document.styleSheets.length;
i++){for(var j=0;
j<document.styleSheets[i].rules.length;
j++){var cssstyle=document.styleSheets[i].rules[j].style;
var bgimage=cssstyle.backgroundImage.replace(rpng,"$1").replace(rs7png,"$1");
var spacer=cssstyle.backgroundImage.replace(rgif,"$1");
var position=cssstyle.position;
if(bgimage&&(bgimage.match(/\.png/i)||bgimage.match(/png\-alpha/i))){cssstyle.position=(position=="static")?"relative":position;
cssstyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', src='"+bgimage.replace(/\.\.\//g,"")+"', sizingMethod='crop')";
cssstyle.backgroundImage="url('"+this.options.clearImage+"')"
}else{if(!spacer){cssstyle.filter="filter:alpha(opacity=1)"
}}}}document.getElements(this.options.backgroundTags.join(",")).each(function(tag){var rpng=new RegExp("url\\(([a-zA-Z0-9_/:-]+.png)\\)");
var rs7png=new RegExp("url\\((.*fmt=png-alpha)\\)");
var bgimage=tag.getStyle("background-image").replace(rpng,"$1").replace(rs7png,"$1");
var position=tag.getStyle("position");
if(bgimage&&bgimage.match(/\.png/i)){tag.setStyles({position:(position=="static")?"relative":position,filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', src='"+bgimage+"', sizingMethod='scale')","background-image":"url('"+this.options.clearImage+"')"})
}}.bind(this));
$$("[src$=.png], [src$=?fmt=png], [src$=fmt=png-alpha]").each(function(img){if(!img.hasClass("mouseover_on")){var size=img.getCoordinates();
var src=img.getProperty("src");
img.setProperty("src",this.options.clearImage);
img.setStyles({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', src='"+src+"', sizingMethod='scale');alpha(opacity=100)'",width:size.width,height:size.height})
}}.bind(this))
}}});
AlphaPng.implement(new Events,new Options);
var Global={_storage:{},createKey:function(){var currentDate=new Date();
return(currentDate.getTime().toString())
},get:function(key){return(this._storage[key])
},set:function(value,key){if(key==undefined){key=this.createKey()
}this._storage[key]=value;
return(key)
},keywordGet:function(keyword){var matches=[];
for(var key in this._storage){if(key.contains(keyword)){matches.push(key)
}}return(matches)
}};
var ModalWindow={defaultOptions:{resizeDuration:900,initialWidth:200,initialHeight:120,contentsWidth:200,contentsHeight:120,minContentsWidth:200,minContentsHeight:120,enableCaption:true,evalScripts:true,evalResponse:false,ajaxMethod:"get",status:"closed",ready:false,overlayOpacity:0.8,errorMessage:"There was a problem with your request.<br /><br />Please try again.<br /><br /><em>Click anywhere to close.</em>"},init:function(options){this.options=$merge(this.defaultOptions,options);
this.anchors=[];
document.getElements("a").each(function(el){if(el.get("rel")&&el.get("href")&&(el.get("rel").test("^modalwindow","i"))){el.addEvent("click",function(){window.addEvent("modalready",function(){this.open(el.get("href"),el.get("title"),el.get("rel"))
}.bind(this));
return(false)
}.bind(this));
this.anchors.push(el)
}},this);
this.eventPosition=this.position.bind(this);
this.overlay=new Element("div").setProperty("id","mb_overlay").setStyle("display","none").inject(document.body);
this.center=new Element("div").setProperty("id","mb_center").setStyles({width:"0px",height:"0px",marginLeft:"-"+(this.options.initialWidth/2)+"px",display:"none"}).inject(document.body);
this.center.setStyle("z-index",10001);
this.contents=new Element("div").setProperty("id","mb_contents").inject(document.body);
this.titleBar=new Element("div").setProperty("id","mb_titleBar").setStyle("display","none").inject(document.body);
this.closelink=new Element("a").setProperties({id:"mb_close_link",href:"javascript:void(0);"}).inject(this.titleBar);
this.caption=new Element("div").setProperty("id","mb_caption").inject(this.titleBar);
new Element("div").setProperty("class","clear").inject(this.titleBar);
this.error=new Element("div").setProperty("id","mb_error").set("html",this.options.errorMessage);
this.closelink.onclick=this.overlay.onclick=this.close.bind(this);
this.ajaxRequest=$empty;
this.options.ready=true
},stockLocatorModalWindow:function(sLinkHref,sLinkTitle,sLinkRel,sFormId){this.open(sLinkHref,sLinkTitle,sLinkRel,sFormId);
this.overlay.onclick=null;
this.overlay.setStyle("cursor","default")
},open:function(sLinkHref,sLinkTitle,sLinkRel,sFormId,sEvalScriptsNow){if(!this.options.ready){window.addEvent("modalready",function(){this.open(sLinkHref,sLinkTitle,sLinkRel,sFormId,sEvalScriptsNow)
}.bind(this));
return(false)
}this.href=(typeof sLinkHref!="undefined")?sLinkHref:this.href;
this.title=(typeof sLinkTitle!="undefined")?sLinkTitle:this.title;
this.rel=(typeof sLinkRel!="undefined")?sLinkRel:this.rel;
this.formId=(typeof sFormId!="undefined")?sFormId:this.formId;
this.formId=($(this.formId)==null)?null:this.formId;
this.evalScriptsNow=(typeof sEvalScriptsNow!="undefined")?sEvalScriptsNow:this.options.evalScripts;
this.closelink.onclick=this.overlay.onclick=this.close.bind(this);
this.overlay.setStyle("cursor","pointer");
if(this.options.status=="open"){this.options.status="recycling";
this.close();
return(false)
}else{if(this.formId!=null&&this.formId!=""){this.method=($(this.formId).getProperty("method")!=null?$(this.formId).getProperty("method"):this.options.ajaxMethod)
}else{this.method=this.options.ajaxMethod
}this.position();
if(this.options.status!="recycling"){this.prepare(true)
}this.top=(Window.getScrollTop()+30+(Window.getHeight()/15))-2;
if(this.options.status!="recycling"){this.center.setStyle("display","")
}this.center.setStyle("top",this.top);
if(this.options.status!="recycling"){this.overlay.setStyles({opacity:0,display:""});
if(!this.overlayFx){this.overlayFx=new Fx.Tween(this.overlay,{duration:this.options.resizeDuration})
}this.overlayFx.start("opacity",this.options.overlayOpacity)
}var aDim=this.rel.match(/([0-9]|auto|noscroll)+/gi);
if(this.options.status=="recycling"){this.center.setStyle("background","#FFFFFF")
}if(parseInt(aDim[0])>=this.options.minContentsWidth){this.options.contentsWidth=aDim[0];
this.options.initialWidth=aDim[0];
this.contents.setStyle("width",this.options.contentsWidth+"px")
}else{this.options.contentsWidth="auto";
this.contents.setStyles({"float":"left",width:""})
}if(parseInt(aDim[1])>=this.options.minContentsHeight){this.options.contentsHeight=aDim[1];
this.contents.setStyles({height:this.options.contentsHeight+"px"})
}else{this.options.contentsHeight="auto";
this.contents.setStyles({"float":"left",height:""})
}this.contents.overflowForce=null;
if(aDim.length>2&aDim[2]=="noscroll"){this.contents.overflowForce="hidden"
}this.contents.setStyles({top:this.top+"px"});
if(this.options.status!="recycling"){this.titleBar.setStyles({opacity:"0",height:"0px",display:"none"});
this.center.setStyles({width:this.options.initialWidth+"px",marginLeft:-(parseInt(this.options.initialWidth)/2)})
}else{this.caption.empty()
}return(this.loadContents(this.href))
}},position:function(){this.overlay.setStyles({top:Window.getScrollTop()+"px",height:Window.getHeight()+"px"})
},prepare:function(open){var elements=$A($$("object"));
$extend(elements,$$(window.ActiveXObject?"select":"embed"));
elements.each(function(el){el.style.visibility=open?"hidden":""
});
var fn=open?"addEvent":"removeEvent";
window[fn]("scroll",this.eventPosition)[fn]("resize",this.eventPosition)
},loadContents:function(){if(this.options.status!="recycling"){this.contents.setStyle("display","none");
this.center.className="mb_loading"
}var qsData={};
if(this.formId!=null&&this.formId!=""){qsData={};
var val;
var els=$extend($(this.formId).getElements("input"),$(this.formId).getElements("select"),$(this.formId).getElements("textarea"));
els.each(function(el){var name=el.name;
var val=el.get("value");
if(val===false||!name||el.disabled){return
}if($chk(qsData[name])&&this.type=="checkbox"){qsData[name]=[qsData[name]]
}if($type(qsData[name])=="array"){qsData[name].push(val)
}else{qsData[name]=val
}})
}if(this.href!="#"){var openWindow=this.openWindow.bind(this);
var ajaxFailure=this.ajaxFailure.bind(this);
this.ajaxRequest=new Request.HTML({url:this.href,method:this.method,update:this.contents,data:qsData,evalScripts:false,evalResponse:this.options.evalResponse,onComplete:openWindow,onFailure:ajaxFailure}).send()
}else{this.options.evalScripts=false;
this.contents.set("html",this.htmlContent);
this.openWindow()
}return(false)
},loadHTML:function(htmlContent,title,options){this.htmlContent=htmlContent;
this.open("#",title,options,undefined,false)
},ajaxFailure:function(){this.contents.set("html","");
this.error.clone().inject(this.contents);
this.openWindow();
this.center.setStyle("cursor","pointer");
this.titleBar.setStyle("cursor","pointer");
this.center.onclick=this.titleBar.onclick=this.close.bind(this)
},getDimensions:function(){this.contents.setStyles({display:""});
this.contents.dimensions=this.contents.getSize();
if(this.options.contentsWidth=="auto"){if(this.contents.dimensions.x>(Window.getWidth()-60)){this.options.contentsWidth=(Window.getWidth()-60)
}else{if(this.contents.dimensions.x<this.options.minContentsWidth){this.options.contentsWidth=this.options.minContentsWidth
}else{this.options.contentsWidth=this.contents.dimensions.x
}}}if(this.options.contentsHeight=="auto"){if((this.contents.dimensions.y>(Window.getHeight()-60))&&((Window.getHeight()-60)>0)){this.options.contentsHeight=(Window.getHeight()-60)
}else{if(this.contents.dimensions.y<this.options.minContentsHeight||this.options.minContentsHeight>Window.getHeight()){this.options.contentsHeight=this.options.minContentsHeight
}else{this.options.contentsHeight=(this.contents.dimensions.y)
}}}if((this.options.contentsHeight+2)<this.contents.dimensions.y){this.options.contentsWidth=parseInt(this.options.contentsWidth)+35
}if((this.options.contentsWidth+2)<this.contents.dimensions.x){this.options.contentsHeight=parseInt(this.options.contentsHeight)+35
}this.contents.setStyle("float","none");
this.center.adopt(this.contents)
},openWindow:function(){this.getDimensions();
this.center.setStyles({background:"#FFFFFF",cursor:"default",width:this.options.contentsWidth+"px",marginLeft:-(parseInt(this.contents.style.width)/2)});
this.titleBar.setStyle("cursor","default");
this.center.onclick=this.titleBar.onclick="";
this.caption.set("html",this.title);
this.contents.setStyles({width:this.options.contentsWidth+"px",height:(parseInt(this.options.contentsHeight)+1)+"px"});
if(this.options.enableCaption){if(this.options.status!="recycling"){this.titleBar.setStyles({top:(this.top-27)+"px",width:this.center.style.width,marginLeft:this.center.style.marginLeft,display:""});
this.titleBar.setStyles({opacity:"1",height:this.titleBar.scrollHeight+"px"})
}else{new Fx.Morph(this.titleBar,{duration:this.options.resizeDuration}).start({width:this.contents.style.width,marginLeft:this.center.style.marginLeft})
}}var displayWindow=function(){new Fx.Tween(this.contents,{duration:ModalWindow.options.resizeDuration,wait:true,onComplete:function(){ModalWindow.contents.setStyle("overflow",(ModalWindow.contents.overflowForce!=null?ModalWindow.contents.overflowForce:"auto"))
}}).start("opacity",1);
if(this.evalScriptsNow){this.ajaxRequest.evalScriptsCompatible()
}this.options.status="open"
}.bind(this);
var properties={};
if(parseInt(this.center.style.width)!=this.options.contentsWidth){properties.width=[this.center.clientWidth,this.options.contentsWidth]
}if(parseInt(this.center.style.height)!=this.options.contentsHeight){properties.height=[this.center.clientHeight,this.options.contentsHeight]
}if(properties.width||properties.height){new Fx.Morph(this.center,{duration:this.options.resizeDuration,transition:Fx.Transitions.Expo.easeOut,onComplete:displayWindow.bind(this)}).start(properties)
}else{displayWindow()
}},close:function(){if(this.options.status!="recycling"){this.center.setStyles({width:"0px",height:"0px",display:"none",background:"#DDDDDD url(/dsw_shoes/images/moodalbox/loading.gif) no-repeat center center;"});
this.titleBar.setStyle("display","none");
this.center.className="mb_loading";
this.contents.setStyles({opacity:"0",overflow:"hidden",display:"none"});
$(document.body).adopt(this.contents);
this.overlay.setStyles({display:"none",opacity:"0"});
this.options.contentWidth=this.options.initialWidth;
this.options.contentHeight=this.options.initialHeight;
this.prepare(false,this);
this.options.status="closed"
}else{this.center.setStyle("background","#FFFFFF url(/dsw_shoes/images/moodalbox/loading.gif) no-repeat center center;");
this.contents.setStyles({overflow:"hidden"});
var reOpen=function(){this.open()
}.bind(this);
new Fx.Tween(this.contents,{duration:this.options.resizeDuration,wait:true,onComplete:reOpen}).start("opacity",0)
}return(false)
}};
Request.implement({evalScriptsCompatible:function(complete){if(this.response){var script,scripts,theBody,scriptsFinal;
var inScriptCount=0;
var extScriptCount=0;
var thePageSource=this.response.text;
var onComplete=function(){if(scriptsFinal){if(typeof window.execScript!="undefined"){try{window.execScript(scriptsFinal)
}catch(e){try{eval(scriptsFinal)
}catch(e){}}if(typeof complete=="function"){try{complete()
}catch(e){}}}else{window.setTimeout(scriptsFinal,0);
if(typeof complete=="function"){window.setTimeout(complete,0)
}}}};
var checkComplete=function(){if(extScriptCount==0){var onloadre=new RegExp(/.*<body[^>]+onload="([^"]+)".*/gi);
var theOnLoad=onloadre.exec(thePageSource);
if(theOnLoad){scripts.push(theOnLoad[1])
}else{onloadre=new RegExp(/.*<body[^>]+onload='([^']+)'.*/gi);
theOnLoad=onloadre.exec(thePageSource);
if(theOnLoad){scripts.push(theOnLoad[1])
}}if(typeof complete!="undefined"&&typeof complete!="function"){scripts.push(complete)
}var oldscripts=scripts;
scriptsFinal="";
for(var i=0;
i<oldscripts.length;
i++){scriptsFinal+=oldscripts[i]+"\n"
}onComplete()
}};
var getExternalScript=function(theSrc,arrPos){var onSuccess=function(responseText){scripts[arrPos]=responseText;
extScriptCount--;
checkComplete()
};
var onFailure=function(){extScriptCount--;
checkComplete()
};
new Request({url:theSrc,method:"get",onSuccess:onSuccess,onFailure:onFailure}).send()
};
var regexp=new RegExp(/<script[^>]*>([\s\S]*?)<\/script>/gi);
var srcre=new RegExp(/<script[^>]+src="([^"]+)".*/gi);
var srcre2=new RegExp(/<script[^>]+src='([^']+)'.*/gi);
scripts=[];
while(script=regexp.exec(thePageSource)){var theExtScript=srcre.exec(script);
var theExtScript2=srcre2.exec(script);
if(theExtScript){extScriptCount++;
var theSrc=theExtScript[1];
scripts.push("");
getExternalScript(theSrc,scripts.length-1)
}else{if(theExtScript2){extScriptCount++;
var theSrc=theExtScript2[1];
scripts.push("");
getExternalScript(theSrc,scripts.length-1)
}else{scripts.push(script[1])
}}}checkComplete()
}}});
Element.Events.modalready={onAdd:function(fn){if(ModalWindow.ready){fn.call(this)
}}};
var modalready=function(){if(ModalWindow.options==null){ModalWindow.init()
}if(ModalWindow.ready){fn.call(this);
return
}else{var modalReady=function(){if(ModalWindow.ready){return
}ModalWindow.ready=true;
ModalWindow.timer=$clear(ModalWindow.timer);
this.fireEvent("modalready")
}.bind(this);
ModalWindow.timer=function(){if(ModalWindow.options!=null&&ModalWindow.options.ready){modalReady()
}}.periodical(50)
}};
function setRedirect(){var params=unescape(window.location.search.replace(/^\?/,"")||"").replace(/[%](?!\d{2})/,"").parseQueryString()||{};
var cmParam=params.cm_mmc;
var rDuration=0;
var value="";
var cm_mmc="";
var cm_mmcID="";
if(cmParam!=null){cm_mmc=cmParam.substring(0,cmParam.indexOf("-"));
cm_mmcID=cmParam.substring(cmParam.lastIndexOf("-")+1)
}if(cm_mmc!=null&&cm_mmc!=""){switch(cm_mmc){case"affil":rDuration=30;
value=cm_mmc;
break;
case"bestbuy":rDuration=2;
value=cm_mmc;
case"emmkt":rDuration=2;
value=cm_mmc;
break;
case"emop":rDuration=2;
value=cm_mmc;
break;
case"pdsrch":rDuration=2;
value=cm_mmc;
break;
case"banner":rDuration=2;
value=cm_mmc;
break;
default:rDuration=2;
value="other";
break
}Cookie.write("mktgchl",value,{duration:rDuration,path:"/",autoSave:true});
if(cm_mmc=="affil"&&(cm_mmcID!=null&&cm_mmcID!="")){Cookie.write("mktgchlID",cm_mmcID,{duration:rDuration,path:"/",autoSave:true})
}else{if(cm_mmcID!=null&&cm_mmcID!=""){Cookie.write("mktgchlID",cm_mmcID,{duration:rDuration,path:"/",autoSave:true})
}}if(cm_mmc.toLowerCase()=="google"){Cookie.write("googpla","true",{duration:30,path:"/"})
}}if(params.adtype!=null&&(params.adtype=="pla"||params.adtype=="pe")){Cookie.write("googpla","true",{duration:30,path:"/"})
}}function parseSku(sku){return({unit:sku.substring(0,2),productId:sku.substring(2,16).replace(/^0+/,""),colorCode:sku.substring(16,19),width:sku.substring(19,24).replace(/^0+/,""),size:sku.substring(24).replace(/^0+/,"")})
}var TextLabel=new Class({Implements:[Options],defaultOptions:{title:"",titleColor:"#666666",color:null,clean:function(value){return value
},toggle:function(focused){}},initialize:function(inputId,options){var htmlText="";
this.setOptions($merge(this.defaultOptions,options));
this.input=$(inputId);
if(this.input){if(!this.options.color){this.options.color=this.input.getStyle("color")
}if("placeholder" in this.input){this.input.placeholder=this.options.title
}else{this.input.addEvent("focus",this.onFocus.bindWithEvent(this));
this.input.addEvent("blur",this.onBlur.bindWithEvent(this));
this.input.addEvent("keyup",this.onKeyPress.bindWithEvent(this));
var form=this.input.getParent("form");
if(form){form.addEvent("submit",this.onSubmit.bindWithEvent(this))
}this.update()
}}},onKeyPress:function(event){var code=event.code;
if(![8,16,17,18,20,27,33,34,35,36,37,38,39,40,45,46,91,112,113,114,115,116,117,118,119,120,121,122,123,144].contains(code)){this.input.value=this.options.clean(this.input.value)
}},onFocus:function(event){this.options.toggle(true);
this.reset();
this.input.setCaretPosition("end")
},onSubmit:function(event){this.reset()
},onBlur:function(event){this.options.toggle(false);
this.update()
},isEmpty:function(){return(this.input.value==""||this.input.value==this.options.title)
},reset:function(){if(!this.input.placeholder&&this.isEmpty()){this.input.setStyle("color",this.options.color);
this.input.value=""
}},update:function(){if(!this.input.placeholder&&this.isEmpty()){this.input.setStyle("color",this.options.titleColor);
this.input.value=this.options.title
}else{this.input.setStyle("color",this.options.color)
}}});
TextLabel.implement(Options.prototype);
var NumberTextLabel=new Class({Extends:TextLabel,defaultOptions:{clean:function(value){if(/[^\d]/.test(value)){value=value.replace(/[^\d]/g,"")
}return value
}},initialize:function(inputId,options){this.parent(inputId,options)
}});
function filterText(text,filters){for(x=0;
x<filters.length;
x++){var find=new RegExp(filters[x].name);
var replace=filters[x].value;
text=text.replace(find,replace)
}return(text)
}function include(id,url,filters,formId,onComplete){var method="get";
if(formId&&$(formId).getProperty("method")!=""){method=$(formId).getProperty("method")
}var failureText="Sorry, but this content is currently unavailable. Please contact technical support for assistance.";
var loadSuccess=function(responseText){if(filters!=undefined){responseText=filterText(responseText,filters)
}$(id).set("html",responseText);
this.evalScriptsCompatible(onComplete)
};
var loadFailure=function(){$(id).set("html",failureText)
};
var request=new Request({method:method,url:url,onSuccess:loadSuccess,onFailure:loadFailure});
request.send();
return request
}function includeFancy(id,url,filters,formId,onComplete){var method="get";
if(formId&&$(formId).getProperty("method")!=""){method=$(formId).getProperty("method")
}var failureText="Sorry, but this content is currently unavailable. Please contact technical support for assistance.";
var duration=1000;
var fadeFx=new Fx.Tween($(id),{duration:duration,wait:false});
var slideFx=new Fx.Slide($(id),{duration:duration,wait:false});
var loadSuccess=function(responseText){if(filters!=undefined){responseText=filterText(responseText,filters)
}$(id).set("html",responseText);
fadeIn();
this.evalScripts(onComplete)
};
var loadFailure=function(){$(id).set("html",failureText);
fadeIn()
};
var loadUrl=function(){new Request({method:method,url:url,onSuccess:loadSuccess,onFailure:loadFailure}).send()
};
var fadeOut=function(){fadeFx.start("opacity",1,0);
slideFx.slideOut()
};
var fadeIn=function(){slideFx.slideIn();
fadeFx.start("opacity",0,1)
};
fadeOut();
(function(){loadUrl()
}).delay(duration)
}function includeSubmit(id,url,formId,filters,onComplete){include(id,url,filters,formId)
}function rewardsNumberFocus(){if(!$("dswRewardsType_1").checked){$("dswRewardsType_1").checked=true
}$("rewardsNumber").style.color="#000000";
$("rewardsNumber").disabled=false;
$("rewardsNumber").focus()
}function showFitInfo(){$("promoInfo").setStyle("display","none");
$("fitInfo").setStyle("display","block")
}function closeFitInfo(){$("fitInfo").setStyle("display","none");
$("promoInfo").setStyle("display","block")
}function toggleStyleImage(styleID,styleAlt){$("styleImage").src="../images/style_"+styleID+".gif";
$("styleImage").alt=styleAlt
}function rewardsNumberCheck(){if(!$("dswRewardsType_1").checked){$("rewardsNumber").style.color="#cccccc"
}else{$("rewardsNumber").style.color="#000000"
}}function searchBrandsOnClick(){if($("brandSearchInput").value==""||$("brandSearchInput").value=="Enter a brand name"){$("brandSearchInput").value="";
$("brandSearchInput").style.color="#000000";
$("brandSearchInput").focus()
}}function searchBrandsOnBlur(){if($("brandSearchInput").value==""){$("brandSearchInput").style.color="#cccccc";
$("brandSearchInput").value="Enter a brand name"
}}function toggleSlide(id,options){if(Global.get("slide"+id)==null){Global.set(new Fx.Slide($(id),options),"slide"+id)
}Global.get("slide"+id).toggle()
}function toggleFadingSlide(id,options){if(Global.get("slide"+id)==null){Global.set(new Fx.Slide($(id),options),"slide"+id)
}if(Global.get("fade"+id)==null){Global.set(new Fx.Tween($(id),options),"fade"+id)
}var opacity=$(id).getStyle("opacity");
if(opacity==0){opacity=1
}else{opacity=0
}Global.get("slide"+id).toggle();
Global.get("fade"+id).start("opacity",opacity)
}function buttonAction(id,action,maxSelections){if($(id)&&$(id).className!="buttonDisabled"){if(action.toLowerCase()=="onclick"){$(id).blur();
if($(id).className=="buttonActive"){$(id).className="buttonNormal"
}else{var activeButtons=document.getElements("#"+$(id).parentNode.id+" button.buttonActive");
if(activeButtons.length>0&&maxSelections!=undefined&&maxSelections>=activeButtons.length){activeButtons[0].className="buttonNormal"
}$(id).className="buttonActive"
}}else{if(action.toLowerCase()=="onmouseover"){if($(id).className!="buttonActive"){$(id).className="buttonOver"
}}else{if(action.toLowerCase()=="onmouseout"){if($(id).className!="buttonActive"){$(id).className="buttonNormal"
}}}}}}function jumpNextField(length,maxLength,nextFieldID){if(length>=maxLength){$(nextFieldID).focus();
return(true)
}else{return(false)
}}function isDirty(el){el=$(el);
if(el){return !el.getElements("input[type!=hidden], select").every(function(field,index){if(!field.disabled){var type=field.type;
if(type=="checkbox"||type=="radio"){if(field.checked!=field.defaultChecked){return true
}}else{if(type=="hidden"||type=="password"||type=="text"||type=="textarea"){if(field.value!=field.defaultValue){return true
}}else{if(type=="select-one"||type=="select-multiple"){var options=field.options;
for(var i=0;
i<options.length;
i++){var option=options[i];
if(option.selected!=option.defaultSelected){return true
}}}}}}return false
})
}return false
}var LZ77=function(settings){settings=settings||{};
var referencePrefix="`";
var referenceIntBase=settings.referenceIntBase||96;
var referenceIntFloorCode=" ".charCodeAt(0);
var referenceIntCeilCode=referenceIntFloorCode+referenceIntBase-1;
var maxStringDistance=Math.pow(referenceIntBase,2)-1;
var minStringLength=settings.minStringLength||5;
var maxStringLength=Math.pow(referenceIntBase,1)-1+minStringLength;
var defaultWindowLength=settings.defaultWindowLength||144;
var maxWindowLength=maxStringDistance+minStringLength;
var encodeReferenceInt=function(value,width){if((value>=0)&&(value<(Math.pow(referenceIntBase,width)-1))){var encoded="";
while(value>0){encoded=(String.fromCharCode((value%referenceIntBase)+referenceIntFloorCode))+encoded;
value=Math.floor(value/referenceIntBase)
}var missingLength=width-encoded.length;
for(var i=0;
i<missingLength;
i++){encoded=String.fromCharCode(referenceIntFloorCode)+encoded
}return encoded
}else{throw"Reference int out of range: "+value+" (width = "+width+")"
}};
var encodeReferenceLength=function(length){return encodeReferenceInt(length-minStringLength,1)
};
var decodeReferenceInt=function(data,width){var value=0;
for(var i=0;
i<width;
i++){value*=referenceIntBase;
var charCode=data.charCodeAt(i);
if((charCode>=referenceIntFloorCode)&&(charCode<=referenceIntCeilCode)){value+=charCode-referenceIntFloorCode
}else{throw"Invalid char code in reference int: "+charCode
}}return value
};
var decodeReferenceLength=function(data){return decodeReferenceInt(data,1)+minStringLength
};
this.compress=function(data,windowLength){windowLength=windowLength||defaultWindowLength;
if(windowLength>maxWindowLength){throw"Window length too large"
}var compressed="";
var pos=0;
var lastPos=data.length-minStringLength;
while(pos<lastPos){var searchStart=Math.max(pos-windowLength,0);
var matchLength=minStringLength;
var foundMatch=false;
var bestMatch={distance:maxStringDistance,length:0};
var newCompressed=null;
while((searchStart+matchLength)<pos){var isValidMatch=((data.substr(searchStart,matchLength)==data.substr(pos,matchLength))&&(matchLength<maxStringLength));
if(isValidMatch){matchLength++;
foundMatch=true
}else{var realMatchLength=matchLength-1;
if(foundMatch&&(realMatchLength>bestMatch.length)){bestMatch.distance=pos-searchStart-realMatchLength;
bestMatch.length=realMatchLength
}matchLength=minStringLength;
searchStart++;
foundMatch=false
}}if(bestMatch.length){newCompressed=referencePrefix+encodeReferenceInt(bestMatch.distance,2)+encodeReferenceLength(bestMatch.length);
pos+=bestMatch.length
}else{if(data.charAt(pos)!=referencePrefix){newCompressed=data.charAt(pos)
}else{newCompressed=referencePrefix+referencePrefix
}pos++
}compressed+=newCompressed
}return compressed+data.slice(pos).replace(/`/g,"``")
};
this.decompress=function(data){var decompressed="";
var pos=0;
while(pos<data.length){var currentChar=data.charAt(pos);
if(currentChar!=referencePrefix){decompressed+=currentChar;
pos++
}else{var nextChar=data.charAt(pos+1);
if(nextChar!=referencePrefix){var distance=decodeReferenceInt(data.substr(pos+1,2),2);
var length=decodeReferenceLength(data.charAt(pos+3));
decompressed+=decompressed.substr(decompressed.length-distance-length,length);
pos+=minStringLength-1
}else{decompressed+=referencePrefix;
pos+=2
}}}return decompressed
}
};
function enterSubmitSetup(){document.getElements("form").each(function(f){if(f.getProperty("class")&&f.getProperty("class").contains("entersubmit")){document.getElements("input").each(function(i){if(i.getProperty("type")&&((i.getProperty("type")=="text")||(i.getProperty("type")=="password"))){i.addEvent("keydown",function(event){var event=new Event(event);
if(event.key=="enter"){f.submit()
}})
}})
}})
}function scCreateTag(obj){if(typeof s!="undefined"){var newSObj=s_gi(s_account);
newSObj.t(obj)
}}var DSW;
window.addEvent("domready",function(){DSW=new ProfileUtility();
mouseoverSetup();
new AlphaPng();
modalready();
setRedirect();
enterSubmitSetup()
});
