var HM_DOM=(document.getElementById)?true:false;var HM_NS4=(document.layers)?true:false;var HM_IE=(document.all)?true:false;var HM_IE4=HM_IE&&!HM_DOM;var HM_Mac=(navigator.appVersion.indexOf("Mac")!=-1);var HM_IE4M=HM_IE4&&HM_Mac;var HM_NS6=(navigator.appName=="Netscape"&&parseFloat(navigator.appVersion)>4&&parseFloat(navigator.appVersion)<7);var HM_IsMenu=(HM_DOM&&!HM_NS6)||(HM_IE4&&!HM_IE4M);if(!Array.prototype.findAll){Array.prototype.findAll=function(func){if(typeof func!="function"){throw new TypeError()}var len=this.length;var arr=[];var thisp=arguments[1];for(var i=0;i<len;i++){if(func.call(thisp,this[i],i,this)){arr.push(this[i])}}return arr}}if(!Array.prototype.removeAll){Array.prototype.removeAll=function(func){if(typeof func!="function"){throw new TypeError()}var len=this.length;var thisp=arguments[1];var b=this.slice(0);this.length=0;for(var i=0;i<len;i++){if(!func.call(thisp,b[i])){this.push(b[i])}}}}if(!Array.prototype.forEach){Array.prototype.forEach=function(func){var len=this.length;if(typeof func!="function"){throw new TypeError()}var thisp=arguments[1];for(var i=0;i<len;i++){if(i in this){func.call(thisp,this[i],i,this)}}}}if(!String.prototype.truncate){String.prototype.truncate=function(len){len=(len<=0)?0:parseInt(len)||100;if(this.length>len){return this.substr(0,len).replace(/\s+\w+$/,"")}return this}}if(!os){var os={}}os.config={api:{Bitly:{KEY:"R_882bcba52117073771dc09f4ef306265",USERNAME:"overstockfed"}}};os.overstock={};os.Plug={extend:function(base,sup,o){var f=function(){};f.prototype=sup.prototype;base.prototype=new f();base.prototype.constructor=base;base._super=sup.prototype;for(var m in o){base.prototype[m]=o[m]}}};os.Plug.config={Tabs:{MENU_EFFECT_SPEED:200},SlideShow:{SLIDE_EFFECT_SPEED:800,SLIDE_INTERVAL:3000,DATA_SRC:"data-src"}};os.Plug.Core=function(){os.Plug.Core._super.init.apply(this,arguments)};os.Plug.extend(os.Plug.Core,jQuery,{_create:function(){this.initialize()},setContext:function(node){this.element=jQuery(node);this._this=node;return this},applySettings:function(base,settings){settings=settings||{};for(var m in base){this[m]=(typeof settings[m]!=="undefined")?settings[m]:base[m]}},mixin:function(mix,override){var self=this;override=override||false;for(var m in mix){if(!self[m]||(self[m]&&override)){self[m]=mix[m]}}}});os.Component=function(selector,config){os.Component._super.constructor.apply(this,arguments);var defaults={name:"os.Component"};this.applySettings(defaults,config)};os.Plug.extend(os.Component,os.Plug.Core,{});os.Module=function(selector,config){os.Module._super.constructor.apply(this,arguments);var defaults={name:"os.Module"};this.applySettings(defaults,config)};os.Plug.extend(os.Module,os.Plug.Core,{getDataTarget:function(itemId){var item=this.element.find(itemId);var dataTarget=null;if(item.size()>0){dataTarget=item.attr("data-target")}return dataTarget||null},showPanel:function(itemId){if(itemId){var self=this;this.adjustPanelSize(itemId,function(){var item=jQuery(itemId),originalDisplay=item.attr(self.attributes.ORG_DISPLAY);if(originalDisplay){item.css({display:originalDisplay})}item.animate({opacity:1},{duration:this.menuEffectSpeed,queue:false,complete:function(){self.element.trigger({type:"menu-open",panelId:itemId})}})})}},hidePanel:function(itemId,callback){callback=callback||function(){};var self=this;if(itemId){jQuery(itemId).animate({opacity:0},{duration:this.menuEffectSpeed,queue:false,complete:function(){self.tabPanel.children().hide();callback();self.element.trigger({type:"menu-close",panelId:itemId})}});return }callback()},adjustPanelSize:function(itemId,callback){callback=callback||function(){};var self=this,item=jQuery(itemId).css({opacity:(this.currentPanel===itemId)?1:0,display:"block"});if(this.animatePanel){this.tabPanel.animate({height:item.attr("offsetHeight")},{duration:this.menuEffectSpeed,queue:false,complete:callback});return }callback()}});os.Tabs=function(selector,config){jQuery(selector).each(function(){var o=new os.Tab(this,config);o.setContext(this)._create()})};os.Tab=function(selector,config){config=config||{};defaults={name:"os.Tabs",menuEffectSpeed:os.Plug.config.Tabs.MENU_EFFECT_SPEED,triggerNodes:{a:"name",button:"data-tab"},triggers:null,tabPanelSelector:".tab-list",tabNavSelector:".tab-nav",animatePanel:true,currentPanel:null,currentRequest:null,resizeID:null,attributes:{ORG_DISPLAY:"data-original-display"}};os.Tab._super.constructor.apply(this,arguments);this.applySettings(defaults,config)};os.Plug.extend(os.Tab,os.Module,{initialize:function(elm){this.tabPanel=this.element.find(this.tabPanelSelector);var self=this,itemId=this.getIndexPanel();this.element.click(function(e){self.handleMenuClick(e)});this.tabPanel.children().each(function(){var $this=jQuery(this);$this.attr(self.attributes.ORG_DISPLAY,$this.css("display")).hide()});this.element.bind("menu-change",function(e){self.handleMenuChange(e)});this.element.trigger({tab:function(){var target=null;if(this.triggers&&this.triggers[itemId]){target=this.element.find(itemId)}else{target=jQuery(this.tabNavSelector).find('a[name="'+itemId+'"]')}return target}(),type:"menu-change",panelId:itemId,request:{url:this.getDataTarget(itemId)}});jQuery(window).bind("resize",function(){if(self.resizeID){clearTimeout(self.resizeID)}self.resizeID=setTimeout(function(){self.adjustPanelSize(self.currentPanel);self.resizeID=null},500)})},getIndexPanel:function(){var index=null;if(location.hash&&location.hash!=="#"){if(jQuery(location.hash,this.element).parent().hasClass(this.tabPanelSelector)){index=location.hash}}return index||"#"+this.tabPanel.children(":first").attr("id")},handleMenuClick:function(e){var target=e.target;var nodeType=target.nodeName.toLowerCase();var itemId=null;while(!this.triggerNodes[nodeType]&&target.parentNode){if(target===this._this){return }target=target.parentNode;nodeType=target.nodeName.toLowerCase()}if(this.triggerNodes[nodeType]){if(this.triggers&&this.triggers[target.id]){itemId=this.triggers[target.id]}else{if(jQuery(target).parent(this.tabNavSelector)){itemId=target.getAttribute(this.triggerNodes[nodeType])}}if(itemId){e.preventDefault();this.element.trigger({tab:e.target,type:"menu-change",panelId:itemId,request:{url:this.getDataTarget(itemId)}})}}},handleMenuChange:function(e){var self=this;switch(e.type){case"menu-change":this.changeMenu(e);break}},changeMenu:function(e){var self=this;var itemId=e.panelId;if(!this.element.find(itemId).size()>0){return }if(this.currentPanel===itemId||this.panelInTransition===itemId){return }this.clearActiveRequests();this.panelInTransition=itemId;this.hidePanel(self.currentPanel,function(){self.getContent(e,function(){self.showPanel(itemId);self.updateInterface(e.tab,itemId)})})},clearActiveRequests:function(){if(this.currentRequest!==null){this.currentRequest.abort();this.currentRequest=null}return true},getContent:function(e,callback){callback=callback||function(){};var self=this;if(typeof e.request!=="undefined"&&e.request.url!==null){this.clearActiveRequests();this.currentRequest=jQuery.ajax({beforeSend:function(){if(self.currentPanel){jQuery(self.currentPanel).hide()}jQuery(e.panelId).addClass("loading").html("loading...").show()},url:e.request.url,success:function(data){jQuery(e.panelId).removeClass("loading").hide().html(data);callback();self.currentRequest=null}});return }callback()},updateInterface:function(node,itemId){this.element.find(this.tabNavSelector+" a").each(function(){jQuery(this).removeClass("current")});jQuery(node).addClass("current");this.currentPanel=itemId;this.panelInTransition=null}});os.Carousel=function(selector,config){var defaults={name:"os.Carousel",className:{CONTROLS:"controls",CONTROL_TRIGGER:"control-trigger",SLIDE:"slide",SLIDE_WINDOW:"slide-window",SLIDE_PANEL:"slide-panel",SLIDE_SHOW:"slide-show",ENABLED:"enabled",TOGGLE:"toggle",SWIPE:"swipe",SELECTED:"current"},selector:{CONTROLS:".controls",CONTROL_TRIGGER:".control-trigger",SLIDE:".slide",SLIDE_WINDOW:".slide-window",SLIDE_PANEL:".slide-panel",SLIDE_SHOW:".slide-show",ENABLED:".enabled",SELECTED:".current"}};os.Carousel._super.constructor.apply(this,arguments);this.applySettings(defaults,config)};os.Plug.extend(os.Carousel,os.Plug.Core,{initialize:function(){var that=this;this.addClass(this.className.ENABLED+" "+this.className.TOGGLE);this.slideWindow=jQuery("<div></div>").addClass(this.className.SLIDE_WINDOW);this.slides=this.element.find(this.selector.SLIDE);this.slidePanel=this.element.find(this.selector.SLIDE_PANEL)},getDataTarget:function(itemId){return null},checkIndex:function(index){index=parseInt(index)||0;return(index>this.slides.length-1)?0:index},setSlideDisplay:function(){var that=this;this.slideWindow.insertBefore(this.slidePanel).append(this.slidePanel)},setControls:function(){var that=this,controlsWrap=jQuery("<ul></ul>").addClass(this.className.CONTROLS),controlList="";this.slides.each(function(i){var label=this.getAttribute("data-label")||i+1;controlList+='<li><a class="'+that.className.CONTROL_TRIGGER+'" name="'+label+'" data-index="'+i+'">'+label+"</a></li>"});controlsWrap.html(controlList).hide().click(function(e){that.handleControlClick(e)});controlsWrap.appendTo(this.slideWindow).fadeIn(this.slideEffectSpeed);this.triggers=this.element.find(this.selector.CONTROL_TRIGGER,controlsWrap);this.updateInterface()},handleControlClick:function(e){var target=e.target,indexId=null;while(target.nodeName.toLowerCase()!=="a"&&target.parentNode){if(target===this._this){return }target=target.parentNode}indexId=target.getAttribute("data-index");if(indexId){e.preventDefault();this.doStop();this.trigger({trigger:e.target,type:"slide-change",indexId:indexId,request:{url:this.getDataTarget(indexId)}})}},changePanelByIndex:function(index){var selectedIndex=this.checkIndex(index),currPos=this.getCurrentIndex();if(currPos===selectedIndex){return }this.showPanel(this.slides[selectedIndex]);this.hidePanel(this.slides[currPos]);this.setCurrentIndex(selectedIndex);this.updateInterface(selectedIndex)},showPanel:function(node){this.beforeShow(node,function(){jQuery(node,this.element).fadeIn(this.slideEffectSpeed)})},beforeShow:function(node,callback){var dataSrc=os.Plug.config.SlideShow.DATA_SRC;var imgs=jQuery("["+dataSrc+"]",node);if(imgs.size()>0){var loadCount=0;imgs.each(function(){var $this=$(this);if($this.attr(dataSrc)){var $img=$("<img></img>").attr({src:$this.attr(dataSrc),alt:$this.text()}).bind("load",function(){loadCount++;if(loadCount===imgs.size()){callback()}});$this.empty().append($img).removeAttr(dataSrc)}})}else{callback()}},hidePanel:function(node){jQuery(node,this.element).fadeOut(this.slideEffectSpeed)},doPlay:function(){if(this.AUTO_ID){return }this.startAutoRun(true)},doStop:function(){if(this.AUTO_ID){clearInterval(this.AUTO_ID)}this.AUTO_ID=null},updateInterface:function(index){var that=this;index=index||this.getCurrentIndex();this.triggers.removeClass(this.className.SELECTED).each(function(i){if(i===index){jQuery(this).addClass(that.className.SELECTED);return }})},startAutoRun:function(bypassFirstInterval){var that=this;if(bypassFirstInterval){that.changePanelByIndex(that.getCurrentIndex()+1)}this.AUTO_ID=setInterval(function(){that.changePanelByIndex(that.getCurrentIndex()+1)},this.slideInterval)},getCurrentIndex:function(){return this.currentIndex},setCurrentIndex:function(index){this.currentIndex=parseInt(index)}});os.SlideShow=function(selector,config){config=config||{};return jQuery(selector).each(function(){var o=new os.SlideShowToggler(this,config);o.setContext(this)._create()})};os.SlideShowToggler=function(selector,config){var defaults={name:"os.SlideShow",slideEffectSpeed:os.Plug.config.SlideShow.SLIDE_EFFECT_SPEED,slideInterval:os.Plug.config.SlideShow.SLIDE_INTERVAL,currentIndex:0,slideWindow:null,slidePanel:null,triggerNodes:{},triggers:null,controls:null,auto:true};os.SlideShowToggler._super.constructor.apply(this,arguments);this.applySettings(defaults,config)};os.Plug.extend(os.SlideShowToggler,os.Carousel,{initialize:function(){os.SlideShowToggler._super.initialize.apply(this);var that=this;this.setSlideDisplay();this.setControls();this.showPanel(this.slides[this.getCurrentIndex()]);this.bind("slide-change",function(e){that.handlePanelChange(e)});if(this.auto){this.startAutoRun()}},handlePanelChange:function(e){switch(e.type){case"slide-change":this.changePanelByIndex(e.indexId);break}}});os.overstock.extend=function(obj,extObj){if(arguments.length>2){for(var a=1;a<arguments.length;a++){this.extend(obj,arguments[a])}}else{obj=obj||{};for(var i in extObj){if(extObj.hasOwnProperty(i)){if(typeof extObj[i]==="object"){obj[i]=this.extend(obj[i],extObj[i])}else{obj[i]=extObj[i]}}}}return obj};os.overstock.core={applyConfig:function(mixin,inObj){for(var p in inObj){mixin[p]=inObj[p]}for(var p in mixin){if(mixin.hasOwnProperty(p)){this[p]=inObj[p]}}}};os.overstock.ApiUtils={Bitly:{apiKey:os.config.api.Bitly.KEY,login:os.config.api.Bitly.USERNAME,version:"2.0.1",getShortUrl:function(options){var longUrl=options.longUrl||self.location.href;var longUrlParams=this.serialize(options.params);var callback=options.callback||function(){};var bitlyPostParams={apiKey:this.apiKey,login:this.login,version:this.version,longUrl:this.formatLongUrl(longUrl,longUrlParams),callback:"?"};var params=this.serialize(bitlyPostParams);jQuery.getJSON("http://api.bit.ly/shorten?"+params,function(data){var result={};for(var r in data.results){result=data.results[r];result.longUrl=r;break}callback(result)})},formatLongUrl:function(url,params){url=url.split("?")[0];if(params){url+="?"+params}return encodeURIComponent(url)},serialize:function(params){params=params||{};var p="";for(var v in params){p+=(p!="")?"&":"";p+=(v+"="+params[v])}return p}}};os.overstock.Page={url:self.location.href,title:(document.getElementsByTagName("title")[0])?document.getElementsByTagName("title")[0].innerHTML:""};os.overstock.util={isLteIE6:(function(){if(typeof document.all!="undefined"&&navigator.userAgent.indexOf("Opera")<0){var reIE=new RegExp("MSIE (\\d+\\.\\d+)");reIE.test(navigator.userAgent);var fIEVersion=parseFloat(RegExp["$1"]);if(typeof document.uniqueID!="undefined"){if(fIEVersion<=6){return true}}}return false}()),replaceMetaData:function(selector,data){jQuery(selector).each(function(){var $this=jQuery(this);var href=$this.attr("href");for(var p in data){var pattern=new RegExp("\\["+p+"\\]","g");href=href.replace(pattern,data[p])}$this.attr("href",href)})},addEvent:(function(){if(typeof window.addEventListener!="undefined"){return function(elm,evType,fn){elm.addEventListener(evType,fn,false)}}else{if(typeof window.attachEvent!="undefined"){return function(elm,evType,fn){elm.attachEvent("on"+evType,fn)}}else{return function(elm,evType,fn){elm["on"+evType]=fn}}}}()),bindEventListener:function(elm,evType,fn){this.addEvent(elm,evType,function(){var e=os.overstock.util.Event.getEvent(elm);fn(e)})},addLoadListener:function(funcRef){if(typeof window.addEventListener!="undefined"){window.addEventListener("load",funcRef,false)}else{if(typeof document.addEventListener!="undefined"){document.addEventListener("load",funcRef,false)}else{if(typeof window.attachEvent!="undefined"){window.attachEvent("onload",funcRef)}else{var olfFunc=window.onload;if(typeof window.onload!="function"){window.onload=funcRef}else{window.onload=function(){oldFunc();funcRef()}}}}}},removeEvent:function(elm,evType,fn,capture){if(typeof elm.removeEventListener!="undefined"){elm.removeEventListener(evType,fn,capture)}else{if(typeof elm.detachEvent!="undefined"){elm.detachEvent("on"+evType,fn)}else{elm["on"+evType]=null}}},addClass:function(target,classValue){this.reClassValue=new RegExp("(^| )"+classValue+"( |$)");if(!reClassValue.test(target.className)){if(target.className==""){target.className=classValue}else{target.className+=" "+classValue}}return true},getElementsByAttribute:function(attrType,attrName,rootElm){this.rootElm=rootElm||document.documentElement;this.elementArray=new Array();this.matchedArray=new Array();this.reAttrName=new RegExp("(^| )"+attrName+"( |$)");if(document.all){this.elementArray=this.rootElm.all}else{this.elementArray=this.rootElm.getElementsByTagName("*")}for(var i=0;i<this.elementArray.length;i++){if(attrType=="class"){if(this.reAttrName.test(this.elementArray[i].className)){this.matchedArray[this.matchedArray.length]=this.elementArray[i]}}else{if(attrType=="for"){if(this.elementArray[i].getAttribute("for")||this.elementArray[i].getAttribute("htmlFor")){if(this.elementArray[i].htmlFor==attrName){this.matchedArray[this.matchedArray.length]=this.elementArray[i]}}}else{if(this.elementArray[i].getAttribute(attrType)==attrName){this.matchedArray[this.matchedArray.length]=this.elementArray[i]}}}}return this.matchedArray},getScrollPosition:function(){this.scrollPos=[];this.scrollPos.x=0;this.scrollPos.y=0;if(typeof window.pageXOffset!="undefined"){this.scrollPos.x=window.pageXOffset;this.scrollPos.y=window.pageYOffset;return this.scrollPos}else{if(typeof document.body.parentElement.scrollTop!="undefined"&&document.compatMode!="BackCompat"){this.scrollPos.x=document.body.parentElement.scrollLeft;this.scrollPos.y=document.body.parentElement.scrollTop;return this.scrollPos}else{if(typeof document.documentElement.scrollTop!="undefined"&&document.documentElement.scrollTop>0){this.scrollPos.x=document.documentElement.scrollLeft;this.scrollPos.y=document.documentElement.scrollTop;return this.scrollPos}else{if(typeof document.body.scrollTop!="undefined"){this.scrollPos.x=document.body.scrollLeft;this.scrollPos.y=document.body.scrollTop;return this.scrollPos}}}}return this.scrollPos},getViewportSize:function(){this.size=[];this.size.x=0;this.size.y=0;if(typeof window.innerWidth!="undefined"){this.size.x=window.innerWidth;this.size.y=window.innerHeight}else{if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0){this.size.x=document.documentElement.clientWidth;this.size.y=document.documentElement.clientHeight}else{this.size.x=document.getElementsByTagName("body")[0].clientWidth;this.size.y=document.getElementsByTagName("body")[0].clientHeight}}return this.size},createUniqueId:function(){var d=new Date();return Date.UTC(d.getFullYear(),d.getMonth(),d.getDate(),d.getMinutes(),d.getSeconds(),d.getMilliseconds())}};os.overstock.util.Storage={COOKIES:{OSTK_AGGR_YEAR:{name:"ostk_aggr_year"},OSTK_CAMPAIGN:{name:"ostk_campaign"},SURFTYPE:{name:"mxcsurftype"},CAMPAIGN_TOKEN:{name:"cmpgn_token",pattern:"\\^(.*?)(\\||$)"},CAMPAIGN_USED:{name:"cmpgn_used",pattern:"\\^(.*?)(\\||$)"},OPT_OUT:{name:"optout",pattern:"\\^(.*?)(\\||$)"}},setCookie:function(cookieData,settings){cookieData=cookieData||{};settings=os.overstock.extend({value:"",expires:365,domain:"overstock.com",path:"/"},settings);var exDate=new Date();exDate.setDate(exDate.getDate()+settings.expires);settings.expires=exDate.toUTCString();var cookieString=this.getCookie(cookieData.cookie);settings.value=this.addKeyValue(cookieData,cookieString);this.writeCookie(cookieData.cookie,settings)},writeCookie:function(cookie,params){if(cookie.name){document.cookie=cookie.name+"="+params.value+"; expires="+params.expires+"; domain="+params.domain+"; path="+params.path}},addKeyValue:function(param,cookieString){var keyArr=[],reKey=new RegExp(param.key.name+param.key.pattern);if(cookieString){keyArr=cookieString.split("|")}if(keyArr.length>0&&reKey.test(cookieString)){for(var i=0;i<keyArr.length;i++){var pair=keyArr[i].split("^");if(pair[0]===param.key.name){pair[1]=param.value;keyArr[i]=pair.join("^");break}}}else{keyArr.push(param.key.name+"^"+param.value)}return keyArr.join("|")},getCookie:function(param){this.cookie=document.cookie;var reCookie=new RegExp(param.name+"=(.*?)(;|$)","g");if(reCookie.test(this.cookie)){return unescape(RegExp.$1)}return false},deleteCookie:function(inName){if(this.getCookie(inName)){this.setCookie(inName,null,-365)}},parseCookieValue:function(cookieValue,param){var reCookie=new RegExp(param.name+param.pattern,"g");if(reCookie.test(cookieValue)){return unescape(RegExp.$1)}return false}};os.overstock.util.Ajax=function(){this.request=null;this.events=new os.overstock.util.Observer();this.url=null;this.method="GET";this.async=true;this.cacheRequest=false;this.status=null;this.statusText="";this.postData=null;this.readyState=null;this.responseText=null;this.responseXML=null;this.handleResp=null;this.responseFormat="text";this.mimeType=null;this.init=function(){if(!this.request){try{this.request=new XMLHttpRequest()}catch(e){try{this.request=new ActiveXObject("MSXML2.XMLHTTP")}catch(e){try{this.request=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){return false}}}}return this.request};this.doReq=function(){if(!this.init()){alert("Could not create XMLHttpRequest Object");return }this.request.open(this.method,this.url,this.async);if(this.mimeType){try{req.overrideMimeType(mimeType)}catch(e){}}if(this.method==="POST"){this.request.setRequestHeader("Content-type","application/x-www-form-urlencoded");this.request.setRequestHeader("Content-length",this.postData.length);this.request.setRequestHeader("Connection","close")}var self=this;this.request.onreadystatechange=function(){var resp=null;if(self.request.readyState==4){switch(self.responseFormat){case"text":resp=self.request.responseText;self.responseText=resp;break;case"xml":resp=self.request.responseXML;self.responseXML=resp;break;case"object":resp=req;break}if(self.request.status>=200&&self.request.status<=299){self.handleResp(resp)}else{self.handleErr(resp)}}};this.request.send(this.postData)};this.setAsync=function(async){this.async=async};this.setMimeType=function(mimeType){this.mimeType=mimeType};this.handleErr=function(resp){this.events.dispatch("StatusError","Status "+(this.request.status+": "+this.request.statusText))};this.setHandlerErr=function(funcRef){this.handleErr=funcRef};this.setHandlerBoth=function(funcRef){this.handleResp=funcRef;this.handleErr=funcRef};this.abort=function(){if(this.request){this.request.onreadystatechange=function(){};this.request.abort();this.request=null}};this.doGet=function(url,handlerFunc,format,postData){this.url=(this.cache)?url:url+"?reqId="+os.overstock.util.createUniqueId();this.handleResp=handlerFunc;this.responseFormat=format||"text";this.postData=postData||null;if(postData){this.method="POST"}this.doReq()}};os.overstock.util.Observer=function(){this.listeners=[]};os.overstock.util.Observer.prototype={addListener:function(type,callback){var exists=(this.listeners.findAll(function(item){return(item.type==type&&item.callback==callback)}).length>0);if(!exists){this.listeners.push(new os.overstock.util.Watcher(type,callback))}},removeListener:function(type,callback){this.listeners.removeAll(function(item){return(item.type===type&&item.callback===callback)})},dispatch:function(type,data,scope){scope=scope||window;var l=this.listeners.findAll(function(item){return(item.type.toLowerCase()===("on"+type).toLowerCase())});l.forEach(function(item){item.callback.call(scope,data)})}};os.overstock.util.Watcher=function(type,callback){this.type=type;this.callback=callback};os.overstock.util.Event={getEvent:function(IECurrentTarget){if(typeof window.event!="undefined"&&navigator.userAgent.indexOf("MSIE")>=0){return os.overstock.util.Event.formatEvent(window.event,IECurrentTarget)}else{return os.overstock.util.Event.getEvent.caller.arguments[0]}},formatEvent:function(e,currentTarget){e.target=e.srcElement;e.currentTarget=currentTarget;e.pageX=e.clientX+(document.body.scrollLeft>0?document.body.scrollLeft:document.documentElement.scrollLeft);e.pageY=e.clientY+(document.body.scrollTop>0?document.body.scrollTop:document.documentElement.scrollTop);e.timeStamp=(new Date()).getTime();if(e.type=="mouseover"){e.relatedTarget=e.fromElement}else{if(e.type=="mouseout"){e.relatedTarget=e.toElement}}e.preventDefault=function(){this.returnValue=false};e.stopPropagation=function(){this.cancelBubble=true};return e}};os.overstock.ui={showSessionTimeout:function(e,siteElement,redirectUrl){redirectUrl=redirectUrl||"https://www.overstock.com/myaccount";siteElement=siteElement||'<img width="404" height="193" border="0" alt="Your current session has expired. Please login to continue. [Click here to confirm]" src="https://www.overstock.com/img/mxc/09-myacc-login-layer.png"/>';var $body=jQuery("body").addClass("noscroll");var $sessionLayer=jQuery("<div>").attr("id","session-layer");var $modal=jQuery("<div>").addClass("modal");$sessionLayer.html('<a href="'+redirectUrl+'">'+siteElement+"</a>");$body.append($modal).append($sessionLayer);$sessionLayer.center().show(600,"easeInOutQuart");os.overstock.util.bindEventListener(document,"keydown",handleKeyEvent);function handleKeyEvent(e){e.preventDefault();window.location=redirectUrl;return false}},Message:function(container,config){var $containerDiv=(typeof container!=="string")?jQuery(container):jQuery("#"+container);return{flash:function(data){var self=this;if($containerDiv){$containerDiv.html(data.message).addClass(data.className).fadeIn(600,function(){setTimeout(self.reset,3000)})}},show:function(data){if($containerDiv){$containerDiv.html(data.message).addClass(data.className).fadeIn(600)}},reset:function(){if($containerDiv){$containerDiv.fadeOut(600,function(){jQuery(this).html("").removeAttr("class")})}},setContainer:function(container){$containerDiv=(typeof container!=="string")?jQuery(container):jQuery("#"+container)}}}};jQuery.fn.tabs=function(){return this.each(function(){var ul=jQuery(this);ul.find("a[href^=#]").each(function(i){var tablink=jQuery(this);if(i){jQuery(tablink.attr("href")).hide()}else{tablink.addClass("current")}tablink.click(function(){jQuery(ul.find("a.current").removeClass("current").attr("href")).hide();jQuery(tablink.addClass("current").attr("href")).show();if(tablink.attr("rel")){$("#tab-preloader").show();$.ajax({url:tablink.attr("rel"),cache:false,success:function(message){jQuery(tablink.attr("href")).empty().append(message);$("#tab-preloader").hide()}})}return false})})})};(function(jQuery){jQuery.fn.jCarouselLite=function(o){o=jQuery.extend({btnPrev:null,btnNext:null,mouseWheel:false,auto:null,speed:200,easing:null,vertical:false,circular:true,navcontainer:null,sectionlinks:null,visible:3,start:0,scroll:1,pauseOnHover:true,beforeStart:null,afterEnd:null},o||{});return this.each(function(){var running=false,animCss=o.vertical?"top":"left",sizeCss=o.vertical?"height":"width";var div=jQuery(this),ul=jQuery("ul",div),tLi=jQuery("li",ul),tl=tLi.size(),v=o.visible;var isMouseOver=false;if(o.circular&&tl>1){ul.prepend(tLi.slice(tl-v-1+1).clone()).append(tLi.slice(0,v).clone());o.start+=v}update_navigation(1);var li=jQuery(o.panel),itemLength=li.size(),curr=o.start;div.css("visibility","visible");li.css({overflow:"hidden","float":(o.vertical)?"none":"left"});ul.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});div.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});var liSize=o.vertical?height(li):width(li);var ulSize=liSize*itemLength;var divSize=liSize*v;var nav=jQuery(o.navcontainer);li.css({width:li.width(),height:li.height()});ul.css(sizeCss,ulSize+"px").css(animCss,-(curr*liSize));div.css(sizeCss,divSize+"px");li.mouseover(function(){isMouseOver=true});li.mouseout(function(){isMouseOver=false});nav.mouseover(function(){isMouseOver=true});nav.mouseout(function(){isMouseOver=false});if(o.btnPrev){jQuery(o.btnPrev).click(function(){return go(curr-o.scroll)})}if(o.btnNext){jQuery(o.btnNext).click(function(){return go(curr+o.scroll)})}if(o.btnGo){jQuery.each(o.btnGo,function(i,val){jQuery(val).click(function(){return go(o.circular?o.visible+i:i+1)})})}if(o.mouseWheel&&div.mousewheel){div.mousewheel(function(e,d){return d>0?go(curr-o.scroll):go(curr+o.scroll)})}if(o.auto){setInterval(function(){if(o.pauseOnHover&&isMouseOver){return }go(curr+o.scroll)},o.auto+o.speed)}function vis(){return li.slice(curr).slice(0,v)}function go(to){if(!running){if(o.beforeStart){o.beforeStart.call(this,vis())}if(o.circular){if(to<=o.start-v-1){ul.css(animCss,-((itemLength-(v*2))*liSize)+"px");curr=to==o.start-v-1?itemLength-(v*2)-1:itemLength-(v*2)-o.scroll}else{if(to>=itemLength-v+1){ul.css(animCss,-((v)*liSize)+"px");curr=to==itemLength-v+1?v+1:v+o.scroll}else{curr=to}}}else{if(to<0||to>itemLength-v){return }else{curr=to}}running=true;ul.animate(animCss=="left"?{left:-(curr*liSize)}:{top:-(curr*liSize)},o.speed,o.easing,function(){if(o.afterEnd){o.afterEnd.call(this,vis())}running=false});update_navigation((o.circular)?0+curr:1+curr);if(!o.circular){jQuery(o.btnPrev+","+o.btnNext).removeClass("disabled");jQuery((curr-o.scroll<0&&o.btnPrev)||(curr+o.scroll>itemLength-v&&o.btnNext)||[]).addClass("disabled")}}return false}function update_navigation(curr){var kids=jQuery(o.panel);var cloneVal=(o.circular)?2:0;var pos=(kids.size()-cloneVal<=curr)?(curr>kids.size()-cloneVal)?1:kids.size()-cloneVal:curr;pos=(pos==0)?kids.size()-cloneVal:pos;var sectionLinks=jQuery(o.sectionlinks);for(k=0;k<sectionLinks.size();k++){if(pos==k+1){jQuery(sectionLinks[k]).attr("class","selected")}else{jQuery(sectionLinks[k]).attr("class","off")}}}})};function css(el,prop){return parseInt(jQuery.css(el[0],prop))||0}function width(el){return el[0].offsetWidth+css(el,"marginLeft")+css(el,"marginRight")}function height(el){return el[0].offsetHeight+css(el,"marginTop")+css(el,"marginBottom")}})(jQuery);jQuery.extend(jQuery.easing,{easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return -c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b}return -c/2*((--t)*(t-2)-1)+b}});jQuery.fn.shortString=function(len,opt){var config=jQuery.extend(true,{revealText:true,elipsis:true},opt||{});return this.each(function(){var $this=jQuery(this);var fullStr=$this.html();var trunc=fullStr.truncate(len);if(trunc!=fullStr){if(config.revealText){var showButton=jQuery('<em class="show-all">[Show all]</em>');showButton.click(function(){$this.hide().empty().html(fullStr).fadeIn();jQuery(this).remove()});showButton.insertAfter($this)}if(config.elipsis){trunc+="..."}$this.html(trunc)}})};jQuery.fn.DropDownMenu=function(o){this.timeoutId=null;var _opt=jQuery.extend(true,{open:"slideDown",close:"slideUp",openDuration:150,closeDuration:150,openTimeout:500,closeTimeout:500,menuSelector:".menu",preventDefault:false},o||{});return this.each(function(){var _$trigger=jQuery(this);var _$menu=jQuery(_opt.menuSelector,_$trigger);return{initialize:function(){var self=this;_$trigger.hover(function(e){self.handleHover(e)},function(e){self.handleHover(e)});_$trigger.attr("hoverState",0);if(_opt.preventDefault){_$trigger.children(":first-child").click(function(e){e.preventDefault()})}},handleHover:function(e){var self=this;this.cancelTimeout(this.timeoutId);if(e.type=="mouseenter"){if(_$trigger.attr("hoverState")!=1){this.timeoutId=setTimeout(function(){self.showMenu()},_opt.openTimeout)}}else{if(_$trigger.attr("hoverState")==1){this.timeoutId=setTimeout(function(){self.hideMenu()},_opt.closeTimeout)}}},showMenu:function(){_$menu[_opt.open](_opt.openDuration);_$trigger.attr("hoverState",1)},hideMenu:function(){_$menu[_opt.close](_opt.closeDuration);_$trigger.attr("hoverState",0)},cancelTimeout:function(timeoutId){if(timeoutId){clearTimeout(timeoutId);timeoutId=null}}}.initialize()})};jQuery.fn.OSDialog=function(o){return this.each(function(){var _opt=jQuery.extend(true,{openOnLoad:false,open:"fadeIn",close:"fadeOut",openDuration:200,closeDuration:500},o||{});var _$dialog=jQuery(this);jQuery.fn.extend({initialize:function(){var closeButton=jQuery('<a href="#" title="close" class="close-dialog"></a>').click(function(e){jQuery(this).hideDialog(e)});_$dialog.prepend(closeButton);if(_opt.openOnLoad){_$dialog.showDialog()}},showDialog:function(e){var $this=jQuery(this);jQuery.Event(e).preventDefault();$this.center();$this[_opt.open](_opt.openDuration)},hideDialog:function(e){jQuery.Event(e).preventDefault();jQuery(this).parent()[_opt.close](_opt.closeDuration)}}).initialize()})};jQuery.fn.OpenDialog=function(d,o){var _opt=jQuery.extend(true,{openOnLoad:false,open:"fadeIn",close:"fadeOut",openDuration:200,closeDuration:500},arguments[1]||{});return this.each(function(){var _$link=jQuery(this);var _$dialog=jQuery("#"+d);return{initialize:function(){var self=this;_$link.click(function(e){e.preventDefault();self.showDialog()});var closeButton=jQuery('<a href="#" title="close" class="close-dialog"></a>').click(function(e){self.hideDialog(e)});_$dialog.prepend(closeButton);if(_opt.openOnLoad){this.showDialog()}},showDialog:function(e){var $this=jQuery(this);jQuery.Event(e).preventDefault();_$dialog.center();_$dialog[_opt.open](_opt.openDuration)},hideDialog:function(e){e.preventDefault();_$dialog[_opt.close](_opt.closeDuration)}}.initialize()})};jQuery.fn.center=function(){return this.each(function(){var $this=jQuery(this);var viewport=os.overstock.util.getViewportSize();var scrollPos=os.overstock.util.getScrollPosition();$this.css("left",parseInt((((viewport.x/2)+scrollPos.x-($this.width()/2)))+"px"));$this.css("top",parseInt((((viewport.y/2)+scrollPos.y-($this.height()/2)))+"px"))})};