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:300,fadeInDuration:300,fadeOutDuration:50,menuShimTransparency:false,primaryNavItemsLength:null},opts||{});options.primaryNavItemsLength=$menu.children().size();$menu.children().eq(options.primaryNavItemsLength-2).css("background-image","none");$menu.children().not("#offers").each(function(i){menuWidth+=$(this).outerWidth()});$menu.find("li#offers").width(760-(menuWidth+2));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;if($(item).hasClass("current")){$(item).prev().addClass("prev")}var container=$(item).find(".shopByGroupContainer");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);$hoveritem.addClass("hovered").prev().addClass("prev");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.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")}})}jQuery(document).ready(function(e){jQuery("#menu").mandsmenu();showDropDownListForMenuOnLoad()});


