
(function(HP,HF){HF.Utils={ready:function(func){document.addEvent('domready',func);},'ABReady':function(func){document.addEvent('domready',function(){if(window.HPOptimostTest&&HPOptimostTest.checkOptimostLoaded&&typeof HPOptimostTest.checkOptimostLoaded.ready=='function'){HPOptimostTest.checkOptimostLoaded.ready(func);}else{func();}});}};HP.Utils=HF.Utils;})(window.HP||(window.HP={}),window.hf||(window.hf={}));hp=window.hp||{};function loadScript(url,callback){var script=document.createElement("script");script.type="text/javascript";if(script.readyState){script.onreadystatechange=function(){if(script.readyState=="loaded"||script.readyState=="complete"){script.onreadystatechange=null;callback();}};}else{script.onload=function(){callback();};}
script.src=url;document.getElementsByTagName("head")[0].appendChild(script);}
window.autocompleteLoader=new function(){var lastLoader;var loaders={};var multi=false;var count;var parameters=[];var readCookie=function(name){if(!name)return;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var c=cookies[i];while(c.charAt(0)==' ')c=c.substring(1);if(c.indexOf(name+'=')==0){return decodeURIComponent(c.substring(name.length+1));}}}};var ETR_OPT_IN=readCookie('ETR_OPT_IN');var storeType='hho-store';var callLoader=function(index,query,callback){loaders[parameters[index].type].getSuggestions(query,function(results){callback(results,(multi?index:null));});}
this.addLoader=function(loader){if(loader.type)
loaders[loader.type]=loader;lastLoader=loader;};this.getSuggestions=function(query,callback,index){if(typeof index!='undefined'){callLoader(index,query,callback);}else if(multi){for(var i=0;i<parameters.length;i++)
callLoader(i,query,callback);}else{if(lastLoader)lastLoader.getSuggestions(query,callback);}};this.setParams=function(params,loaderParams){var loader;if(!loaderParams||loaderParams.length==0){lastLoader.setParams(params);}else{count=0;for(var i=0;i<loaderParams.length;i++){var p=loaderParams[i];loader=loaders[p.type];if(loader){if(p.type!=storeType||parameters.length==0||(ETR_OPT_IN&&ETR_OPT_IN=='true')||(!ETR_OPT_IN&&p.defaultCookieValue)){loader.setParams({language:params.language,country:params.country,count:p.count,url:p.url,callbackParam:p.callbackParam});count++;parameters.push(p);lastLoader=loader;}}}
if(count>1)multi=true;}};this.getActionUrl=function(index){return parameters[index].actionURL;};this.getJumpID=function(index){var loader=(parameters.length)?loaders[parameters[index].type]:lastLoader,loaderParams=loader.getParams();return'se_r1002_'+loaderParams.country+loaderParams.language+'_ac';};this.getMaxItemsCount=function(index){if(parameters.length)
return loaders[parameters[(index||0)].type].getParams()['count'];else
return lastLoader.getParams()['count'];};this.getLoadersCount=function(){if(count>1)return count;};this.getParams=function(){return parameters.length>1?parameters:null;};};window.isIE6=navigator.userAgent.toUpperCase().indexOf("MSIE 6.0")!=-1;window.isIE7=navigator.userAgent.toUpperCase().indexOf("MSIE 7.0")!=-1;window.isIE8=navigator.userAgent.toUpperCase().indexOf("MSIE 8.0")!=-1;window.isIE9=navigator.userAgent.toUpperCase().indexOf("MSIE 9.0")!=-1;window.isIE10=navigator.userAgent.toUpperCase().indexOf("MSIE 10.0")!=-1;window.isIE=navigator.userAgent.toUpperCase().indexOf("MSIE")!=-1;window.isOpera=(window.opera!=undefined);window.gtIE8=isIE8||isIE9;window.rtl=$$('html')[0].getProperty('dir')=='rtl';window.hf=window.hf||{};var SR_SELECTOR='.js_screen_reading';window.CHKOverrides=new Class({overrides:null,setOverrides:function(){if(this.options&&this.options.overrides){this.overrides=new Object(this.options.overrides);if(this.overrides&&(this.overrides.getLength()>0)){this.overrides.each(function(value,key){if(typeOf(value)==='function'){this[key]=value;}}.bind(this));}}}});document.addEvent('domready',function(){var body=$$("body");var eventName=(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i))?"touchstart":"click";var boundCloseOnBodyClickHandler;var closeOnBodyClickHandler=function(e){var target=$(e.target);if(target!=this.trigger){var popupEl=this.popup;var isClosed=true;var body=document.body||document.getElementsByTagName('body')[0];while(target!=body){if(target!=popupEl){target=target.getParent();}else{isClosed=false;break;}}
if(isClosed)this.hide();}};body.addEvent("PopupManager:show",function(popup){boundCloseOnBodyClickHandler=closeOnBodyClickHandler.bind(popup);$(document).addEvent(eventName,boundCloseOnBodyClickHandler);});body.addEvent("PopupManager:hide",function(){$(document).removeEvent(eventName,boundCloseOnBodyClickHandler);});});hf.PopupManager=new Class({popups:[],add:function(popup){this.popups.push(popup);popup.addEvents({"onshow":function(){for(var i=0;i<this.popups.length;i++){var p=this.popups[i];if(p!=popup&&p.isOpen){p.hide();}}
if(popup.options.closeOnBodyClick)$$("body").fireEvent("PopupManager:show",popup);}.bind(this),"onhide":function(){if(popup.options.closeOnBodyClick)$$("body").fireEvent("PopupManager:hide");}});return popup;},addAll:function(popups){popups.each(function(popup){this.add(popup);}.bind(this));},hide:function(){for(var i=0;i<this.popups.length;i++){var popup=this.popups[i];if(popup.isOpen){popup.hide();if(popup.options.closeOnBodyClick)$$("body").fireEvent("PopupManager:hide");}}}});hf.PopupAccessibility=new Class({addSimpleAccessibility:function(selector){var links=this.popup.getElements("a");if(links&&links.length>0){this.addAccessibility(links[0],links[links.length-1]);}},addAccessibility:function(firstLink,lastLink){if(firstLink){this._addFirstLinkEvents(firstLink);}
if(lastLink){this._addLastLinkEvents(lastLink);}},addKeyPressHandler:function(){this._triggerLink().addEvent("keydown",function(event){if(event.key!='enter'||this.inTransition){return true;}
if(this.isOpen){this.hide();}else{this.show();}
return true;}.bind(this));},_addFirstLinkEvents:function(firstLink){firstLink.addEvent('keydown',function(event){if(event.key=='tab'&&event.shift){event.preventDefault();this.hide();this._triggerLink().focus();}}.bind(this));},_addLastLinkEvents:function(lastLink){lastLink.addEvent('keydown',function(event){if(event.key=='tab'&&!event.shift){event.preventDefault();this.hide();this._triggerLink().focus();}}.bind(this));},_triggerLink:function(){return this.trigger.nodeName=="A"?this.trigger:this.trigger.getElement("a");},initPopupScreenReading:function(customOpenLabelId,customCloseLabelId){this.screenReadingEl=this.trigger.getElement(SR_SELECTOR);if(this.screenReadingEl){var triggerTitle=this.trigger.get('title')||'',openLabelId=customOpenLabelId||'open_popup',closeLabelId=customCloseLabelId||'close_popup',showLabel=window.SCREENREADING_LABELS[openLabelId+'_prefix']+triggerTitle+window.SCREENREADING_LABELS[openLabelId+'_suffix'],hideLabel=window.SCREENREADING_LABELS[closeLabelId+'_prefix']+triggerTitle+window.SCREENREADING_LABELS[closeLabelId+'_suffix'];this.initElementScreenReading(showLabel,hideLabel);}},initMenuScreenReading:function(control){if(!control)control=this;this.screenReadingEl=control.trigger.getElement(SR_SELECTOR);if(this.screenReadingEl){var showLabel=SCREENREADING_LABELS['closed_state_menu_prefix']+SCREENREADING_LABELS['closed_state_menu_suffix'],hideLabel=SCREENREADING_LABELS['opened_state_menu_prefix']+SCREENREADING_LABELS['opened_state_menu_suffix'];this.initElementScreenReading.bind(control)(showLabel,hideLabel);}},initElementScreenReading:function(showLabel,hideLabel){this.screenReadingEl=this.trigger.getElement(SR_SELECTOR);if(this.screenReadingEl){this.screenReadingEl.set('text',showLabel);this.addEvents({"onshow":function(){this.screenReadingEl.set('text',hideLabel);},"onhide":function(){this.screenReadingEl.set('text',showLabel);}});}}});hf.AccordionAccessibility={addSimpleAccessibility:function(acc){var links;acc.addEvents({active:function(toggler,element){var tabindex=toggler.getProperty('tabindex');links=element.getElements('a');if(tabindex){links.setProperty('tabindex',tabindex);}},background:function(toggler,element){element.getElements('a').setProperty('tabindex',"-1");},complete:function(){if(links&&links[0]){links[0].focus();links=null;}}});acc.togglers.each(function(trigger,index){var targetLinks=acc.elements[index].getElements("a");targetLinks.setProperty('tabindex',"-1");hf.AccordionAccessibility._addItemAccessibility(acc,trigger.getElement("a")||trigger,targetLinks,index);});},_addItemAccessibility:function(acc,triggerLink,links,index){if(links&&links.length>0){hf.AccordionAccessibility._addListAccessibility(acc,triggerLink,links[0],links[links.length-1]);}},addKeyPressHandler:function(acc,triggerLink,index){triggerLink.addEvent("keydown",function(event){if(event.key=='enter'){acc.display(index);}
return true;});},_addListAccessibility:function(acc,triggerLink,firstLink,lastLink){if(firstLink){hf.AccordionAccessibility._addFirstLinkEvents(acc,triggerLink,firstLink);}
if(lastLink){hf.AccordionAccessibility._addLastLinkEvents(acc,triggerLink,lastLink);}},_addFirstLinkEvents:function(acc,triggerLink,firstLink){firstLink.addEvent('keydown',function(event){if(event.key=='tab'&&event.shift){event.preventDefault();acc.display(-1);triggerLink.focus();}});},_addLastLinkEvents:function(acc,triggerLink,lastLink){lastLink.addEvent('keydown',function(event){if(event.key=='tab'&&!event.shift){acc.display(-1);triggerLink.focus();}});},initAccordionScreenReading:function(acc){var screenReadingElements=acc.togglers.getElements(SR_SELECTOR);if(screenReadingElements.length!=0){var triggerTitle,labels=[],item;acc.togglers.each(function(trigger,index){triggerTitle=$(trigger).get('title')||$(trigger).get('text')||'';item={showLabel:triggerTitle+" "+window.SCREENREADING_LABELS['expand_prefix']+window.SCREENREADING_LABELS['expand_suffix'],hideLabel:triggerTitle+" "+window.SCREENREADING_LABELS['collapse_prefix']+window.SCREENREADING_LABELS['collapse_suffix']};labels.push(item);screenReadingElements[index].set('text',acc.options.show===index?item.hideLabel:item.showLabel);});acc.addEvents({active:function(toggler,element){var selectedIndex=acc.togglers.indexOf(toggler);screenReadingElements[selectedIndex].set('text',labels[selectedIndex].hideLabel);},background:function(toggler,element){var unactiveIndex=acc.togglers.indexOf(toggler);screenReadingElements[unactiveIndex].set('text',labels[unactiveIndex].showLabel);}});}}};hf.AutocompleteAccessibility={initScreenReading:function(control){var body=$$("body");var span=(new Element('div')).set('html','<span class="hf_ac_offscreen_text" aria-live="polite"></span>').getChildren();body.adopt(span);body.addEvent('ac:updatedata',function(count,suggestion){if(span.get('text')!=suggestion)span.set('text',suggestion);});}};(function(hf){var KEY_EVENT_NAME='keydown';var SR_SELECTOR='.js_screen_reading';var addTouchStartMouseDownClickHandlers=function(control){window._touchstart=false;function onTouchStart(e){window._touchstart=true;control._mousedown=false;e.stopPropagation();}
function onClick(e){if(e.type=='mousedown'){if(!window._touchstart){control._mousedown=true;}}else{if(!control._mousedown){e.preventDefault();}
window._touchstart=control._mousedown=false;}}
control.options.triggerEl.getParent().addEvents({'MSPointerDown':onTouchStart,'touchstart':onTouchStart});control.options.triggerEl.addEvents({'mousedown':onClick,'click':onClick});};hf.TopMenuAccessibility=new Class({addAccessibility:function(control){var selectedIndex;var itemEls=control.element.getChildren(control.options.itemSelector+'>'+control.options.triggerSelector);itemEls.set('role','menuitem');if(!control.options.isSubMenu){var parent=control.options.triggerEl.getParent('ul');parent.set('role','menu');parent.getElements('ul').set('role','menu');control.options.triggerEl.set('role','menuitem');control.element.addEvent(KEY_EVENT_NAME,function(e){if(e.key=='tab'){control.options.triggerEl.focus();setTimeout(function(){control.hide();},50);}});}else{control.options.triggerEl.set('aria-haspopup','true');control.options.triggerEl.addEvent('click',function(e){control.onShowTriggerEvent(this,e);});}
control.options.triggerEl.addEvent(KEY_EVENT_NAME,function(e){if(!control.options.isSubMenu){if(e.key=='tab'){control.hide();}else if(e.key=='enter'||e.key=='space'||e.key=='down'||e.key=='up'){if(!control.isOpen)control.show();selectedIndex=0;itemEls[selectedIndex].focus();e.preventDefault();}}else if(e.key=='enter'||e.key=='space'||e.key=='right'){if(!control.isOpen)control.show();selectedIndex=0;itemEls[selectedIndex].focus();e.preventDefault();}});itemEls.addEvent(KEY_EVENT_NAME,function(e){if(e.key=='down'){selectedIndex++;if(selectedIndex==itemEls.length){selectedIndex=0;}
itemEls[selectedIndex].focus();e.preventDefault();}else if(e.key=='up'){selectedIndex--;if(selectedIndex<0){selectedIndex=itemEls.length-1;}
itemEls[selectedIndex].focus();e.preventDefault();}else if(e.key=='esc'||(control.options.isSubMenu&&e.key=='left')){control.options.triggerEl.focus();control.hide();e.preventDefault();}});addTouchStartMouseDownClickHandlers(control);var screenReadingEl=control.options.triggerEl.getElement(SR_SELECTOR);if(control.options.isSubMenu){if(screenReadingEl){var label=SCREENREADING_LABELS['opened_state_submenu_suffix'];screenReadingEl.set('text',label);}}}});})(hf);function updateScreenReading(parentEl,src_selector){var src_el=parentEl.getElement(src_selector);var tar_el=parentEl.getElement('.screenReading');if(src_el&&tar_el){tar_el.innerHTML=src_el.innerHTML;}}
window.hf=Object.merge(window.hf,{version:5.0,description:"Common object to share information between header\\footer widgets and avoid pollution global scope",popupManager:new hf.PopupManager(),HeaderPopupOptions:{showDelay:100,hideDelay:300,openEvent:'mouseenter',opening:{before:{opacity:1,display:'block'}},closeEvent:'mouseleave',closing:{after:{opacity:0,display:'none'}},effect:{duration:0,transition:Fx.Transitions.Sine.easeOut,link:'cancel'}},autoPositionHeaderWidget:function(target){var parentCoordinates=target.getParent().getCoordinates();var coordinates=$('nav_buttons').getCoordinates();var offset,pos;if(rtl){pos=coordinates.left-parentCoordinates.left;target.setStyle('left',pos+'px');}else{pos=-coordinates.right+parentCoordinates.right;target.setStyle('right',pos+'px');}}});function initSkipLinks(){$$(".js-skip-link").each(function(skipLink){var href=skipLink.getAttribute("href");var targetName=href.substr(href.indexOf("#")+1,href.length);var targetEl=$$("[name="+targetName+"]");if(isIE||isOpera){var tempTabIndex;if(targetName=="skiptobody"){tempTabIndex=100;}else if(targetName=="skiptofooter"){tempTabIndex=$$(".footer").getElement("a[tabindex!=-1]")[0].getProperty("tabindex");}
targetEl.addEvents({focus:function(){targetEl.setProperty("tabindex",tempTabIndex);},blur:function(){targetEl.setProperty("tabindex",-1);}});}
skipLink.addEvent("click",function(event){event.preventDefault();targetEl[0].focus();});});}
hf.AnimatedContainer=new Class({Implements:[Options,CHKOverrides],options:{opening:{state:"opening",before:null,beforeAction:null,effect:null,after:null,afterAction:null},closing:{state:"closing",before:null,beforeAction:null,effect:null,after:null,afterAction:null},effect:{duration:500,transition:Fx.Transitions.Sine.easeOut,link:'cancel'}},initialize:function(cnt,options){this.setOptions(options);this.setOverrides();cnt.effect=new Fx.Morph(cnt,this.options.effect);cnt.effect.addEvent("complete",function(){cnt.inprogress=false;cnt.open=cnt.effectState=="opening";var afterStyles=cnt.fxOptions.after;if(afterStyles){cnt.setStyles(afterStyles);}
var action=cnt.fxOptions.afterAction;if(action){action.bind(cnt)(cnt);}
cnt.fireEvent("after-"+cnt.fxOptions.state);});cnt.effectShow=this._effectFunction(this.options.opening).bind(cnt);cnt.effectHide=this._effectFunction(this.options.closing).bind(cnt);},_effectFunction:function(options){return function(){if(this.inprogress){if(this.effectState!=options.state){this.effect.cancel();}else{return;}}
this.fxOptions=options;if(this.fxOptions.before){this.setStyles(this.fxOptions.before);}
var action=this.fxOptions.beforeAction;if(action){action.bind(this)(this);}
this.fireEvent("before-"+this.fxOptions.state);this.inprogress=true;this.effectState=this.fxOptions.state;this.effect.start(this.fxOptions.effect);}}});hf.AnimatedContainer.init=function(cntSelector,options){return $(cntSelector).map(function(cnt){return new hf.AnimatedContainer(cnt,options);});};hf.CustomPopup=new Class({Extends:hf.AnimatedContainer,Implements:Events,options:{triggerActiveClass:'',targetActiveClass:'',openEvent:'mouseover',closeEvent:'mouseleave',keyEvent:'keydown',closeOnBodyClick:true,showKeys:[13],hideKeys:[27],showDelay:100,hideDelay:100},initialize:function(trigger,target,options){this.setOptions(options);this.parent(target,this.options);this.popup=target;this.trigger=trigger;this.popup.hide();this.isOpen=false;this.trigger.addEvent(this.options.openEvent,this.openHandler.bind(this));this.trigger.addEvent(this.options.closeEvent,this.closeHandler.bind(this));this.trigger.addEvent(this.options.keyEvent,this.keyHandler.bind(this));if(this.options.openEvent!='click')this.trigger.addEvent('click',this.openHandler.bind(this));if(window.navigator.msPointerEnabled){var onTouch=function(event){this.touch=true;}.bind(this);this.trigger.addEventListener('MSPointerDown',onTouch,false);this.popup.addEventListener('MSPointerDown',onTouch,false);}
this.popup.addEvent(this.options.closeEvent,function(){if(this.options.openEvent!=this.options.closeEvent){if(window.navigator.msPointerEnabled&&this.touch){this.touch=false;}else{this.closeHandler();}}}.bind(this));this.popup.addEvent("mouseover",function(){clearTimeout(this.timer);}.bind(this));this.popup.addEvent(this.options.keyEvent,this.keyHandler.bind(this));},keyHandler:function(e){if(this.options.showKeys||this.options.hideKeys){var key=e.code;var showFlag=this.options.showKeys&&this.options.showKeys.indexOf(key)!=-1;var hideFlag=this.options.hideKeys&&this.options.hideKeys.indexOf(key)!=-1;if(showFlag&&hideFlag){showFlag=!this.isOpen;}
if(showFlag){this.show();}else if(hideFlag){this.hide();this.trigger.focus();if(isOpera){this.options.closing.afterAction=function(){this.trigger.focus();}.bind(this);}}}},closeHandler:function(){if(window.navigator.msPointerEnabled&&this.touch){this.touch=false;}else{this.timer=setTimeout(this.hide.bind(this),this.options.hideDelay);}},openHandler:function(){if(!this.isOpen)setTimeout(this.show.bind(this),this.options.showDelay);},show:function(){clearTimeout(this.timer);if(!this.isOpen){this.trigger.addClass(this.options.triggerActiveClass);this.popup.addClass(this.options.targetActiveClass);this.popup.effectShow();this.isOpen=true;this.fireEvent("onshow");}},hide:function(){clearTimeout(this.timer);if(this.isOpen){this.trigger.removeClass(this.options.triggerActiveClass);this.popup.removeClass(this.options.targetActiveClass);this.popup.effectHide();this.isOpen=false;this.fireEvent("onhide");}},toggle:function(){if(this.isOpen){this.hide();}else{this.show();}}});AC=function(input,options){this.input=input;this.loader=window[options.loaderName];this.searchForm=$(options.searchForm);this.jumpIDInput=this.searchForm.getElement('input[name="jumpID"]');this.ackeydown=function(e){lastKeyPressCode=e.key;if(lastKeyPressCode=='shift'||lastKeyPressCode=='capslock'||lastKeyPressCode=='control'||lastKeyPressCode=='alt'||lastKeyPressCode=='left'||lastKeyPressCode=='right'){return;}
this._keydown=true;switch(lastKeyPressCode){case'backspace':var str=e.target.id;var patt=/i/;if(str.match(patt)){$(options.searchBox).focus();}
if($clearBtn)this.toggleClearBtn();this.updateList();break;case'up':e.preventDefault();this.moveSelect(-1);break;case'down':e.preventDefault();this.moveSelect(1);break;case'tab':case'enter':if(this.selectCurrent(true)){$input.value=prev;$input.blur();hasFocus=false;e.preventDefault();}
break;case'esc':{$input.value=prev;$input.focus();this.hideResultsNow();e.preventDefault();}
break;default:if($clearBtn)this.toggleClearBtn();this.updateList();break;}};this.updateList=function(){if(timeout)clearTimeout(timeout);timeout=setTimeout(function(){this.onChange();this._keydown=false;}.bind(this),options.delay);};this.onChange=function(){if('delete'==lastKeyPressCode||'shift'==lastKeyPressCode){$results.hide();$results.fireEvent('hide');return;}
var v=$input.value;if(v==prev)return;prev=v;if(v.length>=options.minChars){if(options.loadingClass)
$input.addClass(options.loadingClass);this.requestData(v);}else{if(options.loadingClass)
$input.removeClass(options.loadingClass);$results.hide();$results.fireEvent('hide');}};this.moveSelect=function(step){if($results.isDisplayed()){var lis=results.getElements('li a');var index=lis.indexOf(lis.filter('.ac_focus')[0]);if(!lis||lis.length==0||step==0)return;var lastActive=index;index+=step;if(index<0){index=lis.length-1;}else if(index>=lis.length){index=0;}
$input.value=lis[index].get('data-suggestion');lis[index].focus();}};this.selectCurrent=function(fSubmit){var li=$$('ul li > .ac_focus').getParent()[0];if(!li){console.log("!li***",!li);var $li=$$('ul li');if(options.selectOnly){if($li.length==1)li=$li[0];}else if(options.selectFirst){li=$li[0];}}
if(li){this.selectItem(li,fSubmit);return true;}else{this.searchForm.fireEvent('submitSearchForm',{initiator:"autocomplete",target:this.input});this.searchForm.getElement(options.searchSubmit).click();return true;}};this.selectItem=function(li,fSubmit){if(!li){li=document.createElement("li");li.extra=[];li.selectValue="";}
var v=(li.selectValue?li.selectValue:li.get("text")).trim();input.lastSelected=v;prev=v;$input.value=v;$input.focus();this.hideResultsNow();var index=li.getParent('div').get('data-index')||0,jumpID=null,url;jumpID=this.loader.getJumpID(index);this.enableJumpID();this.setJumpID(jumpID);if(index>0&&(url=this.loader.getActionUrl(index))){location.href=this.evalString(url,{term:$input.value,client:''})+"&jumpID="+jumpID;}else{this.searchForm.fireEvent('submitSearchForm',{initiator:"autocomplete",target:this.input});this.searchForm.getElement(options.searchSubmit).click();}
this.disableJumpID();};this.setJumpID=function(jumpID){this.jumpIDInput.set('value',jumpID);};this.enableJumpID=function(){this.jumpIDInput.removeProperty('disabled');};this.disableJumpID=function(){this.jumpIDInput.setProperty('disabled','disabled');};this.createSelection=function(start,end){var field=$input;if(field.createTextRange){var selRange=field.createTextRange();selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();}else if(field.setSelectionRange){field.setSelectionRange(start,end);}else{if(field.selectionStart){field.selectionStart=start;field.selectionEnd=end;}}
field.focus();};this.autoFill=function(sValue){if(lastKeyPressCode!='backspace'){$input.value=($input.value+sValue.substring(prev.length));this.createSelection(prev.length,sValue.length);}};this.hideResults=function(){if(timeout)clearTimeout(timeout);timeout=setTimeout(this.hideResultsNow,200);};this.hideResultsNow=function(){if(timeout)clearTimeout(timeout);if(options.loadingClass)
$input.removeClass(options.loadingClass);if(document.activeElement!=$input&&document.activeElement!=$submitBtn&&document.activeElement!=$clearBtn){$input.fireEvent('inactive');}
$results.hide();$results.fireEvent('hide');if(options.mustMatch){var v=$input.value;if(v!=input.lastSelected){this.selectItem(null,false);}}
$$('body').fireEvent('ac:updatedata',[0,'']);};this.receiveData=function(data,index){if(data){if(options.loadingClass)
$input.removeClass(options.loadingClass);var params=this.loader.getParams();var obj={term:data.query};var div=results.getElement('.js_results'+(params?index:''));if(!div){var html='';if(params){for(var i=0;i<params.length;i++){html+='<div class="js_results'+i+'" data-index="'+i+'"'+(i>0&&(i!=index||data.itemsCount==0)?' style="display:none">':'>');html+='<div class="ac_title">'+params[i].title+'</div>';html+=(i==0)?'<div class="ac_progress">'+params[i].inProgressHTML+'</div>':'';html+='</div>';}}else{html='<div class="js_results ac_no_title"></div>';}
results.set('html',html);div=results.getElement('.js_results'+(params?index:''));}else{var ul=div.getElement('ul');if(ul)ul.destroy();}
if(params){if(index==0){if(data.itemsCount!=0){div.getElements('.ac_progress').hide();}}else{if(data.itemsCount==0){div.hide();}else{div.show();}}}
if(data.itemsCount==0){if(results.getElements('ul').length==0){return this.hideResultsNow();}}
if(!hasFocus)return this.hideResultsNow();var div2=new Element('div');div2.set('html',data.html);div.adopt(div2.getChildren());this.highlightSuggestions(data.query,div.getElements('.js_suggestion_text'));this.setHandlers(div);if(options.autoFill&&($input.value.toLowerCase()==data.query.toLowerCase()))this.autoFill(results.getElement('.js_suggestion_text').get('data-suggestion'));$results.show();$results.fireEvent('show');$$('body').fireEvent('ac:updatedata',[data.itemsCount,results.getElement('.js_suggestion_text').get('data-suggestion')]);}else{this.hideResultsNow();}};this.evalString=function(str,obj){var a=str.split('@@');var r=[];var val;if(a.length<3)return str;for(var i=0;i<a.length;i++){if(i%2){r.push(obj[a[i]]);}else{r.push(a[i]);}}
return r.join('');};this.highlightSuggestions=function(query,elements){var len=query.length;var pos,text;elements.each(function(el,index){el.getParent('li').selectValue=el.get('data-suggestion');text=el.get('text');pos=text.toLowerCase().indexOf(query.toLowerCase());if(pos!=-1){el.set('html',text.substr(0,pos)+"<span>"+text.substr(pos,len)+"</span>"+text.substr(pos+len));}})};this.setHandlers=function(element){var linkEls=element.getElements('li a');linkEls.getParent().addEvent('click',function(e){e.preventDefault();e.stopPropagation();this.selectItem(e.target,true);}.bind(this));var self=this;linkEls.addEvents({'keydown':this.ackeydown.bind(this),'mouseenter':function(e){results.getElements(".ac_focus").removeClass('ac_focus');this.addClass('ac_focus');$(input).focus();e.preventDefault();},'mouseleave':function(e){this.removeClass('ac_focus');},'focus':function(){results.getElements(".ac_focus").removeClass('ac_focus');this.addClass('ac_focus');hasFocus=true;ourIsFocused=true;input.focus();}});};this.getSuggestions=function(value,index){if(this.loader){function callback(data,i){if(data){this.addToCache(data.query,data,i);if($input.value.toLowerCase().trim()==data.query.trim()){this.receiveData(data,i);}}}
this.loader.getSuggestions(value,callback.bind(this),index);}else{if(options.loadingClass)
$input.removeClass(options.loadingClass);}};this.requestData=function(q){if(!options.matchCase)q=q.toLowerCase();var c=this.loader.getLoadersCount();var data;if(typeof c=='undefined'){data=options.cacheLength?this.loadFromCache(q):null;if(data)this.receiveData(data);else this.getSuggestions(q);}else{for(var i=0;i<c;i++){data=options.cacheLength?this.loadFromCache(q,i):null;var div=results.getElement('.js_results'+i);if(div){if(i==0){div.getElements('.ac_progress').show();}else{div.hide();}
div.getElements('ul').hide();}
if(data)
this.receiveData(data,i);else
this.getSuggestions(q,i);}}};this.loadFromCache=function(q,index){if(!q||cache.length==0)return null;var res=cache.data[q];if(res){if(typeof index=='undefined'){return res;}else{res=cache.data[q][index];if(res)return res;}}
for(var i=q.length-1;i>=options.minChars;i--){var fMatchCache=false;var data=cache.data[q.substr(0,i)];if(data&&typeof index!='undefined')data=data[index];if(data){var result={query:q,html:'',itemsCount:0};if(data.itemsCount==0)return result;fMatchCache=(data.itemsCount<this.loader.getMaxItemsCount(index));if(options.matchSubset&&fMatchCache){if(data.itemsCount==0){this.addToCache(q,result,index);return result;}
var div=new Element('div');div.set('html',data.html);div.getElements('.js_suggestion_text:not([data-suggestion*='+q+'])').getParent('li').destroy();result.itemsCount=div.getElements('.js_suggestion_text').length;if(result.itemsCount!=0){result.html=div.get('html');}
this.addToCache(q,result,index);return result;}}}
return null;};this.matchSubset=function(s,sub){if(!options.matchCase)s=s.toLowerCase();var i=s.indexOf(sub);if(i==-1)return false;return i==0||options.matchContains;};this.flushCache=function(){cache={data:{},length:0};};this.setExtraParams=function(p){options.extraParams=p;};this.addToCache=function(q,data,index){if(!data||!q||!options.cacheLength)return;if(!cache.length||cache.length>options.cacheLength){this.flushCache();cache.length++;}else if(!cache[q]){cache.length++;}
if(typeof index=='undefined'){cache.data[q]=data;}
else{if(!cache.data[q])cache.data[q]=[];cache.data[q][index]=data;}};this.toggleClearBtn=function(){if(timeoutClearBtn)clearTimeout(timeoutClearBtn);var self=this;timeoutClearBtn=setTimeout(function(){var valueLength=$input.value.length;var isBtnVisible=$clearBtn.isDisplayed();if(valueLength>0&&!isBtnVisible)$clearBtn.show();if(valueLength==0&&isBtnVisible)$clearBtn.hide();},100);};var me=this;var actype;var okflag=false;var err='';var $input=$(input).setProperty("autocomplete","off");var $submitBtn=$input.getNext("input[type=submit]");var $clearBtn=$input.getNext(".searchClear");if(options.inputClass)$input.addClass(options.inputClass);var results=document.createElement("div");var $results=$(results);$results.hide().addClass(options.resultsClass).addClass(options.resultsStyleClass).setStyle('position','absolute');var INPUT_TITLE='search_box_suggestion_title';var inputTitle=$input.get('title');$results.addEvents({'show':function(){if(SCREENREADING_LABELS[INPUT_TITLE]){$input.set('title',SCREENREADING_LABELS[INPUT_TITLE]);}},'hide':function(){if(SCREENREADING_LABELS[INPUT_TITLE]){$input.set('title',inputTitle);}}});$input.getParent('.search_container').grab(results);input.autocompleter=me;var timeout=null;var prev="";var cache={};var keyb=false;var hasFocus=false;var lastKeyPressCode=null;var ourIsFocused=false;var timeoutDropdown;var timeoutClearBtn;this.flushCache();$input.addEvent('keydown',function(e){this.ackeydown.call(this,e);}.bind(this));$input.addEvent('keydown',function(event){if(event.key=='enter')
this.hideResultsNow();}.bind(this));var self=this;$input.addEvent('focus',function(){hasFocus=true;ourIsFocused=true;if($clearBtn)self.toggleClearBtn();this.fireEvent('active');});$input.addEvent('blur',function(e){ourIsFocused=false;if(timeoutDropdown)clearTimeout(timeoutDropdown);timeoutDropdown=setTimeout(function(){if(!ourIsFocused){hasFocus=false;if($clearBtn)$clearBtn.hide();this.hideResultsNow();}
if($clearBtn&&document.activeElement!=$clearBtn&&!hasFocus)$clearBtn.hide();}.bind(this),150);}.bind(this));$input.addEvent('paste',function(e){if(!this._keydown){if($clearBtn)this.toggleClearBtn();this.updateList(e);}}.bind(this));if($submitBtn){$submitBtn.addEvents({'blur':function(e){setTimeout(function(){if(!$results.isDisplayed()&&document.activeElement!=$input&&document.activeElement!=$clearBtn){$input.fireEvent('inactive');if($clearBtn)$clearBtn.hide();}},1);}.bind(this)});}
if($clearBtn){$clearBtn.addEvents({'click':function(e){$input.value="";this.toggleClearBtn();$results.hide();$input.focus();}.bind(this),'focus':function(e){ourIsFocused=true;this.hideResultsNow();}.bind(this),'blur':function(e){setTimeout(function(){if(!$results.isDisplayed()&&document.activeElement!=$input&&document.activeElement!=$submitBtn){$input.fireEvent('inactive');$clearBtn.hide();}},1);}});}
if(options.focusOnMouseEnter){$input.addEvent('mouseenter',function(e){$(input).focus();e.preventDefault();});}
this.hideResultsNow();var isElementsVisible=function(el){return el.style.visibility!='hidden'&&el.style.display!='none';}
hf.AutocompleteAccessibility.initScreenReading();};function autocomplete_start(opt){var options={matchSubset:true,matchContains:1,cacheLength:100,minChars:2,delay:100,data:null,searchBox:opt.searchBox||"searchBox",searchForm:opt.searchForm||"searchHP",searchSubmit:opt.searchSubmit||".searchSubmit",inputClass:opt.inputClass||"ac_input",resultsClass:opt.resultsClass||"js_ac_results",resultsStyleClass:opt.resultsStyleClass||"ac_results",lineSeparator:opt.lineSeparator||"\n",cellSeparator:opt.cellSeparator||"|",matchCase:opt.matchCase||0,mustMatch:opt.mustMatch||0,extraParams:opt.extraParams||{},selectFirst:opt.selectFirst||false,selectOnly:opt.selectOnly||false,focusOnMouseEnter:opt.focusOnMouseEnter||false,autoFill:opt.autoFill||false,width:opt.width||0,loaderName:'autocompleteLoader'};initContextualSearch();var searchForm=$(options.searchForm);var metricId;if(searchForm){metricId=searchForm.getElement('.js_metricId').get('html');if(metricId){searchForm.addEvent('submit',function(){window.trackMetrics&&trackMetrics('global-inav',{'link_id':metricId});});}}
return new AC($(options.searchBox),options);}
function initSearchBoxSliding(searchBox,parentActiveClass){var searchBox=$(searchBox);if(searchBox){var searchContainer=searchBox.getParent('.search_container');var shoppingCardCount=$$('.item_count');searchBox.addEvents({active:function(){searchContainer.addClass(parentActiveClass);searchContainer.removeClass("search_container_inactive");if(shoppingCardCount)shoppingCardCount.hide();},inactive:function(){searchContainer.removeClass(parentActiveClass);searchContainer.addClass("search_container_inactive");if(shoppingCardCount)shoppingCardCount.show();}});}}
function initContextualSearch(){var contextSearchMeta=$$("meta[name = search_context]");var searchForm=$("searchHP");if(contextSearchMeta[0]&&searchForm){var contextSearchInput=new Element("input").set({type:"hidden",name:"search_context",value:contextSearchMeta.get('content')});searchForm.grab(contextSearchInput,"top");}}
function trackHFMetrics(link_metrics){if(!link_metrics.getAttribute('name'))return;try{trackMetrics("global-inav",{link_id:link_metrics.getAttribute('name')});}catch(err){}}
function initHFMetrics(metrics_class){$$(metrics_class).each(function(el){el.addEvent('click',function(){trackHFMetrics(el);});});}
hf.SelectableItem=new Class({Implements:[Options,Events],options:{selectionClass:"selected",selectionEvent:"click",hasKeyDownEvent:"true"},initialize:function(itemEl,options){if(!itemEl){return;}
this.itemEl=itemEl;var triggerEl=options&&options.triggerSelector?itemEl.getElement(options.triggerSelector):itemEl;this.setOptions(options);var select=this.select.bind(this);var self=this;if(triggerEl){triggerEl.addEvent(this.options.selectionEvent,select);triggerEl.addEvent('keydown',function(e){if(e.key=='enter'){select();}
return true;});}
var linkEl=itemEl.getElement('a');if(linkEl&&linkEl.get('rel')){window._touchstart=false;var parentHandler=function(e){window._touchstart=true;self._mousedown=false;e.stopPropagation();}
linkEl.getParent().addEvents({'touchstart':parentHandler,'MSPointerDown':parentHandler});var handler=function(e){self._click=false;if(e.type=='mousedown'){if(!window._touchstart){self._mousedown=true;}}else{if(!self._mousedown){e.preventDefault();}else{self._click=true;}
self._touchstart=self._mousedown=false;}};linkEl.addEvents({'mousedown':handler,'click':handler});}},select:function(){if(this.isSelected()){return true;}
this.itemEl.addClass(this.options.selectionClass);this.fireEvent("selectItem",this);return true;},unselect:function(){if(!this.isSelected()){return;}
this.itemEl.removeClass(this.options.selectionClass);this.fireEvent("unselectItem",this);},isSelected:function(){return this.itemEl.hasClass(this.options.selectionClass);}});hf.SelectableItemWithSubMenu=new Class({Extends:hf.SelectableItem,options:{isFocusFirstLink:true},initialize:function(itemEl,options){this.parent(itemEl,options);var container=$(this.getSubMenuContainerId());if(!container){return;}
if(this.options.container){this.initAnimateContainer(container);}else{this.initSimpleContainer(container);}},initSimpleContainer:function(cnt){this.addEvents({selectItem:function(){cnt.show();if(this.options.isFocusFirstLink){this.focusFirstLink(cnt);}},unselectItem:function(){cnt.hide();}});},focusFirstLink:function(cnt){var firstLink=cnt.getElement("a");if(firstLink){(function(){firstLink.focus();}).delay(50);}},initAnimateContainer:function(cnt){new hf.AnimatedContainer(cnt,this.options.container);this.addEvents({selectItem:function(){cnt.effectShow();},unselectItem:function(){cnt.effectHide();}});if(cnt){cnt.addEvent("after-opening",function(){this.getElement("a").focus();});}},getSubMenuContainerId:function(){var el=this.itemEl.getElement("a");return el?el.get("rel"):"";},getSubMenuEl:function(container){var subMenuContainer=container.getElement("."+this.getSubMenuContainerId());if(!subMenuContainer){return null;}
if(subMenuContainer.hasClass("js_menu")){return subMenuContainer;}
return subMenuContainer.getElement(".js_menu");}});hf.Selectable=new Class({Implements:[Options,Events,CHKOverrides],selectedItem:null,options:{itemsSelector:null,itemConstructor:hf.SelectableItem,handleTabNavigation:true},initialize:function(menu,options){this.setOptions(options);this.setOverrides();this.menuItems=this.getItemElements(menu).map(function(itemEl){if(!itemEl.hasClass("disabled")){var item=this.createMenuItem(itemEl,this.options.item);item.addEvents({selectItem:this.onSelectItem.bind(this),unselectItem:this.onUnSelectItem.bind(this)});if(item.isSelected()){this.selectedItem=item;}
return item;}}.bind(this));if(this.options.handleTabNavigation)this.handleTabNavigation();},onUnSelectItem:function(item){if(this.selectedItem==item){this.selectedItem=null;this.setDividers(item.itemEl,"active");}},onSelectItem:function(item){var event={previousItem:this.selectedItem,currentItem:item};if(this.selectedItem){this.selectedItem.unselect();}
this.selectedItem=item;this.setDividers(item.itemEl,"active");this.fireEvent("selectItem",event);},getItemElements:function(menuEl){if(this.options.itemsSelector){return menuEl.getElements(this.options.itemsSelector);}else{return menuEl.getChildren();}},createMenuItem:function(itemEl,options){return new this.options.itemConstructor(itemEl,options);},handleTabNavigation:function(){this._addFirstItemEvents(this.menuItems[0]);this._addLastItemEvents(this.menuItems.getLast());},_addFirstItemEvents:function(firstItem){if(firstItem){firstItem.itemEl.getElement("a").addEvent('keydown',function(event){if(event.key=='tab'&&event.shift){this.fireEvent("leaveToPrev");this.fireEvent("leave");event.preventDefault();}
return true;}.bind(this));}},_addLastItemEvents:function(lastItem){if(lastItem){lastItem.itemEl.getElement("a").addEvent('keydown',function(event){if(event.key=='tab'&&!event.shift){this.fireEvent("leaveToNext");this.fireEvent("leave");event.preventDefault();}
return true;}.bind(this));}},setDividers:function(itemEl,className){if(!itemEl.hasClass("disabled")){var prevDivider=itemEl.getPrevious(".js_tabs_divider");this.toggleDivider(prevDivider,className);var nextDivider=itemEl.getNext(".js_tabs_divider");this.toggleDivider(nextDivider,className);}},toggleDivider:function(dividerEl,className){if(dividerEl!=null){if(dividerEl.hasClass(className)){dividerEl.removeClass(className);}else{dividerEl.addClass(className);}}}});hf.MultiSelectable=new Class({Extends:hf.Selectable,initialize:function(item,options){this.parent(item,options);},onSelectItem:function(item){var event={previousItem:this.selectedItem,currentItem:item};if(this.selectedItem&&this.selectedItem!=item){this.selectedItem.unselect();}
this.selectedItem=item;this.setDividers(item.itemEl,"active");this.fireEvent("selectItem",event);}});hf.Popup=new Class({Implements:[Options,Events,CHKOverrides],options:{hideDelay:1000,showDelay:0,showEvent:'mouseenter',hideEvent:'mouseleave',triggerEl:null,targetActiveClass:'',triggerActiveClass:'',onInit:null,onShow:null,onHide:null,addToPopupManager:true,closeOnBodyClick:true,open:false},'initialize':function(element,options){this.element=this.element||element;this.setOptions(options);this.setOverrides();this.timerId=null;this.touch=false;this.isOpen=this.options.open;if(this.isOpen)
this.element.show();else
this.element.hide();if(this.options.addToPopupManager)
hf.popupManager.add(this);if(this.options.onInit)this.options.onInit(this);if(window.navigator.msPointerEnabled){var self=this;var onTouch=function(event){self.touch=true;};this.element.addEvent('MSPointerDown',onTouch);this.options.triggerEl.addEvent('MSPointerDown',onTouch);}
this.element.addEvent('mouseenter',this.onMouseEnter.bind(this));if(this.options.hideEvent)this.element.addEvent(this.options.hideEvent,this.onHideEvent.bind(this));if(this.options.showEvent)this.options.triggerEl.addEvent(this.options.showEvent,this.onShowTriggerEvent.bind(this));if(this.options.hideEvent)this.options.triggerEl.addEvent(this.options.hideEvent,this.onHideTriggerEvent.bind(this));},'_onShow':function(){if(this.timerId!=null){clearTimeout(this.timerId);}
if(!this.isOpen){if(this.options.showDelay>0){this.timerId=setTimeout(this.show.bind(this),this.options.showDelay);}else{this.show()}}},'_onHide':function(){if(this.timerId!=null){clearTimeout(this.timerId);}
if(this.options.hideDelay>0){this.timerId=setTimeout(this.hide.bind(this),this.options.hideDelay);}else{this.hide()}},'toggle':function(show){if(this.options.showEvent==this.options.hideEvent){if(this.isOpen){this._onHide();}else{this._onShow();}}else{if(show)this._onShow();else this._onHide();}},'onShowTriggerEvent':function(){this.toggle(true);},'onHideTriggerEvent':function(){if(this.options.showEvent!=this.options.hideEvent){if(window.navigator.msPointerEnabled&&this.touch){this.touch=false;}else{this.toggle(false);}}},'onMouseEnter':function(){if(this.timerId!=null){clearTimeout(this.timerId);}},'onHideEvent':function(){if(this.options.showEvent!=this.options.hideEvent){if(window.navigator.msPointerEnabled&&this.touch){this.touch=false;}else{this._onHide();}}},'show':function(){if(this.options.targetActiveClass)this.element.addClass(this.options.targetActiveClass);if(this.options.triggerActiveClass)this.options.triggerEl.addClass(this.options.triggerActiveClass);this.element.show();this.fireEvent("onshow");this.element.fireEvent('show');if(this.options&&this.options.onShow)this.options.onShow();this.isOpen=true;},'hide':function(){if(this.options.targetActiveClass)this.element.removeClass(this.options.targetActiveClass);if(this.options.triggerActiveClass)this.options.triggerEl.removeClass(this.options.triggerActiveClass);this.element.hide();this.fireEvent("onhide");this.element.fireEvent('hide');if(this.options&&this.options.onHide)this.options.onHide();this.isOpen=false;}});hf.TopMenu=new Class({Extends:hf.Popup,Implements:[hf.TopMenuAccessibility],options:{activeClass:'expanded',parentActiveClass:'selected',triggerSelector:'a',targetSelector:'.js_hf_menu',itemSelector:'.js_item',subItemOptions:{addToPopupManager:false,hideDelay:0,hideEvent:'',triggerSelector:'a',targetSelector:'.js_hf_menu',isSubMenu:true}},'initialize':function(element,options){this.items=[];this.setOptions(options);this.setOverrides();this.options.triggerEl=element.getFirst(this.options.triggerSelector);this.element=this.options.triggerEl.getNext(this.options.targetSelector);var self=this;var onHideSubItem=this.hideSubItems.bind(this);this.element.getChildren(this.options.itemSelector).each(function(el,index){var trigger=el.getFirst(self.options.triggerSelector);var target=el.getFirst(self.options.targetSelector);if(target){self.items.push(new hf.TopMenu(el,self.options.subItemOptions));target.addEvents({'show':self.onShowChildPopup.bind(self,target),'hide':self.onHideChildPopup.bind(self,target)});}else{trigger.addEvent('mouseenter',onHideSubItem);}
trigger.addEvent('focus',onHideSubItem);});this.parent();this.addAccessibility(this);},'hide':function(){this.hideSubItems();this.element.getParent().removeClass(this.options.parentActiveClass);this.parent();},'show':function(){this.element.getParent().addClass(this.options.parentActiveClass);this.parent();},'hideSubItems':function(){this.items.each(function(item,index){if(item.isOpen)item.hide();});},'onShowChildPopup':function(subMenuEl){this.hideSubItems(subMenuEl);this.element.addClass(this.options.activeClass);var subMenuHeight=subMenuEl.getStyle("height").toInt();var height=this.element.getStyle("height").toInt();if(height>subMenuHeight)subMenuEl.setStyle('height',height+'px');else this.element.setStyle('height',subMenuHeight+'px');},'onHideChildPopup':function(subMenuEl){this.element.setStyle('height','');subMenuEl.setStyle('height','');this.element.removeClass(this.options.activeClass);}});hf.TopMenu.init=function(selector,options){return $$(selector||".js_header_topmenu .selectable").map(function(el){return new hf.TopMenu(el,options);});};hf.Search={options:{navButtonWidth:32,searchPopupWidth:276},init:function(){$$(".js_search").each(function(search){if(!search){return;}
var searchInput=this.addItemMethods(search);searchInput.setValue(searchInput.defaultText);searchInput.getParent('form').addEvent('submit',function(){var val=searchInput.getProperty('value').clean();if(val==searchInput.defaultText||val==''){searchInput.focus();return false;}});}.bind(this));},addItemMethods:function(search){var searchBox=search.getElement('.searchBox');searchBox.defaultText=search.getElement('.defaultTxt').get('html');searchBox.getValue=this._getSearchInputValue;searchBox.setValue=this._setSearchInputValue;searchBox.addEvents({focus:this._focusInput,blur:this._blurInput});return searchBox;},_focusInput:function(){if(!this.getValue())this.setValue("");},_blurInput:function(){if(!this.getValue()){this.setValue(this.defaultText)}},_setSearchInputValue:function(value){this.setProperty('value',value);},_getSearchInputValue:function(){var value=this.getProperty('value');if(value&&value!=this.defaultText){return value;}}};hf.SpoolerMixIn=new Class({showSpooler:function(){var spooler=$(this.options.spoolerId);if(spooler){spooler.fireEvent('show');spooler.addClass("active");}},hideSpooler:function(){var spooler=$(this.options.spoolerId);if(spooler){spooler.fireEvent('hide');spooler.removeClass("active");}}});hf.ShoppingWidget=new Class({Extends:hf.CustomPopup,Implements:[hf.PopupAccessibility],initialize:function(root,options){var trigger=root.getElement(".js_shopping_trigger");var target=root.getElement(".js_shopping_target");hf.autoPositionHeaderWidget(target);this.setOptions(options);this.parent(trigger,target,this.options);this.addEvents({'onhide':function(){trigger.removeClass('shopping_over');},'onshow':function(){trigger.addClass('shopping_over');}});this.addSimpleAccessibility();this.initPopupScreenReading();}});hf.ShoppingWidget.init=function(popupManager){popupManager=popupManager||hf.popupManager;$$(".js_shopping_widget").each(function(el){popupManager.add(new hf.ShoppingWidget(el,hf.HeaderPopupOptions));});};hf.ShoppingTabs=new Class({Implements:[Options,CHKOverrides],options:{itemConstructor:hf.SelectableItemWithSubMenu,isSelectTabFromUrl:true},initialize:function(tabsEl,options){this.setOptions(options);this.setOverrides();var tabs_element=tabsEl;while(tabs_element&&!tabs_element.hasClass("js_shopping_tabs")){tabs_element=tabs_element.getParent();}
tabs_element.getElements(".js_tab_content").hide();var menu=new hf.Selectable(tabsEl,this.options||{});this.firstItem=menu.menuItems[0].itemEl;if(menu.selectedItem){var cnt=menu.selectedItem.getSubMenuContainerId();var cntWrapper=$(cnt);if(cntWrapper){cntWrapper.show();}}else{var items=menu.menuItems;if(items&&items.length>0){items[0].select();}}
this.selectFirst(this.firstItem);menu.addEvent('selectItem',function(event){if(event.previousItem){event.previousItem.itemEl.removeClass('current_fst');updateScreenReading(event.previousItem.itemEl,'.js_unselectedTab');}
if(event.currentItem){this.selectFirst(event.currentItem.itemEl);updateScreenReading(event.currentItem.itemEl,'.js_selectedTab');}}.bind(this));},selectFirst:function(tabEl){if(this.firstItem==tabEl)
tabEl.addClass('current_fst');}});hf.ShoppingTabs.init=function(tabsSelector,options){return $$(tabsSelector||".tabs_nav .js_menu").map(function(tabs){return new hf.ShoppingTabs(tabs,options);});};hf.CountrySelector=new Class({Extends:hf.CustomPopup,Implements:[Options,Events,hf.SpoolerMixIn,hf.PopupAccessibility],options:{showKeys:[],spoolerId:"cs_spooler",triggerSelector:".js_cselector_trigger",worldmapSelector:".js_cselector_target",triggerActiveClass:"cs_selected"},initialize:function(root,options){this.setOptions(options);this.colNumber=7;this.root=root;this.trigger=root.getElement(this.options.triggerSelector);this.target=root.getElement(this.options.worldmapSelector);this.parent(this.trigger,this.target,this.options);this.trigger.addEvent("keydown",function(e){if(e.shift&&e.key=="tab"){this.hide();}}.bind(this));this.target.addEvent('showContent',function(){this.target.getElement('a').focus();}.bind(this));this.initPopupScreenReading();var screenReadingEl=this.trigger.getElement('.selectedCountry .screenReading');if(screenReadingEl){screenReadingEl.set('text',SCREENREADING_LABELS['selected_country_state']);}},_initWorldMapContent:function(){initHFMetrics('.js_cselector_target .link_metrics');this._initCloseButton();},_initCloseButton:function(){var closeBtn=this.target.getElement('a.cselectorbtn');closeBtn.addEvents({'keydown':function(e){if(e.key=='tab'&&!e.shift){e.preventDefault();this.hide();this.trigger.focus();}}.bind(this),'click':function(){this.hide();this.trigger.focus();}.bind(this)});},_updateCountriesColumns:function(colNumber){colNumber=colNumber||this.colNumber;var countryEls=this.target.getElements('.country_holder li');var countryElWidth=countryEls[0].getSize().x;this.colNumber=colNumber;var lineNumber=Math.ceil(countryEls.length/colNumber);var col=1;var prevColHeight=0;var marginTop;countryEls.each(function(el,index){marginTop='';if(index==lineNumber*col){col++;marginTop=-prevColHeight+'px';prevColHeight=0;}
prevColHeight+=el.getSize().y;el.setStyle(rtl?'margin-right':'margin-left',countryElWidth*(col-1)+'px');el.setStyle('margin-top',marginTop);});}});hf.AjaxCountrySelector=new Class({Extends:hf.CountrySelector,contentLoaded:false,options:{url:'worldmap.html',position:false},initialize:function(root,options){this.setOptions(options||{});this.parent(root,this.options);},show:function(){if(isIE7||isIE6||isOpera||document.documentMode==7)this.root.setStyle("position","relative");if(this.contentLoaded){this.parent();this.target.fireEvent('showContent');}else{this.requestCountrySelector();}},initCountrySelector:function(openOnComplete){this._initWorldMapContent();if(openOnComplete){this.show();}else{this.hide();}
this._updateCountriesColumns();},requestCountrySelector:function(){var req=new Request.HTML({method:'get',url:this.options.url,onRequest:function(){if(!this.contentLoaded)this.showSpooler()}.bind(this),onFailure:this.hideSpooler.bind(this),onException:this.hideSpooler.bind(this),onSuccess:this.onSuccessRequestHandler.bind(this)});var worldmapUrlInfo=$('worldmap_url_info');if(worldmapUrlInfo&&worldmapUrlInfo.getElements('input').length>0){var form_data="";worldmapUrlInfo.getElements('input').each(function(input,index){form_data+=input.getProperty('name')+'='+escape(input.getProperty('value'));if(index==0){form_data+='&'}});req.send({method:worldmapUrlInfo.getProperty('method'),data:form_data});}else{req.send();}},onSuccessRequestHandler:function(responseTree,responseElements,responseHTML){this.root.getElement('.js_worldmap_wrapper').set('html',responseHTML);this.contentLoaded=true;var func=function(){this.initCountrySelector(true);}.bind(this);this.hideSpooler();func();this.target.fireEvent('showContent');}});hf.AjaxCountrySelector.init=function(countrySelectorSelector,options){var popupManager=hf.popupManager;var opt={showDelay:100,hideDelay:200,openEvent:'click',opening:{before:{display:'block'},effect:{opacity:1}},closeEvent:'click',closing:{effect:{opacity:0},after:{display:'none'}},effect:{duration:300,transition:Fx.Transitions.Sine.easeOut,link:'cancel'}};if(isIE6)opt.opening.effect=null;opt.closing.effect=null;$$(countrySelectorSelector||".js_cselector").each(function(countrySelectorElement){popupManager.add(new hf.AjaxCountrySelector(countrySelectorElement,Object.merge(options,opt)));});};hf.JsonpCountrySelector=new Class({Extends:hf.CountrySelector,contentLoaded:false,options:{url:null,position:false,target:"country-selector",data:{contentType:"jsonp"}},initialize:function(root,options){this.setOptions(options||{});this.parent(root,options);},show:function(){if(isIE7||isIE6||isOpera||document.documentMode==7)this.root.setStyle("position","relative");if(this.contentLoaded){this.parent();this.target.fireEvent('showContent');}else{this.requestCountrySelector();}},initCountrySelector:function(openOnComplete){this._initWorldMapContent();if(openOnComplete){this.show();}else{this.hide();}
this._updateCountriesColumns();},requestCountrySelector:function(){var req=new Request.JSONP({method:'get',url:this.options.url,onRequest:function(){if(!this.contentLoaded)this.showSpooler()}.bind(this),onFailure:this.hideSpooler.bind(this),onException:this.hideSpooler.bind(this),onSuccess:this.onSuccessRequestHandler.bind(this)});req.send(this.options);},onSuccessRequestHandler:function(response){var data=response[this.options.target];if(data){data=data.replace(/<!DOCTYPE.*?>/ig,"");this.root.getElement('.js_worldmap_wrapper').set('html',data);}
this.contentLoaded=true;var func=function(){this.initCountrySelector(true);}.bind(this);this.hideSpooler();func();this.target.fireEvent('showContent');}});hf.JsonpCountrySelector.init=function(countrySelectorSelector,options){var popupManager=hf.popupManager;var opt={showDelay:100,hideDelay:200,openEvent:'click',opening:{before:{display:'block'},effect:{opacity:1}},closeEvent:'click',closing:{effect:{opacity:0},after:{display:'none'}},effect:{duration:300,transition:Fx.Transitions.Sine.easeOut,link:'cancel'}};if(isIE6)opt.opening.effect=null;opt.closing.effect=null;$$(countrySelectorSelector||".js_cselector").each(function(countrySelectorElement){popupManager.add(new hf.JsonpCountrySelector(countrySelectorElement,Object.merge(options,opt)));});};

/*
Date: 5/18/2015 10:43:51 AM
All images published
*/