/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txtversion: 0.12.0*/ if(typeof YAHOO=="undefined"){YAHOO={};}YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i-1),isSafari=(ua.indexOf('safari')>-1),isGecko=(ua.indexOf('gecko')>-1),isIE=(!isOpera&&ua.indexOf('msie')>-1);var patterns={HYPHEN:/(-[a-z])/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;}if(propertyCache[property]){return propertyCache[property];}while(patterns.HYPHEN.exec(property)){property=property.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}propertyCache[property]=property;return property;};if(window.getComputedStyle){getStyle=function(el,property){return el.style[property]||getComputedStyle(el,null)[property];};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':try{return(el.filters['DXImageTransform.Microsoft.Alpha']||el.filters['alpha']||100)/100;}catch(e){}break;default:return(el.currentStyle)?el.currentStyle[property]:el.style[property];}};}else{getStyle=function(el,property){return el.style[property];};}if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(typeof el.style.filter=='string'){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}break;default:el.style[property]=val;}};}else{setStyle=function(el,property,val){el.style[property]=val;};}YAHOO.util.Dom={get:function(el){if(!el){return null;}if(typeof el!='string'&&!(el instanceof Array)){return el;}if(typeof el=='string'){return document.getElementById(el);}else{var collection=[];for(var i=0,len=el.length;i=this.left&®ion.right<=this.right&®ion.top>=this.top&®ion.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(x instanceof Array){y=x[1];x=x[0];}this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};YAHOO.util.Point.prototype=new YAHOO.util.Region(); /* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txtversion: 0.12.0*/ YAHOO.util.CustomEvent=function(_1,_2,_3,_4){this.type=_1;this.scope=_2||window;this.silent=_3;this.signature=_4||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var _5="_YUICEOnSubscribe";if(_1!==_5){this.subscribeEvent=new YAHOO.util.CustomEvent(_5,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,_7,_8){if(this.subscribeEvent){this.subscribeEvent.fire(fn,_7,_8);}this.subscribers.push(new YAHOO.util.Subscriber(fn,_7,_8));},unsubscribe:function(fn,_9){var _10=false;for(var i=0,len=this.subscribers.length;i0){_17=_14[0];}ret=s.fn.call(_16,_17,s.obj);}else{ret=s.fn.call(_16,this.type,_14,s.obj);}if(false===ret){if(!this.silent){}return false;}}}return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i=0){_60=_23[_61];}if(!el||!_60){return false;}if(this.useLegacyEvent(el,_59)){var _62=this.getLegacyIndex(el,_59);var _63=_26[_62];if(_63){for(i=0,len=_63.length;i0);}var _76=[];for(var i=0,len=_28.length;i0){for(var i=0,len=_23.length;i0){j=_23.length;while(j){index=j-1;l=_23[index];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],index);}j=j-1;}l=null;EU.clearCache();}for(i=0,len=_25.length;i=0;i--){ _28[_29]=null; } } this._oContainer._oContent._oBody.innerHTML=""; } var _30=document.createElement("ul"); _30=this._oContainer._oContent._oBody.appendChild(_30); for(var i=0;i0){ var _56=setTimeout(function(){ _53._sendQuery(_55); },(_53.queryDelay*1000)); if(_53._nDelayID!=-1){ clearTimeout(_53._nDelayID); } _53._nDelayID=_56; }else{ _53._sendQuery(_55); } }; YAHOO.widget.AutoComplete.prototype._isIgnoreKey=function(_57){ if((_57==9)||(_57==13)||(_57==16)||(_57==17)||(_57>=18&&_57<=20)||(_57==27)||(_57>=33&&_57<=35)||(_57>=36&&_57<=38)||(_57==40)||(_57>=44&&_57<=45)){ return true; } return false; }; YAHOO.widget.AutoComplete.prototype._onTextboxFocus=function(v,_58){ _58._oTextbox.setAttribute("autocomplete","off"); _58._bFocused=true; _58.textboxFocusEvent.fire(_58); }; YAHOO.widget.AutoComplete.prototype._onTextboxBlur=function(v,_59){ if(!_59._bOverContainer||(_59._nKeyCode==9)){ if(!_59._bItemSelected){ if(!_59._bContainerOpen||(_59._bContainerOpen&&!_59._textMatchesOption())){ if(_59.forceSelection){ _59._clearSelection(); }else{ _59.unmatchedItemSelectEvent.fire(_59,_59._sCurQuery); } } } if(_59._bContainerOpen){ _59._toggleContainer(false); } _59._cancelIntervalDetection(_59); _59._bFocused=false; _59.textboxBlurEvent.fire(_59); } }; YAHOO.widget.AutoComplete.prototype._onFormSubmit=function(v,_60){ if(_60.allowBrowserAutocomplete){ _60._oTextbox.setAttribute("autocomplete","on"); }else{ _60._oTextbox.setAttribute("autocomplete","off"); } }; YAHOO.widget.AutoComplete.prototype._sendQuery=function(_61){ var _62=(this.delimChar)?this.delimChar:null; if(_62){ var _63=-1; for(var i=_62.length-1;i>=0;i--){ var _64=_61.lastIndexOf(_62[i]); if(_64>_63){ _63=_64; } } if(_62[i]==" "){ for(var j=_62.length-1;j>=0;j--){ if(_61[_63-1]==_62[j]){ _63--; break; } } } if(_63>-1){ var _66=_63+1; while(_61.charAt(_66)==" "){ _66+=1; } this._sSavedQuery=_61.substring(0,_66); _61=_61.substr(_66); }else{ if(_61.indexOf(this._sSavedQuery)<0){ this._sSavedQuery=null; } } } if(_61&&(_61.length0){ _69._initContainerHelpers(); var _74=_69._aListItems; for(var i=_73-1;i>=0;i--){ var _75=_74[i]; var _76=_68[i]; _75.innerHTML=_69.formatResult(_76,_72); _75.style.display="list-item"; _75._sResultKey=_76[0]; _75._oResultData=_76; } for(var j=_74.length-1;j>=_73;j--){ var _77=_74[j]; _77.innerHTML=null; _77.style.display="none"; _77._sResultKey=null; _77._oResultData=null; } if(_69.autoHighlight){ var _78=_74[0]; _69._toggleHighlight(_78,"to"); _69.itemArrowToEvent.fire(_69,_78); _69._typeAhead(_78,_67); }else{ _69._oCurItem=null; } _69._toggleContainer(true); }else{ _69._toggleContainer(false); } _69.dataReturnEvent.fire(_69,_67,_68); }; YAHOO.widget.AutoComplete.prototype._clearSelection=function(){ var _79=this._oTextbox.value; var _80=(this.delimChar)?this.delimChar[0]:null; var _81=(_80)?_79.lastIndexOf(_80,_79.length-2):-1; if(_81>-1){ this._oTextbox.value=_79.substring(0,_81); }else{ this._oTextbox.value=""; } this._sSavedQuery=this._oTextbox.value; this.selectionEnforceEvent.fire(this); }; YAHOO.widget.AutoComplete.prototype._textMatchesOption=function(){ var _82=false; for(var i=this._nDisplayedItems-1;i>=0;i--){ var _83=this._aListItems[i]; var _84=_83._sResultKey.toLowerCase(); if(_84==this._sCurQuery.toLowerCase()){ _82=true; break; } } return (_82); }; YAHOO.widget.AutoComplete.prototype._typeAhead=function(_85,_86){ if(!this.typeAhead){ return; } var _87=this._oTextbox; var _88=this._oTextbox.value; if(!_87.setSelectionRange&&!_87.createTextRange){ return; } var _89=_88.length; this._updateValue(_85); var _90=_87.value.length; this._selectText(_87,_89,_90); var _91=_87.value.substr(_89,_90); this.typeAheadEvent.fire(this,_86,_91); }; YAHOO.widget.AutoComplete.prototype._selectText=function(_92,_93,_94){ if(_92.setSelectionRange){ _92.setSelectionRange(_93,_94); }else{ if(_92.createTextRange){ var _95=_92.createTextRange(); _95.moveStart("character",_93); _95.moveEnd("character",_94-_92.value.length); _95.select(); }else{ _92.select(); } } }; YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers=function(_96){ var _97=false; var _98=this._oContainer._oContent.offsetWidth+"px"; var _99=this._oContainer._oContent.offsetHeight+"px"; if(this.useIFrame&&this._oContainer._oIFrame){ _97=true; if(_96){ this._oContainer._oIFrame.style.width=_98; this._oContainer._oIFrame.style.height=_99; }else{ this._oContainer._oIFrame.style.width=0; this._oContainer._oIFrame.style.height=0; } } if(this.useShadow&&this._oContainer._oShadow){ _97=true; if(_96){ this._oContainer._oShadow.style.width=_98; this._oContainer._oShadow.style.height=_99; }else{ this._oContainer._oShadow.style.width=0; this._oContainer._oShadow.style.height=0; } } }; YAHOO.widget.AutoComplete.prototype._toggleContainer=function(_100){ var _101=this._oContainer; if(this.alwaysShowContainer&&this._bContainerOpen){ return; } if(!_100){ this._oContainer._oContent.scrollTop=0; var _102=this._aListItems; if(_102&&(_102.length>0)){ for(var i=_102.length-1;i>=0;i--){ _102[i].style.display="none"; } } if(this._oCurItem){ this._toggleHighlight(this._oCurItem,"from"); } this._oCurItem=null; this._nDisplayedItems=0; this._sCurQuery=null; } if(!_100&&!this._bContainerOpen){ _101._oContent.style.display="none"; return; } var _103=this._oAnim; if(_103&&_103.getEl()&&(this.animHoriz||this.animVert)){ if(!_100){ this._toggleContainerHelpers(_100); } if(_103.isAnimated()){ _103.stop(); } var _104=_101._oContent.cloneNode(true); _101.appendChild(_104); _104.style.top="-9000px"; _104.style.display="block"; var wExp=_104.offsetWidth; var hExp=_104.offsetHeight; var _107=(this.animHoriz)?0:wExp; var _108=(this.animVert)?0:hExp; _103.attributes=(_100)?{width:{to:wExp},height:{to:hExp}}:{width:{to:_107},height:{to:_108}}; if(_100&&!this._bContainerOpen){ _101._oContent.style.width=_107+"px"; _101._oContent.style.height=_108+"px"; }else{ _101._oContent.style.width=wExp+"px"; _101._oContent.style.height=hExp+"px"; } _101.removeChild(_104); _104=null; var _109=this; var _110=function(){ _103.onComplete.unsubscribeAll(); if(_100){ _109.containerExpandEvent.fire(_109); }else{ _101._oContent.style.display="none"; _109.containerCollapseEvent.fire(_109); } _109._toggleContainerHelpers(_100); }; _101._oContent.style.display="block"; _103.onComplete.subscribe(_110); _103.animate(); this._bContainerOpen=_100; }else{ if(_100){ _101._oContent.style.display="block"; this.containerExpandEvent.fire(this); }else{ _101._oContent.style.display="none"; this.containerCollapseEvent.fire(this); } this._toggleContainerHelpers(_100); this._bContainerOpen=_100; } }; YAHOO.widget.AutoComplete.prototype._toggleHighlight=function(_111,_112){ var _113=this.highlightClassName; if(this._oCurItem){ YAHOO.util.Dom.removeClass(this._oCurItem,_113); } if((_112=="to")&&_113){ YAHOO.util.Dom.addClass(_111,_113); this._oCurItem=_111; } }; YAHOO.widget.AutoComplete.prototype._togglePrehighlight=function(_114,_115){ if(_114==this._oCurItem){ return; } var _116=this.prehighlightClassName; if((_115=="mouseover")&&_116){ YAHOO.util.Dom.addClass(_114,_116); }else{ YAHOO.util.Dom.removeClass(_114,_116); } }; YAHOO.widget.AutoComplete.prototype._updateValue=function(_117){ var _118=this._oTextbox; var _119=(this.delimChar)?(this.delimChar[0]||this.delimChar):null; var _120=this._sSavedQuery; var _121=_117._sResultKey; _118.focus(); _118.value=""; if(_119){ if(_120){ _118.value=_120; } _118.value+=_121+_119; if(_119!=" "){ _118.value+=" "; } }else{ _118.value=_121; } if(_118.type=="textarea"){ _118.scrollTop=_118.scrollHeight; } var end=_118.value.length; this._selectText(_118,end,end); this._oCurItem=_117; }; YAHOO.widget.AutoComplete.prototype._selectItem=function(_123){ this._bItemSelected=true; this._updateValue(_123); this._cancelIntervalDetection(this); this.itemSelectEvent.fire(this,_123,_123._oResultData); this._toggleContainer(false); }; YAHOO.widget.AutoComplete.prototype._jumpSelection=function(){ if(!this.typeAhead){ return; }else{ this._toggleContainer(false); } }; YAHOO.widget.AutoComplete.prototype._moveSelection=function(_124){ if(this._bContainerOpen){ var _125=this._oCurItem; var _126=-1; if(_125){ _126=_125._nItemIndex; } var _127=(_124==40)?(_126+1):(_126-1); if(_127<-2||_127>=this._nDisplayedItems){ return; } if(_125){ this._toggleHighlight(_125,"from"); this.itemArrowFromEvent.fire(this,_125); } if(_127==-1){ if(this.delimChar&&this._sSavedQuery){ if(!this._textMatchesOption()){ this._oTextbox.value=this._sSavedQuery; }else{ this._oTextbox.value=this._sSavedQuery+this._sCurQuery; } }else{ this._oTextbox.value=this._sCurQuery; } this._oCurItem=null; return; } if(_127==-2){ this._toggleContainer(false); return; } var _128=this._aListItems[_127]; var _129=this._oContainer._oContent; var _130=((YAHOO.util.Dom.getStyle(_129,"overflow")=="auto")||(YAHOO.util.Dom.getStyle(_129,"overflowY")=="auto")); if(_130&&(_127>-1)&&(_127(_129.scrollTop+_129.offsetHeight)){ _129.scrollTop=(_128.offsetTop+_128.offsetHeight)-_129.offsetHeight; }else{ if((_128.offsetTop+_128.offsetHeight)<_129.scrollTop){ _129.scrollTop=_128.offsetTop; } } }else{ if(_128.offsetTop<_129.scrollTop){ this._oContainer._oContent.scrollTop=_128.offsetTop; }else{ if(_128.offsetTop>(_129.scrollTop+_129.offsetHeight)){ this._oContainer._oContent.scrollTop=(_128.offsetTop+_128.offsetHeight)-_129.offsetHeight; } } } } this._toggleHighlight(_128,"to"); this.itemArrowToEvent.fire(this,_128); if(this.typeAhead){ this._updateValue(_128); } } }; YAHOO.widget.DataSource=function(){ }; YAHOO.widget.DataSource.prototype.ERROR_DATANULL="Response data was null"; YAHOO.widget.DataSource.prototype.ERROR_DATAPARSE="Response data could not be parsed"; YAHOO.widget.DataSource.prototype.maxCacheEntries=15; YAHOO.widget.DataSource.prototype.queryMatchContains=false; YAHOO.widget.DataSource.prototype.queryMatchSubset=false; YAHOO.widget.DataSource.prototype.queryMatchCase=false; YAHOO.widget.DataSource.prototype.getName=function(){ return this._sName; }; YAHOO.widget.DataSource.prototype.toString=function(){ return "DataSource "+this._sName; }; YAHOO.widget.DataSource.prototype.getResults=function(_131,_132,_133){ var _134=this._doQueryCache(_131,_132,_133); if(_134.length===0){ this.queryEvent.fire(this,_133,_132); this.doQuery(_131,_132,_133); } }; YAHOO.widget.DataSource.prototype.doQuery=function(_135,_136,_137){ }; YAHOO.widget.DataSource.prototype.flushCache=function(){ if(this._aCache){ this._aCache=[]; } if(this._aCacheHelper){ this._aCacheHelper=[]; } this.cacheFlushEvent.fire(this); }; YAHOO.widget.DataSource.prototype.queryEvent=null; YAHOO.widget.DataSource.prototype.cacheQueryEvent=null; YAHOO.widget.DataSource.prototype.getResultsEvent=null; YAHOO.widget.DataSource.prototype.getCachedResultsEvent=null; YAHOO.widget.DataSource.prototype.dataErrorEvent=null; YAHOO.widget.DataSource.prototype.cacheFlushEvent=null; YAHOO.widget.DataSource._nIndex=0; YAHOO.widget.DataSource.prototype._sName=null; YAHOO.widget.DataSource.prototype._aCache=null; YAHOO.widget.DataSource.prototype._init=function(){ var _138=this.maxCacheEntries; if(isNaN(_138)||(_138<0)){ _138=0; } if(_138>0&&!this._aCache){ this._aCache=[]; } this._sName="instance"+YAHOO.widget.DataSource._nIndex; YAHOO.widget.DataSource._nIndex++; this.queryEvent=new YAHOO.util.CustomEvent("query",this); this.cacheQueryEvent=new YAHOO.util.CustomEvent("cacheQuery",this); this.getResultsEvent=new YAHOO.util.CustomEvent("getResults",this); this.getCachedResultsEvent=new YAHOO.util.CustomEvent("getCachedResults",this); this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this); this.cacheFlushEvent=new YAHOO.util.CustomEvent("cacheFlush",this); }; YAHOO.widget.DataSource.prototype._addCacheElem=function(_139){ var _140=this._aCache; if(!_140||!_139||!_139.query||!_139.results){ return; } if(_140.length>=this.maxCacheEntries){ _140.shift(); } _140.push(_139); }; YAHOO.widget.DataSource.prototype._doQueryCache=function(_141,_142,_143){ var _144=[]; var _145=false; var _146=this._aCache; var _147=(_146)?_146.length:0; var _148=this.queryMatchContains; if((this.maxCacheEntries>0)&&_146&&(_147>0)){ this.cacheQueryEvent.fire(this,_143,_142); if(!this.queryMatchCase){ var _149=_142; _142=_142.toLowerCase(); } for(var i=_147-1;i>=0;i--){ var _150=_146[i]; var _151=_150.results; var _152=(!this.queryMatchCase)?encodeURIComponent(_150.query).toLowerCase():encodeURIComponent(_150.query); if(_152==_142){ _145=true; _144=_151; if(i!=_147-1){ _146.splice(i,1); this._addCacheElem(_150); } break; }else{ if(this.queryMatchSubset){ for(var j=_142.length-1;j>=0;j--){ var _153=_142.substr(0,j); if(_152==_153){ _145=true; for(var k=_151.length-1;k>=0;k--){ var _155=_151[k]; var _156=(this.queryMatchCase)?encodeURIComponent(_155[0]).indexOf(_142):encodeURIComponent(_155[0]).toLowerCase().indexOf(_142); if((!_148&&(_156===0))||(_148&&(_156>-1))){ _144.unshift(_155); } } _150={}; _150.query=_142; _150.results=_144; this._addCacheElem(_150); break; } } if(_145){ break; } } } } if(_145){ this.getCachedResultsEvent.fire(this,_143,_149,_144); _141(_149,_144,_143); } } return _144; }; YAHOO.widget.DS_XHR=function(_157,_158,_159){ if(typeof _159=="object"){ for(var _160 in _159){ this[_160]=_159[_160]; } } if(!_158||(_158.constructor!=Array)){ return; }else{ this.schema=_158; } this.scriptURI=_157; this._init(); }; YAHOO.widget.DS_XHR.prototype=new YAHOO.widget.DataSource(); YAHOO.widget.DS_XHR.prototype.TYPE_JSON=0; YAHOO.widget.DS_XHR.prototype.TYPE_XML=1; YAHOO.widget.DS_XHR.prototype.TYPE_FLAT=2; YAHOO.widget.DS_XHR.prototype.ERROR_DATAXHR="XHR response failed"; YAHOO.widget.DS_XHR.prototype.connMgr=YAHOO.util.Connect; YAHOO.widget.DS_XHR.prototype.connTimeout=0; YAHOO.widget.DS_XHR.prototype.scriptURI=null; YAHOO.widget.DS_XHR.prototype.scriptQueryParam="query"; YAHOO.widget.DS_XHR.prototype.scriptQueryAppend=""; YAHOO.widget.DS_XHR.prototype.responseType=YAHOO.widget.DS_XHR.prototype.TYPE_JSON; YAHOO.widget.DS_XHR.prototype.responseStripAfter="\n