/* ? 2005 Yahoo! Inc. All rights reserved. */YAHOO.namespace('YAHOO.Travel');if(YAHOO.lang.isUndefined(YAHOO.Travel.events)){YAHOO.Travel.events={};}if(YAHOO.lang.isUndefined(YAHOO.Travel.crumbs)){YAHOO.Travel.crumbs={};}if(YAHOO.lang.isUndefined(YAHOO.Travel.images)){YAHOO.Travel.images={};}
/* ? 2005 Yahoo! Inc. All rights reserved. */function yg_popup(u,n,w,h,k){var a=[],o=null,r=arguments;a[0]="width="+w+",height="+h;a[1]=",scrollbars="+((k&1)?1:0);a[2]=",resizable="+((k&2)?1:0);a[3]=",toolbar="+((k&4)?1:0);a[4]=",status="+((k&8)?1:0);a[5]=",location="+((k&16)?1:0);a[6]=",menubar="+((k&32)?1:0);if(r.length>=6){a[7]=(document.layers)?",screenX="+r[5]:",left="+r[5]}if(r.length>=7){a[8]=(document.layers)?",screenY="+r[6]:",top="+r[6]}a=a.join("");o=open(u,n,a);if(o){o.focus();}return o;}function ovt_click(el,popup){if(typeof(el.nodeName) =='undefined'){return false;}var url='';if(el.nodeName=='A'){url=el.getAttribute('href',2);}else{var children=el.getElementsByTagName('A');if(typeof(children[0]) =='null'){return false;}el=children[0];url=el.getAttribute('href',2);}if(url==''){return false;}if(popup==1||popup==null){yg_popup(url,'WebSearch',750,500,63);return true;}else{location.href=url;return true;}}function startshow(url,name,w,h){window.name='slideshowparent';var remote=window.open(url,name,'width='+w+',height='+h+', resizable=yes,scrollbars=no ');if(remote)remote.focus();}function isAlien(a){return isObject(a) &&typeof a.constructor!='function';}function isArray(a){return isObject(a) &&a.constructor==Array;}function isBoolean(a){return typeof a=='boolean';}function isEmpty(o){var i,v;if(isObject(o)){for(i in o){v=o[i];if(isUndefined(v) &&isFunction(v)){return false;}}}return true;}function isFunction(a){return typeof a=='function';}function isNull(a){return typeof a=='object'&&!a;}function isNumber(a){return typeof a=='number'&&isFinite(a);}function isObject(a){return(a&&typeof a=='object') ||isFunction(a);}function isString(a){return typeof a=='string';}function isUndefined(a){return typeof a=='undefined';}function gebi(id){return document.getElementById(id);}function clog(txt){if(!document.all){if(window.console){console.log(txt);}}}
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.txt */
YAHOO.widget.AutoComplete=function(inputEl,containerEl,oDataSource,oConfigs){if(inputEl&&containerEl&&oDataSource){if(oDataSource&&(oDataSource instanceof YAHOO.widget.DataSource)){this.dataSource=oDataSource;}
else{return;}
if(YAHOO.util.Dom.inDocument(inputEl)){if(typeof inputEl=="string"){this._sName="instance"+YAHOO.widget.AutoComplete._nIndex+" "+inputEl;this._oTextbox=document.getElementById(inputEl);}
else{this._sName=(inputEl.id)?"instance"+YAHOO.widget.AutoComplete._nIndex+" "+inputEl.id:"instance"+YAHOO.widget.AutoComplete._nIndex;this._oTextbox=inputEl;}}
else{return;}
if(YAHOO.util.Dom.inDocument(containerEl)){if(typeof containerEl=="string"){this._oContainer=document.getElementById(containerEl);}
else{this._oContainer=containerEl;}
if(this._oContainer.style.display=="none"){}}
else{return;}
if(typeof oConfigs=="object"){for(var sConfig in oConfigs){if(sConfig){this[sConfig]=oConfigs[sConfig];}}}
this._initContainer();this._initProps();this._initList();this._initContainerHelpers();var oSelf=this;var oTextbox=this._oTextbox;var oContent=this._oContainer._oContent;YAHOO.util.Event.addListener(oTextbox,"keyup",oSelf._onTextboxKeyUp,oSelf);YAHOO.util.Event.addListener(oTextbox,"keydown",oSelf._onTextboxKeyDown,oSelf);YAHOO.util.Event.addListener(oTextbox,"keypress",oSelf._onTextboxKeyPress,oSelf);YAHOO.util.Event.addListener(oTextbox,"focus",oSelf._onTextboxFocus,oSelf);YAHOO.util.Event.addListener(oTextbox,"blur",oSelf._onTextboxBlur,oSelf);YAHOO.util.Event.addListener(oContent,"mouseover",oSelf._onContainerMouseover,oSelf);YAHOO.util.Event.addListener(oContent,"mouseout",oSelf._onContainerMouseout,oSelf);YAHOO.util.Event.addListener(oContent,"scroll",oSelf._onContainerScroll,oSelf);YAHOO.util.Event.addListener(oContent,"resize",oSelf._onContainerResize,oSelf);if(oTextbox.form){YAHOO.util.Event.addListener(oTextbox.form,"submit",oSelf._onFormSubmit,oSelf);}
this.textboxFocusEvent=new YAHOO.util.CustomEvent("textboxFocus",this);this.textboxKeyEvent=new YAHOO.util.CustomEvent("textboxKey",this);this.dataRequestEvent=new YAHOO.util.CustomEvent("dataRequest",this);this.dataReturnEvent=new YAHOO.util.CustomEvent("dataReturn",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.containerExpandEvent=new YAHOO.util.CustomEvent("containerExpand",this);this.typeAheadEvent=new YAHOO.util.CustomEvent("typeAhead",this);this.itemMouseOverEvent=new YAHOO.util.CustomEvent("itemMouseOver",this);this.itemMouseOutEvent=new YAHOO.util.CustomEvent("itemMouseOut",this);this.itemArrowToEvent=new YAHOO.util.CustomEvent("itemArrowTo",this);this.itemArrowFromEvent=new YAHOO.util.CustomEvent("itemArrowFrom",this);this.itemSelectEvent=new YAHOO.util.CustomEvent("itemSelect",this);this.unmatchedItemSelectEvent=new YAHOO.util.CustomEvent("unmatchedItemSelect",this);this.selectionEnforceEvent=new YAHOO.util.CustomEvent("selectionEnforce",this);this.containerCollapseEvent=new YAHOO.util.CustomEvent("containerCollapse",this);this.textboxBlurEvent=new YAHOO.util.CustomEvent("textboxBlur",this);oTextbox.setAttribute("autocomplete","off");YAHOO.widget.AutoComplete._nIndex++;}
else{}};YAHOO.widget.AutoComplete.prototype.dataSource=null;YAHOO.widget.AutoComplete.prototype.minQueryLength=1;YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed=10;YAHOO.widget.AutoComplete.prototype.queryDelay=0.5;YAHOO.widget.AutoComplete.prototype.highlightClassName="yui-ac-highlight";YAHOO.widget.AutoComplete.prototype.prehighlightClassName=null;YAHOO.widget.AutoComplete.prototype.delimChar=null;YAHOO.widget.AutoComplete.prototype.autoHighlight=true;YAHOO.widget.AutoComplete.prototype.typeAhead=false;YAHOO.widget.AutoComplete.prototype.animHoriz=false;YAHOO.widget.AutoComplete.prototype.animVert=true;YAHOO.widget.AutoComplete.prototype.animSpeed=0.3;YAHOO.widget.AutoComplete.prototype.forceSelection=false;YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete=true;YAHOO.widget.AutoComplete.prototype.alwaysShowContainer=false;YAHOO.widget.AutoComplete.prototype.useIFrame=false;YAHOO.widget.AutoComplete.prototype.useShadow=false;YAHOO.widget.AutoComplete.prototype.toString=function(){return"AutoComplete "+this._sName;};YAHOO.widget.AutoComplete.prototype.getListItems=function(){return this._aListItems;};YAHOO.widget.AutoComplete.prototype.getListItemData=function(oListItem){if(oListItem._oResultData){return oListItem._oResultData;}
else{return false;}};YAHOO.widget.AutoComplete.prototype.setHeader=function(sHeader){if(sHeader){if(this._oContainer._oContent._oHeader){this._oContainer._oContent._oHeader.innerHTML=sHeader;this._oContainer._oContent._oHeader.style.display="block";}}
else{this._oContainer._oContent._oHeader.innerHTML="";this._oContainer._oContent._oHeader.style.display="none";}};YAHOO.widget.AutoComplete.prototype.setFooter=function(sFooter){if(sFooter){if(this._oContainer._oContent._oFooter){this._oContainer._oContent._oFooter.innerHTML=sFooter;this._oContainer._oContent._oFooter.style.display="block";}}
else{this._oContainer._oContent._oFooter.innerHTML="";this._oContainer._oContent._oFooter.style.display="none";}};YAHOO.widget.AutoComplete.prototype.setBody=function(sBody){if(sBody){if(this._oContainer._oContent._oBody){this._oContainer._oContent._oBody.innerHTML=sBody;this._oContainer._oContent._oBody.style.display="block";this._oContainer._oContent.style.display="block";}}
else{this._oContainer._oContent._oBody.innerHTML="";this._oContainer._oContent.style.display="none";}
this._maxResultsDisplayed=0;};YAHOO.widget.AutoComplete.prototype.formatResult=function(oResultItem,sQuery){var sResult=oResultItem[0];if(sResult){return sResult;}
else{return"";}};YAHOO.widget.AutoComplete.prototype.sendQuery=function(sQuery){if(sQuery){this._sendQuery(sQuery);}
else{return;}};YAHOO.widget.AutoComplete.prototype.textboxFocusEvent=null;YAHOO.widget.AutoComplete.prototype.textboxKeyEvent=null;YAHOO.widget.AutoComplete.prototype.dataRequestEvent=null;YAHOO.widget.AutoComplete.prototype.dataReturnEvent=null;YAHOO.widget.AutoComplete.prototype.dataErrorEvent=null;YAHOO.widget.AutoComplete.prototype.containerExpandEvent=null;YAHOO.widget.AutoComplete.prototype.typeAheadEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowToEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent=null;YAHOO.widget.AutoComplete.prototype.itemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent=null;YAHOO.widget.AutoComplete.prototype.containerCollapseEvent=null;YAHOO.widget.AutoComplete.prototype.textboxBlurEvent=null;YAHOO.widget.AutoComplete._nIndex=0;YAHOO.widget.AutoComplete.prototype._sName=null;YAHOO.widget.AutoComplete.prototype._oTextbox=null;YAHOO.widget.AutoComplete.prototype._bFocused=true;YAHOO.widget.AutoComplete.prototype._oAnim=null;YAHOO.widget.AutoComplete.prototype._oContainer=null;YAHOO.widget.AutoComplete.prototype._bContainerOpen=false;YAHOO.widget.AutoComplete.prototype._bOverContainer=false;YAHOO.widget.AutoComplete.prototype._aListItems=null;YAHOO.widget.AutoComplete.prototype._nDisplayedItems=0;YAHOO.widget.AutoComplete.prototype._maxResultsDisplayed=0;YAHOO.widget.AutoComplete.prototype._sCurQuery=null;YAHOO.widget.AutoComplete.prototype._sSavedQuery=null;YAHOO.widget.AutoComplete.prototype._oCurItem=null;YAHOO.widget.AutoComplete.prototype._bItemSelected=false;YAHOO.widget.AutoComplete.prototype._nKeyCode=null;YAHOO.widget.AutoComplete.prototype._nDelayID=-1;YAHOO.widget.AutoComplete.prototype._iFrameSrc="javascript:false;";YAHOO.widget.AutoComplete.prototype._initProps=function(){var minQueryLength=this.minQueryLength;if(isNaN(minQueryLength)||(minQueryLength<1)){minQueryLength=1;}
var maxResultsDisplayed=this.maxResultsDisplayed;if(isNaN(this.maxResultsDisplayed)||(this.maxResultsDisplayed<1)){this.maxResultsDisplayed=10;}
var queryDelay=this.queryDelay;if(isNaN(this.queryDelay)||(this.queryDelay<0)){this.queryDelay=0.5;}
var aDelimChar=(this.delimChar)?this.delimChar:null;if(aDelimChar){if(typeof aDelimChar=="string"){this.delimChar=[aDelimChar];}
else if(aDelimChar.constructor!=Array){this.delimChar=null;}}
var animSpeed=this.animSpeed;if((this.animHoriz||this.animVert)&&YAHOO.util.Anim){if(isNaN(animSpeed)||(animSpeed<0)){animSpeed=0.3;}
if(!this._oAnim){oAnim=new YAHOO.util.Anim(this._oContainer._oContent,{},this.animSpeed);this._oAnim=oAnim;}
else{this._oAnim.duration=animSpeed;}}
if(this.forceSelection&&this.delimChar){}
if(this.alwaysShowContainer&&(this.useShadow||this.useIFrame)){}
if(this.alwaysShowContainer){this._bContainerOpen=true;}};YAHOO.widget.AutoComplete.prototype._initContainerHelpers=function(){if(this.useShadow&&!this._oContainer._oShadow){var oShadow=document.createElement("div");oShadow.className="yui-ac-shadow";this._oContainer._oShadow=this._oContainer.appendChild(oShadow);}
if(this.useIFrame&&!this._oContainer._oIFrame){var oIFrame=document.createElement("iframe");oIFrame.src=this._iFrameSrc;oIFrame.frameBorder=0;oIFrame.scrolling="no";oIFrame.style.position="absolute";oIFrame.style.width="100%";oIFrame.style.height="100%";this._oContainer._oIFrame=this._oContainer.appendChild(oIFrame);}};YAHOO.widget.AutoComplete.prototype._initContainer=function(){if(!this._oContainer._oContent){var oContent=document.createElement("div");oContent.className="yui-ac-content";oContent.style.display="none";this._oContainer._oContent=this._oContainer.appendChild(oContent);var oHeader=document.createElement("div");oHeader.className="yui-ac-hd";oHeader.style.display="none";this._oContainer._oContent._oHeader=this._oContainer._oContent.appendChild(oHeader);var oBody=document.createElement("div");oBody.className="yui-ac-bd";this._oContainer._oContent._oBody=this._oContainer._oContent.appendChild(oBody);var oFooter=document.createElement("div");oFooter.className="yui-ac-ft";oFooter.style.display="none";this._oContainer._oContent._oFooter=this._oContainer._oContent.appendChild(oFooter);}
else{}};YAHOO.widget.AutoComplete.prototype._initList=function(){this._aListItems=[];while(this._oContainer._oContent._oBody.hasChildNodes()){var oldListItems=this.getListItems();if(oldListItems){for(var oldi=oldListItems.length-1;oldi>=0;i--){oldListItems[oldi]=null;}}
this._oContainer._oContent._oBody.innerHTML="";}
var oList=document.createElement("ul");oList=this._oContainer._oContent._oBody.appendChild(oList);for(var i=0;i<this.maxResultsDisplayed;i++){var oItem=document.createElement("li");oItem=oList.appendChild(oItem);this._aListItems[i]=oItem;this._initListItem(oItem,i);}
this._maxResultsDisplayed=this.maxResultsDisplayed;};YAHOO.widget.AutoComplete.prototype._initListItem=function(oItem,nItemIndex){var oSelf=this;oItem.style.display="none";oItem._nItemIndex=nItemIndex;oItem.mouseover=oItem.mouseout=oItem.onclick=null;YAHOO.util.Event.addListener(oItem,"mouseover",oSelf._onItemMouseover,oSelf);YAHOO.util.Event.addListener(oItem,"mouseout",oSelf._onItemMouseout,oSelf);YAHOO.util.Event.addListener(oItem,"click",oSelf._onItemMouseclick,oSelf);};YAHOO.widget.AutoComplete.prototype._onItemMouseover=function(v,oSelf){if(oSelf.prehighlightClassName){oSelf._togglePrehighlight(this,"mouseover");}
else{oSelf._toggleHighlight(this,"to");}
oSelf.itemMouseOverEvent.fire(oSelf,this);};YAHOO.widget.AutoComplete.prototype._onItemMouseout=function(v,oSelf){if(oSelf.prehighlightClassName){oSelf._togglePrehighlight(this,"mouseout");}
else{oSelf._toggleHighlight(this,"from");}
oSelf.itemMouseOutEvent.fire(oSelf,this);};YAHOO.widget.AutoComplete.prototype._onItemMouseclick=function(v,oSelf){oSelf._toggleHighlight(this,"to");oSelf._selectItem(this);};YAHOO.widget.AutoComplete.prototype._onContainerMouseover=function(v,oSelf){oSelf._bOverContainer=true;};YAHOO.widget.AutoComplete.prototype._onContainerMouseout=function(v,oSelf){oSelf._bOverContainer=false;if(oSelf._oCurItem){oSelf._toggleHighlight(oSelf._oCurItem,"to");}};YAHOO.widget.AutoComplete.prototype._onContainerScroll=function(v,oSelf){oSelf._oTextbox.focus();};YAHOO.widget.AutoComplete.prototype._onContainerResize=function(v,oSelf){oSelf._toggleContainerHelpers(oSelf._bContainerOpen);};YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown=function(v,oSelf){var nKeyCode=v.keyCode;switch(nKeyCode){case 9:if(oSelf.delimChar&&(oSelf._nKeyCode!=nKeyCode)){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}
if(oSelf._oCurItem){oSelf._selectItem(oSelf._oCurItem);}
else{oSelf._clearList();}
break;case 13:if(oSelf._nKeyCode!=nKeyCode){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}
if(oSelf._oCurItem){oSelf._selectItem(oSelf._oCurItem);}
else{oSelf._clearList();}
break;case 27:oSelf._clearList();return;case 39:oSelf._jumpSelection();break;case 38:YAHOO.util.Event.stopEvent(v);oSelf._moveSelection(nKeyCode);break;case 40:YAHOO.util.Event.stopEvent(v);oSelf._moveSelection(nKeyCode);break;default:break;}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress=function(v,oSelf){var nKeyCode=v.keyCode;switch(nKeyCode){case 9:case 13:if((oSelf._nKeyCode!=nKeyCode)){YAHOO.util.Event.stopEvent(v);}
break;case 38:case 40:YAHOO.util.Event.stopEvent(v);break;default:break;}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp=function(v,oSelf){oSelf._initProps();var nKeyCode=v.keyCode;oSelf._nKeyCode=nKeyCode;var sChar=String.fromCharCode(nKeyCode);var sText=this.value;if(oSelf._isIgnoreKey(nKeyCode)||(sText.toLowerCase()==oSelf._sCurQuery)){return;}
else{oSelf.textboxKeyEvent.fire(oSelf,nKeyCode);}
if(oSelf.queryDelay>0){var nDelayID=setTimeout(function(){oSelf._sendQuery(sText);},(oSelf.queryDelay*1000));if(oSelf._nDelayID!=-1){clearTimeout(oSelf._nDelayID);}
oSelf._nDelayID=nDelayID;}
else{oSelf._sendQuery(sText);}};YAHOO.widget.AutoComplete.prototype._isIgnoreKey=function(nKeyCode){if((nKeyCode==9)||(nKeyCode==13)||(nKeyCode==16)||(nKeyCode==17)||(nKeyCode>=18&&nKeyCode<=20)||(nKeyCode==27)||(nKeyCode>=33&&nKeyCode<=35)||(nKeyCode>=36&&nKeyCode<=38)||(nKeyCode==40)||(nKeyCode>=44&&nKeyCode<=45)){return true;}
return false;};YAHOO.widget.AutoComplete.prototype._onTextboxFocus=function(v,oSelf){oSelf._oTextbox.setAttribute("autocomplete","off");oSelf._bFocused=true;oSelf.textboxFocusEvent.fire(oSelf);};YAHOO.widget.AutoComplete.prototype._onTextboxBlur=function(v,oSelf){if(!oSelf._bOverContainer||(oSelf._nKeyCode==9)){if(!oSelf._bItemSelected){if(!oSelf._bContainerOpen||(oSelf._bContainerOpen&&!oSelf._textMatchesOption())){if(oSelf.forceSelection){oSelf._clearSelection();}
else{oSelf.unmatchedItemSelectEvent.fire(oSelf,oSelf._sCurQuery);}}}
if(oSelf._bContainerOpen){oSelf._clearList();}
oSelf._bFocused=false;oSelf.textboxBlurEvent.fire(oSelf);}};YAHOO.widget.AutoComplete.prototype._onFormSubmit=function(v,oSelf){if(oSelf.allowBrowserAutocomplete){oSelf._oTextbox.setAttribute("autocomplete","on");}
else{oSelf._oTextbox.setAttribute("autocomplete","off");}};YAHOO.widget.AutoComplete.prototype._sendQuery=function(sQuery){var aDelimChar=(this.delimChar)?this.delimChar:null;if(aDelimChar){var nDelimIndex=-1;for(var i=aDelimChar.length-1;i>=0;i--){var nNewIndex=sQuery.lastIndexOf(aDelimChar[i]);if(nNewIndex>nDelimIndex){nDelimIndex=nNewIndex;}}
if(aDelimChar[i]==" "){for(var j=aDelimChar.length-1;j>=0;j--){if(sQuery[nDelimIndex-1]==aDelimChar[j]){nDelimIndex--;break;}}}
if(nDelimIndex>-1){var nQueryStart=nDelimIndex+1;while(sQuery.charAt(nQueryStart)==" "){nQueryStart+=1;}
this._sSavedQuery=sQuery.substring(0,nQueryStart);sQuery=sQuery.substr(nQueryStart);}
else if(sQuery.indexOf(this._sSavedQuery)<0){this._sSavedQuery=null;}}
if(sQuery.length<this.minQueryLength){if(this._nDelayID!=-1){clearTimeout(this._nDelayID);}
this._clearList();return;}
sQuery=encodeURIComponent(sQuery);this._nDelayID=-1;this.dataRequestEvent.fire(this,sQuery);this.dataSource.getResults(this._populateList,sQuery,this);};YAHOO.widget.AutoComplete.prototype._clearList=function(){this._oContainer._oContent.scrollTop=0;var aItems=this._aListItems;if(aItems&&(aItems.length>0)){for(var i=aItems.length-1;i>=0;i--){aItems[i].style.display="none";}}
if(this._oCurItem){this._toggleHighlight(this._oCurItem,"from");}
this._oCurItem=null;this._nDisplayedItems=0;this._sCurQuery=null;this._toggleContainer(false);};YAHOO.widget.AutoComplete.prototype._populateList=function(sQuery,aResults,oSelf){if(aResults===null){oSelf.dataErrorEvent.fire(oSelf,sQuery);}
if(!oSelf._bFocused||!aResults){return;}
var isOpera=(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);var contentStyle=oSelf._oContainer._oContent.style;contentStyle.width=(!isOpera)?null:"";contentStyle.height=(!isOpera)?null:"";var sCurQuery=decodeURIComponent(sQuery);oSelf._sCurQuery=sCurQuery;oSelf._bItemSelected=false;if(oSelf._maxResultsDisplayed!=oSelf.maxResultsDisplayed){oSelf._initList();}
var nItems=Math.min(aResults.length,oSelf.maxResultsDisplayed);oSelf._nDisplayedItems=nItems;if(nItems>0){oSelf._initContainerHelpers();var aItems=oSelf._aListItems;for(var i=nItems-1;i>=0;i--){var oItemi=aItems[i];var oResultItemi=aResults[i];oItemi.innerHTML=oSelf.formatResult(oResultItemi,sCurQuery);oItemi.style.display="list-item";oItemi._sResultKey=oResultItemi[0];oItemi._oResultData=oResultItemi;}
for(var j=aItems.length-1;j>=nItems;j--){var oItemj=aItems[j];oItemj.innerHTML=null;oItemj.style.display="none";oItemj._sResultKey=null;oItemj._oResultData=null;}
if(oSelf.autoHighlight){var oFirstItem=aItems[0];oSelf._toggleHighlight(oFirstItem,"to");oSelf.itemArrowToEvent.fire(oSelf,oFirstItem);oSelf._typeAhead(oFirstItem,sQuery);}
else{oSelf._oCurItem=null;}
oSelf._toggleContainer(true);}
else{oSelf._clearList();}
oSelf.dataReturnEvent.fire(oSelf,sQuery,aResults);};YAHOO.widget.AutoComplete.prototype._clearSelection=function(){var sValue=this._oTextbox.value;var sChar=(this.delimChar)?this.delimChar[0]:null;var nIndex=(sChar)?sValue.lastIndexOf(sChar,sValue.length-2):-1;if(nIndex>-1){this._oTextbox.value=sValue.substring(0,nIndex);}
else{this._oTextbox.value="";}
this._sSavedQuery=this._oTextbox.value;this.selectionEnforceEvent.fire(this);};YAHOO.widget.AutoComplete.prototype._textMatchesOption=function(){var foundMatch=false;for(var i=this._nDisplayedItems-1;i>=0;i--){var oItem=this._aListItems[i];var sMatch=oItem._sResultKey.toLowerCase();if(sMatch==this._sCurQuery.toLowerCase()){foundMatch=true;break;}}
return(foundMatch);};YAHOO.widget.AutoComplete.prototype._typeAhead=function(oItem,sQuery){if(!this.typeAhead){return;}
var oTextbox=this._oTextbox;var sValue=this._oTextbox.value;if(!oTextbox.setSelectionRange&&!oTextbox.createTextRange){return;}
var nStart=sValue.length;this._updateValue(oItem);var nEnd=oTextbox.value.length;this._selectText(oTextbox,nStart,nEnd);var sPrefill=oTextbox.value.substr(nStart,nEnd);this.typeAheadEvent.fire(this,sQuery,sPrefill);};YAHOO.widget.AutoComplete.prototype._selectText=function(oTextbox,nStart,nEnd){if(oTextbox.setSelectionRange){oTextbox.setSelectionRange(nStart,nEnd);}
else if(oTextbox.createTextRange){var oTextRange=oTextbox.createTextRange();oTextRange.moveStart("character",nStart);oTextRange.moveEnd("character",nEnd-oTextbox.value.length);oTextRange.select();}
else{oTextbox.select();}};YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers=function(bShow){var bFireEvent=false;var width=this._oContainer._oContent.offsetWidth+"px";var height=this._oContainer._oContent.offsetHeight+"px";if(this.useIFrame&&this._oContainer._oIFrame){bFireEvent=true;if(this.alwaysShowContainer||bShow){this._oContainer._oIFrame.style.width=width;this._oContainer._oIFrame.style.height=height;}
else{this._oContainer._oIFrame.style.width=0;this._oContainer._oIFrame.style.height=0;}}
if(this.useShadow&&this._oContainer._oShadow){bFireEvent=true;if(this.alwaysShowContainer||bShow){this._oContainer._oShadow.style.width=width;this._oContainer._oShadow.style.height=height;}
else{this._oContainer._oShadow.style.width=0;this._oContainer._oShadow.style.height=0;}}};YAHOO.widget.AutoComplete.prototype._toggleContainer=function(bShow){if(this.alwaysShowContainer){if(bShow){this.containerExpandEvent.fire(this);}
else{this.containerCollapseEvent.fire(this);}
this._bContainerOpen=bShow;return;}
var oContainer=this._oContainer;if(!bShow&&!this._bContainerOpen){oContainer._oContent.style.display="none";return;}
var oAnim=this._oAnim;if(oAnim&&oAnim.getEl()&&(this.animHoriz||this.animVert)){if(!bShow){this._toggleContainerHelpers(bShow);}
if(oAnim.isAnimated()){oAnim.stop();}
var oClone=oContainer._oContent.cloneNode(true);oContainer.appendChild(oClone);oClone.style.top="-9000px";oClone.style.display="block";var wExp=oClone.offsetWidth;var hExp=oClone.offsetHeight;var wColl=(this.animHoriz)?0:wExp;var hColl=(this.animVert)?0:hExp;oAnim.attributes=(bShow)?{width:{to:wExp},height:{to:hExp}}:{width:{to:wColl},height:{to:hColl}};if(bShow&&!this._bContainerOpen){oContainer._oContent.style.width=wColl+"px";oContainer._oContent.style.height=hColl+"px";}
else{oContainer._oContent.style.width=wExp+"px";oContainer._oContent.style.height=hExp+"px";}
oContainer.removeChild(oClone);oClone=null;var oSelf=this;var onAnimComplete=function(){oAnim.onComplete.unsubscribeAll();if(bShow){oSelf.containerExpandEvent.fire(oSelf);}
else{oContainer._oContent.style.display="none";oSelf.containerCollapseEvent.fire(oSelf);}
oSelf._toggleContainerHelpers(bShow);};oContainer._oContent.style.display="block";oAnim.onComplete.subscribe(onAnimComplete);oAnim.animate();this._bContainerOpen=bShow;}
else{if(bShow){oContainer._oContent.style.display="block";this.containerExpandEvent.fire(this);}
else{oContainer._oContent.style.display="none";this.containerCollapseEvent.fire(this);}
this._toggleContainerHelpers(bShow);this._bContainerOpen=bShow;}};YAHOO.widget.AutoComplete.prototype._toggleHighlight=function(oNewItem,sType){var sHighlight=this.highlightClassName;if(this._oCurItem){YAHOO.util.Dom.removeClass(this._oCurItem,sHighlight);}
if((sType=="to")&&sHighlight){YAHOO.util.Dom.addClass(oNewItem,sHighlight);this._oCurItem=oNewItem;}};YAHOO.widget.AutoComplete.prototype._togglePrehighlight=function(oNewItem,sType){if(oNewItem==this._oCurItem){return;}
var sPrehighlight=this.prehighlightClassName;if((sType=="mouseover")&&sPrehighlight){YAHOO.util.Dom.addClass(oNewItem,sPrehighlight);}
else{YAHOO.util.Dom.removeClass(oNewItem,sPrehighlight);}};YAHOO.widget.AutoComplete.prototype._updateValue=function(oItem){var oTextbox=this._oTextbox;var sDelimChar=(this.delimChar)?this.delimChar[0]:null;var sSavedQuery=this._sSavedQuery;var sResultKey=oItem._sResultKey;oTextbox.focus();oTextbox.value="";if(sDelimChar){if(sSavedQuery){oTextbox.value=sSavedQuery;}
oTextbox.value+=sResultKey+sDelimChar;if(sDelimChar!=" "){oTextbox.value+=" ";}}
else{oTextbox.value=sResultKey;}
if(oTextbox.type=="textarea"){oTextbox.scrollTop=oTextbox.scrollHeight;}
var end=oTextbox.value.length;this._selectText(oTextbox,end,end);this._oCurItem=oItem;};YAHOO.widget.AutoComplete.prototype._selectItem=function(oItem){this._bItemSelected=true;this._updateValue(oItem);this.itemSelectEvent.fire(this,oItem,oItem._oResultData);this._clearList();};YAHOO.widget.AutoComplete.prototype._jumpSelection=function(){if(!this.typeAhead){return;}
else{this._clearList();}};YAHOO.widget.AutoComplete.prototype._moveSelection=function(nKeyCode){if(this._bContainerOpen){var oCurItem=this._oCurItem;var nCurItemIndex=-1;if(oCurItem){nCurItemIndex=oCurItem._nItemIndex;}
var nNewItemIndex=(nKeyCode==40)?(nCurItemIndex+1):(nCurItemIndex-1);if(nNewItemIndex<-2||nNewItemIndex>=this._nDisplayedItems){return;}
if(oCurItem){this._toggleHighlight(oCurItem,"from");this.itemArrowFromEvent.fire(this,oCurItem);}
if(nNewItemIndex==-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(nNewItemIndex==-2){this._clearList();return;}
var oNewItem=this._aListItems[nNewItemIndex];var oContent=this._oContainer._oContent;var scrollOn=((YAHOO.util.Dom.getStyle(oContent,"overflow")=="auto")||(YAHOO.util.Dom.getStyle(oContent,"overflowY")=="auto"));if(scrollOn&&(nNewItemIndex>-1)&&(nNewItemIndex<this._nDisplayedItems)){if(nKeyCode==40){if((oNewItem.offsetTop+oNewItem.offsetHeight)>(oContent.scrollTop+oContent.offsetHeight)){oContent.scrollTop=(oNewItem.offsetTop+oNewItem.offsetHeight)-oContent.offsetHeight;}
else if((oNewItem.offsetTop+oNewItem.offsetHeight)<oContent.scrollTop){oContent.scrollTop=oNewItem.offsetTop;}}
else{if(oNewItem.offsetTop<oContent.scrollTop){this._oContainer._oContent.scrollTop=oNewItem.offsetTop;}
else if(oNewItem.offsetTop>(oContent.scrollTop+oContent.offsetHeight)){this._oContainer._oContent.scrollTop=(oNewItem.offsetTop+oNewItem.offsetHeight)-oContent.offsetHeight;}}}
this._toggleHighlight(oNewItem,"to");this.itemArrowToEvent.fire(this,oNewItem);if(this.typeAhead){this._updateValue(oNewItem);}}};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(oCallbackFn,sQuery,oParent){var aResults=this._doQueryCache(oCallbackFn,sQuery,oParent);if(aResults.length===0){this.queryEvent.fire(this,oParent,sQuery);this.doQuery(oCallbackFn,sQuery,oParent);}};YAHOO.widget.DataSource.prototype.doQuery=function(oCallbackFn,sQuery,oParent){};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 maxCacheEntries=this.maxCacheEntries;if(isNaN(maxCacheEntries)||(maxCacheEntries<0)){maxCacheEntries=0;}
if(maxCacheEntries>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(resultObj){var aCache=this._aCache;if(!aCache||!resultObj||!resultObj.query||!resultObj.results){return;}
if(aCache.length>=this.maxCacheEntries){aCache.shift();}
aCache.push(resultObj);};YAHOO.widget.DataSource.prototype._doQueryCache=function(oCallbackFn,sQuery,oParent){var aResults=[];var bMatchFound=false;var aCache=this._aCache;var nCacheLength=(aCache)?aCache.length:0;var bMatchContains=this.queryMatchContains;if((this.maxCacheEntries>0)&&aCache&&(nCacheLength>0)){this.cacheQueryEvent.fire(this,oParent,sQuery);if(!this.queryMatchCase){var sOrigQuery=sQuery;sQuery=sQuery.toLowerCase();}
for(var i=nCacheLength-1;i>=0;i--){var resultObj=aCache[i];var aAllResultItems=resultObj.results;var matchKey=(!this.queryMatchCase)?encodeURIComponent(resultObj.query.toLowerCase()):encodeURIComponent(resultObj.query);if(matchKey==sQuery){bMatchFound=true;aResults=aAllResultItems;if(i!=nCacheLength-1){aCache.splice(i,1);this._addCacheElem(resultObj);}
break;}
else if(this.queryMatchSubset){for(var j=sQuery.length-1;j>=0;j--){var subQuery=sQuery.substr(0,j);if(matchKey==subQuery){bMatchFound=true;for(var k=aAllResultItems.length-1;k>=0;k--){var aRecord=aAllResultItems[k];var sKeyIndex=(this.queryMatchCase)?encodeURIComponent(aRecord[0]).indexOf(sQuery):encodeURIComponent(aRecord[0]).toLowerCase().indexOf(sQuery);if((!bMatchContains&&(sKeyIndex===0))||(bMatchContains&&(sKeyIndex>-1))){aResults.unshift(aRecord);}}
resultObj={};resultObj.query=sQuery;resultObj.results=aResults;this._addCacheElem(resultObj);break;}}
if(bMatchFound){break;}}}
if(bMatchFound){this.getCachedResultsEvent.fire(this,oParent,sOrigQuery,aResults);oCallbackFn(sOrigQuery,aResults,oParent);}}
return aResults;};YAHOO.widget.DS_XHR=function(sScriptURI,aSchema,oConfigs){if(typeof oConfigs=="object"){for(var sConfig in oConfigs){this[sConfig]=oConfigs[sConfig];}}
if(!aSchema||(aSchema.constructor!=Array)){return;}
else{this.schema=aSchema;}
this.scriptURI=sScriptURI;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.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<!--";YAHOO.widget.DS_XHR.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var isXML=(this.responseType==this.TYPE_XML);var sUri=this.scriptURI+"?"+this.scriptQueryParam+"="+sQuery;if(this.scriptQueryAppend.length>0){sUri+="&"+this.scriptQueryAppend;}
var oResponse=null;var oSelf=this;var responseSuccess=function(oResp){if(!oSelf._oConn||(oResp.tId!=oSelf._oConn.tId)){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,oSelf.ERROR_DATANULL);return;}
for(var foo in oResp){}
if(!isXML){oResp=oResp.responseText;}
else{oResp=oResp.responseXML;}
if(oResp===null){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,oSelf.ERROR_DATANULL);return;}
var aResults=oSelf.parseResponse(sQuery,oResp,oParent);var resultObj={};resultObj.query=decodeURIComponent(sQuery);resultObj.results=aResults;if(aResults===null){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,oSelf.ERROR_DATAPARSE);return;}
else{oSelf.getResultsEvent.fire(oSelf,oParent,sQuery,aResults);oSelf._addCacheElem(resultObj);oCallbackFn(sQuery,aResults,oParent);}};var responseFailure=function(oResp){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,oSelf.ERROR_DATAXHR);return;};var oCallback={success:responseSuccess,failure:responseFailure};if(!isNaN(this.connTimeout)&&this.connTimeout>0){oCallback.timeout=this.connTimeout;}
if(this._oConn){YAHOO.util.Connect.abort(this._oConn);}
oSelf._oConn=YAHOO.util.Connect.asyncRequest("GET",sUri,oCallback,null);};YAHOO.widget.DS_XHR.prototype.parseResponse=function(sQuery,oResponse,oParent){var aSchema=this.schema;var aResults=[];var bError=false;var nEnd=((this.responseStripAfter!=="")&&(oResponse.indexOf))?oResponse.indexOf(this.responseStripAfter):-1;if(nEnd!=-1){oResponse=oResponse.substring(0,nEnd);}
switch(this.responseType){case this.TYPE_JSON:var jsonList;if(window.JSON&&(navigator.userAgent.toLowerCase().indexOf('khtml')==-1)){var jsonObjParsed=JSON.parse(oResponse);if(!jsonObjParsed){bError=true;break;}
else{jsonList=eval("jsonObjParsed."+aSchema[0]);}}
else{try{while(oResponse.substring(0,1)==" "){oResponse=oResponse.substring(1,oResponse.length);}
if(oResponse.indexOf("{")<0){bError=true;break;}
if(oResponse.indexOf("{}")===0){break;}
var jsonObjRaw=eval("("+oResponse+")");if(!jsonObjRaw){bError=true;break;}
jsonList=eval("(jsonObjRaw."+aSchema[0]+")");}
catch(e){bError=true;break;}}
if(!jsonList){bError=true;break;}
if(jsonList.constructor!=Array){jsonList=[jsonList];}
for(var i=jsonList.length-1;i>=0;i--){var aResultItem=[];var jsonResult=jsonList[i];for(var j=aSchema.length-1;j>=1;j--){var dataFieldValue=jsonResult[aSchema[j]];if(!dataFieldValue){dataFieldValue="";}
aResultItem.unshift(dataFieldValue);}
aResults.unshift(aResultItem);}
break;case this.TYPE_XML:var xmlList=oResponse.getElementsByTagName(aSchema[0]);if(!xmlList){bError=true;break;}
for(var k=xmlList.length-1;k>=0;k--){var result=xmlList.item(k);var aFieldSet=[];for(var m=aSchema.length-1;m>=1;m--){var sValue=null;var xmlAttr=result.attributes.getNamedItem(aSchema[m]);if(xmlAttr){sValue=xmlAttr.value;}
else{var xmlNode=result.getElementsByTagName(aSchema[m]);if(xmlNode&&xmlNode.item(0)&&xmlNode.item(0).firstChild){sValue=xmlNode.item(0).firstChild.nodeValue;}
else{sValue="";}}
aFieldSet.unshift(sValue);}
aResults.unshift(aFieldSet);}
break;case this.TYPE_FLAT:if(oResponse.length>0){var newLength=oResponse.length-aSchema[0].length;if(oResponse.substr(newLength)==aSchema[0]){oResponse=oResponse.substr(0,newLength);}
var aRecords=oResponse.split(aSchema[0]);for(var n=aRecords.length-1;n>=0;n--){aResults[n]=aRecords[n].split(aSchema[1]);}}
break;default:break;}
sQuery=null;oResponse=null;oParent=null;if(bError){return null;}
else{return aResults;}};YAHOO.widget.DS_XHR.prototype._oConn=null;YAHOO.widget.DS_JSFunction=function(oFunction,oConfigs){if(typeof oConfigs=="object"){for(var sConfig in oConfigs){this[sConfig]=oConfigs[sConfig];}}
if(!oFunction||(oFunction.constructor!=Function)){return;}
else{this.dataFunction=oFunction;this._init();}};YAHOO.widget.DS_JSFunction.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_JSFunction.prototype.dataFunction=null;YAHOO.widget.DS_JSFunction.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var oFunction=this.dataFunction;var aResults=[];aResults=oFunction(sQuery);if(aResults===null){this.dataErrorEvent.fire(this,oParent,sQuery,this.ERROR_DATANULL);return;}
var resultObj={};resultObj.query=decodeURIComponent(sQuery);resultObj.results=aResults;this._addCacheElem(resultObj);this.getResultsEvent.fire(this,oParent,sQuery,aResults);oCallbackFn(sQuery,aResults,oParent);return;};YAHOO.widget.DS_JSArray=function(aData,oConfigs){if(typeof oConfigs=="object"){for(var sConfig in oConfigs){this[sConfig]=oConfigs[sConfig];}}
if(!aData||(aData.constructor!=Array)){return;}
else{this.data=aData;this._init();}};YAHOO.widget.DS_JSArray.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_JSArray.prototype.data=null;YAHOO.widget.DS_JSArray.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var aData=this.data;var aResults=[];var bMatchFound=false;var bMatchContains=this.queryMatchContains;if(!this.queryMatchCase){sQuery=sQuery.toLowerCase();}
for(var i=aData.length-1;i>=0;i--){var aDataset=[];if(aData[i]){if(aData[i].constructor==String){aDataset[0]=aData[i];}
else if(aData[i].constructor==Array){aDataset=aData[i];}}
if(aDataset[0]&&(aDataset[0].constructor==String)){var sKeyIndex=(this.queryMatchCase)?encodeURIComponent(aDataset[0]).indexOf(sQuery):encodeURIComponent(aDataset[0]).toLowerCase().indexOf(sQuery);if((!bMatchContains&&(sKeyIndex===0))||(bMatchContains&&(sKeyIndex>-1))){aResults.unshift(aDataset);}}}
this.getResultsEvent.fire(this,oParent,sQuery,aResults);oCallbackFn(sQuery,aResults,oParent);};

