(function(){var d=YAHOO,c=d.util,a=c.Dom,b=parseFloat(d.env.modules.yahoo.version);if(b>=2.4&&b<2.6){d.lang.augmentObject=function(j,h){if(!h||!j){throw new Error("Absorb failed, verify dependencies.")}var e=arguments,g,k,f=e[2];if(f&&f!==true){for(g=2;g<e.length;g=g+1){j[e[g]]=h[e[g]]}}else{for(k in h){if(f||!(k in j)){j[k]=h[k]}}d.lang._IEEnumFix(j,h)}}}if(d.env.ua.gecko>1.8){a._inDoc=function(f,g){var e=false;if(f&&f.tagName){g=g||f.ownerDocument;e=a.isAncestor(g.documentElement,f)}return e};a._canPosition=function(e){return(a.getStyle(e,"display")!=="none"&&a._inDoc(e))};a._getXY=function(g){var k,j,f,i,e=Math.round,h=false;if(a._canPosition(g)){f=g.getBoundingClientRect();i=g.ownerDocument;k=a.getDocumentScrollLeft(i);j=a.getDocumentScrollTop(i);h=[e(f.left),e(f.top)];if((j||k)){h[0]+=k;h[1]+=j}h[0]=e(h[0]);h[1]=e(h[1])}return h};a.getXY=function(e){return a.batch(e,a._getXY)}}})();(function(){var d=YAHOO,c=d.util,b=c.Dom,a=c.Event;if(parseFloat(d.env.modules.yahoo.version)<2.4){return}d.namespace("Search");d.Search.Configurable=function(){};d.Search.Configurable.prototype={onConfigChange:new c.CustomEvent("configChange"),getConfigValue:function(e){return this._config.hasOwnProperty(e)?this._config[e]:undefined},setConfigValue:function(f,g){var e=this.getConfigValue(f);this._config[f]=g;this.onConfigChange.fire(f,e,g)}};d.Search.Assist=function(f,e){this.TRIGGER_DEL=1;this.TRIGGER_INS=0;this._config=e||{};d.lang.augmentObject(this._config,{autoSuggest:true,ksMaxDelay:3000,ksMinDelay:400,ksMinLength:null,ksMultiplier:4,ksSuggestDelay:200,smartSuggest:true,suppressBrowserComplete:true});this._inputEl=b.get(f);this._ksCount=0;this._ksFirstStroke=null;this._ksMode=null;this._ksTimeout=null;this._originalQuery=this._inputEl.value;this._hasFocus=false;this.onTriggerSuggest=new c.CustomEvent("triggerSuggest");this._init()};d.Search.Assist.prototype={buildSearchUrl:function(n,q,h){var f=this._inputEl.form,m=[],j=[],e=h?h:f.action,l,o,g,p;for(g in q){p=q[g];j.push(encodeURIComponent(g)+"="+encodeURIComponent(p))}n=n||this.getQuery();m=b.getElementsBy(function(i){switch(i.tagName.toLowerCase()){case"input":case"select":case"textarea":return true}return false},null,f);for(l=0;l<m.length;++l){o=m[l];if(o.tagName.toLowerCase()==="input"){switch(o.type){case"button":case"image":case"reset":case"submit":continue;case"checkbox":case"radio":if(!o.checked){continue}break}}g=o.name;p=g===this._inputEl.name?n:o.value;if(p&&!q[g]){j.push(encodeURIComponent(g)+"="+encodeURIComponent(p))}}return e+"?"+j.join("&")},encodeEntities:function(e){return document.createElement("div").appendChild(document.createTextNode(e)).parentNode.innerHTML},getOriginalQuery:function(){return this._originalQuery},getQuery:function(){return this._inputEl.value},hasFocus:function(){return this._hasFocus},highlight:function(e,h){h=this.encodeEntities(d.lang.trim(h||this.getQuery()));e=this.encodeEntities(d.lang.trim(e));if(!h){return e}var f,g=h.replace(/["<>]/g,"").split(/\s+/).sort(function(j,i){return i.length-j.length});for(f=0;f<g.length;++f){e=e.replace(new RegExp('(^|\\s+|\\.|")('+this._escapeRegexp(g[f])+")(?!</strong>)","gi"),"$1<strong>$2</strong>")}return e},setQuery:function(e){this._resetKeys();this._inputEl.value=e},truncate:function(g,e,f){var h,j;g=d.lang.trim(g);if(!d.lang.isString(g)||g.length<=e||(f&&!d.lang.isString(f))){return g}f=f?f.split(/\s+/):[];for(h=0;h<f.length;++h){j=f[h];if(j.length>3){g=g.replace(new RegExp("(?:^|\\s+)"+j+"(?:\\s+)?","gi"),"...");if(g.length<=e){return g}}}return d.lang.trim(g.substr(0,e-3)).replace(/\.+$/,"")+"..."},_analyzeKeys:function(l){var i=this._config,h=null,k=l.keyCode,j=d.lang.trim(this.getQuery()),g,f;if(!i.autoSuggest||(k<46&&k!==8&&k!==32)){return}if(this._ksTimeout){clearTimeout(this._ksTimeout);this._ksTimeout=null}if(i.ksMinLength&&j.length<i.ksMinLength){return}this._ksMode=k===8||k===46?this.TRIGGER_DEL:this.TRIGGER_INS;if(i.smartSuggest){g=(new Date()).getTime();this._ksCount+=1;if(this._ksCount===1){this._ksFirstStroke=g;h=i.ksMaxDelay}else{h=Math.round((g-this._ksFirstStroke)/this._ksCount)*i.ksMultiplier}if(h>i.ksMaxDelay){h=i.ksMaxDelay}else{if(h<i.ksMinDelay){h=i.ksMinDelay}}}else{h=i.ksSuggestDelay}if(h!==null){f=this;this._ksTimeout=setTimeout(function(){f._triggerSuggest.call(f)},h)}},_configChange:function(g,f){switch(f[0]){case"autoSuggest":case"suppressBrowserComplete":this._initConfig();break}},_detachEvents:function(){a.removeListener(this._inputEl,"keyup",this._analyzeKeys);a.removeListener(this._inputEl,"focus",this._resetKeys)},_escapeRegexp:function(e){return e.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1")},_init:function(){this._initFocus();this._initConfig();this.onConfigChange.subscribe(this._configChange,this,true)},_initConfig:function(){var e=this._inputEl;this._detachEvents();if(this._config.autoSuggest){a.on(e,"keyup",this._analyzeKeys,this,true);a.on(e,"focus",this._resetKeys,this,true)}if(this._config.suppressBrowserComplete){e.setAttribute("autocomplete","off")}else{e.removeAttribute("autocomplete")}},_initFocus:function(){var e=this._inputEl;a.on(e,"focus",function(){this._hasFocus=true},this,true);a.on(e,"blur",function(){this._hasFocus=false},this,true)},_resetKeys:function(){this._ksCount=0;this._ksFirstStroke=null;this._ksMode=null;if(this._ksTimeout){clearTimeout(this._ksTimeout);this._ksTimeout=null}},_triggerSuggest:function(){this.onTriggerSuggest.fire(this._inputEl,this.getQuery(),this._ksMode)}};d.lang.augment(d.Search.Assist,d.Search.Configurable);YAHOO.register("searchassist",YAHOO.Search.Assist,{version:"2.1.0",build:"0"})})();(function(){var g=document,f=YAHOO,e=f.util,a=e.Dom,b=0,c=1;if(parseFloat(f.env.modules.yahoo.version)<2.4){return}f.Search.Assist.Tray=function(i,h,d){this._config=d||{};f.lang.augmentObject(this._config,{animEnabled:false,animDuration:0.1,classOpen:"open",heightClosed:"0",heightOpen:"7.7em",iframeShimMode:1});this._animClose=null;this._animOpen=null;this._assist=i;this._panels={};this._pixelEl=null;this._trayEl=a.get(h);this._iframeShim=null;this.onAfterClose=new e.CustomEvent("afterClose");this.onAfterOpen=new e.CustomEvent("afterOpen");this.onBeforeClose=new e.CustomEvent("beforeClose");this.onBeforeOpen=new e.CustomEvent("beforeOpen");this._init()};f.Search.Assist.Tray.prototype={close:function(){if(this.getState()===b){return}this.onBeforeClose.fire();if(this._config.animEnabled){this.stopAnim();this._animClose.animate()}else{this._close()}},getState:function(){return a.hasClass(this._trayEl,this._config.classOpen)?c:b},isAnimated:function(){return this._config.animEnabled&&(this._animOpen.isAnimated()||this._animClose.isAnimated())},isClosed:function(){return this.getState()===b},isOpen:function(){return this.getState()===c},open:function(){if(this.getState()===c){return}this.onBeforeOpen.fire();if(this._config.animEnabled){this.stopAnim();this._animOpen.animate()}else{this._open()}},setState:function(d){if(d===b){this.close()}else{if(d===c){this.open()}}},stopAnim:function(){if(!this._config.animEnabled){return false}if(this._animClose.isAnimated()){this._animClose.stop(true);return true}else{if(this._animOpen.isAnimated()){this._animOpen.stop(true);return true}}return false},toggle:function(){if(this.getState()===b){this.open();return c}else{this.close();return b}},_configChange:function(h,d){switch(d[0]){case"animDuration":case"animEnabled":case"heightClosed":case"heightOpen":this._initAnim();break;case"iframeShimMode":this._initIframeShim();break}},_getPixelHeight:function(h){if(h==0){return 0}var d,i,j;if(this._pixelEl){d=this._pixelEl;i=d.style}else{d=this._pixelEl=g.createElement("div");i=d.style;i.display="none";i.position="absolute";i.left="-9999px";this._trayEl.parentNode.appendChild(d)}i.height=h;i.display="block";j=d.offsetHeight;i.display="none";return j},_init:function(){this._initAnim();this._initIframeShim();this.onConfigChange.subscribe(this._configChange,this,true)},_initAnim:function(){var j=this._config,h=this,i,d;if(!j.animEnabled){return}if(!f.env.modules.animation){j.animEnabled=false;if(e.YUILoader){d=new e.YUILoader();d.require("animation");d.insert(function(){j.animEnabled=true;h._initAnim()})}}if(j.animEnabled){i=this._getPixelHeight(j.heightOpen);this._animClose=new e.Anim(this._trayEl,{height:{to:this._getPixelHeight(j.heightClosed)}},j.animDuration);this._animClose.onComplete.subscribe(this._close,this,true);this._animOpen=new e.Anim(this._trayEl,{height:{to:i}},j.animDuration);this._animOpen.onComplete.subscribe(this._open,this,true);yue.on(window,"resize",function(){var k=h._getPixelHeight(j.heightOpen);if(i!=k){h._animOpen.attributes.height.to=k;if(h.isOpen()){h._animOpen.animate()}i=k}})}},_initIframeShim:function(){var h=this._config,i,d;if(h.iframeShimMode===0||h.iframeShimMode===1&&(!f.env.ua.ie||f.env.ua.ie>=7)){if(this._iframeShim){this._iframeShim.parentNode.removeChild(this._iframeShim);this._iframeShim=null}return}i=g.createElement("iframe");if(window.location.href.toLowerCase().indexOf("https")===0){i.src="javascript:false;"}if(f.env.ua.ie){i.style.filter="alpha(opacity=0)";i.frameBorder=0}else{i.style.opacity="0"}i.style.position="absolute";i.style.border="none";i.style.margin="0";i.style.padding="0";i.style.display="none";i.tabIndex=-1;i.setAttribute("role","presentation");d=this._trayEl.parentNode||g.body;d.appendChild(i);this._iframeShim=i},syncIframeShim:function(){var d=this._iframeShim,h;if(d){d.style.width=this._trayEl.offsetWidth+"px";d.style.height=this._trayEl.offsetHeight+"px";h=a.getXY(this._trayEl);if(h===false){d.style.display="none"}else{a.setXY(d,[h[0],h[1]])}}},_stackIframeShim:function(){var d=this._iframeShim,h;if(d){h=a.getStyle(this._trayEl,"zIndex");if(!f.lang.isUndefined(h)&&!isNaN(h)){a.setStyle(d,"zIndex",(h-1))}}},_showIframeShim:function(){var d=this._iframeShim;if(d){d.style.display="block"}},_hideIframeShim:function(){var d=this._iframeShim;if(d){d.style.display="none"}},_open:function(){a.addClass(this._trayEl,this._config.classOpen);this._showIframeShim();this._stackIframeShim();this.syncIframeShim();this.onAfterOpen.fire()},_close:function(){a.removeClass(this._trayEl,this._config.classOpen);this._hideIframeShim();this.onAfterClose.fire()}};f.Search.Assist.Tray.STATE_CLOSED=b;f.Search.Assist.Tray.STATE_OPEN=c;f.lang.augment(f.Search.Assist.Tray,f.Search.Configurable);YAHOO.register("searchassist_tray",YAHOO.Search.Assist.Tray,{version:"2.1.0",build:"0"})})();(function(){var f=document,e=YAHOO,c=e.util,b=c.Dom,a=c.Event;if(parseFloat(e.env.modules.yahoo.version)<2.4){return}e.Search.Assist.TrayPanel=function(h,g,d){this.SCROLL_ARROW=0;this.SCROLL_BUTTON=2;this.SCROLL_WHEEL=1;this._config=d||{};e.lang.augmentObject(this._config,{animEnabled:false,animDuration:0.2,buttonDown:null,buttonLeft:null,buttonRight:null,buttonUp:null,classButtonDisabled:"disabled",classHidden:"hidden",panelBottom:null,panelLeft:null,panelRight:null,panelTop:null,scrollX:false,scrollY:false});this._animHide=null;this._animShow=null;this._assist=h._assist;this._panelEl=b.get(g);this._tray=h;this._hasFocus=false;this.onAfterHide=new c.CustomEvent("afterHide");this.onAfterShow=new c.CustomEvent("afterShow");this.onBeforeHide=new c.CustomEvent("beforeHide");this.onBeforeShow=new c.CustomEvent("beforeShow");this.onScrollDown=new c.CustomEvent("scrollDown");this.onScrollLeft=new c.CustomEvent("scrollLeft");this.onScrollRight=new c.CustomEvent("scrollRight");this.onScrollUp=new c.CustomEvent("scrollUp");this.onFocus=new c.CustomEvent("focus");this.onBlur=new c.CustomEvent("focus");this._init()};e.Search.Assist.TrayPanel.prototype={focus:function(){function d(i){switch(i.tagName.toLowerCase()){case"a":case"area":case"button":case"input":case"label":case"select":case"textarea":return true}return false}function h(k){var m=b.getChildren(k),n,l,j;for(l=0;l<m.length;++l){n=m[l];j=d(n)?n:h(n);if(j){return j}}return null}var g=h(this._panelEl);if(g&&g.focus){g.focus();return g}return null},hide:function(){if(!this.isVisible()){return}this.onBeforeHide.fire();if(this._config.animEnabled){this.stopAnim();this._animHide.animate()}else{this._hide()}},isVisible:function(){return this._tray.isOpen()&&!b.hasClass(this._panelEl,this._config.classHidden)},hasFocus:function(){return this._hasFocus},show:function(){if(this.isVisible()){return}this.onBeforeShow.fire();if(this._config.animEnabled){this.stopAnim();this._animShow.animate()}else{this._show()}},stopAnim:function(){if(!this._config.animEnabled){return false}if(this._animHide.isAnimated()){this._animHide.stop(true);return true}else{if(this._animShow.isAnimated()){this._animShow.stop(true);return true}}return false},_configChange:function(g,d){switch(d[0]){case"animEnabled":case"animDuration":case"buttonDown":case"buttonLeft":case"buttonRight":case"buttonUp":case"scrollX":case"scrollY":this._initConfig();break}},_detachEvents:function(){var g=this._config,j=["Down","Left","Right","Up"],h,d;this._tray.onBeforeClose.unsubscribe(this.hide,this);a.removeListener(this._panelEl,e.env.ua.gecko||e.env.ua.opera?"keypress":"keydown",this._keyDown);a.removeListener(this._panelEl,e.env.ua.gecko?"DOMMouseScroll":"mousewheel",this._mouseWheel);for(h=0;h<j.length;++h){d=j[h];if(g["button"+d]){a.removeListener(g["button"+d],"click",this._scrollButton)}}},_hide:function(){b.addClass(this._panelEl,this._config.classHidden);this.onAfterHide.fire()},_init:function(){this._initFocus();this._initConfig();this.onConfigChange.subscribe(this._configChange,this,true)},_initAnim:function(){var h=this._config;if(!h.animEnabled){return}if(!e.env.modules.animation){h.animEnabled=false;if(c.YUILoader){var d=new c.YUILoader(),g=this;d.require("animation");d.insert(function(){h.animEnabled=true;g._initAnim()})}}if(h.animEnabled){this._animHide=new c.Anim(this._panelEl,{opacity:{to:0}},h.animDuration,c.Easing.easeBoth);this._animHide.onComplete.subscribe(this._hide,this,true);this._animShow=new c.Anim(this._panelEl,{opacity:{to:1}},h.animDuration,c.Easing.easeBoth);this._animShow.onComplete.subscribe(this._show,this,true);this._animShow.onStart.subscribe(function(){b.setStyle(this._panelEl,"opacity",0);b.removeClass(this._panelEl,h.classHidden)},this,true)}},_initConfig:function(){var j=["Down","Left","Right","Up"],g=this._config,h,d;this._detachEvents();this._initAnim();this._tray.onBeforeClose.subscribe(this.hide,this,true);if(g.scrollX||g.scrollY){a.on(this._panelEl,e.env.ua.gecko||e.env.ua.opera?"keypress":"keydown",this._keyNav,this,true);for(h=0;h<j.length;++h){d=j[h];if(g["button"+d]){a.on(g["button"+d],"click",this._scrollButton,[this,d])}}if(g.scrollY){a.on(this._panelEl,e.env.ua.gecko?"DOMMouseScroll":"mousewheel",this._mouseWheel,this,true)}}},_initFocus:function(){var d=this;function h(){d._hasFocus=true;d.onFocus.fire()}function g(){d._hasFocus=false;d.onBlur.fire()}if(a.onFocus&&a.onBlur){a.onFocus(this._panelEl,h);a.onBlur(this._panelEl,g)}else{if(e.env.ua.ie){a.on(this._panelEl,"focusin",h,this,true);a.on(this._panelEl,"focusout",g,this,true)}else{this._panelEl.addEventListener("focus",h,true);this._panelEl.addEventListener("blur",g,true)}}},_keyNav:function(h){if(h.altKey||h.ctrlKey||h.metaKey||h.shiftKey){return}var g=this.SCROLL_ARROW,d=a.preventDefault;if(this._config.scrollX){switch(h.keyCode){case 37:case 63234:d(h);this.onScrollLeft.fire(g);return;case 39:case 63235:d(h);this.onScrollRight.fire(g);return}}if(this._config.scrollY){switch(h.keyCode){case 38:case 63232:d(h);this.onScrollUp.fire(g);return;case 40:case 63233:d(h);this.onScrollDown.fire(g);return}}},_mouseWheel:function(d){var g;if(d.wheelDelta){g=d.wheelDelta/120}else{if(d.detail){g=-d.detail/3}else{return}}a.preventDefault(d);if(g>0){this.onScrollUp.fire(this.SCROLL_WHEEL)}else{this.onScrollDown.fire(this.SCROLL_WHEEL)}},_scrollButton:function(h,g){var d=g[0];if(h.button===0){a.preventDefault(h);d["onScroll"+g[1]].fire(d.SCROLL_BUTTON)}},_show:function(){if(!this._config.animEnabled){b.removeClass(this._panelEl,this._config.classHidden)}this.onAfterShow.fire()}};e.lang.augment(e.Search.Assist.TrayPanel,e.Search.Configurable);YAHOO.register("searchassist_traypanel",YAHOO.Search.Assist.TrayPanel,{version:"2.1.0",build:"0"})})();(function(){var f=YAHOO,c=f.util,b=c.Dom,a=c.Event;if(parseFloat(f.env.modules.yahoo.version)<2.4){return}function e(i,h,g){g=g||{};f.lang.augmentObject(g,{linkParams:{},scrollY:true,timeout:5000,fetchCSS:true,url:"http://sugg-uh.us.search.yahoo.com/uhsa?p=#{q}&o=jsonp-html",click_target:null});e.superclass.constructor.call(this,i,h,g);this._inputEl=this._assist._inputEl;this._cache={};this._data={};this._hascss=false;this._lastQuery=null;this._pvid=null;this._items=[];this._selIndex=null;this._tId=null;this.onRequest=new c.CustomEvent("request");this.onResponse=new c.CustomEvent("response");this.onRefresh=new c.CustomEvent("refresh");this.onClick=new c.CustomEvent("click");this._initRichGossip()}f.lang.extend(e,f.Search.Assist.TrayPanel);var d=e.prototype;d.cancel=function(){if(this._tId){window.jsonpRichGossipFn=function(){};c.Get.abort(this._tId);this._tId=null}};d.clear=function(){for(var h=0,g=this._panelEl.childNodes.length;h<g;h++){a.purgeElement(this._panelEl.childNodes[h],true)}this._panelEl.innerHTML="";this._items=[];if(this._hasFocus){try{this._inputEl.focus()}catch(j){}}};d.focus=function(){var g;if(this._tray.isOpen()&&this.hasSuggestions()){g=this._items[this._selIndex];try{g.focus()}catch(h){}}};d.getSelectedIndex=function(){return this._selIndex};d.hasSuggestions=function(){return this._items.length>0};d.refresh=function(){var k,h,j,m,g,n;if(this._config.fetchCSS&&!this._hascss){return}this.clear();this._panelEl.innerHTML=this._data.content;this._items=b.getElementsByClassName("focusable","a",this._panelEl,function(i){i.tabIndex="-1"});if(this._config.click_target){j=this._panelEl.getElementsByTagName("a");for(k=0,h=j.length;k<h;k++){m=j[k];m.target=this._config.click_target}}g=this._panelEl.getElementsByTagName("img");for(k=0,h=g.length;k<h;k++){n=g[k];n.style.visibility="hidden";a.on(n,"load",this._handleImageLoadEvent,this,true);n.src=n.getAttribute("u");n.removeAttribute("u")}this.onRefresh.fire()};d.request=function(m){var j=this,i=this._cache,l,h,g;if(!m){m=this._assist.getQuery()}if(!m||m.length>255){this.clear();return false}if(i[m]){this._data=i[m];this.onResponse.fire(m,i[m]);return true}l=this._config.url.replace("#{q}",encodeURIComponent(m));if(this._pvid){l+="&pvid="+this._pvid}for(h in this._config.linkParams){g=this._config.linkParams[h];l+="&"+encodeURIComponent(h)+"="+encodeURIComponent(g)}if(this._config.fetchCSS&&!this._hascss){l+="&css=1"}if(this._tId){c.Get.abort(this._tId);this._tId=null}this._lastQuery=m;window.jsonpRichGossipFn=function(o){var k,n;j._cache[o.query]=o;j._pvid=o.csrcpvid;if(o.css){j._hascss=true;k=document.getElementsByTagName("head")[0];n=document.createElement("style");n.setAttribute("type","text/css");n.styleSheet?n.styleSheet.cssText=o.css:n.appendChild(document.createTextNode(o.css));k.appendChild(n)}if(o.query===j._lastQuery){j._data=o;j.onResponse.fire(m,o)}};this._tId=c.Get.script(l,{scope:this,onSuccess:function(k){k.purge();if(k.tId===this._tId){this._tId=null}},onFailure:function(k){k.purge();if(k.tId===this._tId){this._tId=null}},timeout:this._config.timeout}).tId;this.onRequest.fire(m,l);return true};d.setSelectedIndex=function(g){var h;if(g<0||g>=this._items.length){return false}if(this._selIndex!==null){h=this._items[this._selIndex];h.tabIndex=-1}this._selIndex=g;if(this._selIndex===null){return false}h=this._items[this._selIndex];h.tabIndex=0;if(this._hasFocus){try{h.focus()}catch(i){}}return true};d._initRichGossip=function(){a.on(this._panelEl,"click",this._listClick,this,true);this.onResponse.subscribe(this._handleResponse,this,true);this.onScrollDown.subscribe(this._scrollDown,this,true);this.onScrollUp.subscribe(this._scrollUp,this,true)};d._listClick=function(i){var h,g,j;if(i.ctrlKey||i.metaKey||i.shiftKey){return}h=a.getTarget(i);if(!h||this.onClick.subscribers.length===0){return}if(h.tagName.toLowerCase()!=="a"){if(!(h=b.getAncestorByTagName(h,"a"))){return}}a.preventDefault(i);j=h.innerText||h.textContent||"";g=b.hasClass(h.parentNode,this._config.classItemSpAYT);this.onClick.fire(h,j,h.href,g)};d._handleResponse=function(){this.refresh()};d._scrollDown=function(h,g){if(g[0]===this.SCROLL_ARROW){this.setSelectedIndex(this._selIndex!==null?this._selIndex+1:1)}};d._scrollUp=function(h,g){if(g[0]===this.SCROLL_ARROW){if(this._selIndex===0){try{this._inputEl.focus()}catch(h){}}else{this.setSelectedIndex(this._selIndex!==null?this._selIndex-1:0)}}};d._handleImageLoadEvent=function(i,h){var g=a.getTarget(i);(function(){var j=g.width,k=g.height;if(j>0&&k>0){if(j>=k){if(j>64){g.width=64}}else{if(k>64){g.height=64}}g.style.visibility="visible"}else{setTimeout(arguments.callee,50)}})()};f.Search.Assist.RichGossip=e;YAHOO.register("searchassist_richgossip",YAHOO.Search.Assist.RichGossip,{version:"2.1.0",build:"0"})})();(function(){var f=YAHOO,d=f.namespace("Search"),e=f.util,b=e.Dom,a=e.Event,g=null;if(parseFloat(f.env.modules.yahoo.version)<2.4){return}function c(j,h,i){this._config=i||{};this._inputEl=b.get(j);this._trayEl=b.get(h);this._ariaLiveRegion=null;if(!this._inputEl||this._inputEl.tagName.toUpperCase()!=="INPUT"||this._inputEl.type!=="text"){throw new Error("Missing or invalid argument")}if(!this._trayEl){this._trayEl=document.createElement("div");document.body.appendChild(this._trayEl);if(!("auto_positioning" in this._config)){this._config.auto_positioning=true}}f.lang.augmentObject(this._config,{TRAY_CLASSNAME:"",ARIA_LIVE_REGION_CLASSNAME:"aria-live-region",aria_available_suggestions:"Search suggestions are available, use the up and down arrow keys to review them.",aria_no_available_suggestions:"No suggestion is available.",auto_positioning:false});this._init()}c.prototype={assist:null,tray:null,_createAriaLiveRegion:function(){var h=this._ariaLiveRegion=document.createElement("div");h.setAttribute("role","status");h.setAttribute("aria-live","polite");h.className=this._config.ARIA_LIVE_REGION_CLASSNAME;this._trayEl.appendChild(h);return h},_initDomElements:function(){var h=this._trayEl,i=this._config;b.addClass(h,i.TRAY_CLASSNAME);if(f.env.ua.ie){b.addClass(h,"ie"+f.env.ua.ie);if(document.compatMode==="BackCompat"){b.addClass(h,"quirksmode")}}if(i.auto_positioning){if(h.parentNode!==document.body){h.parentNode.removeChild(h);document.body.appendChild(h)}h.style.position="absolute"}this._ariaLiveRegion=b.getElementsByClassName(i.ARIA_LIVE_REGION_CLASSNAME,"div",h)[0]||this._createAriaLiveRegion()},_createComponents:function(){this.assist=new d.Assist(this._inputEl,{ksSuggestDelay:0,smartSuggest:false});this.tray=new d.Assist.Tray(this.assist,this._trayEl)},_attachEvents:function(){this.tray.onAfterOpen.subscribe(this._handleAfterTrayOpen,this,true);a.on(document,"mousedown",this._handleMouseDown,this,true);if(this._config.auto_positioning){a.on(window,"resize",this._handleWindowResize,this,true)}},_init:function(){this._initDomElements();this._createComponents();this._attachEvents()},_updateAriaLiveRegion:function(i){var h=this._ariaLiveRegion,j;while(h.firstChild){h.removeChild(h.firstChild)}j=document.createElement("p");j.innerHTML=i;h.appendChild(j)},_updateTrayPosition:function(){var l,h,k,i,j;this._trayEl.style.display="none";l=b.getXY(this._inputEl);this._trayEl.style.display="";if(l!==false){h=l[0];k=l[1]+this._inputEl.offsetHeight;b.setXY(this._trayEl,[h,k])}i=this._inputEl.offsetWidth;this._trayEl.style.width=i+"px";j=this._trayEl.offsetWidth-i;this._trayEl.style.width=(i-j)+"px";this.tray.syncIframeShim()},_handleWindowResize:function(){var h=this;if(g){clearTimeout(g)}g=setTimeout(function(){h._updateTrayPosition();g=null},100)},_handleAfterTrayOpen:function(){this._updateTrayPosition()},_handleMouseDown:function(i){var h;if(this.tray.getState()===d.Assist.Tray.STATE_OPEN){h=a.getTarget(i);if(h!=this._inputEl&&!b.isAncestor(this._trayEl,h)){this.tray.close();this.assist._resetKeys()}}}};f.lang.augment(c,d.Configurable);d.BaseAssist=c;f.register("baseassist",d.BaseAssist,{version:"2.1.0",build:"0"})}());(function(){var f=YAHOO,d=f.namespace("Search"),e=f.util,b=e.Dom,a=e.Event,g;if(parseFloat(f.env.modules.yahoo.version)<2.4){return}function c(j,h,i){i=i||{};f.lang.augmentObject(i,{TRAY_CLASSNAME:"richassist"});g.constructor.call(this,j,h,i)}f.lang.extend(c,d.BaseAssist,{richgossip:null,_createComponents:function(){var j,k,h,l={};g._createComponents.call(this);h=this._inputEl.form.getElementsByTagName("input");for(j=0;j<h.length;++j){k=h[j];switch(k.name){case"fr":l[k.name]=k.value;break}}this.richgossip=new d.Assist.RichGossip(this.tray,this._trayEl,{linkParams:l})},_attachEvents:function(){g._attachEvents.call(this);this.tray.onBeforeOpen.subscribe(this._handleBeforeTrayOpen,this,true);this.tray.onBeforeClose.subscribe(this._handleBeforeTrayClose,this,true);this.assist.onTriggerSuggest.subscribe(this._handleRichGossipRequest,this,true);this.richgossip.onRefresh.subscribe(this._handleRichGossipRefresh,this,true);a.on(this._inputEl,f.env.ua.gecko||f.env.ua.opera?"keypress":"keydown",this._handleInputKeyNav,this,true);a.on(this._trayEl,f.env.ua.gecko||f.env.ua.opera?"keypress":"keydown",this._handleTrayKeyNav,this,true);a.on(this._inputEl.form,"submit",this._handleSearchFormSubmit,this,true)},_handleBeforeTrayOpen:function(h){this.richgossip.show()},_handleAfterTrayOpen:function(h){g._handleAfterTrayOpen.call(this);this.richgossip.setSelectedIndex(0)},_handleBeforeTrayClose:function(h){this.richgossip.setSelectedIndex(null)},_handleInputKeyNav:function(h){if(h.altKey||h.ctrlKey||h.metaKey||h.shiftKey){return}switch(h.keyCode){case 27:if(this.tray.isOpen()){this.tray.close()}break;case 40:case 63233:if(this.tray.isOpen()){if(this.richgossip.hasSuggestions()){this.richgossip.setSelectedIndex(0);this.richgossip.focus()}}else{if(this.richgossip.hasSuggestions()&&f.lang.trim(this._inputEl.value).length>0){this.tray.open()}}break;default:return}a.preventDefault(h)},_handleTrayKeyNav:function(h){if(h.altKey||h.ctrlKey||h.metaKey||h.shiftKey){return}if(h.keyCode===27){this.richgossip.setSelectedIndex(null);this._inputEl.focus()}},_handleRichGossipRequest:function(i,h){if(h[1].length>0){this.richgossip.request(h[1])}else{if(h[1].length===0&&this.tray.isOpen()){this.tray.close()}}},_handleRichGossipRefresh:function(j,h){var i;if(this.richgossip.hasSuggestions()&&(this.assist.hasFocus()||this.richgossip.hasFocus())){i=this._config.aria_available_suggestions;this.tray.open()}else{i=this._config.aria_no_available_suggestions;this.tray.close()}this._updateAriaLiveRegion(i);this.tray.syncIframeShim()},_handleSearchFormSubmit:function(j){var i=this._inputEl.form,h;if(this.richgossip._pvid){h=document.createElement("input");h.type="hidden";h.name="pvid";h.value=this.richgossip._pvid;i.appendChild(h)}}});g=c.superclass;d.RichAssist=c;YAHOO.register("richassist",d.RichAssist,{version:"2.1.0",build:"0"})}());