/* ? 2005 Yahoo! Inc. All rights reserved. */YAHOO.util.Event.addListener(window,"load",trv_auto_sug_onload);function trvchkQuery(form,inputid,warnMsg){var oInput=document.getElementById(inputid);if(!oInput){return false;}oInput.value=oInput.value.replace(/^\s+|\s+$/,'');if(oInput.value==""){if(!self.oldTxtBoxColor){oldTxtBoxColor=oInput.style.color;}oInput.style.color="red";oInput.value=warnMsg;oInput.blur();return false;}else if(oInput.value==warnMsg){return false;}else{return true;}}function trvclrQuery(form,inputid,warnMsg){var oInput=document.getElementById(inputid);if(!oInput){return;}if(self.oldTxtBoxColor){oInput.style.color=oldTxtBoxColor;}else{oInput.style.color="black";}var inputidHidden=inputid+'SugId';var oSugId=document.getElementById(inputidHidden);if(oSugId){oSugId.value=0;}if(oInput.value==warnMsg){oInput.value="";}}function trv_auto_sug_onload(){if(!self.atcInputArray)return;if(self.oACDS)return;var rScript="/bin/search/vespa_autocomplete_service.php";oACDS=new YAHOO.widget.DS_XHR(rScript,["result","title","searchgroup","oid","state","city","country","popularity","statecode","countrycode"]);oACDS.responseType=oACDS.TYPE_XML;oACDS.queryMatchContains=true;oACDS.responseStripAfter="<!-"+"-";var imgRoot="http://us.js2.yimg.com/us.js.yimg.com/static/i/travel/trvatc/";for(var i in atcInputArray){initial_atc_obj(i,atcInputArray[i][0],atcInputArray[i][1],atcInputArray[i][2],atcInputArray[i][3]);}}function initial_atc_obj(inputID,containerID,cat,spaceid,myWarnMsg){if(!document.getElementById(inputID))return;if(!document.getElementById(containerID))return;var agent=navigator.userAgent.toLowerCase();if(agent.indexOf("opera")>-1||agent.indexOf("safari")>-1){return;}if(!self.myAutoComp0){myAutoComp0=new Array();}if(!myAutoComp0[inputID]){myAutoComp0[inputID]=new YAHOO.widget.AutoComplete(inputID,containerID,oACDS);}var myAutoComp=myAutoComp0[inputID];myAutoComp.myWarnMsg=myWarnMsg;myAutoComp.scriptQueryAppend=cat;myAutoComp.animVert=false;myAutoComp.animHoriz=false;myAutoComp.animSpeed=0.5;myAutoComp.maxResultsDisplayed=10;myAutoComp.minQueryLength=3;myAutoComp.queryDelay=0.3;myAutoComp.autoHighlight=false;myAutoComp.useShadow=true;myAutoComp.useIFrame=true;myAutoComp.forceSelection=false;myAutoComp.typeAhead=false;myAutoComp.allowBrowserAutocomplete=false;myAutoComp.alwaysShowContainer=false;myAutoComp.myUpdValuefunc1=myAutoComp._updateValue;myAutoComp._updateValue=function(oItem){this.myUpdValuefunc1(oItem);var oHiddenObjID=this._oTextbox.id+'SugId';var oHiddenObj=document.getElementById(oHiddenObjID);if(oItem){oHiddenObj.value=oItem._sResultOid;}};myAutoComp.myPopList=myAutoComp._populateList;myAutoComp._populateList=function(sQuery,aResults,oSelf){oSelf.myPopList(sQuery,aResults,oSelf);if(!oSelf._bFocused||!aResults){return;}var nItems=Math.min(aResults.length,oSelf.maxResultsDisplayed);if(nItems>0){var aItems=oSelf._aListItems;for(var i=nItems-1;i>=0;i--){var oItemi=aItems[i];var oResultItemi=aResults[i];if(oResultItemi[2]){oItemi._sResultOid=oResultItemi[2]+'*'+i+'*'+oResultItemi[1];}else{oItemi._sResultOid=null;}}for(var j=aItems.length-1;j>=nItems;j--){var oItemj=aItems[j];oItemj._sResultOid=null;}}};myAutoComp.myOnTextboxFocus=function(sType,aArgs){oACDS.scriptQueryAppend=this.scriptQueryAppend;trvclrQuery(this._oTextbox.form,inputID,myAutoComp.myWarnMsg);};myAutoComp.onformsubmit=myAutoComp._oTextbox.form.onsubmit;myAutoComp._oTextbox.form.onsubmit=function(){if(myAutoComp.onformsubmit&&!myAutoComp.onformsubmit())return false;return trvchkQuery(this,inputID,myAutoComp.myWarnMsg);};myAutoComp.textboxFocusEvent.subscribe(myAutoComp.myOnTextboxFocus);if(cat=='cat=all'){myAutoComp.formatResult=get_my_formatresult_ref();myAutoComp.itemSelectEvent.subscribe(yt_ac_submit_form,myAutoComp._oTextbox.form);YAHOO.util.Event.addListener(myAutoComp._oTextbox,"keyup",ytsEnterKeyHandler,myAutoComp);}}function ytsEnterKeyHandler(v,oSelf){oACDS.scriptQueryAppend=oSelf.scriptQueryAppend;if(oSelf._nKeyCode==13&&!oSelf._bItemSelected){if(oSelf._oTextbox.form.onsubmit()){oSelf._oTextbox.form.submit();}}}function get_searchgroup_icon(searchgroup){var imgname="destination";switch(searchgroup){case'hoteldetail':imgname="hotel";break;case'destination':imgname="hotel";break;case'desthotellist':imgname="hotel";break;case'dining':imgname="restaurant";break;case'nightlife':imgname="entertainment";break;case'shopping':imgname="shopping";break;case'sightseeing':imgname="poi";break;case'parks':imgname="poi";break;case'ski':imgname="ski-resort";break;case'cardir':imgname="poi";break;case'hoteldir':imgname="hotel";break;}return imgname;}function CountWords(w){w=w.replace(/[^\w]+/g,' ');w=w.replace(/^\s+|\s+$/,'');var a=w.split(' ');return a.length;}function get_my_formatresult_ref(){return(function(oResultItem,sQuery){var sTitle=oResultItem[0];var sGroup=oResultItem[1];var sOid=oResultItem[2];var sState=oResultItem[3];var sCity=oResultItem[4];var sCountry=oResultItem[5];var sPop=oResultItem[6];var sUrl=get_searchgroup_icon(sGroup);if(sGroup!='destination'&&sGroup!='desthotellist'){var sLowTitle=sTitle.toLowerCase();if(sLowTitle.indexOf(sCity.toLowerCase()) ==-1&&CountWords(sLowTitle)<4){sTitle+=', '+sCity;}}var sMarkup="<span class='yui-ac-trvimg ac-cat-"+sUrl+" '></span>"+sTitle;sTitle=decodeURI(encodeURI(sTitle));sTitle=sTitle.replace(/&amp;/gi,"&");sTitle=sTitle.replace(/&gt;/gi,">");sTitle=sTitle.replace(/&lt;/gi,"<");oResultItem[0]=sTitle;return(sMarkup);});}function yt_ac_submit_form(type,args,formObj){formObj.submit();}
/* ? 2005 Yahoo! Inc. All rights reserved. */function common_send_to_server(url,mode,payload){if(url.indexOf('?') ==-1){url+="?js=1";}else{url+='&js=1';}return common_send_to_server_xml(url,mode,payload);}YAHOO.Travel.common_xmlhttp=null;function common_send_to_server_xml(url,mode,payload){if(YAHOO.Travel.common_xmlhttp){if(YAHOO.util.Connect.isCallInProgress(YAHOO.Travel.common_xmlhttp)){YAHOO.util.Connect.abort(YAHOO.Travel.common_xmlhttp);}}var callback={success:common_onrequeststate};if(mode=='POST'){YAHOO.Travel.common_xmlhttp=YAHOO.util.Connect.asyncRequest('POST',url,callback,payload);}else{YAHOO.Travel.oommon_xmlhttp=YAHOO.util.Connect.asyncRequest('POST',url,callback,null);}return true;}function common_onrequeststate(common_xmlhttp){if(common_xmlhttp.status==200){var debug_node=document.getElementById('debug_node');var root=common_xmlhttp.responseXML.getElementsByTagName('Document')[0];if(!root){alert("There was a problem retrieving data, please try again later.");return;}var command=root.childNodes[0];if(command){eval(common_get_node_text(command));}}else{alert("There was a problem retrieving data:\n"+common_xmlhttp.status+common_xmlhttp.statusText);}}function common_get_node_text(node){var children=node.childNodes;var text=[];var length=children.length;for(var i=0;i<length;i++)text.push(children[i].nodeValue);return text.join('');}
/* ? 2005 Yahoo! Inc. All rights reserved. */YAHOO.namespace('YAHOO.Travel');YAHOO.Travel.getCatIconClass=function(cat,color,bakcolor,include_miprefix){var classname,prefix;var miprefix='ytmiCatIcon';var posprefix='ytmiCatPos_';if(!vespaTypes[cat]){cat=vespaToSmartMap[cat];}if(color&&color!==''&&bakcolor&&bakcolor!==''){if(!(color==='white'||color==='blue'||color==='orange')){return false;}if((color==='blue'||color==='orange') &&bakcolor!=='white'){return false;}if(color==='white'&&!(bakcolor=='orange'||bakcolor=='green'||bakcolor=='blue')){return false;}if(include_miprefix){prefix=miprefix+' '+posprefix;}else{prefix=posprefix;}classname=prefix+cat+'_'+color+'_'+bakcolor;return classname;}};var vespaTypes={hotels:'lodging-tgl',thingstodo:'sightseeing',restaurants:'dining',entertainment:'nightlife',nightlife:'nightlife',skiresorts:'skiresort',shopping:'shopping',airport:'airport',city:'city'};var vespaToSmartMap={lodging:'hotels','lodging-tgl':'hotels',sightseeing:'thingstodo',attraction:'thingstodo',dining:'restaurants',shopping:'shopping',nightlife:'entertainment',skiresort:'skiresorts',airport:'airport',city:'city'};
/* ? 2005 Yahoo! Inc. All rights reserved. */function ytrv_myTravelModule(){this.moduleSections=new Array();this.openSection=null;this.closeSection=ytrv_mtm_closeSection;}function ytrv_mtm_closeSection(secToOpen){if(secToOpen==this.openSection)return;this.openSection.executeClose(secToOpen);this.openSection=secToOpen;}function ytrv_myTravelModuleSection(){this.bodyHtml=null;this.bodyHtmlId=null;this.secHeadAndMiddleHtml=null;this.secHeadAndMiddleHtmlId=null;this.isOpen=false;this.sectionHeight='174';this.nextSecToOpen=null;this.headerArrowId=null;this.openOnclick=null;this.closeOnclick=null;this.openCloseLinkId=null;this.openCloseHeaderId=null;this.needAttAnim=false;this.enableLinkId=null;this.enableLinkHtml=null;this.disableLinkHtml=null;this.disabledBodyHtml=null;this.ajaxIdName=null;this.registerOpen=false;this.openCloseAnimSpeed=.5;this.parent=ytrv_mtm_module;this.attComponent=null;this.open=ytrv_mtm_openSection;this.executeClose=ytrv_mtm_secExecuteClose;this.collapseAnim=ytrv_mtm_secCollapseAnim;this.expandAnim=ytrv_mtm_secExpandAnim;this.quickFadeAnim=ytrv_mtm_quickFadeAnim;this.fadeInAnim=ytrv_mtm_fadeInAnim;this.enableOnOff=ytrv_mtm_enableOnOff;}function ytrv_mtm_openSection(){this.registerOpen=true;return this.parent.closeSection(this);}function ytrv_mtm_secExecuteClose(secToOpen){this.isOpen=false;this.nextSecToOpen=secToOpen;var myAnim=new YAHOO.util.Anim(this.bodyHtmlId);myAnim.attributes.opacity={to:0};myAnim.duration=.5;myAnim.onComplete.subscribe(this.collapseAnim,this);myAnim.animate();}function ytrv_mtm_secCollapseAnim(type,args,thisObj){var bodyDiv=document.getElementById(thisObj.bodyHtmlId);ytrv_mtm_purge(bodyDiv,false,true);myAnim=new YAHOO.util.Anim(thisObj.bodyHtmlId);myAnim.attributes.height={to:0};myAnim.duration=thisObj.openCloseAnimSpeed;if(thisObj.nextSecToOpen){myAnim.onComplete.subscribe(thisObj.nextSecToOpen.expandAnim,thisObj.nextSecToOpen);thisObj.nextSecToOpen=null;}myAnim.animate();if(thisObj.headerArrowId){var arrowEl=document.getElementById(thisObj.headerArrowId);arrowEl.style.backgroundPosition='-148px -810px';}if(thisObj.openCloseLinkId){var ocEl=document.getElementById(thisObj.openCloseLinkId);ocEl.innerHTML='open';}if(thisObj.openCloseHeaderId){var ocTitleEl=document.getElementById(thisObj.openCloseHeaderId);ocTitleEl.onclick=new Function(thisObj.closeOnclick);}}function ytrv_mtm_secExpandAnim(type,args,thisObj){this.isOpen=true;var bodyEl=document.getElementById(thisObj.bodyHtmlId);YAHOO.util.Dom.setStyle(bodyEl,'opacity','0.01');myAnim=new YAHOO.util.Anim(thisObj.bodyHtmlId);myAnim.attributes.height={to:thisObj.sectionHeight};myAnim.duration=thisObj.openCloseAnimSpeed;myAnim.onComplete.subscribe(thisObj.quickFadeAnim,thisObj);myAnim.animate();}function ytrv_mtm_quickFadeAnim(type,args,thisObj){myAnim=new YAHOO.util.Anim(thisObj.bodyHtmlId);myAnim.attributes.opacity={to:0};myAnim.duration=0.01;myAnim.onComplete.subscribe(thisObj.fadeInAnim,thisObj);myAnim.animate();}function ytrv_mtm_fadeInAnim(type,args,thisObj){var bodyEl=document.getElementById(thisObj.bodyHtmlId);myAnim=new YAHOO.util.Anim(thisObj.bodyHtmlId);myAnim.attributes.opacity={to:1};myAnim.duration=.5;if(thisObj.needAttAnim)myAnim.onComplete.subscribe(thisObj.attComponent.startAnimation,thisObj.attComponent);myAnim.animate();if(thisObj.headerArrowId){var arrowEl=document.getElementById(thisObj.headerArrowId);arrowEl.style.backgroundPosition='-150px -797px';}if(thisObj.openCloseLinkId){var ocEl=document.getElementById(thisObj.openCloseLinkId);ocEl.innerHTML='close';}if(thisObj.openCloseHeaderId){var ocTitleEl=document.getElementById(thisObj.openCloseHeaderId);ocTitleEl.onclick=new Function(thisObj.openOnclick);}if(thisObj.registerOpen){thisObj.registerOpen=false;var xhrArgs={cmd:'open',ooswitch:'on',section:thisObj.ajaxIdName};ytrv_mtm_genericXHRRequest(xhrArgs);}}function ytrv_mtm_enableOnOff(turnOn){var xhrArgs={cmd:'enable',ooswitch:(turnOn?'on':'off'),section:this.ajaxIdName};ytrv_mtm_genericXHRRequest(xhrArgs);var linkEl=document.getElementById(this.enableLinkId);ytrv_mtm_purge(linkEl,false,true);linkEl.innerHTML=(turnOn)?this.disableLinkHtml:this.enableLinkHtml;if(!turnOn){if(this.parent.openSection==this&&this.bodyHtml!=this.disabledBodyHtml){this.bodyHtml=this.disabledBodyHtml;var myAnim=new YAHOO.util.Anim(this.bodyHtmlId);myAnim.attributes.opacity={to:0};myAnim.duration=.5;myAnim.onComplete.subscribe(this.fadeInAnim,this);myAnim.animate();}else{this.bodyHtml=this.disabledBodyHtml;}}}function ytrv_mtm_genericXHRRequest(args){var addlArgs='&rand='+Math.random()+'&_crumb='+YAHOO.Travel.crumbs.mytravelmodule;for(var name in args){addlArgs+="&"+name+"="+args[name];}YAHOO.util.Connect.asyncRequest('GET','http://'+window.location.hostname+"/common?action=mytravelmod"+addlArgs);}function ytrv_myTravelModuleAddToTripComponent(parentObj){this.parent=parentObj;this.maxListSize=3;this.tripPid=null;this.tripItemKeys=new Array();this.srcEl=null;this.trip=null;this.newItem=null;this.existingItems=null;this.totalCountElId=null;this.typesToStandard={'hotel':'hotels','things to do':'thingstodo','restaurant':'restaurants','shopping':'shopping','entertainment':'entertainment','city':'city','other':'other','flight':'airport','transportation':'transportation'};this.add=ytrv_mtm_attAdd;this.isSameTrip=ytrv_mtm_attIsSameTrip;this.buildMiddleHtml=ytrv_mtm_attBuildMiddleHtml;this.startAnimation=ytrv_mtm_startAttAnim;this.swapAnimElIn=ytrv_mtm_swapAnimElIn;this.fadeInMiddle=ytrv_mtm_attFadeInMiddle;}function ytrv_mtm_attAdd(srcEl,trip,newItem,existingItems){this.parent.needAttAnim=true;this.srcEl=srcEl;this.newItem=newItem;this.trip=trip;this.existingItems=existingItems;if(this.parent.parent.openSection==this.parent){if(!this.isSameTrip(trip,existingItems)){this.buildMiddleHtml(trip,existingItems);var myAnim=new YAHOO.util.Anim(this.parent.secHeadAndMiddleHtmlId);myAnim.attributes.opacity={to:0};myAnim.duration=.5;myAnim.onComplete.subscribe(this.fadeInMiddle,this);myAnim.animate();}else{this.startAnimation(null,null,this);}}else{if(!this.isSameTrip(trip,existingItems)){this.buildMiddleHtml(trip,existingItems);}this.parent.open();}}function ytrv_mtm_attIsSameTrip(trip,items){if(this.tripPid!=trip['pid'])return false;if(this.tripItemKeys.length<this.maxListSize&&this.tripItemKeys.length!=items.length)return false;if(items.length<this.tripItemKeys.length)return false;for(var i=0;i<this.tripItemKeys.length;i++){var itemKey=items[i]['title']+'|'+items[i]['type'];if(this.tripItemKeys[i] !=itemKey)return false;}return true;}function ytrv_mtm_attBuildMiddleHtml(trip,items){this.tripPid=trip['pid'];this.tripItemKeys=new Array();var url="http://travel.yahoo.com/trip?action=view&pid="+trip['pid'];var html="<div class='secHeadAndRealMiddle'><div class='secSubHead'><a href='"+url+"' target='_top'>"+trip['title'].toUpperCase()+" TRIP PLAN</a></div><div class='tpContent activeTrip' id='ytrv_mtm_activeTripContent'>";this.tripPid=trip['pid'];if(items.length==0)html+="No items in Trip";for(var i=0;i<items.length&&i<this.maxListSize;i++){var item=items[i];var itemLinkHtml=(item['url'])?"<a href='"+'http://travel.yahoo.com'+item['url']+"' target='_top' title='"+item['title']+"'>"+trimStringToWord(item['title'],26)+"</a>":"<span title='"+item['title']+"'>"+trimStringToWord(item['title'],26)+"</span>";var typeLookupName=item['type'].toLowerCase();var standardType=this.typesToStandard[typeLookupName];var iconClass=YAHOO.Travel.getCatIconClass(standardType,'white','green',true);html+="<div class='tpLink'><div class='"+iconClass+" tpItemImg'></div>"+"<div class='tpItemName'>"+itemLinkHtml+"</div><div class='ymtClear'></div></div>";this.tripItemKeys[i]=item['title']+'|'+item['type'];}html+="</div></div>";var totalCountText=(items.length>0)?trip['numitems']+' Total Items':'';html+="<div class='totalItems'"+((items.length==0)?" style='display:none;'":"")+"><a href='"+url+"' target='_top' id='ytrv_mtm_totalItemCount'>"+totalCountText+"</a></div>";this.parent.secHeadAndMiddleHtml=html;this.parent.bodyHtml="<div class='secHeadAndMiddle' id='ytrv_mtm_tpSecHeadAndMiddle'>"+html+"</div>"+"<hr /><div class='tpFooter'>"+"<a class='tpFooterLink' href='http://travel.yahoo.com/trip?action=mytrips' target='_top'>My Trip Plans</a>"+"&nbsp;&nbsp;|&nbsp;&nbsp;"+"<a class='tpFooterLink' href='http://travel.yahoo.com/trip?action=create' target='_top'>Create a new trip plan</a></div>";return html;}function ytrv_mtm_attFadeInMiddle(type,args,thisObj){var midEl=document.getElementById(thisObj.parent.secHeadAndMiddleHtmlId);ytrv_mtm_purge(midEl,false,true);midEl.innerHTML=thisObj.parent.secHeadAndMiddleHtml;var myAnim=new YAHOO.util.Anim(thisObj.parent.secHeadAndMiddleHtmlId);myAnim.attributes.opacity={to:1};myAnim.duration=.5;if(thisObj.parent.needAttAnim)myAnim.onComplete.subscribe(thisObj.startAnimation,thisObj);myAnim.animate();}function ytrv_mtm_startAttAnim(type,args,thisObj){thisObj.parent.needAttAnim=false;var sourceEl=thisObj.srcEl;var item=thisObj.newItem;var newObj=document.createElement('DIV');newObj.id='myTravelModATTAnimObj';newObj.className='ytrv_mtm_tripListAnimObj';var itemLinkHtml=(item['url'])?"<a href='"+'http://travel.yahoo.com'+item['url']+"' target='_top' title='"+item['title']+"'>"+trimStringToWord(item['title'],26)+"</a>":"<span title='"+item['title']+"'>"+trimStringToWord(item['title'],26)+"</span>";var typeLookupName=item['type'].toLowerCase();var standardType=thisObj.typesToStandard[typeLookupName];var iconClass=YAHOO.Travel.getCatIconClass(standardType,'white','green',true);newObj.innerHTML="<div class='"+iconClass+" tpItemImg'></div><div class='tpItemName'>"+itemLinkHtml+"</div><div class='ymtClear'></div>";var sourceElPos=YAHOO.util.Dom.getXY(sourceEl);newObj.style.left=sourceElPos[0]+'px';newObj.style.top=sourceElPos[1]+'px';document.body.appendChild(newObj);var containerObj=document.getElementById('ytrv_mtm_activeTripContent');if(containerObj.childNodes.length>=thisObj.maxListSize||thisObj.tripItemKeys.length==0){containerObj.removeChild(containerObj.childNodes[containerObj.childNodes.length-1]);thisObj.tripItemKeys.pop();}thisObj.tripItemKeys.unshift(item['title']+'|'+item['type']);var exIt=thisObj.existingItems;exIt.unshift(item);thisObj.buildMiddleHtml(thisObj.trip,exIt);var newItemObj=document.createElement('DIV');newItemObj.id='ytrv_mtm_attAnimPlaceholder';newItemObj.className='ytrv_mtm_tripListAnimObj';newItemObj.innerHTML='<div></div>';var targetFirstChild=(containerObj.childNodes.length>0)?containerObj.childNodes[0]:null;containerObj.insertBefore(newItemObj,targetFirstChild);var moveDownAnim=new YAHOO.util.Anim('ytrv_mtm_attAnimPlaceholder');moveDownAnim.attributes.height={to:newObj.offsetHeight};moveDownAnim.animate();var targetPos=YAHOO.util.Dom.getXY(newItemObj);var myAnim=new YAHOO.util.Anim('myTravelModATTAnimObj');var adjustment=figureOutXYAdjustment();myAnim.attributes.top={to:targetPos[1]+adjustment[1]};myAnim.attributes.left={to:targetPos[0]+adjustment[0]};myAnim.attributes.opacity={to:1};myAnim.duration=1;myAnim.method=YAHOO.util.Easing.easeOut;myAnim.onComplete.subscribe(ytrv_mtm_swapAnimElIn,myAnim.getEl());myAnim.animate();if(thisObj.totalCountElId){var tcEl=document.getElementById(thisObj.totalCountElId);tcEl.innerHTML=thisObj.trip['numitems']+' Total Items';tcEl.parentNode.style.display='block';}}function ytrv_mtm_swapAnimElIn(type,args,animObj){var contEl=document.getElementById('ytrv_mtm_attAnimPlaceholder');contEl.innerHTML=animObj.innerHTML;contEl.id='';document.body.removeChild(animObj);ytrv_mtm_purge(animObj,false,true);delete animObj;}function trimStringToWord(str,maxLen){if(str&&str.length>maxLen){str=str.substring(0,str.lastIndexOf(" ",maxLen));str+=" ...";}return str;}function figureOutXYAdjustment(){var adjust=new Array(2);var ua=window.navigator.userAgent;if(ua.indexOf('MSIE')>-1)return(new Array(-2,-2));if(ua.indexOf('Firefox')>-1)return(new Array(0,0));if(window.opera)return(new Array(0,-6));if(ua.indexOf('Safari')>-1)return(new Array(0,0));return(new Array(0,0));}function ytrv_mtm_purge(d,notDeep,removeObjects){if(!d)return;var a=d.attributes,i,l,n;if(a){l=a.length;for(i=0;i<l;i+=1){n=a[i].name;if(typeof d[n] ==='function'){d[n]=null;}else if(removeObjects==true&&typeof d[n] ==='object'&&n!='style'){d[n]=null;}}}if(notDeep)return;a=d.childNodes;if(a){l=a.length;for(i=0;i<l;i+=1){ytrv_mtm_purge(d.childNodes[i]);}}}
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
*/
YAHOO.widget.DateMath=new function(){this.DAY="D";this.WEEK="W";this.YEAR="Y";this.MONTH="M";this.ONE_DAY_MS=1000*60*60*24;this.add=function(date,field,amount){var d=new Date(date.getTime());switch(field){case this.MONTH:var newMonth=date.getMonth()+amount;var years=0;if(newMonth<0){while(newMonth<0){newMonth+=12;years-=1;}}else if(newMonth>11){while(newMonth>11){newMonth-=12;years+=1;}}
d.setMonth(newMonth);d.setFullYear(date.getFullYear()+years);break;case this.DAY:d.setDate(date.getDate()+amount);break;case this.YEAR:d.setFullYear(date.getFullYear()+amount);break;case this.WEEK:d.setDate(date.getDate()+(amount*7));break;}
return d;};this.subtract=function(date,field,amount){return this.add(date,field,(amount*-1));};this.before=function(date,compareTo){var ms=compareTo.getTime();if(date.getTime()<ms){return true;}else{return false;}};this.after=function(date,compareTo){var ms=compareTo.getTime();if(date.getTime()>ms){return true;}else{return false;}};this.between=function(date,dateBegin,dateEnd){if(this.after(date,dateBegin)&&this.before(date,dateEnd)){return true;}else{return false;}};this.getJan1=function(calendarYear){return new Date(calendarYear,0,1);};this.getDayOffset=function(date,calendarYear){var beginYear=this.getJan1(calendarYear);var dayOffset=Math.ceil((date.getTime()-beginYear.getTime())/this.ONE_DAY_MS);return dayOffset;};this.getWeekNumber=function(date,calendarYear,weekStartsOn){date.setHours(12,0,0,0);if(!weekStartsOn){weekStartsOn=0;}
if(!calendarYear){calendarYear=date.getFullYear();}
var weekNum=-1;var jan1=this.getJan1(calendarYear);var jan1Offset=jan1.getDay()-weekStartsOn;var jan1DayOfWeek=(jan1Offset>=0?jan1Offset:(7+jan1Offset));var endOfWeek1=this.add(jan1,this.DAY,(6-jan1DayOfWeek));endOfWeek1.setHours(23,59,59,999);var month=date.getMonth();var day=date.getDate();var year=date.getFullYear();var dayOffset=this.getDayOffset(date,calendarYear);if(dayOffset<0||this.before(date,endOfWeek1)){weekNum=1;}else{weekNum=2;var weekBegin=new Date(endOfWeek1.getTime()+1);var weekEnd=this.add(weekBegin,this.WEEK,1);while(!this.between(date,weekBegin,weekEnd)){weekBegin=this.add(weekBegin,this.WEEK,1);weekEnd=this.add(weekEnd,this.WEEK,1);weekNum+=1;}}
return weekNum;};this.isYearOverlapWeek=function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getFullYear()!=weekBeginDate.getFullYear()){overlaps=true;}
return overlaps;};this.isMonthOverlapWeek=function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getMonth()!=weekBeginDate.getMonth()){overlaps=true;}
return overlaps;};this.findMonthStart=function(date){var start=new Date(date.getFullYear(),date.getMonth(),1);return start;};this.findMonthEnd=function(date){var start=this.findMonthStart(date);var nextMonth=this.add(start,this.MONTH,1);var end=this.subtract(nextMonth,this.DAY,1);return end;};this.clearTime=function(date){date.setHours(0,0,0,0);return date;};}
YAHOO.widget.Calendar_Core=function(id,containerId,monthyear,selected){if(arguments.length>0){this.init(id,containerId,monthyear,selected);}}
YAHOO.widget.Calendar_Core.IMG_ROOT=(window.location.href.toLowerCase().indexOf("https")==0?"https://a248.e.akamai.net/sec.yimg.com/i/":"http://us.i1.yimg.com/us.yimg.com/i/");YAHOO.widget.Calendar_Core.DATE="D";YAHOO.widget.Calendar_Core.MONTH_DAY="MD";YAHOO.widget.Calendar_Core.WEEKDAY="WD";YAHOO.widget.Calendar_Core.RANGE="R";YAHOO.widget.Calendar_Core.MONTH="M";YAHOO.widget.Calendar_Core.DISPLAY_DAYS=42;YAHOO.widget.Calendar_Core.STOP_RENDER="S";YAHOO.widget.Calendar_Core.prototype={Config:null,parent:null,index:-1,cells:null,weekHeaderCells:null,weekFooterCells:null,cellDates:null,id:null,oDomContainer:null,today:null,renderStack:null,_renderStack:null,pageDate:null,_pageDate:null,minDate:null,maxDate:null,selectedDates:null,_selectedDates:null,shellRendered:false,table:null,headerCell:null};YAHOO.widget.Calendar_Core.prototype.init=function(id,containerId,monthyear,selected){this.setupConfig();this.id=id;this.cellDates=new Array();this.cells=new Array();this.renderStack=new Array();this._renderStack=new Array();this.oDomContainer=document.getElementById(containerId);this.today=new Date();YAHOO.widget.DateMath.clearTime(this.today);var month;var year;if(monthyear){var aMonthYear=monthyear.split(this.Locale.DATE_FIELD_DELIMITER);month=parseInt(aMonthYear[this.Locale.MY_MONTH_POSITION-1]);year=parseInt(aMonthYear[this.Locale.MY_YEAR_POSITION-1]);}else{month=this.today.getMonth()+1;year=this.today.getFullYear();}
this.pageDate=new Date(year,month-1,1);this._pageDate=new Date(this.pageDate.getTime());if(selected){this.selectedDates=this._parseDates(selected);this._selectedDates=this.selectedDates.concat();}else{this.selectedDates=new Array();this._selectedDates=new Array();}
this.wireDefaultEvents();this.wireCustomEvents();};YAHOO.widget.Calendar_Core.prototype.wireDefaultEvents=function(){this.doSelectCell=function(e,cal){var cell=this;var index=cell.index;var d=cal.cellDates[index];var date=new Date(d[0],d[1]-1,d[2]);if(!cal.isDateOOM(date)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_RESTRICTED)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_OOB)){if(cal.Options.MULTI_SELECT){var link=cell.getElementsByTagName("A")[0];link.blur();var cellDate=cal.cellDates[index];var cellDateIndex=cal._indexOfSelectedFieldArray(cellDate);if(cellDateIndex>-1){cal.deselectCell(index);}else{cal.selectCell(index);}}else{var link=cell.getElementsByTagName("A")[0];link.blur()
cal.selectCell(index);}}}
this.doCellMouseOver=function(e,cal){var cell=this;var index=cell.index;var d=cal.cellDates[index];var date=new Date(d[0],d[1]-1,d[2]);if(!cal.isDateOOM(date)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_RESTRICTED)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_OOB)){YAHOO.util.Dom.addClass(cell,cal.Style.CSS_CELL_HOVER);}}
this.doCellMouseOut=function(e,cal){YAHOO.util.Dom.removeClass(this,cal.Style.CSS_CELL_HOVER);}
this.doNextMonth=function(e,cal){cal.nextMonth();}
this.doPreviousMonth=function(e,cal){cal.previousMonth();}}
YAHOO.widget.Calendar_Core.prototype.wireCustomEvents=function(){}
YAHOO.widget.Calendar_Core.prototype.setupConfig=function(){this.Config=new Object();this.Config.Style={CSS_ROW_HEADER:"calrowhead",CSS_ROW_FOOTER:"calrowfoot",CSS_CELL:"calcell",CSS_CELL_SELECTED:"selected",CSS_CELL_RESTRICTED:"restricted",CSS_CELL_TODAY:"today",CSS_CELL_OOM:"oom",CSS_CELL_OOB:"previous",CSS_HEADER:"calheader",CSS_HEADER_TEXT:"calhead",CSS_WEEKDAY_CELL:"calweekdaycell",CSS_WEEKDAY_ROW:"calweekdayrow",CSS_FOOTER:"calfoot",CSS_CALENDAR:"yui-calendar",CSS_CONTAINER:"yui-calcontainer",CSS_2UPWRAPPER:"yui-cal2upwrapper",CSS_NAV_LEFT:"calnavleft",CSS_NAV_RIGHT:"calnavright",CSS_CELL_TOP:"calcelltop",CSS_CELL_LEFT:"calcellleft",CSS_CELL_RIGHT:"calcellright",CSS_CELL_BOTTOM:"calcellbottom",CSS_CELL_HOVER:"calcellhover",CSS_CELL_HIGHLIGHT1:"highlight1",CSS_CELL_HIGHLIGHT2:"highlight2",CSS_CELL_HIGHLIGHT3:"highlight3",CSS_CELL_HIGHLIGHT4:"highlight4"};this.Style=this.Config.Style;this.Config.Locale={MONTHS_SHORT:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],MONTHS_LONG:["January","February","March","April","May","June","July","August","September","October","November","December"],WEEKDAYS_1CHAR:["S","M","T","W","T","F","S"],WEEKDAYS_SHORT:["Su","Mo","Tu","We","Th","Fr","Sa"],WEEKDAYS_MEDIUM:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],WEEKDAYS_LONG:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],DATE_DELIMITER:",",DATE_FIELD_DELIMITER:"/",DATE_RANGE_DELIMITER:"-",MY_MONTH_POSITION:1,MY_YEAR_POSITION:2,MD_MONTH_POSITION:1,MD_DAY_POSITION:2,MDY_MONTH_POSITION:1,MDY_DAY_POSITION:2,MDY_YEAR_POSITION:3};this.Locale=this.Config.Locale;this.Config.Options={MULTI_SELECT:false,SHOW_WEEKDAYS:true,START_WEEKDAY:0,SHOW_WEEK_HEADER:false,SHOW_WEEK_FOOTER:false,HIDE_BLANK_WEEKS:false,NAV_ARROW_LEFT:YAHOO.widget.Calendar_Core.IMG_ROOT+"us/tr/callt.gif",NAV_ARROW_RIGHT:YAHOO.widget.Calendar_Core.IMG_ROOT+"us/tr/calrt.gif"};this.Options=this.Config.Options;this.customConfig();if(!this.Options.LOCALE_MONTHS){this.Options.LOCALE_MONTHS=this.Locale.MONTHS_LONG;}
if(!this.Options.LOCALE_WEEKDAYS){this.Options.LOCALE_WEEKDAYS=this.Locale.WEEKDAYS_SHORT;}
if(this.Options.START_WEEKDAY>0){for(var w=0;w<this.Options.START_WEEKDAY;++w){this.Locale.WEEKDAYS_SHORT.push(this.Locale.WEEKDAYS_SHORT.shift());this.Locale.WEEKDAYS_MEDIUM.push(this.Locale.WEEKDAYS_MEDIUM.shift());this.Locale.WEEKDAYS_LONG.push(this.Locale.WEEKDAYS_LONG.shift());}}};YAHOO.widget.Calendar_Core.prototype.customConfig=function(){};YAHOO.widget.Calendar_Core.prototype.buildMonthLabel=function(){var text=this.Options.LOCALE_MONTHS[this.pageDate.getMonth()]+" "+this.pageDate.getFullYear();return text;};YAHOO.widget.Calendar_Core.prototype.buildDayLabel=function(workingDate){var day=workingDate.getDate();return day;};YAHOO.widget.Calendar_Core.prototype.buildShell=function(){this.table=document.createElement("TABLE");this.table.cellSpacing=0;YAHOO.widget.Calendar_Core.setCssClasses(this.table,[this.Style.CSS_CALENDAR]);this.table.id=this.id;this.buildShellHeader();this.buildShellBody();this.buildShellFooter();YAHOO.util.Event.addListener(window,"unload",this._unload,this);};YAHOO.widget.Calendar_Core.prototype.buildShellHeader=function(){var head=document.createElement("THEAD");var headRow=document.createElement("TR");var headerCell=document.createElement("TH");var colSpan=7;if(this.Config.Options.SHOW_WEEK_HEADER){this.weekHeaderCells=new Array();colSpan+=1;}
if(this.Config.Options.SHOW_WEEK_FOOTER){this.weekFooterCells=new Array();colSpan+=1;}
headerCell.colSpan=colSpan;YAHOO.widget.Calendar_Core.setCssClasses(headerCell,[this.Style.CSS_HEADER_TEXT]);this.headerCell=headerCell;headRow.appendChild(headerCell);head.appendChild(headRow);if(this.Options.SHOW_WEEKDAYS){var row=document.createElement("TR");var fillerCell;YAHOO.widget.Calendar_Core.setCssClasses(row,[this.Style.CSS_WEEKDAY_ROW]);if(this.Config.Options.SHOW_WEEK_HEADER){fillerCell=document.createElement("TH");YAHOO.widget.Calendar_Core.setCssClasses(fillerCell,[this.Style.CSS_WEEKDAY_CELL]);row.appendChild(fillerCell);}
for(var i=0;i<this.Options.LOCALE_WEEKDAYS.length;++i){var cell=document.createElement("TH");YAHOO.widget.Calendar_Core.setCssClasses(cell,[this.Style.CSS_WEEKDAY_CELL]);cell.innerHTML=this.Options.LOCALE_WEEKDAYS[i];row.appendChild(cell);}
if(this.Config.Options.SHOW_WEEK_FOOTER){fillerCell=document.createElement("TH");YAHOO.widget.Calendar_Core.setCssClasses(fillerCell,[this.Style.CSS_WEEKDAY_CELL]);row.appendChild(fillerCell);}
head.appendChild(row);}
this.table.appendChild(head);};YAHOO.widget.Calendar_Core.prototype.buildShellBody=function(){this.tbody=document.createElement("TBODY");for(var r=0;r<6;++r){var row=document.createElement("TR");for(var c=0;c<this.headerCell.colSpan;++c){var cell;if(this.Config.Options.SHOW_WEEK_HEADER&&c===0){cell=document.createElement("TH");this.weekHeaderCells[this.weekHeaderCells.length]=cell;}else if(this.Config.Options.SHOW_WEEK_FOOTER&&c==(this.headerCell.colSpan-1)){cell=document.createElement("TH");this.weekFooterCells[this.weekFooterCells.length]=cell;}else{cell=document.createElement("TD");this.cells[this.cells.length]=cell;YAHOO.widget.Calendar_Core.setCssClasses(cell,[this.Style.CSS_CELL]);YAHOO.util.Event.addListener(cell,"click",this.doSelectCell,this);YAHOO.util.Event.addListener(cell,"mouseover",this.doCellMouseOver,this);YAHOO.util.Event.addListener(cell,"mouseout",this.doCellMouseOut,this);}
row.appendChild(cell);}
this.tbody.appendChild(row);}
this.table.appendChild(this.tbody);};YAHOO.widget.Calendar_Core.prototype.buildShellFooter=function(){};YAHOO.widget.Calendar_Core.prototype.renderShell=function(){this.oDomContainer.appendChild(this.table);this.shellRendered=true;};YAHOO.widget.Calendar_Core.prototype.render=function(){if(!this.shellRendered){this.buildShell();this.renderShell();}
this.resetRenderers();this.cellDates.length=0;var workingDate=YAHOO.widget.DateMath.findMonthStart(this.pageDate);this.renderHeader();this.renderBody(workingDate);this.renderFooter();this.onRender();};YAHOO.widget.Calendar_Core.prototype.renderHeader=function(){this.headerCell.innerHTML="";var headerContainer=document.createElement("DIV");headerContainer.className=this.Style.CSS_HEADER;headerContainer.appendChild(document.createTextNode(this.buildMonthLabel()));this.headerCell.appendChild(headerContainer);};YAHOO.widget.Calendar_Core.prototype.renderBody=function(workingDate){this.preMonthDays=workingDate.getDay();if(this.Options.START_WEEKDAY>0){this.preMonthDays-=this.Options.START_WEEKDAY;}
if(this.preMonthDays<0){this.preMonthDays+=7;}
this.monthDays=YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();this.postMonthDays=YAHOO.widget.Calendar_Core.DISPLAY_DAYS-this.preMonthDays-this.monthDays;workingDate=YAHOO.widget.DateMath.subtract(workingDate,YAHOO.widget.DateMath.DAY,this.preMonthDays);var weekRowIndex=0;for(var c=0;c<this.cells.length;++c){var cellRenderers=new Array();var cell=this.cells[c];this.clearElement(cell);cell.index=c;cell.id=this.id+"_cell"+c;this.cellDates[this.cellDates.length]=[workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()];if(workingDate.getDay()==this.Options.START_WEEKDAY){var rowHeaderCell=null;var rowFooterCell=null;if(this.Options.SHOW_WEEK_HEADER){rowHeaderCell=this.weekHeaderCells[weekRowIndex];this.clearElement(rowHeaderCell);}
if(this.Options.SHOW_WEEK_FOOTER){rowFooterCell=this.weekFooterCells[weekRowIndex];this.clearElement(rowFooterCell);}
if(this.Options.HIDE_BLANK_WEEKS&&this.isDateOOM(workingDate)&&!YAHOO.widget.DateMath.isMonthOverlapWeek(workingDate)){continue;}else{if(rowHeaderCell){this.renderRowHeader(workingDate,rowHeaderCell);}
if(rowFooterCell){this.renderRowFooter(workingDate,rowFooterCell);}}}
var renderer=null;if(workingDate.getFullYear()==this.today.getFullYear()&&workingDate.getMonth()==this.today.getMonth()&&workingDate.getDate()==this.today.getDate()){cellRenderers[cellRenderers.length]=this.renderCellStyleToday;}
if(this.isDateOOM(workingDate)){cellRenderers[cellRenderers.length]=this.renderCellNotThisMonth;}else{for(var r=0;r<this.renderStack.length;++r){var rArray=this.renderStack[r];var type=rArray[0];var month;var day;var year;switch(type){case YAHOO.widget.Calendar_Core.DATE:month=rArray[1][1];day=rArray[1][2];year=rArray[1][0];if(workingDate.getMonth()+1==month&&workingDate.getDate()==day&&workingDate.getFullYear()==year){renderer=rArray[2];this.renderStack.splice(r,1);}
break;case YAHOO.widget.Calendar_Core.MONTH_DAY:month=rArray[1][0];day=rArray[1][1];if(workingDate.getMonth()+1==month&&workingDate.getDate()==day){renderer=rArray[2];this.renderStack.splice(r,1);}
break;case YAHOO.widget.Calendar_Core.RANGE:var date1=rArray[1][0];var date2=rArray[1][1];var d1month=date1[1];var d1day=date1[2];var d1year=date1[0];var d1=new Date(d1year,d1month-1,d1day);var d2month=date2[1];var d2day=date2[2];var d2year=date2[0];var d2=new Date(d2year,d2month-1,d2day);if(workingDate.getTime()>=d1.getTime()&&workingDate.getTime()<=d2.getTime()){renderer=rArray[2];if(workingDate.getTime()==d2.getTime()){this.renderStack.splice(r,1);}}
break;case YAHOO.widget.Calendar_Core.WEEKDAY:var weekday=rArray[1][0];if(workingDate.getDay()+1==weekday){renderer=rArray[2];}
break;case YAHOO.widget.Calendar_Core.MONTH:month=rArray[1][0];if(workingDate.getMonth()+1==month){renderer=rArray[2];}
break;}
if(renderer){cellRenderers[cellRenderers.length]=renderer;}}}
if(this._indexOfSelectedFieldArray([workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()])>-1){cellRenderers[cellRenderers.length]=this.renderCellStyleSelected;}
if(this.minDate){this.minDate=YAHOO.widget.DateMath.clearTime(this.minDate);}
if(this.maxDate){this.maxDate=YAHOO.widget.DateMath.clearTime(this.maxDate);}
if((this.minDate&&(workingDate.getTime()<this.minDate.getTime()))||(this.maxDate&&(workingDate.getTime()>this.maxDate.getTime()))){cellRenderers[cellRenderers.length]=this.renderOutOfBoundsDate;}else{cellRenderers[cellRenderers.length]=this.renderCellDefault;}
for(var x=0;x<cellRenderers.length;++x){var ren=cellRenderers[x];if(ren.call(this,workingDate,cell)==YAHOO.widget.Calendar_Core.STOP_RENDER){break;}}
workingDate=YAHOO.widget.DateMath.add(workingDate,YAHOO.widget.DateMath.DAY,1);if(workingDate.getDay()==this.Options.START_WEEKDAY){weekRowIndex+=1;}
YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL);if(c>=0&&c<=6){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_TOP);}
if((c%7)==0){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_LEFT);}
if(((c+1)%7)==0){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_RIGHT);}
var postDays=this.postMonthDays;if(postDays>=7&&this.Options.HIDE_BLANK_WEEKS){var blankWeeks=Math.floor(postDays/7);for(var p=0;p<blankWeeks;++p){postDays-=7;}}
if(c>=((this.preMonthDays+postDays+this.monthDays)-7)){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_BOTTOM);}}};YAHOO.widget.Calendar_Core.prototype.renderFooter=function(){};YAHOO.widget.Calendar_Core.prototype._unload=function(e,cal){for(var c in cal.cells){c=null;}
cal.cells=null;cal.tbody=null;cal.oDomContainer=null;cal.table=null;cal.headerCell=null;cal=null;};YAHOO.widget.Calendar_Core.prototype.renderOutOfBoundsDate=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOB);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar_Core.STOP_RENDER;}
YAHOO.widget.Calendar_Core.prototype.renderRowHeader=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_ROW_HEADER);var useYear=this.pageDate.getFullYear();if(!YAHOO.widget.DateMath.isYearOverlapWeek(workingDate)){useYear=workingDate.getFullYear();}
var weekNum=YAHOO.widget.DateMath.getWeekNumber(workingDate,useYear,this.Options.START_WEEKDAY);cell.innerHTML=weekNum;if(this.isDateOOM(workingDate)&&!YAHOO.widget.DateMath.isMonthOverlapWeek(workingDate)){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOM);}};YAHOO.widget.Calendar_Core.prototype.renderRowFooter=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_ROW_FOOTER);if(this.isDateOOM(workingDate)&&!YAHOO.widget.DateMath.isMonthOverlapWeek(workingDate)){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOM);}};YAHOO.widget.Calendar_Core.prototype.renderCellDefault=function(workingDate,cell){cell.innerHTML="";var link=document.createElement("a");link.href="javascript:void(null);";link.name=this.id+"__"+workingDate.getFullYear()+"_"+(workingDate.getMonth()+1)+"_"+workingDate.getDate();link.appendChild(document.createTextNode(this.buildDayLabel(workingDate)));cell.appendChild(link);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight1=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT1);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight2=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT2);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight3=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT3);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight4=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT4);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleToday=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_TODAY);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleSelected=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_SELECTED);};YAHOO.widget.Calendar_Core.prototype.renderCellNotThisMonth=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOM);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar_Core.STOP_RENDER;};YAHOO.widget.Calendar_Core.prototype.renderBodyCellRestricted=function(workingDate,cell){YAHOO.widget.Calendar_Core.setCssClasses(cell,[this.Style.CSS_CELL,this.Style.CSS_CELL_RESTRICTED]);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar_Core.STOP_RENDER;};YAHOO.widget.Calendar_Core.prototype.addMonths=function(count){this.pageDate=YAHOO.widget.DateMath.add(this.pageDate,YAHOO.widget.DateMath.MONTH,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.subtractMonths=function(count){this.pageDate=YAHOO.widget.DateMath.subtract(this.pageDate,YAHOO.widget.DateMath.MONTH,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.addYears=function(count){this.pageDate=YAHOO.widget.DateMath.add(this.pageDate,YAHOO.widget.DateMath.YEAR,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.subtractYears=function(count){this.pageDate=YAHOO.widget.DateMath.subtract(this.pageDate,YAHOO.widget.DateMath.YEAR,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.nextMonth=function(){this.addMonths(1);};YAHOO.widget.Calendar_Core.prototype.previousMonth=function(){this.subtractMonths(1);};YAHOO.widget.Calendar_Core.prototype.nextYear=function(){this.addYears(1);};YAHOO.widget.Calendar_Core.prototype.previousYear=function(){this.subtractYears(1);};YAHOO.widget.Calendar_Core.prototype.reset=function(){this.selectedDates.length=0;this.selectedDates=this._selectedDates.concat();this.pageDate=new Date(this._pageDate.getTime());this.onReset();};YAHOO.widget.Calendar_Core.prototype.clear=function(){this.selectedDates.length=0;this.pageDate=new Date(this.today.getTime());this.onClear();};YAHOO.widget.Calendar_Core.prototype.select=function(date){this.onBeforeSelect();var aToBeSelected=this._toFieldArray(date);for(var a=0;a<aToBeSelected.length;++a){var toSelect=aToBeSelected[a];if(this._indexOfSelectedFieldArray(toSelect)==-1){this.selectedDates[this.selectedDates.length]=toSelect;}}
if(this.parent){this.parent.sync(this);}
this.onSelect();return this.getSelectedDates();};YAHOO.widget.Calendar_Core.prototype.selectCell=function(cellIndex){this.onBeforeSelect();this.cells=this.tbody.getElementsByTagName("TD");var cell=this.cells[cellIndex];var cellDate=this.cellDates[cellIndex];var dCellDate=this._toDate(cellDate);var selectDate=cellDate.concat();this.selectedDates.push(selectDate);if(this.parent){this.parent.sync(this);}
this.renderCellStyleSelected(dCellDate,cell);this.onSelect();this.doCellMouseOut.call(cell,null,this);return this.getSelectedDates();};YAHOO.widget.Calendar_Core.prototype.deselect=function(date){this.onBeforeDeselect();var aToBeSelected=this._toFieldArray(date);for(var a=0;a<aToBeSelected.length;++a){var toSelect=aToBeSelected[a];var index=this._indexOfSelectedFieldArray(toSelect);if(index!=-1){this.selectedDates.splice(index,1);}}
if(this.parent){this.parent.sync(this);}
this.onDeselect();return this.getSelectedDates();};YAHOO.widget.Calendar_Core.prototype.deselectCell=function(i){this.onBeforeDeselect();this.cells=this.tbody.getElementsByTagName("TD");var cell=this.cells[i];var cellDate=this.cellDates[i];var cellDateIndex=this._indexOfSelectedFieldArray(cellDate);var dCellDate=this._toDate(cellDate);var selectDate=cellDate.concat();if(cellDateIndex>-1){if(this.pageDate.getMonth()==dCellDate.getMonth()&&this.pageDate.getFullYear()==dCellDate.getFullYear()){YAHOO.util.Dom.removeClass(cell,this.Style.CSS_CELL_SELECTED);}
this.selectedDates.splice(cellDateIndex,1);}
if(this.parent){this.parent.sync(this);}
this.onDeselect();return this.getSelectedDates();};YAHOO.widget.Calendar_Core.prototype.deselectAll=function(){this.onBeforeDeselect();var count=this.selectedDates.length;this.selectedDates.length=0;if(this.parent){this.parent.sync(this);}
if(count>0){this.onDeselect();}
return this.getSelectedDates();};YAHOO.widget.Calendar_Core.prototype._toFieldArray=function(date){var returnDate=new Array();if(date instanceof Date){returnDate=[[date.getFullYear(),date.getMonth()+1,date.getDate()]];}else if(typeof date=='string'){returnDate=this._parseDates(date);}else if(date instanceof Array){for(var i=0;i<date.length;++i){var d=date[i];returnDate[returnDate.length]=[d.getFullYear(),d.getMonth()+1,d.getDate()];}}
return returnDate;};YAHOO.widget.Calendar_Core.prototype._toDate=function(dateFieldArray){if(dateFieldArray instanceof Date){return dateFieldArray;}else{return new Date(dateFieldArray[0],dateFieldArray[1]-1,dateFieldArray[2]);}};YAHOO.widget.Calendar_Core.prototype._fieldArraysAreEqual=function(array1,array2){var match=false;if(array1[0]==array2[0]&&array1[1]==array2[1]&&array1[2]==array2[2]){match=true;}
return match;};YAHOO.widget.Calendar_Core.prototype._indexOfSelectedFieldArray=function(find){var selected=-1;for(var s=0;s<this.selectedDates.length;++s){var sArray=this.selectedDates[s];if(find[0]==sArray[0]&&find[1]==sArray[1]&&find[2]==sArray[2]){selected=s;break;}}
return selected;};YAHOO.widget.Calendar_Core.prototype.isDateOOM=function(date){var isOOM=false;if(date.getMonth()!=this.pageDate.getMonth()){isOOM=true;}
return isOOM;};YAHOO.widget.Calendar_Core.prototype.onBeforeSelect=function(){if(!this.Options.MULTI_SELECT){this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED);this.deselectAll();}};YAHOO.widget.Calendar_Core.prototype.onSelect=function(){};YAHOO.widget.Calendar_Core.prototype.onBeforeDeselect=function(){};YAHOO.widget.Calendar_Core.prototype.onDeselect=function(){};YAHOO.widget.Calendar_Core.prototype.onChangePage=function(){var me=this;this.renderHeader();if(this.renderProcId){clearTimeout(this.renderProcId);}
this.renderProcId=setTimeout(function(){me.render();me.renderProcId=null;},1);};YAHOO.widget.Calendar_Core.prototype.onRender=function(){};YAHOO.widget.Calendar_Core.prototype.onReset=function(){this.render();};YAHOO.widget.Calendar_Core.prototype.onClear=function(){this.render();};YAHOO.widget.Calendar_Core.prototype.validate=function(){return true;};YAHOO.widget.Calendar_Core.prototype._parseDate=function(sDate){var aDate=sDate.split(this.Locale.DATE_FIELD_DELIMITER);var rArray;if(aDate.length==2){rArray=[aDate[this.Locale.MD_MONTH_POSITION-1],aDate[this.Locale.MD_DAY_POSITION-1]];rArray.type=YAHOO.widget.Calendar_Core.MONTH_DAY;}else{rArray=[aDate[this.Locale.MDY_YEAR_POSITION-1],aDate[this.Locale.MDY_MONTH_POSITION-1],aDate[this.Locale.MDY_DAY_POSITION-1]];rArray.type=YAHOO.widget.Calendar_Core.DATE;}
return rArray;};YAHOO.widget.Calendar_Core.prototype._parseDates=function(sDates){var aReturn=new Array();var aDates=sDates.split(this.Locale.DATE_DELIMITER);for(var d=0;d<aDates.length;++d){var sDate=aDates[d];if(sDate.indexOf(this.Locale.DATE_RANGE_DELIMITER)!=-1){var aRange=sDate.split(this.Locale.DATE_RANGE_DELIMITER);var dateStart=this._parseDate(aRange[0]);var dateEnd=this._parseDate(aRange[1]);var fullRange=this._parseRange(dateStart,dateEnd);aReturn=aReturn.concat(fullRange);}else{var aDate=this._parseDate(sDate);aReturn.push(aDate);}}
return aReturn;};YAHOO.widget.Calendar_Core.prototype._parseRange=function(startDate,endDate){var dStart=new Date(startDate[0],startDate[1]-1,startDate[2]);var dCurrent=YAHOO.widget.DateMath.add(new Date(startDate[0],startDate[1]-1,startDate[2]),YAHOO.widget.DateMath.DAY,1);var dEnd=new Date(endDate[0],endDate[1]-1,endDate[2]);var results=new Array();results.push(startDate);while(dCurrent.getTime()<=dEnd.getTime()){results.push([dCurrent.getFullYear(),dCurrent.getMonth()+1,dCurrent.getDate()]);dCurrent=YAHOO.widget.DateMath.add(dCurrent,YAHOO.widget.DateMath.DAY,1);}
return results;};YAHOO.widget.Calendar_Core.prototype.resetRenderers=function(){this.renderStack=this._renderStack.concat();};YAHOO.widget.Calendar_Core.prototype.clearElement=function(cell){cell.innerHTML="&nbsp;";cell.className="";};YAHOO.widget.Calendar_Core.prototype.addRenderer=function(sDates,fnRender){var aDates=this._parseDates(sDates);for(var i=0;i<aDates.length;++i){var aDate=aDates[i];if(aDate.length==2){if(aDate[0]instanceof Array){this._addRenderer(YAHOO.widget.Calendar_Core.RANGE,aDate,fnRender);}else{this._addRenderer(YAHOO.widget.Calendar_Core.MONTH_DAY,aDate,fnRender);}}else if(aDate.length==3){this._addRenderer(YAHOO.widget.Calendar_Core.DATE,aDate,fnRender);}}};YAHOO.widget.Calendar_Core.prototype._addRenderer=function(type,aDates,fnRender){var add=[type,aDates,fnRender];this.renderStack.unshift(add);this._renderStack=this.renderStack.concat();};YAHOO.widget.Calendar_Core.prototype.addMonthRenderer=function(month,fnRender){this._addRenderer(YAHOO.widget.Calendar_Core.MONTH,[month],fnRender);};YAHOO.widget.Calendar_Core.prototype.addWeekdayRenderer=function(weekday,fnRender){this._addRenderer(YAHOO.widget.Calendar_Core.WEEKDAY,[weekday],fnRender);};YAHOO.widget.Calendar_Core.setCssClasses=function(element,aStyles){element.className="";var className=aStyles.join(" ");element.className=className;};YAHOO.widget.Calendar_Core.prototype.clearAllBodyCellStyles=function(style){for(var c=0;c<this.cells.length;++c){YAHOO.util.Dom.removeClass(this.cells[c],style);}};YAHOO.widget.Calendar_Core.prototype.setMonth=function(month){this.pageDate.setMonth(month);};YAHOO.widget.Calendar_Core.prototype.setYear=function(year){this.pageDate.setFullYear(year);};YAHOO.widget.Calendar_Core.prototype.getSelectedDates=function(){var returnDates=new Array();for(var d=0;d<this.selectedDates.length;++d){var dateArray=this.selectedDates[d];var date=new Date(dateArray[0],dateArray[1]-1,dateArray[2]);returnDates.push(date);}
returnDates.sort();return returnDates;};YAHOO.widget.Calendar_Core._getBrowser=function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1)
return'opera';else if(ua.indexOf('msie')!=-1)
return'ie';else if(ua.indexOf('safari')!=-1)
return'safari';else if(ua.indexOf('gecko')!=-1)
return'gecko';else
return false;}
YAHOO.widget.Calendar_Core.prototype.toString=function(){return"Calendar_Core "+this.id;}
YAHOO.widget.Cal_Core=YAHOO.widget.Calendar_Core;YAHOO.widget.Calendar=function(id,containerId,monthyear,selected){if(arguments.length>0){this.init(id,containerId,monthyear,selected);}}
YAHOO.widget.Calendar.prototype=new YAHOO.widget.Calendar_Core();YAHOO.widget.Calendar.prototype.buildShell=function(){this.border=document.createElement("DIV");this.border.className=this.Style.CSS_CONTAINER;this.table=document.createElement("TABLE");this.table.cellSpacing=0;YAHOO.widget.Calendar_Core.setCssClasses(this.table,[this.Style.CSS_CALENDAR]);this.border.id=this.id;this.buildShellHeader();this.buildShellBody();this.buildShellFooter();};YAHOO.widget.Calendar.prototype.renderShell=function(){this.border.appendChild(this.table);this.oDomContainer.appendChild(this.border);this.shellRendered=true;};YAHOO.widget.Calendar.prototype.renderHeader=function(){this.headerCell.innerHTML="";var headerContainer=document.createElement("DIV");headerContainer.className=this.Style.CSS_HEADER;if(this.linkLeft){YAHOO.util.Event.removeListener(this.linkLeft,"mousedown",this.previousMonth);}
this.linkLeft=document.createElement("A");this.linkLeft.innerHTML="&nbsp;";YAHOO.util.Event.addListener(this.linkLeft,"mousedown",this.previousMonth,this,true);this.linkLeft.style.backgroundImage="url("+this.Options.NAV_ARROW_LEFT+")";this.linkLeft.className=this.Style.CSS_NAV_LEFT;if(this.linkRight){YAHOO.util.Event.removeListener(this.linkRight,"mousedown",this.nextMonth);}
this.linkRight=document.createElement("A");this.linkRight.innerHTML="&nbsp;";YAHOO.util.Event.addListener(this.linkRight,"mousedown",this.nextMonth,this,true);this.linkRight.style.backgroundImage="url("+this.Options.NAV_ARROW_RIGHT+")";this.linkRight.className=this.Style.CSS_NAV_RIGHT;headerContainer.appendChild(this.linkLeft);headerContainer.appendChild(document.createTextNode(this.buildMonthLabel()));headerContainer.appendChild(this.linkRight);this.headerCell.appendChild(headerContainer);};YAHOO.widget.Cal=YAHOO.widget.Calendar;YAHOO.widget.CalendarGroup=function(pageCount,id,containerId,monthyear,selected){if(arguments.length>0){this.init(pageCount,id,containerId,monthyear,selected);}}
YAHOO.widget.CalendarGroup.prototype.init=function(pageCount,id,containerId,monthyear,selected){this.id=id;this.selectedDates=new Array();this.containerId=containerId;this.pageCount=pageCount;this.pages=new Array();for(var p=0;p<pageCount;++p){var cal=this.constructChild(id+"_"+p,this.containerId+"_"+p,monthyear,selected);cal.parent=this;cal.index=p;cal.pageDate.setMonth(cal.pageDate.getMonth()+p);cal._pageDate=new Date(cal.pageDate.getFullYear(),cal.pageDate.getMonth(),cal.pageDate.getDate());this.pages.push(cal);}
this.doNextMonth=function(e,calGroup){calGroup.nextMonth();};this.doPreviousMonth=function(e,calGroup){calGroup.previousMonth();};};YAHOO.widget.CalendarGroup.prototype.setChildFunction=function(fnName,fn){for(var p=0;p<this.pageCount;++p){this.pages[p][fnName]=fn;}}
YAHOO.widget.CalendarGroup.prototype.callChildFunction=function(fnName,args){for(var p=0;p<this.pageCount;++p){var page=this.pages[p];if(page[fnName]){var fn=page[fnName];fn.call(page,args);}}}
YAHOO.widget.CalendarGroup.prototype.constructChild=function(id,containerId,monthyear,selected){return new YAHOO.widget.Calendar_Core(id,containerId,monthyear,selected);};YAHOO.widget.CalendarGroup.prototype.setMonth=function(month){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal.setMonth(month+p);}};YAHOO.widget.CalendarGroup.prototype.setYear=function(year){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];if((cal.pageDate.getMonth()+1)==1&&p>0)
{year+=1;}
cal.setYear(year);}};YAHOO.widget.CalendarGroup.prototype.render=function(){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal.render();}};YAHOO.widget.CalendarGroup.prototype.select=function(date){var ret;for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];ret=cal.select(date);}
return ret;};YAHOO.widget.CalendarGroup.prototype.selectCell=function(cellIndex){var ret;for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];ret=cal.selectCell(cellIndex);}
return ret;};YAHOO.widget.CalendarGroup.prototype.deselect=function(date){var ret;for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];ret=cal.deselect(date);}
return ret;};YAHOO.widget.CalendarGroup.prototype.deselectAll=function(){var ret;for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];ret=cal.deselectAll();}
return ret;};YAHOO.widget.CalendarGroup.prototype.deselectCell=function(cellIndex){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal.deselectCell(cellIndex);}
return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.reset=function(){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal.reset();}};YAHOO.widget.CalendarGroup.prototype.clear=function(){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal.clear();}};YAHOO.widget.CalendarGroup.prototype.nextMonth=function(){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal.nextMonth();}};YAHOO.widget.CalendarGroup.prototype.previousMonth=function(){for(var p=this.pages.length-1;p>=0;--p)
{var cal=this.pages[p];cal.previousMonth();}};YAHOO.widget.CalendarGroup.prototype.nextYear=function(){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal.nextYear();}};YAHOO.widget.CalendarGroup.prototype.previousYear=function(){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal.previousYear();}};YAHOO.widget.CalendarGroup.prototype.sync=function(caller){var calendar;if(caller)
{this.selectedDates=caller.selectedDates.concat();}else{var hash=new Object();var combinedDates=new Array();for(var p=0;p<this.pages.length;++p)
{calendar=this.pages[p];var values=calendar.selectedDates;for(var v=0;v<values.length;++v)
{var valueArray=values[v];hash[valueArray.toString()]=valueArray;}}
for(var val in hash)
{combinedDates[combinedDates.length]=hash[val];}
this.selectedDates=combinedDates.concat();}
for(p=0;p<this.pages.length;++p)
{calendar=this.pages[p];if(!calendar.Options.MULTI_SELECT){calendar.clearAllBodyCellStyles(calendar.Config.Style.CSS_CELL_SELECTED);}
calendar.selectedDates=this.selectedDates.concat();}
return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.getSelectedDates=function(){var returnDates=new Array();for(var d=0;d<this.selectedDates.length;++d)
{var dateArray=this.selectedDates[d];var date=new Date(dateArray[0],dateArray[1]-1,dateArray[2]);returnDates.push(date);}
returnDates.sort();return returnDates;};YAHOO.widget.CalendarGroup.prototype.addRenderer=function(sDates,fnRender){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal.addRenderer(sDates,fnRender);}};YAHOO.widget.CalendarGroup.prototype.addMonthRenderer=function(month,fnRender){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal.addMonthRenderer(month,fnRender);}};YAHOO.widget.CalendarGroup.prototype.addWeekdayRenderer=function(weekday,fnRender){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal.addWeekdayRenderer(weekday,fnRender);}};YAHOO.widget.CalendarGroup.prototype.wireEvent=function(eventName,fn){for(var p=0;p<this.pages.length;++p)
{var cal=this.pages[p];cal[eventName]=fn;}};YAHOO.widget.CalendarGroup.prototype.toString=function(){return"CalendarGroup "+this.id;}
YAHOO.widget.CalGrp=YAHOO.widget.CalendarGroup;YAHOO.widget.Calendar2up_Cal=function(id,containerId,monthyear,selected){if(arguments.length>0)
{this.init(id,containerId,monthyear,selected);}}
YAHOO.widget.Calendar2up_Cal.prototype=new YAHOO.widget.Calendar_Core();YAHOO.widget.Calendar2up_Cal.prototype.renderHeader=function(){this.headerCell.innerHTML="";var headerContainer=document.createElement("DIV");headerContainer.className=this.Style.CSS_HEADER;if(this.index==0){if(this.linkLeft){YAHOO.util.Event.removeListener(this.linkLeft,"mousedown",this.parent.doPreviousMonth);}
this.linkLeft=document.createElement("A");this.linkLeft.innerHTML="&nbsp;";this.linkLeft.style.backgroundImage="url("+this.Options.NAV_ARROW_LEFT+")";this.linkLeft.className=this.Style.CSS_NAV_LEFT;YAHOO.util.Event.addListener(this.linkLeft,"mousedown",this.parent.doPreviousMonth,this.parent);headerContainer.appendChild(this.linkLeft);}
headerContainer.appendChild(document.createTextNode(this.buildMonthLabel()));if(this.index==1){if(this.linkRight){YAHOO.util.Event.removeListener(this.linkRight,"mousedown",this.parent.doNextMonth);}
this.linkRight=document.createElement("A");this.linkRight.innerHTML="&nbsp;";this.linkRight.style.backgroundImage="url("+this.Options.NAV_ARROW_RIGHT+")";this.linkRight.className=this.Style.CSS_NAV_RIGHT;YAHOO.util.Event.addListener(this.linkRight,"mousedown",this.parent.doNextMonth,this.parent);headerContainer.appendChild(this.linkRight);}
this.headerCell.appendChild(headerContainer);};YAHOO.widget.Calendar2up=function(id,containerId,monthyear,selected){if(arguments.length>0)
{this.buildWrapper(containerId);this.init(2,id,containerId,monthyear,selected);}}
YAHOO.widget.Calendar2up.prototype=new YAHOO.widget.CalendarGroup();YAHOO.widget.Calendar2up.CSS_2UPWRAPPER="yui-cal2upwrapper";YAHOO.widget.Calendar2up.CSS_CONTAINER="yui-calcontainer";YAHOO.widget.Calendar2up.CSS_2UPCONTAINER="cal2up";YAHOO.widget.Calendar2up.CSS_2UPTITLE="title";YAHOO.widget.Calendar2up.CSS_2UPCLOSE="close-icon";YAHOO.widget.Calendar2up.prototype.constructChild=function(id,containerId,monthyear,selected){var cal=new YAHOO.widget.Calendar2up_Cal(id,containerId,monthyear,selected);return cal;};YAHOO.widget.Calendar2up.prototype.buildWrapper=function(containerId){var outerContainer=document.getElementById(containerId);outerContainer.className=YAHOO.widget.Calendar2up.CSS_2UPWRAPPER;var innerContainer=document.createElement("DIV");innerContainer.className=YAHOO.widget.Calendar2up.CSS_CONTAINER;innerContainer.id=containerId+"_inner";var cal1Container=document.createElement("DIV");cal1Container.id=containerId+"_0";cal1Container.className=YAHOO.widget.Calendar2up.CSS_2UPCONTAINER;cal1Container.style.marginRight="10px";var cal2Container=document.createElement("DIV");cal2Container.id=containerId+"_1";cal2Container.className=YAHOO.widget.Calendar2up.CSS_2UPCONTAINER;outerContainer.appendChild(innerContainer);innerContainer.appendChild(cal1Container);innerContainer.appendChild(cal2Container);this.innerContainer=innerContainer;this.outerContainer=outerContainer;}
YAHOO.widget.Calendar2up.prototype.render=function(){this.renderHeader();YAHOO.widget.CalendarGroup.prototype.render.call(this);this.renderFooter();};YAHOO.widget.Calendar2up.prototype.renderHeader=function(){if(!this.title){this.title="";}
if(!this.titleDiv)
{this.titleDiv=document.createElement("DIV");if(this.title=="")
{this.titleDiv.style.display="none";}}
this.titleDiv.className=YAHOO.widget.Calendar2up.CSS_2UPTITLE;this.titleDiv.innerHTML=this.title;if(this.outerContainer.style.position=="absolute")
{var linkClose=document.createElement("A");linkClose.href="javascript:void(null)";YAHOO.util.Event.addListener(linkClose,"click",this.hide,this);var imgClose=document.createElement("IMG");imgClose.src=YAHOO.widget.Calendar_Core.IMG_ROOT+"us/my/bn/x_d.gif";imgClose.className=YAHOO.widget.Calendar2up.CSS_2UPCLOSE;linkClose.appendChild(imgClose);this.linkClose=linkClose;this.titleDiv.appendChild(linkClose);}
this.innerContainer.insertBefore(this.titleDiv,this.innerContainer.firstChild);}
YAHOO.widget.Calendar2up.prototype.hide=function(e,cal){if(!cal)
{cal=this;}
cal.outerContainer.style.display="none";}
YAHOO.widget.Calendar2up.prototype.renderFooter=function(){}
YAHOO.widget.Cal2up=YAHOO.widget.Calendar2up;
/* ? 2005 Yahoo! Inc. All rights reserved. */if(YAHOO.widget.Calendar2up){YAHOO.namespace('Travel');YAHOO.widget.Calendar2up.prototype.hide=function(e,cal){if(!cal){cal=this;}cal.outerContainer.parentNode.style.display="none";cal.postHide();};YAHOO.widget.Calendar2up.prototype.postHide=function(){if(this.mgrObj){YAHOO.util.Event.removeListener(window,'resize',this.mgrObj.adjustPos);}};YAHOO.Travel.calMgr=function(field1,field2,instance,field1Text,field2Text,direction){if(typeof(field1) =="string"){field1=document.getElementById(field1);}if(typeof(field2) =="string"){field2=document.getElementById(field2);}if(!field1||!field2){return null;}var today=new Date();var thisMonth=today.getMonth();var thisDay=today.getDate();var thisYear=today.getFullYear();this.activeField=null;this.instance=instance;this.container=document.createElement('DIV');this.container.className='calparent';this.container.id=this.getMainDomObjId();this.container.style.width="350px";this.container.style.display="none";document.body.appendChild(this.container);if(window.ActiveXObject){var iframe=document.createElement('IFRAME');iframe.id=instance+"_ifr";this.container.appendChild(iframe);}var tmp=document.createElement('DIV');var calContainer=instance+"_cont";tmp.className="calcontainer";tmp.style.position="absolute";tmp.id=calContainer;this.container.appendChild(tmp);var startString=(thisMonth+1)+"/"+thisYear;var firstDate=null;var secondDate=null;if(field1&&field1.value){var startDATE=field1.value;var parts=startDATE.split('/');if(parts&&parts.length==3){var month=parts[0];if(month.length==1){month='0'+month;}var year=parts[2];var valMon=parseInt(month,10);var valYr=parseInt(year,10);if(valMon>0&&valMon<=12&&valYr>0&&valYr<100&&year.length==2){startString=valMon+'/20'+year;}}}this.calendar=new YAHOO.widget.Calendar2up(instance+'_cal',calContainer,startString);this.calendar.mgrObj=this;this.calendar.addRenderer(this.convertDate(field1.value),this.highlightCal1);this.calendar.addRenderer(this.convertDate(field2.value),this.highlightCal2);minDate=YAHOO.widget.DateMath.add(new Date(),YAHOO.widget.DateMath.DAY,1);for(var i=0;i<this.calendar.pages.length; ++i){this.calendar.pages[i].minDate=minDate;}if(field1Text!=null&&field2Text!=null){this.field1Text=field1Text;this.field2Text=field2Text;}else{this.field1Text=null;this.field2Text=null;}this.calendar.title="&nbsp;";if(direction=="left"){this.calendar.outerContainer.style.left="-240px";if(document.getElementById(this.instance+"_ifr")){document.getElementById(this.instance+"_ifr").style.left="-240px";}}else if(direction=="middle"){this.calendar.outerContainer.style.left="-150px";if(document.getElementById(this.instance+"_ifr")){document.getElementById(this.instance+"_ifr").style.left="-150px";}}else{this.calendar.outerContainer.style.left="0px";}var self=this;field1.onclick=function(){self.show(this);};var tmp=field1.parentNode.getElementsByTagName('A');if(tmp.length>0){tmp[0].onclick=function(){self.show(field1);};}field2.onclick=function(){self.show(this);};tmp=field2.parentNode.getElementsByTagName('A');if(tmp.length>0){tmp[0].onclick=function(){self.show(field2);};}this.calendar.setChildFunction("onSelect",function(){self.set();});this.field1=field1;this.field2=field2;this.dateFormatter=null;this.onHide=null;this.onBeforeHide=null;this.onShow=null;};YAHOO.Travel.calMgr.prototype.show=function(field){YAHOO.util.Event.removeListener(window,'resize',this.adjustPos,adjObj);if(field.disabled){return;}this.activeField=field;this.calendar.outerContainer.parentNode.style.visibility="hidden";this.calendar.outerContainer.parentNode.style.display="block";var pos=YAHOO.util.Dom.getXY(field);YAHOO.util.Dom.setXY(this.calendar.outerContainer.parentNode,[pos[0],pos[1]+field.offsetHeight+1]);this.calendar.addRenderer(this.convertDate(this.field1.value),this.highlightCal1);this.calendar.addRenderer(this.convertDate(this.field2.value),this.highlightCal2);this.calendar.render();var iframe=document.getElementById(this.instance+"_ifr");if(iframe){iframe.height=this.calendar.innerContainer.offsetHeight;iframe.width=this.calendar.innerContainer.offsetWidth;}this.calendar.outerContainer.parentNode.style.visibility="visible";var adjObj={calMgrObj:this,field:field};YAHOO.util.Event.addListener(window,'resize',this.adjustPos,adjObj);};YAHOO.Travel.calMgr.prototype.adjustPos=function(e,adjObj){var pos=YAHOO.util.Dom.getXY(adjObj.field);YAHOO.util.Dom.setXY(adjObj.calMgrObj.calendar.outerContainer.parentNode,[pos[0],pos[1]+adjObj.field.offsetHeight+1]);};YAHOO.Travel.calMgr.prototype.highlightCal1=function(myDate,cell){this.renderCellStyleHighlight1(myDate,cell);};YAHOO.Travel.calMgr.prototype.highlightCal2=function(myDate,cell){this.renderCellStyleHighlight2(myDate,cell);};YAHOO.Travel.calMgr.prototype.disableDate=function(myDate,cell){this.renderOutOfBoundsDate(myDate,cell);};YAHOO.Travel.calMgr.prototype.set=function(){if(this.activeField){var currDate=this.calendar.getSelectedDates()[0];var oldDate=this.activeField.value;var dt="";if(this.dateFormatter){dt=this.dateFormatter(currDate);}else{var mon=currDate.getMonth()+1;var day=currDate.getDate();var year=new String(currDate.getFullYear());if(mon<10){mon="0"+mon;}if(day<10){day="0"+day;}year=year.substr(2);dt=(mon)+"/"+day+"/"+year;}this.activeField.value=dt;}var okToHide=true;if(this.onBeforeHide){okToHide=this.onBeforeHide(dt,this.activeField);}if(okToHide){this.calendar.hide();this.calendar.deselect(currDate);if(this.onHide){this.onHide();}}};YAHOO.Travel.calMgr.prototype.convertDate=function(dt){if(dt.search(/^[0-1][0-9]\/[0-3][0-9]\/(\d{2}|\d{4})$/) ==0){pos=dt.lastIndexOf('/');dt=dt.substr(0,pos+1)+"20"+dt.substr(pos+1);}else if(dt=="mm/dd/yy"){dt="";}return dt;};YAHOO.Travel.calMgr.prototype.getMainDomObjId=function(){return this.instance;}}
/* ? 2005 Yahoo! Inc. All rights reserved. */YAHOO.namespace("Travel");YAHOO.Travel.popupCardClass=function(name,instance,needsIframe){this.oDomRef=null;this.oIfrRef=null;this.attachedNode=null;this.anim=null;this.name=(name!=null)?name:"popup_card";this.instance=(instance!=null)?instance:"popupCard";this.currentId=null;this.needsIframe=needsIframe;this.knownBodyH=null;this.knownBodyW=null;};YAHOO.Travel.popupCardClass.prototype.open=function(node,xposition,yposition){if(this.oDomRef==null){this.create();}if(node){this.attachedNode=node.id;var pos=YAHOO.util.Dom.getXY(node);if(window.opera&&node.parentNode.tagName=='TD'){var tmp=YAHOO.util.Dom.getXY(node.parentNode.parentNode);var y=tmp[1]+node.offsetTop;pos[1]=y;}this.oDomRef.style.display="block";var linkw=node.offsetWidth;var linkh=node.offsetHeight;var popupw=this.oDomRef.offsetWidth;if(xposition=="left"){xoffset=0;}else if(xposition=="right"){xoffset=(popupw-linkw);}else if(xposition=="fullright"){xoffset=0-linkw;}else{xoffset=Math.abs((popupw/2)-(linkw/2));}if(yposition=="center"){yoffset=0-(linkh/2);}else{yoffset=20;}YAHOO.util.Dom.setXY(this.name,[pos[0]-xoffset,pos[1]+yoffset]);if(this.oIfrRef){YAHOO.util.Dom.setXY(this.oIfrRef,[pos[0]-xoffset,pos[1]+yoffset]);this.oIfrRef.style.height=this.oDomRef.offsetHeight;this.oIfrRef.style.width=this.oDomRef.offsetWidth;this.oIfrRef.style.display='block';}this.knownBodyH=document.body.offsetHeight;this.knownBodyW=document.body.offsetWidth;YAHOO.util.Event.addListener(window,'resize',this.handleBodyResize,this,true);return false;}};YAHOO.Travel.popupCardClass.prototype.close=function(doAnim){if(doAnim==true){this.anim=new YAHOO.util.Anim(this.oDomRef,{opacity:{to:0}},.75,YAHOO.util.Easing.easeOut);var self=this;this.anim.onComplete.subscribe(function(){self.close();});this.anim.animate();}else{if(this.oDomRef){this.oDomRef.style.display="none";if(this.oIfrRef){this.oIfrRef.style.display="none";}this.attachedNode=null;this.currentId=null;this.resetAnim();this.knownBodyH=null;this.knownBodyW=null;YAHOO.util.Event.removeListener(window,'resize',this.handleBodyResize);}}return false;};YAHOO.Travel.popupCardClass.prototype.resetAnim=function(){if(this.oDomRef.style.filter){this.oDomRef.style.filter="";}else{this.oDomRef.style.opacity="";}this.anim=null;};YAHOO.Travel.popupCardClass.prototype.create=function(){var card=document.createElement("DIV");var content="<div class='title'></div>";content+="<div class='content'></div><div class='bottom'>";content+="<a href='javascript: void(0);' onclick='return "+this.instance+".close(false);'>Close Window</a></div>";card.innerHTML=content;card.id=this.name;card.className="dhtml_card";document.body.appendChild(card);this.oDomRef=card;if(window.ActiveXObject&&this.needsIframe){var iframe=document.createElement('IFRAME');iframe.id=this.name+'_ifr';this.oIfrRef=iframe;document.body.appendChild(iframe);}};YAHOO.Travel.popupCardClass.prototype.setContent=function(content){if(!this.oDomRef){return false;}if(typeof(content) =='object'){this.oDomRef.childNodes[1].innerHTML="";this.oDomRef.childNodes[1].appendChild(content);}else{this.oDomRef.childNodes[1].innerHTML=content;}};YAHOO.Travel.popupCardClass.prototype.showToolTip=function(node,content,position,toggle){if(this.anim!=null){this.anim.stop();this.resetAnim();}if(this.oDomRef==null){this.create();}if(node.id!=this.attachedNode){if(this.attachedNode){this.close();}this.setContent(content);this.open(node,position);}else if(toggle){this.close();}return false;};YAHOO.Travel.popupCardClass.prototype.handleBodyResize=function(){var curBodyH=document.body.offsetHeight;var curBodyW=document.body.offsetWidth;if(this.knownBodyH!=curBodyH||this.knownBodyW!=curBodyW)this.close();};
/* ? 2005 Yahoo! Inc. All rights reserved. */YAHOO.Travel.addToTripClass=function(instance,hrefTarget){YAHOO.Travel.addToTripClass.superclass.constructor.call(this,'addtotrip_popup',instance);this.tripOptions=null;this.newTripDefault="Enter a name for your trip";this.currentItemExtraInfo=new Array();this.currentClass=null;this.hrefTarget=(hrefTarget)?hrefTarget:'_top';this.closeTimeout=null;};YAHOO.extend(YAHOO.Travel.addToTripClass,YAHOO.Travel.popupCardClass);YAHOO.Travel.addToTripClass.prototype.setTrips=function(trips){this.tripOptions=trips;};YAHOO.Travel.addToTripClass.prototype.error=function(msg){this.toggleBusy(false);alert(msg);this.close();};YAHOO.Travel.addToTripClass.prototype.showTripCard=function(node,itemClass,title,mode,extraInfo){if(this.anim!=null){this.anim.stop();this.resetAnim();}clearTimeout(this.closeTimeout);if(this.oDomRef==null){this.create();}if(node){if(node.id==this.attachedNode){return false;}this.attachedNode=node.id;this.currentId=node.id.substr(4);this.currentItemExtraInfo=extraInfo;this.setImage(itemClass);this.currentClass=itemClass;this.setTitle(title);this.toggleBusy(true,node);if(mode=="login"){return this.showLogin(node);}else{return this.showAddForm(node);}}};YAHOO.Travel.addToTripClass.prototype.showAddForm=function(node,itemClass,title){if(node){if(this.tripOptions==null){YAHOO.util.Dom.addClass(node.firstChild,'busy');var faction="quickadd";var url=trip_get_xml_url();var args='action=gettrips&call_v=2&faction='+faction;return!common_send_to_server(url,"POST",args);}}else{if(this.attachedNode){node=document.getElementById(this.attachedNode);}}if(!node){return false;}if(this.tripOptions){this.showSelectForm();}this.toggleBusy(false,node);this.open(node);return false;};YAHOO.Travel.addToTripClass.prototype.showLogin=function(node){if(this.oDomRef==null){this.create();}if(!node){node=document.getElementById(this.attachedNode);}var url=document.location.href;url+=(url.indexOf("?")<0)?"?":"&";url+="addtotpoid="+this.currentId+"#att_"+this.currentId;url='http://login.yahoo.com/config/login?.src=trv&.done='+escape(url);content="<div>Please <a href='"+url+"'>sign in</a> to use this feature.";this.setContent(content);this.toggleBusy(false,node);this.open(node);return false;};YAHOO.Travel.addToTripClass.prototype.toggleBusy=function(state,node){if(!node){node=document.getElementById(this.attachedNode);}if(node&&node.firstChild){if(state){YAHOO.util.Dom.addClass(node.firstChild,'busy');}else{YAHOO.util.Dom.removeClass(node.firstChild,'busy');}}};YAHOO.Travel.addToTripClass.prototype.addToTrip=function(btn){if(!btn){return false;}var f=btn.form;var action=f.action;var v={};var addlArgs='';for(var i=0;i<f.elements.length;i++){var e=f.elements[i];if(e.tagName=='INPUT'||e.tagName=='SELECT'){v[e.name]=e.value;if(e.name!='ptitle'&&e.name!='pid')addlArgs+='&'+e.name+'='+escape(e.value);}}var url=trip_get_xml_url();var mode="js";var args='call_v=2';args+=addlArgs;if(v.ptitle){args+='&ptitle='+escape(v.ptitle);}else if(v.pid){var pid=v.pid;if(pid==-1){var ptitle=trip_get_name();if(ptitle){args+='&ptitle='+escape(ptitle);f.ptitle.value=escape(ptitle);}else{return false;}}else{args+='&pid='+pid;}}if(window.ytrv_mtm_tripPlannerSec){args+="&need_items=1";}btn.disabled=true;return!common_send_to_server(url,"POST",args);};YAHOO.Travel.addToTripClass.prototype.create=function(){var addtotrip=document.createElement("DIV");var content="<div class='title'><div id='addtotrip_animeEl' style='padding-left: 18px;'><span class='name' id='addtotrip_title'></span></div></div>";content+="<div class='content'></div><div class='bottom'>";content+="<a href='http://travel.yahoo.com/trip?action=create' target='"+this.hrefTarget+"'>Create a New Trip</a> | <a href='javascript: void(0);' onclick='return "+this.instance+".close(false);'>Close Window</a></div>";addtotrip.innerHTML=content;addtotrip.id='addtotrip_popup';addtotrip.className="dhtml_card";document.body.appendChild(addtotrip);this.oDomRef=addtotrip;};YAHOO.Travel._previousAddToTripImage='';YAHOO.Travel.addToTripClass.prototype.setImage=function(itemClass){if(!this.oDomRef){return false;}var posclass='',itemtype;switch(itemClass){case"Hotels":case"Lodging":itemtype='hotels';break;case"Attraction":case"Things to do":itemtype='thingstodo';break;case"Shopping locations":itemtype='shopping';break;case"Entertainment":itemtype='entertainment';break;case"Dining":case"Restaurants":itemtype='restaurants';break;case"Ski Resorts":itemtype='skiresort';break;case"Cities":case"Destinations":itemtype='city';break;case"Flights":itemtype='airport';break;default:itemtype='other';break;}posclass=YAHOO.Travel.getCatIconClass(itemtype,'white','green',true);var img=gebi('addtotrip_animeEl');if(img){img.className=posclass;}};YAHOO.Travel.addToTripClass.prototype.setTitle=function(text){if(!this.oDomRef){return false;}var title=gebi('addtotrip_title');title.innerHTML=text;};YAHOO.Travel.addToTripClass.prototype.tripAdded=function(pid,ptitle,numitems,items,newitem,msg){var url=trip_get_base_url()+"?p=trip&action=view&pid="+pid;var content="<div class='added'>";if(newitem){content+="Added to trip plan";}else{content+="Already added to trip plan";}content+="<br />";content+="<a href='"+url+"' target='"+this.hrefTarget+"'>"+ptitle+"</a>";this.setContent(content);this.closeTimeout=setTimeout('addToTripMod.close(true)',2000);if(newitem&&window.ytrv_mtm_tripPlannerSec){newItem=items.shift();ytrv_mtm_tripPlannerSec.attComponent.add(gebi('addtotrip_animeEl'),{"pid":pid,"title":ptitle,"numitems":numitems},newItem,items);}};YAHOO.Travel.addToTripClass.prototype.showSelectForm=function(){if(this.tripOptions==null){return false;}var content="<form>";content+="<input type='hidden' name='_crumb' value='"+this.tripOptions.crumb+"' />";content+="<input type='hidden' name='action' value='quickadd' />";if(this.currentClass=='Flights')content+="<input type='hidden' name='flight_id' value='"+this.currentId+"' />";else content+="<input type='hidden' name='oid' value='"+this.currentId+"' />";for(var k in this.currentItemExtraInfo){content+="<input type='hidden' name='"+k+"' value='"+this.currentItemExtraInfo[k]+"' />";}if(this.tripOptions['plans'].length>0){var plans=this.tripOptions['plans'];content+="<input type='button' class='abtn' name='btn' value='Add' onclick='addToTripMod.addToTrip(this);' />";content+="<select name='pid' class='ainput'>";for(i=0;i<plans.length; ++i){content+="<option value='"+plans[i].pid+"'>"+plans[i].title+"</option>";}content+="</select>";}else{content+="<input type='button' name='btn' class='cbtn' value='Create' disabled='true' onclick='addToTripMod.addToTrip(this);' />";content+="<input type='text' class='cinput' value='"+this.newTripDefault+"' name='ptitle' onfocus='addToTripMod.checkTextField(this, true);' onblur='addToTripMod.checkTextField(this, false);'>";}content+="</form>";this.setContent(content);};YAHOO.Travel.addToTripClass.prototype.checkTextField=function(field,focus){if(!field){return;}if(focus){if(field.value==this.newTripDefault){field.value="";field.form.btn.disabled=false;}}else{if(field.value==""){field.value=this.newTripDefault;field.form.btn.disabled=true;}}};function trip_cancel(thing){var p=thing.form.parentNode;p.style.display='none';p.innerHTML='';return false;}function trip_get_xml_url(){return"http://"+document.location.host+"/trip";}function trip_get_base_url(){return"http://"+document.location.host+"/trip";}
/* ? 2005 Yahoo! Inc. All rights reserved. */YAHOO.namespace("Travel");YAHOO.Travel.tglPlus=function(name,links,urlArgs,urlBase,beaconURL,callbackStr,clickBeacon){this.formRef=document.forms[name+"_tglplus"];this.links=links;this.calendar=null;this.name=name;this.tglPlusBcn="";this.clickBeacon=clickBeacon;this.urlBase=(urlBase!=null)?urlBase:"/common";var sep=(this.urlBase.indexOf("?") ==-1)?"?":"&";var callbackCmd=(callbackStr)?callbackStr:this.name+"_tglPlusObj.showDatedLinks";this.urlArgs=sep+"action=tglplus&callback="+callbackCmd;if(urlArgs){this.urlArgs+="&"+urlArgs;}this.beaconURL=(beaconURL!=null)?beaconURL:null;if(this.formRef){var beacon=document.createElement('img');beacon.id=this.name+'_tglPlusCalBeacon';beacon.style.visibility='hidden';beacon.style.width='0px';beacon.style.height='0px';document.body.appendChild(beacon);this.calendar=new YAHOO.Travel.calMgr(this.formRef.checkindate,this.formRef.checkoutdate,name,"Select your check-in date","Select your check-out date");if(this.calendar){var self=this;this.calendar.onHide=function(){return self.calHandler();};this.calendar.onBeforeHide=function(currDate,field){return self.checkCalDates(currDate,field);};}var self=this;if(this.formRef.checkindate){self.formRef.checkindate.onchange=function(){self.fieldHandler(this);}}if(this.formRef.checkoutdate){self.formRef.checkoutdate.onchange=function(){self.fieldHandler(this);}}}};YAHOO.Travel.tglPlus.prototype.calHandler=function(){if(this.tglPlusBcn==""){var beacon=document.getElementById(this.name+'_tglPlusCalBeacon');if(beacon&&this.beaconURL){this.tglPlusBcn=this.beaconURL+"?rnd="+Math.random();beacon.src=this.tglPlusBcn;}}if(this.updateFields()){this.getDatedTGL();}};YAHOO.Travel.tglPlus.prototype.fieldHandler=function(field){this.checkCalDates(field.value,field);if(this.updateFields()){this.getDatedTGL();}};YAHOO.Travel.tglPlus.prototype.getDatedTGL=function(){var checkIn=this.formRef.checkindate.value;var checkOut=this.formRef.checkoutdate.value;var guestCount=2;var roomCount=1;var currci=decodeURIComponent(this.formRef.currci.value);var currco=decodeURIComponent(this.formRef.currco.value);var currgc=2;var currrc=1;if(this.verifyDates(checkIn,checkOut)){checkIn=encodeURIComponent(checkIn);checkOut=encodeURIComponent(checkOut);var payload=new Array();for(var i=0;i<this.links.length; ++i){payload.push("url"+(i+1)+"="+encodeURI(this.links[i].url));payload.push("h"+(i+1)+"="+this.links[i].host);}payload.push("urlcount="+this.links.length);payload.push("checkin="+checkIn);payload.push("checkout="+checkOut);payload.push("guestcount="+guestCount);payload.push("roomcount="+roomCount);payload=payload.join("&");this.formRef.currci.value=checkIn;this.formRef.currco.value=checkOut;this.formRef.currgc.value=guestCount;this.formRef.currrc.value=roomCount;common_send_to_server(this.urlBase+this.urlArgs,"POST",payload);return true;}return false;};YAHOO.Travel.tglPlus.prototype.showDatedLinks=function(data){var tglpluslinks=document.getElementById(this.name+'_tglpluslinks');if(tglpluslinks){var children=tglpluslinks.childNodes;var row=0;for(i=0;i<children.length; ++i){var child=children[i];if(child.tagName=="LI"){child.onclick=null;for(j=0;j<child.childNodes.length; ++j){var child2=child.childNodes[j];if(child2.nodeType!=3){child2.onclick=null;}}YAHOO.util.Dom.setStyle(child,'opacity',0.01);}}for(i=0;i<children.length; ++i){var child=children[i];if(child.tagName=="LI"){if(data.links[row] !=0){child.className='dateenabled';var url=data.links[row].url;var partner=data.links[row].partner;var dates=data.checkin+"-"+data.checkout;var highlight=(typeof data.links[row].highlight!="undefined");text="Check "+dates+" on "+partner;tgl_show(child,url,text,.1+(.3*i),.5,highlight,this.clickBeacon);}else{child.style.display="none";}row++;}}}};YAHOO.Travel.tglPlus.prototype.updateFields=function(){var checkIn=this.formRef.checkindate.value;var checkOut=this.formRef.checkoutdate.value;if(checkIn!="mm/dd/yy"&&checkOut!="mm/dd/yy"){return true;}return false;};YAHOO.Travel.tglPlus.prototype.checkCalDates=function(currDate,field){var checkIn="";var checkOut="";if(field==this.formRef.checkindate){var checkIn=currDate;var checkOut=this.formRef.checkoutdate.value;}else{var checkIn=this.formRef.checkindate.value;var checkOut=currDate;}if(checkIn=='mm/dd/yy'||checkOut=='mm/dd/yy'){return true;}return this.verifyDates(checkIn,checkOut);};YAHOO.Travel.tglPlus.prototype.verifyDates=function(checkIn,checkOut){if(checkIn.search(/^[0-1][0-9]\/[0-3][0-9]\/(\d{2}|\d{4})$/) !=0||checkOut.search(/^[0-1][0-9]\/[0-3][0-9]\/(\d{2}|\d{4})$/) !=0){this.setError("Please enter your dates in mm/dd/yy format.");return false;}if(checkOut==checkIn){this.setError("Your Check-out date is the same as your Check-in date. Please change your dates.");return false;}months=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];checkInArr=checkIn.split("/");checkInArr[0]=parseInt(checkInArr[0],10);checkInMonth=(checkInArr[0] <=12)?months[checkInArr[0]-1]:checkInArr[0];if(checkInArr[2].length==2){checkInArr[2]="20"+checkInArr[2];}checkOutArr=checkOut.split("/");checkOutArr[0]=parseInt(checkOutArr[0],10);checkOutMonth=(checkOutArr[0] <=12)?months[checkOutArr[0]-1]:checkOutArr[0];if(checkOutArr[2].length==2){checkOutArr[2]="20"+checkOutArr[2];}checkIn=checkInMonth+" "+checkInArr[1]+", "+checkInArr[2];checkOut=checkOutMonth+" "+checkOutArr[1]+", "+checkOutArr[2];checkIn=new Date(checkIn);checkOut=new Date(checkOut);if(checkIn.getFullYear() !=checkInArr[2] ||checkIn.getMonth() !=(checkInArr[0]-1) ||checkIn.getDate() !=checkInArr[1]){this.setError("Your Check-in date is invalid. Please enter a new date.");return false;}if(checkOut.getFullYear() !=checkOutArr[2] ||checkOut.getMonth() !=(checkOutArr[0]-1) ||checkOut.getDate() !=checkOutArr[1]){this.setError("Your Check-out date is invalid. Please enter a new date.");return false;}if(checkOut<checkIn){this.setError("Your Check-out date is before your Check-in date. Please change your dates.");return false;}if((checkOut-checkIn)>(86400000*30)){this.setError("Reservations are limited to a 30 day maximum.  Please enter new dates.");return false;}var tmp=new Date();if(checkIn<tmp||checkOut<tmp){this.setError("Your Check-in date is in the past.  Please enter new dates.");return false;}if(checkIn.valueOf()>(tmp.valueOf()+(86400000*364))){this.setError("Reservations beyond 364 days are not available. Please enter new dates.");return false;}this.setError("");return true;};YAHOO.Travel.tglPlus.prototype.setError=function(string){var errorBox=document.getElementById(this.name+'_tglerror');if(errorBox){errorBox.innerHTML=string;if(string!=""){errorBox.style.display="block";highlight(errorBox);}else{errorBox.style.display="none";}}};function highlight(el,time,fadeTime){if(typeof el=='string'){el=document.getElementById(el);}if(el){if(time==null){time=1000;}else{time=time*1000;}if(fadeTime==null){fadeTime=1;}el.style.backgroundColor='rgb(255, 255, 167)';var clrTimeout=function(){var fade=new YAHOO.util.ColorAnim(el,{backgroundColor:{from:'#FFFFA7',to:'#F9F9EF'}},1,YAHOO.util.Easing.easeOut);fade.animate();};window.setTimeout(clrTimeout,time);}}function tgl_show(el,url,txt,time,fadeTime,bold,clickBeacon){if(typeof el=='string'){el=document.getElementById(el);}if(el){if(time==null){time=100;}else{time=time*1000;}if(fadeTime==null){fadeTime=1;}var argleBargle=function(){var linkclass="";if(bold){linkclass=" class='hilite'";}el.innerHTML="<a href='"+url+"'"+linkclass+">"+txt+"</a>";for(j=0;j<el.childNodes.length; ++j){var child2=el.childNodes[j];if(child2.tagName=="A"||child2.tagName=="INPUT"){child2.onclick=createTGLOnclick(url,clickBeacon);}}var fade=new YAHOO.util.Anim(el,{opacity:{to:0.99}},fadeTime,YAHOO.util.Easing.easeOut);fade.animate();};window.setTimeout(argleBargle,time);}}function createTGLOnclick(url,clickBeacon){return function(){if(clickBeacon&&clickBeacon=='cj'){beacon_cj_tgl();}yg_popup(url,'ImageSearch',750,500,63);return false;}}function record_cj_click(cat,test){if(!cat){return;}var tracking_container='yshp_aff_track_cont';var el=document.getElementById('yshp_aff_track_cont');if(el)document.body.removeChild(el);el=document.createElement('img');el.id=tracking_container;el.style.cssFloat='left';el.style.width='1px';el.style.height='1px';el.src='http://www.emjcd.com/u?CID=1121438&OID=travel'+Number(new Date)+'&TYPE=309288&ITEM1='+cat+'&AMT1=0&QTY1=1&CURRENCY=USD&METHOD=IMG';if(test){alert('Will beacon '.el.src);}document.body.insertBefore(el,document.body.firstChild);wait_for_beacon();return;}function beacon_cj_tgl(){var dd=new Date();var st=dd.getMilliseconds();var tracking_container='ytrv_aff_track_tgl'+st;var el=document.getElementById(tracking_container);if(el)document.body.removeChild(el);el=document.createElement('img');el.id=tracking_container;el.style.cssFloat='left';el.style.width='1px';el.style.height='1px';el.src='http://www.emjcd.com/u?CID=1121438&OID=travel'+Number(new Date)+'&TYPE=316589&ITEM1=tgllink&AMT1=0&QTY1=1&CURRENCY=USD&METHOD=IMG';document.body.insertBefore(el,document.body.firstChild);wait_for_beacon();return;}function beacon_cj_tso(tsocat){var dd=new Date();var st=dd.getMilliseconds();var tracking_container='ytrv_aff_track_tgl'+st;var el=document.getElementById(tracking_container);if(el)document.body.removeChild(el);el=document.createElement('img');el.id=tracking_container;el.style.cssFloat='left';el.style.width='1px';el.style.height='1px';el.src='http://www.emjcd.com/u?CID=1121438&OID=travel'+Number(new Date)+'&TYPE=316589&ITEM1='+tsocat+'&AMT1=0&QTY1=1&CURRENCY=USD&METHOD=IMG';document.body.insertBefore(el,document.body.firstChild);wait_for_beacon();return;}function beacon_cj_ov(){var dd=new Date();var st=dd.getMilliseconds();var tracking_container='ytrv_aff_track_ov'+st;var el=document.getElementById(tracking_container);if(el)document.body.removeChild(el);el=document.createElement('img');el.id=tracking_container;el.style.cssFloat='left';el.style.width='1px';el.style.height='1px';el.src='http://www.emjcd.com/u?CID=1121438&OID=travel'+Number(new Date)+'&TYPE=316588&ITEM1=ovlink&AMT1=0&QTY1=1&CURRENCY=USD&METHOD=IMG';document.body.insertBefore(el,document.body.firstChild);wait_for_beacon();return;}function wait_for_beacon(){var dd=new Date();var st=dd.getMilliseconds();var et=st+500;for(var i=0;i<50;i++){var links=document.getElementsByTagName('div');var cpcLinks=[];var to=links.length;if(to>50)to=20;for(var j=0;j<to;j++){var lnk=links[j];var k=lnk.innerHTML.indexOf('Compare');if(k>0)cpcLinks.push({'link':lnk});}var dd=new Date();var tt=dd.getMilliseconds();if(tt<=st)tt+=1000;if(tt>=et)break;}var dd=new Date();}
/* ? 2005 Yahoo! Inc. All rights reserved. */if(typeof(YAHOO.util.ImageLoader) =='undefined'){YAHOO.util.ImageLoader={};}YAHOO.util.ImageLoader.group=function(trigEl,trigAct,timeout){this.name='unnamed';this._imgObjs={};this.timeoutLen=timeout;this._timeout=null;this._triggers=[];this._customTriggers=[];this.foldConditional=false;this.className=null;this._classImageEls=null;YAHOO.util.Event.addListener(window,'load',this._onloadTasks,this,true);this.addTrigger(trigEl,trigAct);};YAHOO.util.ImageLoader.group.prototype.addTrigger=function(trigEl,trigAct){if(!trigEl||!trigAct){return;}var wrappedFetch=function(){this.fetch();};this._triggers.push([trigEl,trigAct,wrappedFetch]);YAHOO.util.Event.addListener(trigEl,trigAct,wrappedFetch,this,true);};YAHOO.util.ImageLoader.group.prototype.addCustomTrigger=function(event){if(!event||!event instanceof YAHOO.util.CustomEvent){return;}var wrappedFetch=function(){this.fetch();};this._customTriggers.push([event,wrappedFetch]);event.subscribe(wrappedFetch,this,true);};YAHOO.util.ImageLoader.group.prototype._onloadTasks=function(){if(this.timeoutLen&&typeof(this.timeoutLen) =='number'&&this.timeoutLen>0){this._timeout=setTimeout(this._getFetchTimeout(),this.timeoutLen*1000);}if(this.foldConditional){this._foldCheck();}};YAHOO.util.ImageLoader.group.prototype._getFetchTimeout=function(){var self=this;return function(){self.fetch();};};YAHOO.util.ImageLoader.group.prototype.registerBgImage=function(domId,url){this._imgObjs[domId]=new YAHOO.util.ImageLoader.bgImgObj(domId,url);return this._imgObjs[domId];};YAHOO.util.ImageLoader.group.prototype.registerSrcImage=function(domId,url,width,height){this._imgObjs[domId]=new YAHOO.util.ImageLoader.srcImgObj(domId,url,width,height);return this._imgObjs[domId];};YAHOO.util.ImageLoader.group.prototype.registerPngBgImage=function(domId,url){this._imgObjs[domId]=new YAHOO.util.ImageLoader.pngBgImgObj(domId,url);return this._imgObjs[domId];};YAHOO.util.ImageLoader.group.prototype.fetch=function(){YAHOO.log('Fetching images in group: "'+this.name+'".','info','imageloader');clearTimeout(this._timeout);for(var i=0;i<this._triggers.length;i++){YAHOO.util.Event.removeListener(this._triggers[i][0],this._triggers[i][1],this._triggers[i][2]);}for(var i=0;i<this._customTriggers.length;i++){this._customTriggers[i][0].unsubscribe(this._customTriggers[i][1],this);}this._fetchByClass();for(var id in this._imgObjs){if(YAHOO.lang.hasOwnProperty(this._imgObjs,id)){this._imgObjs[id].fetch();}}};YAHOO.util.ImageLoader.group.prototype._foldCheck=function(){YAHOO.log('Checking for images above the fold in group: "'+this.name+'"','info','imageloader');var scrollTop=(document.compatMode!='CSS1Compat')?document.body.scrollTop:document.documentElement.scrollTop;var viewHeight=YAHOO.util.Dom.getViewportHeight();var hLimit=scrollTop+viewHeight;var scrollLeft=(document.compatMode!='CSS1Compat')?document.body.scrollLeft:document.documentElement.scrollLeft;var viewWidth=YAHOO.util.Dom.getViewportWidth();var wLimit=scrollLeft+viewWidth;for(var id in this._imgObjs){if(YAHOO.lang.hasOwnProperty(this._imgObjs,id)){var elPos=YAHOO.util.Dom.getXY(this._imgObjs[id].domId);if