YAHOO.namespace("YAHOO.Travel2");function yg_popup(D,H,B,E,C){var A=[],G=null,F=arguments;A[0]="width="+B+",height="+E;A[1]=",scrollbars="+((C&1)?1:0);A[2]=",resizable="+((C&2)?1:0);A[3]=",toolbar="+((C&4)?1:0);A[4]=",status="+((C&8)?1:0);A[5]=",location="+((C&16)?1:0);A[6]=",menubar="+((C&32)?1:0);if(F.length>=6){A[7]=(document.layers)?",screenX="+F[5]:",left="+F[5]}if(F.length>=7){A[8]=(document.layers)?",screenY="+F[6]:",top="+F[6]}A=A.join("");G=open(D,H,A);if(G){G.focus()}return G}function startshow(C,B,A,D){window.name="slideshowparent";var E=window.open(C,B,"width="+A+",height="+D+", resizable=yes,scrollbars=no ");if(E){E.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(C){var B,A;if(isObject(C)){for(B in C){A=C[B];if(isUndefined(A)&&isFunction(A)){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(A){return document.getElementById(A)}function clog(A){if(!document.all){if(window.console){console.log(A)}}}YAHOO.widget.AutoComplete=function(H,F,A,G){if(H&&F&&A){if(A&&(A instanceof YAHOO.widget.DataSource)){this.dataSource=A}else{return }if(YAHOO.util.Dom.inDocument(H)){if(typeof H=="string"){this._sName="instance"+YAHOO.widget.AutoComplete._nIndex+" "+H;this._oTextbox=document.getElementById(H)}else{this._sName=(H.id)?"instance"+YAHOO.widget.AutoComplete._nIndex+" "+H.id:"instance"+YAHOO.widget.AutoComplete._nIndex;this._oTextbox=H}}else{return }if(YAHOO.util.Dom.inDocument(F)){if(typeof F=="string"){this._oContainer=document.getElementById(F)}else{this._oContainer=F}if(this._oContainer.style.display=="none"){}}else{return }if(typeof G=="object"){for(var E in G){if(E){this[E]=G[E]}}}this._initContainer();this._initProps();this._initList();this._initContainerHelpers();var C=this;var B=this._oTextbox;var D=this._oContainer._oContent;YAHOO.util.Event.addListener(B,"keyup",C._onTextboxKeyUp,C);YAHOO.util.Event.addListener(B,"keydown",C._onTextboxKeyDown,C);YAHOO.util.Event.addListener(B,"keypress",C._onTextboxKeyPress,C);YAHOO.util.Event.addListener(B,"focus",C._onTextboxFocus,C);YAHOO.util.Event.addListener(B,"blur",C._onTextboxBlur,C);YAHOO.util.Event.addListener(D,"mouseover",C._onContainerMouseover,C);YAHOO.util.Event.addListener(D,"mouseout",C._onContainerMouseout,C);YAHOO.util.Event.addListener(D,"scroll",C._onContainerScroll,C);YAHOO.util.Event.addListener(D,"resize",C._onContainerResize,C);if(B.form){YAHOO.util.Event.addListener(B.form,"submit",C._onFormSubmit,C)}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);B.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(A){if(A._oResultData){return A._oResultData}else{return false}};YAHOO.widget.AutoComplete.prototype.setHeader=function(A){if(A){if(this._oContainer._oContent._oHeader){this._oContainer._oContent._oHeader.innerHTML=A;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(A){if(A){if(this._oContainer._oContent._oFooter){this._oContainer._oContent._oFooter.innerHTML=A;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(A){if(A){if(this._oContainer._oContent._oBody){this._oContainer._oContent._oBody.innerHTML=A;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(B,C){var A=B[0];if(A){return A}else{return""}};YAHOO.widget.AutoComplete.prototype.sendQuery=function(A){if(A){this._sendQuery(A)}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 A=this.minQueryLength;if(isNaN(A)||(A<1)){A=1}var D=this.maxResultsDisplayed;if(isNaN(this.maxResultsDisplayed)||(this.maxResultsDisplayed<1)){this.maxResultsDisplayed=10}var E=this.queryDelay;if(isNaN(this.queryDelay)||(this.queryDelay<0)){this.queryDelay=0.5}var B=(this.delimChar)?this.delimChar:null;if(B){if(typeof B=="string"){this.delimChar=[B]}else{if(B.constructor!=Array){this.delimChar=null}}}var C=this.animSpeed;if((this.animHoriz||this.animVert)&&YAHOO.util.Anim){if(isNaN(C)||(C<0)){C=0.3}if(!this._oAnim){oAnim=new YAHOO.util.Anim(this._oContainer._oContent,{},this.animSpeed);this._oAnim=oAnim}else{this._oAnim.duration=C}}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 B=document.createElement("div");B.className="yui-ac-shadow";this._oContainer._oShadow=this._oContainer.appendChild(B)}if(this.useIFrame&&!this._oContainer._oIFrame){var A=document.createElement("iframe");A.src=this._iFrameSrc;A.frameBorder=0;A.scrolling="no";A.style.position="absolute";A.style.width="100%";A.style.height="100%";this._oContainer._oIFrame=this._oContainer.appendChild(A)}};YAHOO.widget.AutoComplete.prototype._initContainer=function(){if(!this._oContainer._oContent){var D=document.createElement("div");D.className="yui-ac-content";D.style.display="none";this._oContainer._oContent=this._oContainer.appendChild(D);var B=document.createElement("div");B.className="yui-ac-hd";B.style.display="none";this._oContainer._oContent._oHeader=this._oContainer._oContent.appendChild(B);var C=document.createElement("div");C.className="yui-ac-bd";this._oContainer._oContent._oBody=this._oContainer._oContent.appendChild(C);var A=document.createElement("div");A.className="yui-ac-ft";A.style.display="none";this._oContainer._oContent._oFooter=this._oContainer._oContent.appendChild(A)}else{}};YAHOO.widget.AutoComplete.prototype._initList=function(){this._aListItems=[];while(this._oContainer._oContent._oBody.hasChildNodes()){var B=this.getListItems();if(B){for(var A=B.length-1;A>=0;C--){B[A]=null}}this._oContainer._oContent._oBody.innerHTML=""}var E=document.createElement("ul");E=this._oContainer._oContent._oBody.appendChild(E);for(var C=0;C<this.maxResultsDisplayed;C++){var D=document.createElement("li");D=E.appendChild(D);this._aListItems[C]=D;this._initListItem(D,C)}this._maxResultsDisplayed=this.maxResultsDisplayed};YAHOO.widget.AutoComplete.prototype._initListItem=function(C,B){var A=this;C.style.display="none";C._nItemIndex=B;C.mouseover=C.mouseout=C.onclick=null;YAHOO.util.Event.addListener(C,"mouseover",A._onItemMouseover,A);YAHOO.util.Event.addListener(C,"mouseout",A._onItemMouseout,A);YAHOO.util.Event.addListener(C,"click",A._onItemMouseclick,A)};YAHOO.widget.AutoComplete.prototype._onItemMouseover=function(A,B){if(B.prehighlightClassName){B._togglePrehighlight(this,"mouseover")}else{B._toggleHighlight(this,"to")}B.itemMouseOverEvent.fire(B,this)};YAHOO.widget.AutoComplete.prototype._onItemMouseout=function(A,B){if(B.prehighlightClassName){B._togglePrehighlight(this,"mouseout")}else{B._toggleHighlight(this,"from")}B.itemMouseOutEvent.fire(B,this)};YAHOO.widget.AutoComplete.prototype._onItemMouseclick=function(A,B){B._toggleHighlight(this,"to");B._selectItem(this)};YAHOO.widget.AutoComplete.prototype._onContainerMouseover=function(A,B){B._bOverContainer=true};YAHOO.widget.AutoComplete.prototype._onContainerMouseout=function(A,B){B._bOverContainer=false;if(B._oCurItem){B._toggleHighlight(B._oCurItem,"to")}};YAHOO.widget.AutoComplete.prototype._onContainerScroll=function(A,B){B._oTextbox.focus()};YAHOO.widget.AutoComplete.prototype._onContainerResize=function(A,B){B._toggleContainerHelpers(B._bContainerOpen)};YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown=function(A,B){var C=A.keyCode;switch(C){case 9:if(B.delimChar&&(B._nKeyCode!=C)){if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A)}}if(B._oCurItem){B._selectItem(B._oCurItem)}else{B._clearList()}break;case 13:if(B._nKeyCode!=C){if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A)}}if(B._oCurItem){B._selectItem(B._oCurItem)}else{B._clearList()}break;case 27:B._clearList();return ;case 39:B._jumpSelection();break;case 38:YAHOO.util.Event.stopEvent(A);B._moveSelection(C);break;case 40:YAHOO.util.Event.stopEvent(A);B._moveSelection(C);break;default:break}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress=function(A,B){var C=A.keyCode;switch(C){case 9:case 13:if((B._nKeyCode!=C)){YAHOO.util.Event.stopEvent(A)}break;case 38:case 40:YAHOO.util.Event.stopEvent(A);break;default:break}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp=function(B,D){D._initProps();var E=B.keyCode;D._nKeyCode=E;var F=String.fromCharCode(E);var C=this.value;if(D._isIgnoreKey(E)||(C.toLowerCase()==D._sCurQuery)){return }else{D.textboxKeyEvent.fire(D,E)}if(D.queryDelay>0){var A=setTimeout(function(){D._sendQuery(C)},(D.queryDelay*1000));if(D._nDelayID!=-1){clearTimeout(D._nDelayID)}D._nDelayID=A}else{D._sendQuery(C)}};YAHOO.widget.AutoComplete.prototype._isIgnoreKey=function(A){if((A==9)||(A==13)||(A==16)||(A==17)||(A>=18&&A<=20)||(A==27)||(A>=33&&A<=35)||(A>=36&&A<=38)||(A==40)||(A>=44&&A<=45)){return true}return false};YAHOO.widget.AutoComplete.prototype._onTextboxFocus=function(A,B){B._oTextbox.setAttribute("autocomplete","off");B._bFocused=true;B.textboxFocusEvent.fire(B)};YAHOO.widget.AutoComplete.prototype._onTextboxBlur=function(A,B){if(!B._bOverContainer||(B._nKeyCode==9)){if(!B._bItemSelected){if(!B._bContainerOpen||(B._bContainerOpen&&!B._textMatchesOption())){if(B.forceSelection){B._clearSelection()}else{B.unmatchedItemSelectEvent.fire(B,B._sCurQuery)}}}if(B._bContainerOpen){B._clearList()}B._bFocused=false;B.textboxBlurEvent.fire(B)}};YAHOO.widget.AutoComplete.prototype._onFormSubmit=function(A,B){if(B.allowBrowserAutocomplete){B._oTextbox.setAttribute("autocomplete","on")}else{B._oTextbox.setAttribute("autocomplete","off")}};YAHOO.widget.AutoComplete.prototype._sendQuery=function(G){var C=(this.delimChar)?this.delimChar:null;if(C){var E=-1;for(var B=C.length-1;B>=0;B--){var F=G.lastIndexOf(C[B]);if(F>E){E=F}}if(C[B]==" "){for(var A=C.length-1;A>=0;A--){if(G[E-1]==C[A]){E--;break}}}if(E>-1){var D=E+1;while(G.charAt(D)==" "){D+=1}this._sSavedQuery=G.substring(0,D);G=G.substr(D)}else{if(G.indexOf(this._sSavedQuery)<0){this._sSavedQuery=null}}}if(G.length<this.minQueryLength){if(this._nDelayID!=-1){clearTimeout(this._nDelayID)}this._clearList();return }G=encodeURIComponent(G);this._nDelayID=-1;this.dataRequestEvent.fire(this,G);this.dataSource.getResults(this._populateList,G,this)};YAHOO.widget.AutoComplete.prototype._clearList=function(){this._oContainer._oContent.scrollTop=0;var A=this._aListItems;if(A&&(A.length>0)){for(var B=A.length-1;B>=0;B--){A[B].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(J,K,I){if(K===null){I.dataErrorEvent.fire(I,J)}if(!I._bFocused||!K){return }var A=(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);var N=I._oContainer._oContent.style;N.width=(!A)?null:"";N.height=(!A)?null:"";var H=decodeURIComponent(J);I._sCurQuery=H;I._bItemSelected=false;if(I._maxResultsDisplayed!=I.maxResultsDisplayed){I._initList()}var C=Math.min(K.length,I.maxResultsDisplayed);I._nDisplayedItems=C;if(C>0){I._initContainerHelpers();var D=I._aListItems;for(var G=C-1;G>=0;G--){var M=D[G];var B=K[G];M.innerHTML=I.formatResult(B,H);M.style.display="list-item";M._sResultKey=B[0];M._oResultData=B}for(var F=D.length-1;F>=C;F--){var L=D[F];L.innerHTML=null;L.style.display="none";L._sResultKey=null;L._oResultData=null}if(I.autoHighlight){var E=D[0];I._toggleHighlight(E,"to");I.itemArrowToEvent.fire(I,E);I._typeAhead(E,J)}else{I._oCurItem=null}I._toggleContainer(true)}else{I._clearList()}I.dataReturnEvent.fire(I,J,K)};YAHOO.widget.AutoComplete.prototype._clearSelection=function(){var C=this._oTextbox.value;var B=(this.delimChar)?this.delimChar[0]:null;var A=(B)?C.lastIndexOf(B,C.length-2):-1;if(A>-1){this._oTextbox.value=C.substring(0,A)}else{this._oTextbox.value=""}this._sSavedQuery=this._oTextbox.value;this.selectionEnforceEvent.fire(this)};YAHOO.widget.AutoComplete.prototype._textMatchesOption=function(){var D=false;for(var A=this._nDisplayedItems-1;A>=0;A--){var C=this._aListItems[A];var B=C._sResultKey.toLowerCase();if(B==this._sCurQuery.toLowerCase()){D=true;break}}return(D)};YAHOO.widget.AutoComplete.prototype._typeAhead=function(E,G){if(!this.typeAhead){return }var B=this._oTextbox;var F=this._oTextbox.value;if(!B.setSelectionRange&&!B.createTextRange){return }var C=F.length;this._updateValue(E);var D=B.value.length;this._selectText(B,C,D);var A=B.value.substr(C,D);this.typeAheadEvent.fire(this,G,A)};YAHOO.widget.AutoComplete.prototype._selectText=function(A,B,C){if(A.setSelectionRange){A.setSelectionRange(B,C)}else{if(A.createTextRange){var D=A.createTextRange();D.moveStart("character",B);D.moveEnd("character",C-A.value.length);D.select()}else{A.select()}}};YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers=function(B){var D=false;var C=this._oContainer._oContent.offsetWidth+"px";var A=this._oContainer._oContent.offsetHeight+"px";if(this.useIFrame&&this._oContainer._oIFrame){D=true;if(this.alwaysShowContainer||B){this._oContainer._oIFrame.style.width=C;this._oContainer._oIFrame.style.height=A}else{this._oContainer._oIFrame.style.width=0;this._oContainer._oIFrame.style.height=0}}if(this.useShadow&&this._oContainer._oShadow){D=true;if(this.alwaysShowContainer||B){this._oContainer._oShadow.style.width=C;this._oContainer._oShadow.style.height=A}else{this._oContainer._oShadow.style.width=0;this._oContainer._oShadow.style.height=0}}};YAHOO.widget.AutoComplete.prototype._toggleContainer=function(H){if(this.alwaysShowContainer){if(H){this.containerExpandEvent.fire(this)}else{this.containerCollapseEvent.fire(this)}this._bContainerOpen=H;return }var J=this._oContainer;if(!H&&!this._bContainerOpen){J._oContent.style.display="none";return }var A=this._oAnim;if(A&&A.getEl()&&(this.animHoriz||this.animVert)){if(!H){this._toggleContainerHelpers(H)}if(A.isAnimated()){A.stop()}var F=J._oContent.cloneNode(true);J.appendChild(F);F.style.top="-9000px";F.style.display="block";var E=F.offsetWidth;var C=F.offsetHeight;var B=(this.animHoriz)?0:E;var D=(this.animVert)?0:C;A.attributes=(H)?{width:{to:E},height:{to:C}}:{width:{to:B},height:{to:D}};if(H&&!this._bContainerOpen){J._oContent.style.width=B+"px";J._oContent.style.height=D+"px"}else{J._oContent.style.width=E+"px";J._oContent.style.height=C+"px"}J.removeChild(F);F=null;var G=this;var I=function(){A.onComplete.unsubscribeAll();if(H){G.containerExpandEvent.fire(G)}else{J._oContent.style.display="none";G.containerCollapseEvent.fire(G)}G._toggleContainerHelpers(H)};J._oContent.style.display="block";A.onComplete.subscribe(I);A.animate();this._bContainerOpen=H}else{if(H){J._oContent.style.display="block";this.containerExpandEvent.fire(this)}else{J._oContent.style.display="none";this.containerCollapseEvent.fire(this)}this._toggleContainerHelpers(H);this._bContainerOpen=H}};YAHOO.widget.AutoComplete.prototype._toggleHighlight=function(A,C){var B=this.highlightClassName;if(this._oCurItem){YAHOO.util.Dom.removeClass(this._oCurItem,B)}if((C=="to")&&B){YAHOO.util.Dom.addClass(A,B);this._oCurItem=A}};YAHOO.widget.AutoComplete.prototype._togglePrehighlight=function(A,C){if(A==this._oCurItem){return }var B=this.prehighlightClassName;if((C=="mouseover")&&B){YAHOO.util.Dom.addClass(A,B)}else{YAHOO.util.Dom.removeClass(A,B)}};YAHOO.widget.AutoComplete.prototype._updateValue=function(F){var C=this._oTextbox;var E=(this.delimChar)?this.delimChar[0]:null;var B=this._sSavedQuery;var D=F._sResultKey;C.focus();C.value="";if(E){if(B){C.value=B}C.value+=D+E;if(E!=" "){C.value+=" "}}else{C.value=D}if(C.type=="textarea"){C.scrollTop=C.scrollHeight}var A=C.value.length;this._selectText(C,A,A);this._oCurItem=F};YAHOO.widget.AutoComplete.prototype._selectItem=function(A){this._bItemSelected=true;this._updateValue(A);this.itemSelectEvent.fire(this,A,A._oResultData);this._clearList()};YAHOO.widget.AutoComplete.prototype._jumpSelection=function(){if(!this.typeAhead){return }else{this._clearList()}};YAHOO.widget.AutoComplete.prototype._moveSelection=function(G){if(this._bContainerOpen){var D=this._oCurItem;var F=-1;if(D){F=D._nItemIndex}var C=(G==40)?(F+1):(F-1);if(C<-2||C>=this._nDisplayedItems){return }if(D){this._toggleHighlight(D,"from");this.itemArrowFromEvent.fire(this,D)}if(C==-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(C==-2){this._clearList();return }var B=this._aListItems[C];var E=this._oContainer._oContent;var A=((YAHOO.util.Dom.getStyle(E,"overflow")=="auto")||(YAHOO.util.Dom.getStyle(E,"overflowY")=="auto"));if(A&&(C>-1)&&(C<this._nDisplayedItems)){if(G==40){if((B.offsetTop+B.offsetHeight)>(E.scrollTop+E.offsetHeight)){E.scrollTop=(B.offsetTop+B.offsetHeight)-E.offsetHeight}else{if((B.offsetTop+B.offsetHeight)<E.scrollTop){E.scrollTop=B.offsetTop}}}else{if(B.offsetTop<E.scrollTop){this._oContainer._oContent.scrollTop=B.offsetTop}else{if(B.offsetTop>(E.scrollTop+E.offsetHeight)){this._oContainer._oContent.scrollTop=(B.offsetTop+B.offsetHeight)-E.offsetHeight}}}}this._toggleHighlight(B,"to");this.itemArrowToEvent.fire(this,B);if(this.typeAhead){this._updateValue(B)}}};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(A,D,B){var C=this._doQueryCache(A,D,B);if(C.length===0){this.queryEvent.fire(this,B,D);this.doQuery(A,D,B)}};YAHOO.widget.DataSource.prototype.doQuery=function(A,C,B){};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 A=this.maxCacheEntries;if(isNaN(A)||(A<0)){A=0}if(A>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(B){var A=this._aCache;if(!A||!B||!B.query||!B.results){return }if(A.length>=this.maxCacheEntries){A.shift()}A.push(B)};YAHOO.widget.DataSource.prototype._doQueryCache=function(A,I,N){var H=[];var G=false;var J=this._aCache;var F=(J)?J.length:0;var K=this.queryMatchContains;if((this.maxCacheEntries>0)&&J&&(F>0)){this.cacheQueryEvent.fire(this,N,I);if(!this.queryMatchCase){var D=I;I=I.toLowerCase()}for(var P=F-1;P>=0;P--){var E=J[P];var B=E.results;var C=(!this.queryMatchCase)?encodeURIComponent(E.query.toLowerCase()):encodeURIComponent(E.query);if(C==I){G=true;H=B;if(P!=F-1){J.splice(P,1);this._addCacheElem(E)}break}else{if(this.queryMatchSubset){for(var O=I.length-1;O>=0;O--){var R=I.substr(0,O);if(C==R){G=true;for(var M=B.length-1;M>=0;M--){var Q=B[M];var L=(this.queryMatchCase)?encodeURIComponent(Q[0]).indexOf(I):encodeURIComponent(Q[0]).toLowerCase().indexOf(I);if((!K&&(L===0))||(K&&(L>-1))){H.unshift(Q)}}E={};E.query=I;E.results=H;this._addCacheElem(E);break}}if(G){break}}}}if(G){this.getCachedResultsEvent.fire(this,N,D,H);A(D,H,N)}}return H};YAHOO.widget.DS_XHR=function(C,A,D){if(typeof D=="object"){for(var B in D){this[B]=D[B]}}if(!A||(A.constructor!=Array)){return }else{this.schema=A}this.scriptURI=C;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(E,G,B){var J=(this.responseType==this.TYPE_XML);var D=this.scriptURI+"?"+this.scriptQueryParam+"="+G;if(this.scriptQueryAppend.length>0){D+="&"+this.scriptQueryAppend}var C=null;var F=this;var I=function(K){if(!F._oConn||(K.tId!=F._oConn.tId)){F.dataErrorEvent.fire(F,B,G,F.ERROR_DATANULL);return }for(var N in K){}if(!J){K=K.responseText}else{K=K.responseXML}if(K===null){F.dataErrorEvent.fire(F,B,G,F.ERROR_DATANULL);return }var M=F.parseResponse(G,K,B);var L={};L.query=decodeURIComponent(G);L.results=M;if(M===null){F.dataErrorEvent.fire(F,B,G,F.ERROR_DATAPARSE);return }else{F.getResultsEvent.fire(F,B,G,M);F._addCacheElem(L);E(G,M,B)}};var A=function(K){F.dataErrorEvent.fire(F,B,G,F.ERROR_DATAXHR);return };var H={success:I,failure:A};if(!isNaN(this.connTimeout)&&this.connTimeout>0){H.timeout=this.connTimeout}if(this._oConn){YAHOO.util.Connect.abort(this._oConn)}F._oConn=YAHOO.util.Connect.asyncRequest("GET",D,H,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(A,C){if(typeof C=="object"){for(var B in C){this[B]=C[B]}}if(!A||(A.constructor!=Function)){return }else{this.dataFunction=A;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(C,F,D){var B=this.dataFunction;var E=[];E=B(F);if(E===null){this.dataErrorEvent.fire(this,D,F,this.ERROR_DATANULL);return }var A={};A.query=decodeURIComponent(F);A.results=E;this._addCacheElem(A);this.getResultsEvent.fire(this,D,F,E);C(F,E,D);return };YAHOO.widget.DS_JSArray=function(A,C){if(typeof C=="object"){for(var B in C){this[B]=C[B]}}if(!A||(A.constructor!=Array)){return }else{this.data=A;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(E,I,A){var C=this.data;var J=[];var D=false;var B=this.queryMatchContains;if(!this.queryMatchCase){I=I.toLowerCase()}for(var F=C.length-1;F>=0;F--){var H=[];if(C[F]){if(C[F].constructor==String){H[0]=C[F]}else{if(C[F].constructor==Array){H=C[F]}}}if(H[0]&&(H[0].constructor==String)){var G=(this.queryMatchCase)?encodeURIComponent(H[0]).indexOf(I):encodeURIComponent(H[0]).toLowerCase().indexOf(I);if((!B&&(G===0))||(B&&(G>-1))){J.unshift(H)}}}this.getResultsEvent.fire(this,A,I,J);E(I,J,A)};YAHOO.util.Event.addListener(window,"load",trv_auto_sug_onload);function trvchkQuery(C,A,B){var D=document.getElementById(A);if(!D){return false}D.value=D.value.replace(/^\s+|\s+$/,"");if(D.value==""){if(!self.oldTxtBoxColor){oldTxtBoxColor=D.style.color}D.style.color="red";D.value=B;D.blur();return false}else{if(D.value==B){return false}else{return true}}}function trvclrQuery(E,A,D){var F=document.getElementById(A);if(!F){return }if(self.oldTxtBoxColor){F.style.color=oldTxtBoxColor}else{F.style.color="black"}var C=A+"SugId";var B=document.getElementById(C);if(B){B.value=0}if(F.value==D){F.value=""}}function trv_auto_sug_onload(){if(!self.atcInputArray){return }if(self.oACDS){return }var C="/bin/search/vespa_autocomplete_service.php";oACDS=new YAHOO.widget.DS_XHR(C,["result","title","searchgroup","oid","state","city","country","popularity"]);oACDS.responseType=oACDS.TYPE_XML;oACDS.queryMatchContains=true;oACDS.responseStripAfter="<!--";var A="http://us.js2.yimg.com/us.js.yimg.com/static/i/travel/trvatc/";for(var B in atcInputArray){initial_atc_obj(B,atcInputArray[B][0],atcInputArray[B][1],atcInputArray[B][2],atcInputArray[B][3])}}function initial_atc_obj(C,B,A,G,D){if(!document.getElementById(C)){return }if(!document.getElementById(B)){return }var F=navigator.userAgent.toLowerCase();if(F.indexOf("opera")>-1||F.indexOf("safari")>-1){return }if(!self.myAutoComp0){myAutoComp0=new Array()}if(!myAutoComp0[C]){myAutoComp0[C]=new YAHOO.widget.AutoComplete(C,B,oACDS)}var E=myAutoComp0[C];E.myWarnMsg=D;E.scriptQueryAppend=A;E.animVert=false;E.animHoriz=false;E.animSpeed=0.5;E.maxResultsDisplayed=10;E.minQueryLength=3;E.queryDelay=0.3;E.autoHighlight=false;E.useShadow=true;E.useIFrame=true;E.forceSelection=false;E.typeAhead=false;E.allowBrowserAutocomplete=false;E.alwaysShowContainer=false;E.myUpdValuefunc1=E._updateValue;E._updateValue=function(J){this.myUpdValuefunc1(J);var I=this._oTextbox.id+"SugId";var H=document.getElementById(I);if(J){H.value=J._sResultOid}};E.myPopList=E._populateList;E._populateList=function(N,O,M){M.myPopList(N,O,M);if(!M._bFocused||!O){return }var H=Math.min(O.length,M.maxResultsDisplayed);if(H>0){var J=M._aListItems;for(var L=H-1;L>=0;L--){var Q=J[L];var I=O[L];if(I[2]){Q._sResultOid=I[2]+"*"+L+"*"+I[1]}else{Q._sResultOid=null}}for(var K=J.length-1;K>=H;K--){var P=J[K];P._sResultOid=null}}};E.myOnTextboxFocus=function(I,H){oACDS.scriptQueryAppend=this.scriptQueryAppend;trvclrQuery(this._oTextbox.form,C,E.myWarnMsg)};E.onformsubmit=E._oTextbox.form.onsubmit;E._oTextbox.form.onsubmit=function(){if(E.onformsubmit&&!E.onformsubmit()){return false}return trvchkQuery(this,C,E.myWarnMsg)};E.textboxFocusEvent.subscribe(E.myOnTextboxFocus);if(A=="cat=all"){E.formatResult=get_my_formatresult_ref();E.itemSelectEvent.subscribe(yt_ac_submit_form,E._oTextbox.form);YAHOO.util.Event.addListener(E._oTextbox,"keyup",ytsEnterKeyHandler,E)}}function ytsEnterKeyHandler(A,B){oACDS.scriptQueryAppend=B.scriptQueryAppend;if(B._nKeyCode==13&&!B._bItemSelected){if(B._oTextbox.form.onsubmit()){B._oTextbox.form.submit()}}}function get_searchgroup_icon(A){var B="destination";switch(A){case"hoteldetail":B="hotel";break;case"destination":B="hotel";break;case"desthotellist":B="hotel";break;case"dining":B="restaurant";break;case"nightlife":B="entertainment";break;case"shopping":B="shopping";break;case"sightseeing":B="poi";break;case"parks":B="poi";break;case"ski":B="ski-resort";break;case"cardir":B="poi";break;case"hoteldir":B="hotel";break}return B}function CountWords(B){B=B.replace(/[^\w]+/g," ");B=B.replace(/^\s+|\s+$/,"");var A=B.split(" ");return A.length}function get_my_formatresult_ref(){return(function(F,H){var J=F[0];var L=F[1];var D=F[2];var B=F[3];var I=F[4];var C=F[5];var K=F[6];var A=get_searchgroup_icon(L);if(L!="destination"&&L!="desthotellist"){var E=J.toLowerCase();if(E.indexOf(I.toLowerCase())==-1&&CountWords(E)<4){J+=", "+I}}var G="<span class='yui-ac-trvimg ac-cat-"+A+" '></span>"+J;J=decodeURI(encodeURI(J));J=J.replace(/&amp;/gi,"&");J=J.replace(/&gt;/gi,">");J=J.replace(/&lt;/gi,"<");F[0]=J;return(G)})}function yt_ac_submit_form(C,B,A){A.submit()}function common_send_to_server(A,C,B){if(A.indexOf("?")==-1){A+="?js=1"}else{A+="&js=1"}return common_send_to_server_xml(A,C,B)}YAHOO.Travel2.common_xmlhttp=null;function common_send_to_server_xml(A,C,B){if(YAHOO.Travel2.common_xmlhttp){if(YAHOO.util.Connect.isCallInProgress(YAHOO.Travel2.common_xmlhttp)){YAHOO.util.Connect.abort(YAHOO.Travel2.common_xmlhttp)}}var D={success:common_onrequeststate};if(C=="POST"){YAHOO.Travel2.common_xmlhttp=YAHOO.util.Connect.asyncRequest("POST",A,D,B)}else{YAHOO.Travel2.oommon_xmlhttp=YAHOO.util.Connect.asyncRequest("POST",A,D,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(D){var B=D.childNodes;var E=[];var C=B.length;for(var A=0;A<C;A++){E.push(B[A].nodeValue)}return E.join("")}YAHOO.namespace("YAHOO.Travel2");YAHOO.Travel2.getCatIconClass=function(A,B,D,C){var G,F;var H="ytmiCatIcon";var E="ytmiCatPos_";if(!vespaTypes[A]){A=vespaToSmartMap[A]}if(B&&B!==""&&D&&D!==""){if(!(B==="white"||B==="blue"||B==="orange")){return false}if((B==="blue"||B==="orange")&&D!=="white"){return false}if(B==="white"&&!(D=="orange"||D=="green"||D=="blue")){return false}if(C){F=H+" "+E}else{F=E}G=F+A+"_"+B+"_"+D;return G}};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"};function ytrv_myTravelModule(){this.moduleSections=new Array();this.openSection=null;this.closeSection=ytrv_mtm_closeSection}function ytrv_mtm_closeSection(A){if(A==this.openSection){return }this.openSection.executeClose(A);this.openSection=A}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=0.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(B){this.isOpen=false;this.nextSecToOpen=B;var A=new YAHOO.util.Anim(this.bodyHtmlId);A.attributes.opacity={to:0};A.duration=0.5;A.onComplete.subscribe(this.collapseAnim,this);A.animate()}function ytrv_mtm_secCollapseAnim(E,B,G){var D=document.getElementById(G.bodyHtmlId);ytrv_mtm_purge(D,false,true);D.innerHTML="<div></div>";myAnim=new YAHOO.util.Anim(G.bodyHtmlId);myAnim.attributes.height={to:0};myAnim.duration=G.openCloseAnimSpeed;if(G.nextSecToOpen){myAnim.onComplete.subscribe(G.nextSecToOpen.expandAnim,G.nextSecToOpen);G.nextSecToOpen=null}myAnim.animate();if(G.headerArrowId){var A=document.getElementById(G.headerArrowId);A.style.backgroundPosition="-148px -810px"}if(G.openCloseLinkId){var C=document.getElementById(G.openCloseLinkId);C.innerHTML="open"}if(G.openCloseHeaderId){var F=document.getElementById(G.openCloseHeaderId);F.onclick=new Function(G.closeOnclick)}}function ytrv_mtm_secExpandAnim(C,B,D){this.isOpen=true;var A=document.getElementById(D.bodyHtmlId);ytrv_mtm_purge(A,false,true);A.innerHTML="<div></div>";myAnim=new YAHOO.util.Anim(D.bodyHtmlId);myAnim.attributes.height={to:D.sectionHeight};myAnim.duration=D.openCloseAnimSpeed;myAnim.onComplete.subscribe(D.quickFadeAnim,D);myAnim.animate()}function ytrv_mtm_quickFadeAnim(B,A,C){myAnim=new YAHOO.util.Anim(C.bodyHtmlId);myAnim.attributes.opacity={to:0};myAnim.duration=0.01;myAnim.onComplete.subscribe(C.fadeInAnim,C);myAnim.animate()}function ytrv_mtm_fadeInAnim(E,C,H){var B=document.getElementById(H.bodyHtmlId);ytrv_mtm_purge(B,false,true);B.innerHTML=H.bodyHtml;myAnim=new YAHOO.util.Anim(H.bodyHtmlId);myAnim.attributes.opacity={to:1};myAnim.duration=0.5;if(H.needAttAnim){myAnim.onComplete.subscribe(H.attComponent.startAnimation,H.attComponent)}myAnim.animate();if(H.headerArrowId){var A=document.getElementById(H.headerArrowId);A.style.backgroundPosition="-150px -797px"}if(H.openCloseLinkId){var D=document.getElementById(H.openCloseLinkId);D.innerHTML="close"}if(H.openCloseHeaderId){var F=document.getElementById(H.openCloseHeaderId);F.onclick=new Function(H.openOnclick)}if(H.registerOpen){H.registerOpen=false;var G={cmd:"open",ooswitch:"on",section:H.ajaxIdName};ytrv_mtm_genericXHRRequest(G)}}function ytrv_mtm_enableOnOff(C){var D={cmd:"enable",ooswitch:(C?"on":"off"),section:this.ajaxIdName};ytrv_mtm_genericXHRRequest(D);var A=document.getElementById(this.enableLinkId);ytrv_mtm_purge(A,false,true);A.innerHTML=(C)?this.disableLinkHtml:this.enableLinkHtml;if(!C){if(this.parent.openSection==this&&this.bodyHtml!=this.disabledBodyHtml){this.bodyHtml=this.disabledBodyHtml;var B=new YAHOO.util.Anim(this.bodyHtmlId);B.attributes.opacity={to:0};B.duration=0.5;B.onComplete.subscribe(this.fadeInAnim,this);B.animate()}else{this.bodyHtml=this.disabledBodyHtml}}}function ytrv_mtm_genericXHRRequest(B){var C="&rand="+Math.random();for(var A in B){C+="&"+A+"="+B[A]}YAHOO.util.Connect.asyncRequest("GET","http://"+window.location.hostname+"/common?action=mytravelmod"+C)}function ytrv_myTravelModuleAddToTripComponent(A){this.parent=A;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(B,E,C,A){this.parent.needAttAnim=true;this.srcEl=B;this.newItem=C;this.trip=E;this.existingItems=A;if(this.parent.parent.openSection==this.parent){if(!this.isSameTrip(E,A)){this.buildMiddleHtml(E,A);var D=new YAHOO.util.Anim(this.parent.secHeadAndMiddleHtmlId);D.attributes.opacity={to:0};D.duration=0.5;D.onComplete.subscribe(this.fadeInMiddle,this);D.animate()}else{this.startAnimation(null,null,this)}}else{if(!this.isSameTrip(E,A)){this.buildMiddleHtml(E,A)}this.parent.open()}}function ytrv_mtm_attIsSameTrip(C,A){if(this.tripPid!=C.pid){return false}if(this.tripItemKeys.length<this.maxListSize&&this.tripItemKeys.length!=A.length){return false}if(A.length<this.tripItemKeys.length){return false}for(var B=0;B<this.tripItemKeys.length;B++){var D=A[B]["title"]+"|"+A[B]["type"];if(this.tripItemKeys[B]!=D){return false}}return true}function ytrv_mtm_attBuildMiddleHtml(C,F){this.tripPid=C.pid;this.tripItemKeys=new Array();var B="http://travel.yahoo.com/trip?action=view&pid="+C.pid;var E="<div class='secHeadAndRealMiddle'><div class='secSubHead'><a href='"+B+"' target='_top'>"+C.title.toUpperCase()+" TRIP PLAN</a></div><div class='tpContent activeTrip' id='ytrv_mtm_activeTripContent'>";this.tripPid=C.pid;if(F.length==0){E+="No items in Trip"}for(var D=0;D<F.length&&D<this.maxListSize;D++){var K=F[D];var H=(K.url)?"<a href='http://travel.yahoo.com"+K.url+"' target='_top' title='"+K.title+"'>"+trimStringToWord(K.title,26)+"</a>":"<span title='"+K.title+"'>"+trimStringToWord(K.title,26)+"</span>";var I=K.type.toLowerCase();var J=this.typesToStandard[I];var G=YAHOO.Travel2.getCatIconClass(J,"white","green",true);E+="<div class='tpLink'><div class='"+G+" tpItemImg'></div><div class='tpItemName'>"+H+"</div><div class='ymtClear'></div></div>";this.tripItemKeys[D]=K.title+"|"+K.type}E+="</div></div>";var A=(F.length>0)?C.numitems+" Total Items":"";E+="<div class='totalItems'"+((F.length==0)?" style='display:none;'":"")+"><a href='"+B+"' target='_top' id='ytrv_mtm_totalItemCount'>"+A+"</a></div>";this.parent.secHeadAndMiddleHtml=E;this.parent.bodyHtml="<div class='secHeadAndMiddle' id='ytrv_mtm_tpSecHeadAndMiddle'>"+E+"</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 E}function ytrv_mtm_attFadeInMiddle(C,B,E){var A=document.getElementById(E.parent.secHeadAndMiddleHtmlId);ytrv_mtm_purge(A,false,true);A.innerHTML=E.parent.secHeadAndMiddleHtml;var D=new YAHOO.util.Anim(E.parent.secHeadAndMiddleHtmlId);D.attributes.opacity={to:1};D.duration=0.5;if(E.parent.needAttAnim){D.onComplete.subscribe(E.startAnimation,E)}D.animate()}function ytrv_mtm_startAttAnim(F,D,S){S.parent.needAttAnim=false;var M=S.srcEl;var O=S.newItem;var H=document.createElement("DIV");H.id="myTravelModATTAnimObj";H.className="ytrv_mtm_tripListAnimObj";var Q=(O.url)?"<a href='http://travel.yahoo.com"+O.url+"' target='_top' title='"+O.title+"'>"+trimStringToWord(O.title,26)+"</a>":"<span title='"+O.title+"'>"+trimStringToWord(O.title,26)+"</span>";var B=O.type.toLowerCase();var L=S.typesToStandard[B];var A=YAHOO.Travel2.getCatIconClass(L,"white","green",true);H.innerHTML="<div class='"+A+" tpItemImg'></div><div class='tpItemName'>"+Q+"</div><div class='ymtClear'></div>";var P=YAHOO.util.Dom.getXY(M);H.style.left=P[0]+"px";H.style.top=P[1]+"px";document.body.appendChild(H);var I=document.getElementById("ytrv_mtm_activeTripContent");if(I.childNodes.length>=S.maxListSize||S.tripItemKeys.length==0){I.removeChild(I.childNodes[I.childNodes.length-1]);S.tripItemKeys.pop()}S.tripItemKeys.unshift(O.title+"|"+O.type);var N=S.existingItems;N.unshift(O);S.buildMiddleHtml(S.trip,N);var R=document.createElement("DIV");R.id="ytrv_mtm_attAnimPlaceholder";R.className="ytrv_mtm_tripListAnimObj";R.innerHTML="<div></div>";var K=(I.childNodes.length>0)?I.childNodes[0]:null;I.insertBefore(R,K);var C=new YAHOO.util.Anim("ytrv_mtm_attAnimPlaceholder");C.attributes.height={to:H.offsetHeight};C.animate();var E=YAHOO.util.Dom.getXY(R);var T=new YAHOO.util.Anim("myTravelModATTAnimObj");var J=figureOutXYAdjustment();T.attributes.top={to:E[1]+J[1]};T.attributes.left={to:E[0]+J[0]};T.attributes.opacity={to:1};T.duration=1;T.method=YAHOO.util.Easing.easeOut;T.onComplete.subscribe(ytrv_mtm_swapAnimElIn,T.getEl());T.animate();if(S.totalCountElId){var G=document.getElementById(S.totalCountElId);G.innerHTML=S.trip.numitems+" Total Items";G.parentNode.style.display="block"}}function ytrv_mtm_swapAnimElIn(D,C,A){var B=document.getElementById("ytrv_mtm_attAnimPlaceholder");B.innerHTML=A.innerHTML;B.id="";document.body.removeChild(A);ytrv_mtm_purge(A,false,true);delete A}function trimStringToWord(B,A){if(B&&B.length>A){B=B.substring(0,B.lastIndexOf(" ",A));B+=" ..."}return B}function figureOutXYAdjustment(){var B=new Array(2);var A=window.navigator.userAgent;if(A.indexOf("MSIE")>-1){return(new Array(-2,-2))}if(A.indexOf("Firefox")>-1){return(new Array(0,0))}if(window.opera){return(new Array(0,-6))}if(A.indexOf("Safari")>-1){return(new Array(0,0))}return(new Array(0,0))}function ytrv_mtm_purge(F,E,C){if(!F){return }var B=F.attributes,D,A,G;if(B){A=B.length;for(D=0;D<A;D+=1){G=B[D].name;if(typeof F[G]==="function"){F[G]=null}else{if(C==true&&typeof F[G]==="object"&&G!="style"){F[G]=null}}}}if(E){return }B=F.childNodes;if(B){A=B.length;for(D=0;D<A;D+=1){ytrv_mtm_purge(F.childNodes[D])}}}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(A,D,C){var F=new Date(A.getTime());switch(D){case this.MONTH:var E=A.getMonth()+C;var B=0;if(E<0){while(E<0){E+=12;B-=1}}else{if(E>11){while(E>11){E-=12;B+=1}}}F.setMonth(E);F.setFullYear(A.getFullYear()+B);break;case this.DAY:F.setDate(A.getDate()+C);break;case this.YEAR:F.setFullYear(A.getFullYear()+C);break;case this.WEEK:F.setDate(A.getDate()+(C*7));break}return F};this.subtract=function(A,C,B){return this.add(A,C,(B*-1))};this.before=function(C,B){var A=B.getTime();if(C.getTime()<A){return true}else{return false}};this.after=function(C,B){var A=B.getTime();if(C.getTime()>A){return true}else{return false}};this.between=function(B,A,C){if(this.after(B,A)&&this.before(B,C)){return true}else{return false}};this.getJan1=function(A){return new Date(A,0,1)};this.getDayOffset=function(B,D){var C=this.getJan1(D);var A=Math.ceil((B.getTime()-C.getTime())/this.ONE_DAY_MS);return A};this.getWeekNumber=function(D,G,K){D.setHours(12,0,0,0);if(!K){K=0}if(!G){G=D.getFullYear()}var E=-1;var A=this.getJan1(G);var L=A.getDay()-K;var H=(L>=0?L:(7+L));var N=this.add(A,this.DAY,(6-H));N.setHours(23,59,59,999);var F=D.getMonth();var J=D.getDate();var I=D.getFullYear();var M=this.getDayOffset(D,G);if(M<0||this.before(D,N)){E=1}else{E=2;var B=new Date(N.getTime()+1);var C=this.add(B,this.WEEK,1);while(!this.between(D,B,C)){B=this.add(B,this.WEEK,1);C=this.add(C,this.WEEK,1);E+=1}}return E};this.isYearOverlapWeek=function(A){var C=false;var B=this.add(A,this.DAY,6);if(B.getFullYear()!=A.getFullYear()){C=true}return C};this.isMonthOverlapWeek=function(A){var C=false;var B=this.add(A,this.DAY,6);if(B.getMonth()!=A.getMonth()){C=true}return C};this.findMonthStart=function(A){var B=new Date(A.getFullYear(),A.getMonth(),1);return B};this.findMonthEnd=function(B){var D=this.findMonthStart(B);var C=this.add(D,this.MONTH,1);var A=this.subtract(C,this.DAY,1);return A};this.clearTime=function(A){A.setHours(0,0,0,0);return A}};YAHOO.widget.Calendar_Core=function(D,A,C,B){if(arguments.length>0){this.init(D,A,C,B)}};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(G,A,E,D){this.setupConfig();this.id=G;this.cellDates=new Array();this.cells=new Array();this.renderStack=new Array();this._renderStack=new Array();this.oDomContainer=document.getElementById(A);this.today=new Date();YAHOO.widget.DateMath.clearTime(this.today);var F;var C;if(E){var B=E.split(this.Locale.DATE_FIELD_DELIMITER);F=parseInt(B[this.Locale.MY_MONTH_POSITION-1]);C=parseInt(B[this.Locale.MY_YEAR_POSITION-1])}else{F=this.today.getMonth()+1;C=this.today.getFullYear()}this.pageDate=new Date(C,F-1,1);this._pageDate=new Date(this.pageDate.getTime());if(D){this.selectedDates=this._parseDates(D);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,A){var I=this;var D=I.index;var F=A.cellDates[D];var B=new Date(F[0],F[1]-1,F[2]);if(!A.isDateOOM(B)&&!YAHOO.util.Dom.hasClass(I,A.Style.CSS_CELL_RESTRICTED)&&!YAHOO.util.Dom.hasClass(I,A.Style.CSS_CELL_OOB)){if(A.Options.MULTI_SELECT){var H=I.getElementsByTagName("A")[0];H.blur();var C=A.cellDates[D];var G=A._indexOfSelectedFieldArray(C);if(G>-1){A.deselectCell(D)}else{A.selectCell(D)}}else{var H=I.getElementsByTagName("A")[0];H.blur();A.selectCell(D)}}};this.doCellMouseOver=function(E,D){var A=this;var C=A.index;var F=D.cellDates[C];var B=new Date(F[0],F[1]-1,F[2]);if(!D.isDateOOM(B)&&!YAHOO.util.Dom.hasClass(A,D.Style.CSS_CELL_RESTRICTED)&&!YAHOO.util.Dom.hasClass(A,D.Style.CSS_CELL_OOB)){YAHOO.util.Dom.addClass(A,D.Style.CSS_CELL_HOVER)}};this.doCellMouseOut=function(B,A){YAHOO.util.Dom.removeClass(this,A.Style.CSS_CELL_HOVER)};this.doNextMonth=function(B,A){A.nextMonth()};this.doPreviousMonth=function(B,A){A.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 A=0;A<this.Options.START_WEEKDAY;++A){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 A=this.Options.LOCALE_MONTHS[this.pageDate.getMonth()]+" "+this.pageDate.getFullYear();return A};YAHOO.widget.Calendar_Core.prototype.buildDayLabel=function(B){var A=B.getDate();return A};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 C=document.createElement("THEAD");var G=document.createElement("TR");var E=document.createElement("TH");var D=7;if(this.Config.Options.SHOW_WEEK_HEADER){this.weekHeaderCells=new Array();D+=1}if(this.Config.Options.SHOW_WEEK_FOOTER){this.weekFooterCells=new Array();D+=1}E.colSpan=D;YAHOO.widget.Calendar_Core.setCssClasses(E,[this.Style.CSS_HEADER_TEXT]);this.headerCell=E;G.appendChild(E);C.appendChild(G);if(this.Options.SHOW_WEEKDAYS){var F=document.createElement("TR");var H;YAHOO.widget.Calendar_Core.setCssClasses(F,[this.Style.CSS_WEEKDAY_ROW]);if(this.Config.Options.SHOW_WEEK_HEADER){H=document.createElement("TH");YAHOO.widget.Calendar_Core.setCssClasses(H,[this.Style.CSS_WEEKDAY_CELL]);F.appendChild(H)}for(var B=0;B<this.Options.LOCALE_WEEKDAYS.length;++B){var A=document.createElement("TH");YAHOO.widget.Calendar_Core.setCssClasses(A,[this.Style.CSS_WEEKDAY_CELL]);A.innerHTML=this.Options.LOCALE_WEEKDAYS[B];F.appendChild(A)}if(this.Config.Options.SHOW_WEEK_FOOTER){H=document.createElement("TH");YAHOO.widget.Calendar_Core.setCssClasses(H,[this.Style.CSS_WEEKDAY_CELL]);F.appendChild(H)}C.appendChild(F)}this.table.appendChild(C)};YAHOO.widget.Calendar_Core.prototype.buildShellBody=function(){this.tbody=document.createElement("TBODY");for(var B=0;B<6;++B){var C=document.createElement("TR");for(var D=0;D<this.headerCell.colSpan;++D){var A;if(this.Config.Options.SHOW_WEEK_HEADER&&D===0){A=document.createElement("TH");this.weekHeaderCells[this.weekHeaderCells.length]=A}else{if(this.Config.Options.SHOW_WEEK_FOOTER&&D==(this.headerCell.colSpan-1)){A=document.createElement("TH");this.weekFooterCells[this.weekFooterCells.length]=A}else{A=document.createElement("TD");this.cells[this.cells.length]=A;YAHOO.widget.Calendar_Core.setCssClasses(A,[this.Style.CSS_CELL]);YAHOO.util.Event.addListener(A,"click",this.doSelectCell,this);YAHOO.util.Event.addListener(A,"mouseover",this.doCellMouseOver,this);YAHOO.util.Event.addListener(A,"mouseout",this.doCellMouseOut,this)}}C.appendChild(A)}this.tbody.appendChild(C)}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 A=YAHOO.widget.DateMath.findMonthStart(this.pageDate);this.renderHeader();this.renderBody(A);this.renderFooter();this.onRender()};YAHOO.widget.Calendar_Core.prototype.renderHeader=function(){this.headerCell.innerHTML="";var A=document.createElement("DIV");A.className=this.Style.CSS_HEADER;A.appendChild(document.createTextNode(this.buildMonthLabel()));this.headerCell.appendChild(A)};YAHOO.widget.Calendar_Core.prototype.renderBody=function(G){this.preMonthDays=G.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(G).getDate();this.postMonthDays=YAHOO.widget.Calendar_Core.DISPLAY_DAYS-this.preMonthDays-this.monthDays;G=YAHOO.widget.DateMath.subtract(G,YAHOO.widget.DateMath.DAY,this.preMonthDays);var D=0;for(var X=0;X<this.cells.length;++X){var W=new Array();var B=this.cells[X];this.clearElement(B);B.index=X;B.id=this.id+"_cell"+X;this.cellDates[this.cellDates.length]=[G.getFullYear(),G.getMonth()+1,G.getDate()];if(G.getDay()==this.Options.START_WEEKDAY){var A=null;var d=null;if(this.Options.SHOW_WEEK_HEADER){A=this.weekHeaderCells[D];this.clearElement(A)}if(this.Options.SHOW_WEEK_FOOTER){d=this.weekFooterCells[D];this.clearElement(d)}if(this.Options.HIDE_BLANK_WEEKS&&this.isDateOOM(G)&&!YAHOO.widget.DateMath.isMonthOverlapWeek(G)){continue}else{if(A){this.renderRowHeader(G,A)}if(d){this.renderRowFooter(G,d)}}}var S=null;if(G.getFullYear()==this.today.getFullYear()&&G.getMonth()==this.today.getMonth()&&G.getDate()==this.today.getDate()){W[W.length]=this.renderCellStyleToday}if(this.isDateOOM(G)){W[W.length]=this.renderCellNotThisMonth}else{for(var M=0;M<this.renderStack.length;++M){var N=this.renderStack[M];var F=N[0];var Z;var U;var J;switch(F){case YAHOO.widget.Calendar_Core.DATE:Z=N[1][1];U=N[1][2];J=N[1][0];if(G.getMonth()+1==Z&&G.getDate()==U&&G.getFullYear()==J){S=N[2];this.renderStack.splice(M,1)}break;case YAHOO.widget.Calendar_Core.MONTH_DAY:Z=N[1][0];U=N[1][1];if(G.getMonth()+1==Z&&G.getDate()==U){S=N[2];this.renderStack.splice(M,1)}break;case YAHOO.widget.Calendar_Core.RANGE:var Q=N[1][0];var P=N[1][1];var R=Q[1];var T=Q[2];var a=Q[0];var e=new Date(a,R-1,T);var V=P[1];var Y=P[2];var K=P[0];var b=new Date(K,V-1,Y);if(G.getTime()>=e.getTime()&&G.getTime()<=b.getTime()){S=N[2];if(G.getTime()==b.getTime()){this.renderStack.splice(M,1)}}break;case YAHOO.widget.Calendar_Core.WEEKDAY:var E=N[1][0];if(G.getDay()+1==E){S=N[2]}break;case YAHOO.widget.Calendar_Core.MONTH:Z=N[1][0];if(G.getMonth()+1==Z){S=N[2]}break}if(S){W[W.length]=S}}}if(this._indexOfSelectedFieldArray([G.getFullYear(),G.getMonth()+1,G.getDate()])>-1){W[W.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&&(G.getTime()<this.minDate.getTime()))||(this.maxDate&&(G.getTime()>this.maxDate.getTime()))){W[W.length]=this.renderOutOfBoundsDate}else{W[W.length]=this.renderCellDefault}for(var H=0;H<W.length;++H){var C=W[H];if(C.call(this,G,B)==YAHOO.widget.Calendar_Core.STOP_RENDER){break}}G=YAHOO.widget.DateMath.add(G,YAHOO.widget.DateMath.DAY,1);if(G.getDay()==this.Options.START_WEEKDAY){D+=1}YAHOO.util.Dom.addClass(B,this.Style.CSS_CELL);if(X>=0&&X<=6){YAHOO.util.Dom.addClass(B,this.Style.CSS_CELL_TOP)}if((X%7)==0){YAHOO.util.Dom.addClass(B,this.Style.CSS_CELL_LEFT)}if(((X+1)%7)==0){YAHOO.util.Dom.addClass(B,this.Style.CSS_CELL_RIGHT)}var I=this.postMonthDays;if(I>=7&&this.Options.HIDE_BLANK_WEEKS){var L=Math.floor(I/7);for(var O=0;O<L;++O){I-=7}}if(X>=((this.preMonthDays+I+this.monthDays)-7)){YAHOO.util.Dom.addClass(B,this.Style.CSS_CELL_BOTTOM)}}};YAHOO.widget.Calendar_Core.prototype.renderFooter=function(){};YAHOO.widget.Calendar_Core.prototype._unload=function(B,A){for(var C in A.cells){C=null}A.cells=null;A.tbody=null;A.oDomContainer=null;A.table=null;A.headerCell=null;A=null};YAHOO.widget.Calendar_Core.prototype.renderOutOfBoundsDate=function(B,A){YAHOO.util.Dom.addClass(A,this.Style.CSS_CELL_OOB);A.innerHTML=B.getDate();return YAHOO.widget.Calendar_Core.STOP_RENDER};YAHOO.widget.Calendar_Core.prototype.renderRowHeader=function(D,B){YAHOO.util.Dom.addClass(B,this.Style.CSS_ROW_HEADER);var A=this.pageDate.getFullYear();if(!YAHOO.widget.DateMath.isYearOverlapWeek(D)){A=D.getFullYear()}var C=YAHOO.widget.DateMath.getWeekNumber(D,A,this.Options.START_WEEKDAY);B.innerHTML=C;if(this.isDateOOM(D)&&!YAHOO.widget.DateMath.isMonthOverlapWeek(D)){YAHOO.util.Dom.addClass(B,this.Style.CSS_CELL_OOM)}};YAHOO.widget.Calendar_Core.prototype.renderRowFooter=function(B,A){YAHOO.util.Dom.addClass(A,this.Style.CSS_ROW_FOOTER);if(this.isDateOOM(B)&&!YAHOO.widget.DateMath.isMonthOverlapWeek(B)){YAHOO.util.Dom.addClass(A,this.Style.CSS_CELL_OOM)}};YAHOO.widget.Calendar_Core.prototype.renderCellDefault=function(C,A){A.innerHTML="";var B=document.createElement("a");B.href="javascript:void(null);";B.name=this.id+"__"+C.getFullYear()+"_"+(C.getMonth()+1)+"_"+C.getDate();B.appendChild(document.createTextNode(this.buildDayLabel(C)));A.appendChild(B)};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight1=function(B,A){YAHOO.util.Dom.addClass(A,this.Style.CSS_CELL_HIGHLIGHT1)};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight2=function(B,A){YAHOO.util.Dom.addClass(A,this.Style.CSS_CELL_HIGHLIGHT2)};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight3=function(B,A){YAHOO.util.Dom.addClass(A,this.Style.CSS_CELL_HIGHLIGHT3)};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight4=function(B,A){YAHOO.util.Dom.addClass(A,this.Style.CSS_CELL_HIGHLIGHT4)};YAHOO.widget.Calendar_Core.prototype.renderCellStyleToday=function(B,A){YAHOO.util.Dom.addClass(A,this.Style.CSS_CELL_TODAY)};YAHOO.widget.Calendar_Core.prototype.renderCellStyleSelected=function(B,A){YAHOO.util.Dom.addClass(A,this.Style.CSS_CELL_SELECTED)};YAHOO.widget.Calendar_Core.prototype.renderCellNotThisMonth=function(B,A){YAHOO.util.Dom.addClass(A,this.Style.CSS_CELL_OOM);A.innerHTML=B.getDate();return YAHOO.widget.Calendar_Core.STOP_RENDER};YAHOO.widget.Calendar_Core.prototype.renderBodyCellRestricted=function(B,A){YAHOO.widget.Calendar_Core.setCssClasses(A,[this.Style.CSS_CELL,this.Style.CSS_CELL_RESTRICTED]);A.innerHTML=B.getDate();return YAHOO.widget.Calendar_Core.STOP_RENDER};YAHOO.widget.Calendar_Core.prototype.addMonths=function(A){this.pageDate=YAHOO.widget.DateMath.add(this.pageDate,YAHOO.widget.DateMath.MONTH,A);this.resetRenderers();this.onChangePage()};YAHOO.widget.Calendar_Core.prototype.subtractMonths=function(A){this.pageDate=YAHOO.widget.DateMath.subtract(this.pageDate,YAHOO.widget.DateMath.MONTH,A);this.resetRenderers();this.onChangePage()};YAHOO.widget.Calendar_Core.prototype.addYears=function(A){this.pageDate=YAHOO.widget.DateMath.add(this.pageDate,YAHOO.widget.DateMath.YEAR,A);this.resetRenderers();this.onChangePage()};YAHOO.widget.Calendar_Core.prototype.subtractYears=function(A){this.pageDate=YAHOO.widget.DateMath.subtract(this.pageDate,YAHOO.widget.DateMath.YEAR,A);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(B){this.onBeforeSelect();var D=this._toFieldArray(B);for(var A=0;A<D.length;++A){var C=D[A];if(this._indexOfSelectedFieldArray(C)==-1){this.selectedDates[this.selectedDates.length]=C}}if(this.parent){this.parent.sync(this)}this.onSelect();return this.getSelectedDates()};YAHOO.widget.Calendar_Core.prototype.selectCell=function(C){this.onBeforeSelect();this.cells=this.tbody.getElementsByTagName("TD");var B=this.cells[C];var E=this.cellDates[C];var D=this._toDate(E);var A=E.concat();this.selectedDates.push(A);if(this.parent){this.parent.sync(this)}this.renderCellStyleSelected(D,B);this.onSelect();this.doCellMouseOut.call(B,null,this);return this.getSelectedDates()};YAHOO.widget.Calendar_Core.prototype.deselect=function(C){this.onBeforeDeselect();var E=this._toFieldArray(C);for(var A=0;A<E.length;++A){var D=E[A];var B=this._indexOfSelectedFieldArray(D);if(B!=-1){this.selectedDates.splice(B,1)}}if(this.parent){this.parent.sync(this)}this.onDeselect();return this.getSelectedDates()};YAHOO.widget.Calendar_Core.prototype.deselectCell=function(D){this.onBeforeDeselect();this.cells=this.tbody.getElementsByTagName("TD");var B=this.cells[D];var F=this.cellDates[D];var C=this._indexOfSelectedFieldArray(F);var E=this._toDate(F);var A=F.concat();if(C>-1){if(this.pageDate.getMonth()==E.getMonth()&&this.pageDate.getFullYear()==E.getFullYear()){YAHOO.util.Dom.removeClass(B,this.Style.CSS_CELL_SELECTED)}this.selectedDates.splice(C,1)}if(this.parent){this.parent.sync(this)}this.onDeselect();return this.getSelectedDates()};YAHOO.widget.Calendar_Core.prototype.deselectAll=function(){this.onBeforeDeselect();var A=this.selectedDates.length;this.selectedDates.length=0;if(this.parent){this.parent.sync(this)}if(A>0){this.onDeselect()}return this.getSelectedDates()};YAHOO.widget.Calendar_Core.prototype._toFieldArray=function(B){var A=new Array();if(B instanceof Date){A=[[B.getFullYear(),B.getMonth()+1,B.getDate()]]}else{if(typeof B=="string"){A=this._parseDates(B)}else{if(B instanceof Array){for(var C=0;C<B.length;++C){var D=B[C];A[A.length]=[D.getFullYear(),D.getMonth()+1,D.getDate()]}}}}return A};YAHOO.widget.Calendar_Core.prototype._toDate=function(A){if(A instanceof Date){return A}else{return new Date(A[0],A[1]-1,A[2])}};YAHOO.widget.Calendar_Core.prototype._fieldArraysAreEqual=function(C,B){var A=false;if(C[0]==B[0]&&C[1]==B[1]&&C[2]==B[2]){A=true}return A};YAHOO.widget.Calendar_Core.prototype._indexOfSelectedFieldArray=function(D){var C=-1;for(var B=0;B<this.selectedDates.length;++B){var A=this.selectedDates[B];if(D[0]==A[0]&&D[1]==A[1]&&D[2]==A[2]){C=B;break}}return C};YAHOO.widget.Calendar_Core.prototype.isDateOOM=function(A){var B=false;if(A.getMonth()!=this.pageDate.getMonth()){B=true}return B};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 A=this;this.renderHeader();if(this.renderProcId){clearTimeout(this.renderProcId)}this.renderProcId=setTimeout(function(){A.render();A.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(B){var C=B.split(this.Locale.DATE_FIELD_DELIMITER);var A;if(C.length==2){A=[C[this.Locale.MD_MONTH_POSITION-1],C[this.Locale.MD_DAY_POSITION-1]];A.type=YAHOO.widget.Calendar_Core.MONTH_DAY}else{A=[C[this.Locale.MDY_YEAR_POSITION-1],C[this.Locale.MDY_MONTH_POSITION-1],C[this.Locale.MDY_DAY_POSITION-1]];A.type=YAHOO.widget.Calendar_Core.DATE}return A};YAHOO.widget.Calendar_Core.prototype._parseDates=function(B){var I=new Array();var H=B.split(this.Locale.DATE_DELIMITER);for(var G=0;G<H.length;++G){var F=H[G];if(F.indexOf(this.Locale.DATE_RANGE_DELIMITER)!=-1){var A=F.split(this.Locale.DATE_RANGE_DELIMITER);var E=this._parseDate(A[0]);var J=this._parseDate(A[1]);var D=this._parseRange(E,J);I=I.concat(D)}else{var C=this._parseDate(F);I.push(C)}}return I};YAHOO.widget.Calendar_Core.prototype._parseRange=function(A,F){var E=new Date(A[0],A[1]-1,A[2]);var B=YAHOO.widget.DateMath.add(new Date(A[0],A[1]-1,A[2]),YAHOO.widget.DateMath.DAY,1);var D=new Date(F[0],F[1]-1,F[2]);var C=new Array();C.push(A);while(B.getTime()<=D.getTime()){C.push([B.getFullYear(),B.getMonth()+1,B.getDate()]);B=YAHOO.widget.DateMath.add(B,YAHOO.widget.DateMath.DAY,1)}return C};YAHOO.widget.Calendar_Core.prototype.resetRenderers=function(){this.renderStack=this._renderStack.concat()};YAHOO.widget.Calendar_Core.prototype.clearElement=function(A){A.innerHTML="&nbsp;";A.className=""};YAHOO.widget.Calendar_Core.prototype.addRenderer=function(A,B){var D=this._parseDates(A);for(var C=0;C<D.length;++C){var E=D[C];if(E.length==2){if(E[0] instanceof Array){this._addRenderer(YAHOO.widget.Calendar_Core.RANGE,E,B)}else{this._addRenderer(YAHOO.widget.Calendar_Core.MONTH_DAY,E,B)}}else{if(E.length==3){this._addRenderer(YAHOO.widget.Calendar_Core.DATE,E,B)}}}};YAHOO.widget.Calendar_Core.prototype._addRenderer=function(B,C,A){var D=[B,C,A];this.renderStack.unshift(D);this._renderStack=this.renderStack.concat()};YAHOO.widget.Calendar_Core.prototype.addMonthRenderer=function(B,A){this._addRenderer(YAHOO.widget.Calendar_Core.MONTH,[B],A)};YAHOO.widget.Calendar_Core.prototype.addWeekdayRenderer=function(B,A){this._addRenderer(YAHOO.widget.Calendar_Core.WEEKDAY,[B],A)};YAHOO.widget.Calendar_Core.setCssClasses=function(B,A){B.className="";var C=A.join(" ");B.className=C};YAHOO.widget.Calendar_Core.prototype.clearAllBodyCellStyles=function(A){for(var B=0;B<this.cells.length;++B){YAHOO.util.Dom.removeClass(this.cells[B],A)}};YAHOO.widget.Calendar_Core.prototype.setMonth=function(A){this.pageDate.setMonth(A)};YAHOO.widget.Calendar_Core.prototype.setYear=function(A){this.pageDate.setFullYear(A)};YAHOO.widget.Calendar_Core.prototype.getSelectedDates=function(){var B=new Array();for(var D=0;D<this.selectedDates.length;++D){var C=this.selectedDates[D];var A=new Date(C[0],C[1]-1,C[2]);B.push(A)}B.sort();return B};YAHOO.widget.Calendar_Core._getBrowser=function(){var A=navigator.userAgent.toLowerCase();if(A.indexOf("opera")!=-1){return"opera"}else{if(A.indexOf("msie")!=-1){return"ie"}else{if(A.indexOf("safari")!=-1){return"safari"}else{if(A.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(D,A,C,B){if(arguments.length>0){this.init(D,A,C,B)}};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 A=document.createElement("DIV");A.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;A.appendChild(this.linkLeft);A.appendChild(document.createTextNode(this.buildMonthLabel()));A.appendChild(this.linkRight);this.headerCell.appendChild(A)};YAHOO.widget.Cal=YAHOO.widget.Calendar;YAHOO.widget.CalendarGroup=function(B,E,A,D,C){if(arguments.length>0){this.init(B,E,A,D,C)}};YAHOO.widget.CalendarGroup.prototype.init=function(B,G,A,D,C){this.id=G;this.selectedDates=new Array();this.containerId=A;this.pageCount=B;this.pages=new Array();for(var F=0;F<B;++F){var E=this.constructChild(G+"_"+F,this.containerId+"_"+F,D,C);E.parent=this;E.index=F;E.pageDate.setMonth(E.pageDate.getMonth()+F);E._pageDate=new Date(E.pageDate.getFullYear(),E.pageDate.getMonth(),E.pageDate.getDate());this.pages.push(E)}this.doNextMonth=function(I,H){H.nextMonth()};this.doPreviousMonth=function(I,H){H.previousMonth()}};YAHOO.widget.CalendarGroup.prototype.setChildFunction=function(C,A){for(var B=0;B<this.pageCount;++B){this.pages[B][C]=A}};YAHOO.widget.CalendarGroup.prototype.callChildFunction=function(E,A){for(var D=0;D<this.pageCount;++D){var C=this.pages[D];if(C[E]){var B=C[E];B.call(C,A)}}};YAHOO.widget.CalendarGroup.prototype.constructChild=function(D,A,C,B){return new YAHOO.widget.Calendar_Core(D,A,C,B)};YAHOO.widget.CalendarGroup.prototype.setMonth=function(C){for(var B=0;B<this.pages.length;++B){var A=this.pages[B];A.setMonth(C+B)}};YAHOO.widget.CalendarGroup.prototype.setYear=function(A){for(var C=0;C<this.pages.length;++C){var B=this.pages[C];if((B.pageDate.getMonth()+1)==1&&C>0){A+=1}B.setYear(A)}};YAHOO.widget.CalendarGroup.prototype.render=function(){for(var B=0;B<this.pages.length;++B){var A=this.pages[B];A.render()}};YAHOO.widget.CalendarGroup.prototype.select=function(B){var A;for(var D=0;D<this.pages.length;++D){var C=this.pages[D];A=C.select(B)}return A};YAHOO.widget.CalendarGroup.prototype.selectCell=function(B){var A;for(var D=0;D<this.pages.length;++D){var C=this.pages[D];A=C.selectCell(B)}return A};YAHOO.widget.CalendarGroup.prototype.deselect=function(B){var A;for(var D=0;D<this.pages.length;++D){var C=this.pages[D];A=C.deselect(B)}return A};YAHOO.widget.CalendarGroup.prototype.deselectAll=function(){var A;for(var C=0;C<this.pages.length;++C){var B=this.pages[C];A=B.deselectAll()}return A};YAHOO.widget.CalendarGroup.prototype.deselectCell=function(A){for(var C=0;C<this.pages.length;++C){var B=this.pages[C];B.deselectCell(A)}return this.getSelectedDates()};YAHOO.widget.CalendarGroup.prototype.reset=function(){for(var B=0;B<this.pages.length;++B){var A=this.pages[B];A.reset()}};YAHOO.widget.CalendarGroup.prototype.clear=function(){for(var B=0;B<this.pages.length;++B){var A=this.pages[B];A.clear()}};YAHOO.widget.CalendarGroup.prototype.nextMonth=function(){for(var B=0;B<this.pages.length;++B){var A=this.pages[B];A.nextMonth()}};YAHOO.widget.CalendarGroup.prototype.previousMonth=function(){for(var B=this.pages.length-1;B>=0;--B){var A=this.pages[B];A.previousMonth()}};YAHOO.widget.CalendarGroup.prototype.nextYear=function(){for(var B=0;B<this.pages.length;++B){var A=this.pages[B];A.nextYear()}};YAHOO.widget.CalendarGroup.prototype.previousYear=function(){for(var B=0;B<this.pages.length;++B){var A=this.pages[B];A.previousYear()}};YAHOO.widget.CalendarGroup.prototype.sync=function(B){var D;if(B){this.selectedDates=B.selectedDates.concat()}else{var E=new Object();var F=new Array();for(var A=0;A<this.pages.length;++A){D=this.pages[A];var H=D.selectedDates;for(var I=0;I<H.length;++I){var G=H[I];E[G.toString()]=G}}for(var C in E){F[F.length]=E[C]}this.selectedDates=F.concat()}for(A=0;A<this.pages.length;++A){D=this.pages[A];if(!D.Options.MULTI_SELECT){D.clearAllBodyCellStyles(D.Config.Style.CSS_CELL_SELECTED)}D.selectedDates=this.selectedDates.concat()}return this.getSelectedDates()};YAHOO.widget.CalendarGroup.prototype.getSelectedDates=function(){var B=new Array();for(var D=0;D<this.selectedDates.length;++D){var C=this.selectedDates[D];var A=new Date(C[0],C[1]-1,C[2]);B.push(A)}B.sort();return B};YAHOO.widget.CalendarGroup.prototype.addRenderer=function(A,B){for(var D=0;D<this.pages.length;++D){var C=this.pages[D];C.addRenderer(A,B)}};YAHOO.widget.CalendarGroup.prototype.addMonthRenderer=function(D,A){for(var C=0;C<this.pages.length;++C){var B=this.pages[C];B.addMonthRenderer(D,A)}};YAHOO.widget.CalendarGroup.prototype.addWeekdayRenderer=function(B,A){for(var D=0;D<this.pages.length;++D){var C=this.pages[D];C.addWeekdayRenderer(B,A)}};YAHOO.widget.CalendarGroup.prototype.wireEvent=function(A,B){for(var D=0;D<this.pages.length;++D){var C=this.pages[D];C[A]=B}};YAHOO.widget.CalendarGroup.prototype.toString=function(){return"CalendarGroup "+this.id};YAHOO.widget.CalGrp=YAHOO.widget.CalendarGroup;YAHOO.widget.Calendar2up_Cal=function(D,A,C,B){if(arguments.length>0){this.init(D,A,C,B)}};YAHOO.widget.Calendar2up_Cal.prototype=new YAHOO.widget.Calendar_Core();YAHOO.widget.Calendar2up_Cal.prototype.renderHeader=function(){this.headerCell.innerHTML="";var A=document.createElement("DIV");A.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);A.appendChild(this.linkLeft)}A.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);A.appendChild(this.linkRight)}this.headerCell.appendChild(A)};YAHOO.widget.Calendar2up=function(D,A,C,B){if(arguments.length>0){this.buildWrapper(A);this.init(2,D,A,C,B)}};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(E,A,C,B){var D=new YAHOO.widget.Calendar2up_Cal(E,A,C,B);return D};YAHOO.widget.Calendar2up.prototype.buildWrapper=function(B){var D=document.getElementById(B);D.className=YAHOO.widget.Calendar2up.CSS_2UPWRAPPER;var A=document.createElement("DIV");A.className=YAHOO.widget.Calendar2up.CSS_CONTAINER;A.id=B+"_inner";var C=document.createElement("DIV");C.id=B+"_0";C.className=YAHOO.widget.Calendar2up.CSS_2UPCONTAINER;C.style.marginRight="10px";var E=document.createElement("DIV");E.id=B+"_1";E.className=YAHOO.widget.Calendar2up.CSS_2UPCONTAINER;D.appendChild(A);A.appendChild(C);A.appendChild(E);this.innerContainer=A;this.outerContainer=D};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 B=document.createElement("A");B.href="javascript:void(null)";YAHOO.util.Event.addListener(B,"click",this.hide,this);var A=document.createElement("IMG");A.src=YAHOO.widget.Calendar_Core.IMG_ROOT+"us/my/bn/x_d.gif";A.className=YAHOO.widget.Calendar2up.CSS_2UPCLOSE;B.appendChild(A);this.linkClose=B;this.titleDiv.appendChild(B)}this.innerContainer.insertBefore(this.titleDiv,this.innerContainer.firstChild)};YAHOO.widget.Calendar2up.prototype.hide=function(B,A){if(!A){A=this}A.outerContainer.style.display="none"};YAHOO.widget.Calendar2up.prototype.renderFooter=function(){};YAHOO.widget.Cal2up=YAHOO.widget.Calendar2up;if(YAHOO.widget.Calendar2up){YAHOO.namespace("Travel");YAHOO.widget.Calendar2up.prototype.hide=function(B,A){if(!A){A=this}A.outerContainer.parentNode.style.display="none";A.postHide()};YAHOO.widget.Calendar2up.prototype.postHide=function(){if(this.mgrObj){YAHOO.util.Event.removeListener(window,"resize",this.mgrObj.adjustPos)}};YAHOO.Travel2.calMgr=function(C,B,S,J,A,W){if(typeof (C)=="string"){C=document.getElementById(C)}if(typeof (B)=="string"){B=document.getElementById(B)}if(!C||!B){return null}var T=new Date();var H=T.getMonth();var E=T.getDate();var G=T.getFullYear();this.activeField=null;this.instance=S;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 I=document.createElement("IFRAME");I.id=S+"_ifr";this.container.appendChild(I)}var U=document.createElement("DIV");var D=S+"_cont";U.className="calcontainer";U.style.position="absolute";U.id=D;this.container.appendChild(U);var M=(H+1)+"/"+G;var X=null;var P=null;if(C&&C.value){var F=C.value;var O=F.split("/");if(O&&O.length==3){var V=O[0];if(V.length==1){V="0"+V}var L=O[2];var K=parseInt(V,10);var R=parseInt(L,10);if(K>0&&K<=12&&R>0&&R<100&&L.length==2){M=K+"/20"+L}}}this.calendar=new YAHOO.widget.Calendar2up(S+"_cal",D,M);this.calendar.mgrObj=this;this.calendar.addRenderer(this.convertDate(C.value),this.highlightCal1);this.calendar.addRenderer(this.convertDate(B.value),this.highlightCal2);minDate=YAHOO.widget.DateMath.add(new Date(),YAHOO.widget.DateMath.DAY,1);for(var Q=0;Q<this.calendar.pages.length;++Q){this.calendar.pages[Q].minDate=minDate}if(J!=null&&A!=null){this.field1Text=J;this.field2Text=A}else{this.field1Text=null;this.field2Text=null}this.calendar.title="&nbsp;";if(W=="left"){this.calendar.outerContainer.style.left="-240px";if(document.getElementById(this.instance+"_ifr")){document.getElementById(this.instance+"_ifr").style.left="-240px"}}else{if(W=="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 N=this;C.onclick=function(){N.show(this)};var U=C.parentNode.getElementsByTagName("A");if(U.length>0){U[0].onclick=function(){N.show(C)}}B.onclick=function(){N.show(this)};U=B.parentNode.getElementsByTagName("A");if(U.length>0){U[0].onclick=function(){N.show(B)}}this.calendar.setChildFunction("onSelect",function(){N.set()});this.field1=C;this.field2=B;this.dateFormatter=null;this.onHide=null;this.onBeforeHide=null;this.onShow=null};YAHOO.Travel2.calMgr.prototype.show=function(C){this.activeField=C;this.calendar.outerContainer.parentNode.style.visibility="hidden";this.calendar.outerContainer.parentNode.style.display="block";var D=YAHOO.util.Dom.getXY(C);YAHOO.util.Dom.setXY(this.calendar.outerContainer.parentNode,[D[0],D[1]+C.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 B=document.getElementById(this.instance+"_ifr");if(B){B.height=this.calendar.innerContainer.offsetHeight;B.width=this.calendar.innerContainer.offsetWidth}this.calendar.outerContainer.parentNode.style.visibility="visible";var A={calMgrObj:this,field:C};YAHOO.util.Event.addListener(window,"resize",this.adjustPos,A)};YAHOO.Travel2.calMgr.prototype.adjustPos=function(B,A){var C=YAHOO.util.Dom.getXY(A.field);YAHOO.util.Dom.setXY(A.calMgrObj.calendar.outerContainer.parentNode,[C[0],C[1]+A.field.offsetHeight+1])};YAHOO.Travel2.calMgr.prototype.highlightCal1=function(B,A){this.renderCellStyleHighlight1(B,A)};YAHOO.Travel2.calMgr.prototype.highlightCal2=function(B,A){this.renderCellStyleHighlight2(B,A)};YAHOO.Travel2.calMgr.prototype.disableDate=function(B,A){this.renderOutOfBoundsDate(B,A)};YAHOO.Travel2.calMgr.prototype.set=function(){if(this.activeField){var F=this.calendar.getSelectedDates()[0];var D=this.activeField.value;var E="";if(this.dateFormatter){E=this.dateFormatter(F)}else{var C=F.getMonth()+1;var A=F.getDate();var B=new String(F.getFullYear());if(C<10){C="0"+C}if(A<10){A="0"+A}B=B.substr(2);E=(C)+"/"+A+"/"+B}this.activeField.value=E}var G=true;if(this.onBeforeHide){G=this.onBeforeHide(E,this.activeField)}if(G){this.calendar.hide();this.calendar.deselect(F);if(this.onHide){this.onHide()}}};YAHOO.Travel2.calMgr.prototype.convertDate=function(A){if(A.search(/^[0-1][0-9]\/[0-3][0-9]\/(\d{2}|\d{4})$/)==0){pos=A.lastIndexOf("/");A=A.substr(0,pos+1)+"20"+A.substr(pos+1)}else{if(A=="mm/dd/yy"){A=""}}return A};YAHOO.Travel2.calMgr.prototype.getMainDomObjId=function(){return this.instance}}YAHOO.namespace("Travel");YAHOO.Travel2.popupCardClass=function(B,A,C){this.oDomRef=null;this.oIfrRef=null;this.attachedNode=null;this.anim=null;this.name=(B!=null)?B:"popup_card";this.instance=(A!=null)?A:"popupCard";this.currentId=null;this.needsIframe=C;this.knownBodyH=null;this.knownBodyW=null};YAHOO.Travel2.popupCardClass.prototype.open=function(A,B,I){if(this.oDomRef==null){this.create()}if(A){this.attachedNode=A.id;var E=YAHOO.util.Dom.getXY(A);if(window.opera&&A.parentNode.tagName=="TD"){var D=YAHOO.util.Dom.getXY(A.parentNode.parentNode);var F=D[1]+A.offsetTop;E[1]=F}this.oDomRef.style.display="block";var G=A.offsetWidth;var C=A.offsetHeight;var H=this.oDomRef.offsetWidth;if(B=="left"){xoffset=0}else{if(B=="right"){xoffset=(H-G)}else{if(B=="fullright"){xoffset=0-G}else{xoffset=Math.abs((H/2)-(G/2))}}}if(I=="center"){yoffset=0-(C/2)}else{yoffset=20}YAHOO.util.Dom.setXY(this.name,[E[0]-xoffset,E[1]+yoffset]);if(this.oIfrRef){YAHOO.util.Dom.setXY(this.oIfrRef,[E[0]-xoffset,E[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.Travel2.popupCardClass.prototype.close=function(A){if(A==true){this.anim=new YAHOO.util.Anim(this.oDomRef,{opacity:{to:0}},0.75,YAHOO.util.Easing.easeOut);var B=this;this.anim.onComplete.subscribe(function(){B.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.Travel2.popupCardClass.prototype.resetAnim=function(){if(this.oDomRef.style.filter){this.oDomRef.style.filter=""}else{this.oDomRef.style.opacity=""}this.anim=null};YAHOO.Travel2.popupCardClass.prototype.create=function(){var A=document.createElement("DIV");var C="<div class='title'></div>";C+="<div class='content'></div><div class='bottom'>";C+="<a href='javascript: void(0);' onclick='return "+this.instance+".close(false);'>Close Window</a></div>";A.innerHTML=C;A.id=this.name;A.className="dhtml_card";document.body.appendChild(A);this.oDomRef=A;if(window.ActiveXObject&&this.needsIframe){var B=document.createElement("IFRAME");B.id=this.name+"_ifr";this.oIfrRef=B;document.body.appendChild(B)}};YAHOO.Travel2.popupCardClass.prototype.setContent=function(A){if(!this.oDomRef){return false}if(typeof (A)=="object"){this.oDomRef.childNodes[1].innerHTML="";this.oDomRef.childNodes[1].appendChild(A)}else{this.oDomRef.childNodes[1].innerHTML=A}};YAHOO.Travel2.popupCardClass.prototype.showToolTip=function(D,C,B,A){if(this.anim!=null){this.anim.stop();this.resetAnim()}if(this.oDomRef==null){this.create()}if(D.id!=this.attachedNode){if(this.attachedNode){this.close()}this.setContent(C);this.open(D,B)}else{if(A){this.close()}}return false};YAHOO.Travel2.popupCardClass.prototype.handleBodyResize=function(){var A=document.body.offsetHeight;var B=document.body.offsetWidth;if(this.knownBodyH!=A||this.knownBodyW!=B){this.close()}};YAHOO.Travel2.addToTripClass=function(A,B){YAHOO.Travel2.addToTripClass.superclass.constructor.call(this,"addtotrip_popup",A);this.tripOptions=null;this.newTripDefault="Enter a name for your trip";this.currentItemExtraInfo=new Array();this.currentClass=null;this.hrefTarget=(B)?B:"_top";this.closeTimeout=null};YAHOO.extend(YAHOO.Travel2.addToTripClass,YAHOO.Travel2.popupCardClass);YAHOO.Travel2.addToTripClass.prototype.setTrips=function(A){this.tripOptions=A};YAHOO.Travel2.addToTripClass.prototype.error=function(A){this.toggleBusy(false);alert(A);this.close()};YAHOO.Travel2.addToTripClass.prototype.showTripCard=function(B,E,D,C,A){if(this.anim!=null){this.anim.stop();this.resetAnim()}clearTimeout(this.closeTimeout);if(this.oDomRef==null){this.create()}if(B){if(B.id==this.attachedNode){return false}this.attachedNode=B.id;this.currentId=B.id.substr(4);this.currentItemExtraInfo=A;this.setImage(E);this.currentClass=E;this.setTitle(D);this.toggleBusy(true,B);if(C=="login"){return this.showLogin(B)}else{return this.showAddForm(B)}}};YAHOO.Travel2.addToTripClass.prototype.showAddForm=function(C,F,E){if(C){if(this.tripOptions==null){YAHOO.util.Dom.addClass(C.firstChild,"busy");var D="quickadd";var B=trip_get_xml_url();var A="action=gettrips&call_v=2&faction="+D;return !common_send_to_server(B,"POST",A)}}else{if(this.attachedNode){C=document.getElementById(this.attachedNode)}}if(!C){return false}if(this.tripOptions){this.showSelectForm()}this.toggleBusy(false,C);this.open(C);return false};YAHOO.Travel2.addToTripClass.prototype.showLogin=function(B){if(this.oDomRef==null){this.create()}if(!B){B=document.getElementById(this.attachedNode)}var A=document.location.href;A+=(A.indexOf("?")<0)?"?":"&";A+="addtotpoid="+this.currentId+"#att_"+this.currentId;A="http://login.yahoo.com/config/login?.src=trv&.done="+escape(A);content="<div>Please <a href='"+A+"'>sign in</a> to use this feature.";this.setContent(content);this.toggleBusy(false,B);this.open(B);return false};YAHOO.Travel2.addToTripClass.prototype.toggleBusy=function(B,A){if(!A){A=document.getElementById(this.attachedNode)}if(A&&A.firstChild){if(B){YAHOO.util.Dom.addClass(A.firstChild,"busy")}else{YAHOO.util.Dom.removeClass(A.firstChild,"busy")}}};YAHOO.Travel2.addToTripClass.prototype.addToTrip=function(D){if(!D){return false}var I=D.form;var E=I.action;var L={};var C="";for(var F=0;F<I.elements.length;F++){var J=I.elements[F];if(J.tagName=="INPUT"||J.tagName=="SELECT"){L[J.name]=J.value;if(J.name!="ptitle"&&J.name!="pid"){C+="&"+J.name+"="+escape(J.value)}}}var A=trip_get_xml_url();var H="js";var K="call_v=2";K+=C;if(L.ptitle){K+="&ptitle="+escape(L.ptitle)}else{if(L.pid){var G=L.pid;if(G==-1){var B=trip_get_name();if(B){K+="&ptitle="+escape(B);I.ptitle.value=escape(B)}else{return false}}else{K+="&pid="+G}}}if(window.ytrv_mtm_tripPlannerSec){K+="&need_items=1"}D.disabled=true;return !common_send_to_server(A,"POST",K)};YAHOO.Travel2.addToTripClass.prototype.create=function(){var A=document.createElement("DIV");var B="<div class='title'><div id='addtotrip_animeEl' style='padding-left: 18px;'><span class='name' id='addtotrip_title'></span></div></div>";B+="<div class='content'></div><div class='bottom'>";B+="<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>";A.innerHTML=B;A.id="addtotrip_popup";A.className="dhtml_card";document.body.appendChild(A);this.oDomRef=A};YAHOO.Travel2._previousAddToTripImage="";YAHOO.Travel2.addToTripClass.prototype.setImage=function(D){if(!this.oDomRef){return false}var B="",A;switch(D){case"Hotels":case"Lodging":A="hotels";break;case"Attraction":case"Things to do":A="thingstodo";break;case"Shopping locations":A="shopping";break;case"Entertainment":A="entertainment";break;case"Dining":case"Restaurants":A="restaurants";break;case"Ski Resorts":A="skiresort";break;case"Cities":case"Destinations":A="city";break;case"Flights":A="airport";break;default:A="other";break}B=YAHOO.Travel2.getCatIconClass(A,"white","green",true);var C=gebi("addtotrip_animeEl");if(C){C.className=B}};YAHOO.Travel2.addToTripClass.prototype.setTitle=function(B){if(!this.oDomRef){return false}var A=gebi("addtotrip_title");A.innerHTML=B};YAHOO.Travel2.addToTripClass.prototype.tripAdded=function(B,H,G,A,E,F){var C=trip_get_base_url()+"?p=trip&action=view&pid="+B;var D="<div class='added'>";if(E){D+="Added to trip plan"}else{D+="Already added to trip plan"}D+="<br />";D+="<a href='"+C+"' target='"+this.hrefTarget+"'>"+H+"</a>";this.setContent(D);this.closeTimeout=setTimeout("addToTripMod.close(true)",2000);if(E&&window.ytrv_mtm_tripPlannerSec){newItem=A.shift();ytrv_mtm_tripPlannerSec.attComponent.add(gebi("addtotrip_animeEl"),{pid:B,title:H,numitems:G},newItem,A)}};YAHOO.Travel2.addToTripClass.prototype.showSelectForm=function(){if(this.tripOptions==null){return false}var B="<form>";B+="<input type='hidden' name='_crumb' value='"+this.tripOptions.crumb+"' />";B+="<input type='hidden' name='action' value='quickadd' />";if(this.currentClass=="Flights"){B+="<input type='hidden' name='flight_id' value='"+this.currentId+"' />"}else{B+="<input type='hidden' name='oid' value='"+this.currentId+"' />"}for(var A in this.currentItemExtraInfo){B+="<input type='hidden' name='"+A+"' value='"+this.currentItemExtraInfo[A]+"' />"}if(this.tripOptions.plans.length>0){var C=this.tripOptions.plans;B+="<input type='button' class='abtn' name='btn' value='Add' onclick='addToTripMod.addToTrip(this);' />";B+="<select name='pid' class='ainput'>";for(i=0;i<C.length;++i){B+="<option value='"+C[i].pid+"'>"+C[i].title+"</option>"}B+="</select>"}else{B+="<input type='button' name='btn' class='cbtn' value='Create' disabled='true' onclick='addToTripMod.addToTrip(this);' />";B+="<input type='text' class='cinput' value='"+this.newTripDefault+"' name='ptitle' onfocus='addToTripMod.checkTextField(this, true);' onblur='addToTripMod.checkTextField(this, false);'>"}B+="</form>";this.setContent(B)};YAHOO.Travel2.addToTripClass.prototype.checkTextField=function(B,A){if(!B){return }if(A){if(B.value==this.newTripDefault){B.value="";B.form.btn.disabled=false}}else{if(B.value==""){B.value=this.newTripDefault;B.form.btn.disabled=true}}};function trip_cancel(A){var B=A.form.parentNode;B.style.display="none";B.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"}YAHOO.namespace("Travel");YAHOO.Travel2.tglPlus=function(A,G,I,D,E,C){this.formRef=document.forms[A+"_tglplus"];this.links=G;this.calendar=null;this.name=A;this.tglPlusBcn="";this.urlBase=(D!=null)?D:"/common";var J=(this.urlBase.indexOf("?")==-1)?"?":"&";var F=(C)?C:this.name+"_tglPlusObj.showDatedLinks";this.urlArgs=J+"action=tglplus&callback="+F;if(I){this.urlArgs+="&"+I}this.beaconURL=(E!=null)?E:null;if(this.formRef){var B=document.createElement("img");B.id=this.name+"_tglPlusCalBeacon";B.style.visibility="hidden";B.style.width="0px";B.style.height="0px";document.body.appendChild(B);this.calendar=new YAHOO.Travel2.calMgr(this.formRef.checkindate,this.formRef.checkoutdate,A,"Select your check-in date","Select your check-out date");if(this.calendar){var H=this;this.calendar.onHide=function(){return H.calHandler()};this.calendar.onBeforeHide=function(L,K){return H.checkCalDates(L,K)}}var H=this;if(this.formRef.checkindate){H.formRef.checkindate.onchange=function(){H.fieldHandler(this)}}if(this.formRef.checkoutdate){H.formRef.checkoutdate.onchange=function(){H.fieldHandler(this)}}}};YAHOO.Travel2.tglPlus.prototype.calHandler=function(){if(this.tglPlusBcn==""){var A=document.getElementById(this.name+"_tglPlusCalBeacon");if(A&&this.beaconURL){this.tglPlusBcn=this.beaconURL+"?rnd="+Math.random();A.src=this.tglPlusBcn}}if(this.updateFields()){this.getDatedTGL()}};YAHOO.Travel2.tglPlus.prototype.fieldHandler=function(A){this.checkCalDates(A.value,A);if(this.updateFields()){this.getDatedTGL()}};YAHOO.Travel2.tglPlus.prototype.getDatedTGL=function(){var A=this.formRef.checkindate.value;var H=this.formRef.checkoutdate.value;var C=2;var F=1;var D=decodeURIComponent(this.formRef.currci.value);var J=decodeURIComponent(this.formRef.currco.value);var B=2;var E=1;if(this.verifyDates(A,H)){A=encodeURIComponent(A);H=encodeURIComponent(H);var I=new Array();for(var G=0;G<this.links.length;++G){I.push("url"+(G+1)+"="+encodeURI(this.links[G].url));I.push("h"+(G+1)+"="+this.links[G].host)}I.push("urlcount="+this.links.length);I.push("checkin="+A);I.push("checkout="+H);I.push("guestcount="+C);I.push("roomcount="+F);I=I.join("&");this.formRef.currci.value=A;this.formRef.currco.value=H;this.formRef.currgc.value=C;this.formRef.currrc.value=F;common_send_to_server(this.urlBase+this.urlArgs,"POST",I);return true}return false};YAHOO.Travel2.tglPlus.prototype.showDatedLinks=function(G){var I=document.getElementById(this.name+"_tglpluslinks");if(I){var E=I.childNodes;var J=0;for(i=0;i<E.length;++i){var D=E[i];if(D.tagName=="LI"){D.onclick=null;for(j=0;j<D.childNodes.length;++j){var H=D.childNodes[j];if(H.nodeType!=3){H.onclick=null}}YAHOO.util.Dom.setStyle(D,"opacity",0.01)}}for(i=0;i<E.length;++i){var D=E[i];if(D.tagName=="LI"){if(G.links[J]!=0){D.className="dateenabled";var B=G.links[J].url;var C=G.links[J].partner;var A=G.checkin+"-"+G.checkout;var F=(typeof G.links[J].highlight!="undefined");text="Check "+A+" on "+C;tgl_show(D,B,text,0.1+(0.3*i),0.5,F)}else{D.style.display="none"}J++}}}};YAHOO.Travel2.tglPlus.prototype.updateFields=function(){var B=this.formRef.checkindate.value;var A=this.formRef.checkoutdate.value;if(B!="mm/dd/yy"&&A!="mm/dd/yy"){return true}return false};YAHOO.Travel2.tglPlus.prototype.checkCalDates=function(D,C){var B="";var A="";if(C==this.formRef.checkindate){var B=D;var A=this.formRef.checkoutdate.value}else{var B=this.formRef.checkindate.value;var A=D}if(B=="mm/dd/yy"||A=="mm/dd/yy"){return true}return this.verifyDates(B,A)};YAHOO.Travel2.tglPlus.prototype.verifyDates=function(C,A){if(C.search(/^[0-1][0-9]\/[0-3][0-9]\/(\d{2}|\d{4})$/)!=0||A.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(A==C){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=C.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=A.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]}C=checkInMonth+" "+checkInArr[1]+", "+checkInArr[2];A=checkOutMonth+" "+checkOutArr[1]+", "+checkOutArr[2];C=new Date(C);A=new Date(A);if(C.getFullYear()!=checkInArr[2]||C.getMonth()!=(checkInArr[0]-1)||C.getDate()!=checkInArr[1]){this.setError("Your Check-in date is invalid. Please enter a new date.");return false}if(A.getFullYear()!=checkOutArr[2]||A.getMonth()!=(checkOutArr[0]-1)||A.getDate()!=checkOutArr[1]){this.setError("Your Check-out date is invalid. Please enter a new date.");return false}if(A<C){this.setError("Your Check-out date is before your Check-in date. Please change your dates.");return false}if((A-C)>(86400000*30)){this.setError("Reservations are limited to a 30 day maximum.  Please enter new dates.");return false}var B=new Date();if(C<B||A<B){this.setError("Your Check-in date is in the past.  Please enter new dates.");return false}if(C.valueOf()>(B.valueOf()+(86400000*364))){this.setError("Reservations beyond 364 days are not available. Please enter new dates.");return false}this.setError("");return true};YAHOO.Travel2.tglPlus.prototype.setError=function(B){var A=document.getElementById(this.name+"_tglerror");if(A){A.innerHTML=B;if(B!=""){A.style.display="block";highlight(A)}else{A.style.display="none"}}};function highlight(C,D,B){if(typeof C=="string"){C=document.getElementById(C)}if(C){if(D==null){D=1000}else{D=D*1000}if(B==null){B=1}C.style.backgroundColor="rgb(255, 255, 167)";var A=function(){var E=new YAHOO.util.ColorAnim(C,{backgroundColor:{from:"#FFFFA7",to:"#F9F9EF"}},1,YAHOO.util.Easing.easeOut);E.animate()};window.setTimeout(A,D)}}function tgl_show(E,C,A,G,B,D){if(typeof E=="string"){E=document.getElementById(E)}if(E){if(G==null){G=100}else{G=G*1000}if(B==null){B=1}var F=function(){var H="";if(D){H=" class='hilite'"}E.innerHTML="<a href='"+C+"'"+H+">"+A+"</a>";for(j=0;j<E.childNodes.length;++j){var I=E.childNodes[j];if(I.tagName=="A"||I.tagName=="INPUT"){I.onclick=createTGLOnclick(C)}}var J=new YAHOO.util.Anim(E,{opacity:{to:1}},B,YAHOO.util.Easing.easeOut);J.animate()};window.setTimeout(F,G)}}function createTGLOnclick(A){return function(){yg_popup(A,"ImageSearch",750,500,63);return false}}if(typeof (YAHOO.util.ImageLoader)=="undefined"){YAHOO.util.ImageLoader={}}YAHOO.util.ImageLoader.group=function(A,B,C){this.name="unnamed";this._imgObjs={};this.timeoutLen=C;this._timeout=null;this._triggers=[];this.foldConditional=false;this.className=null;this._classImageEls=null;YAHOO.util.Event.addListener(window,"load",this._onloadTasks,this,true);this.addTrigger(A,B)};YAHOO.util.ImageLoader.group.prototype.addTrigger=function(B,C){if(!B||!C){return }var A=function(){this.fetch()};this._triggers.push([B,C,A]);YAHOO.util.Event.addListener(B,C,A,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 A=this;return function(){A.fetch()}};YAHOO.util.ImageLoader.group.prototype.registerBgImage=function(B,A){this._imgObjs[B]=new YAHOO.util.ImageLoader.bgImgObj(B,A);return this._imgObjs[B]};YAHOO.util.ImageLoader.group.prototype.registerSrcImage=function(D,B,C,A){this._imgObjs[D]=new YAHOO.util.ImageLoader.srcImgObj(D,B,C,A);return this._imgObjs[D]};YAHOO.util.ImageLoader.group.prototype.registerPngBgImage=function(B,A){this._imgObjs[B]=new YAHOO.util.ImageLoader.pngBgImgObj(B,A);return this._imgObjs[B]};YAHOO.util.ImageLoader.group.prototype.fetch=function(){YAHOO.log('Fetching images in group: "'+this.name+'".',"info","imageloader");clearTimeout(this._timeout);for(var A=0;A<this._triggers.length;A++){YAHOO.util.Event.removeListener(this._triggers[A][0],this._triggers[A][1],this._triggers[A][2])}this._fetchByClass();for(var B in this._imgObjs){if(YAHOO.lang.hasOwnProperty(this._imgObjs,B)){this._imgObjs[B].fetch()}}};YAHOO.util.ImageLoader.group.prototype._foldCheck=function(){YAHOO.log('Checking for images above the fold in group: "'+this.name+'"',"info","imageloader");var C=(document.compatMode!="CSS1Compat")?document.body.scrollTop:document.documentElement.scrollTop;var D=YAHOO.util.Dom.getViewportHeight();var A=C+D;var E=(document.compatMode!="CSS1Compat")?document.body.scrollLeft:document.documentElement.scrollLeft;var G=YAHOO.util.Dom.getViewportWidth();var H=E+G;for(var B in this._imgObjs){if(YAHOO.lang.hasOwnProperty(this._imgObjs,B)){var I=YAHOO.util.Dom.getXY(this._imgObjs[B].domId);if(I[1]<A&&I[0]<H){YAHOO.log('Image with id "'+this._imgObjs[B].domId+'" is above the fold. Fetching image.',"info","imageloader");this._imgObjs[B].fetch()}}}if(this.className){this._classImageEls=YAHOO.util.Dom.getElementsByClassName(this.className);for(var F=0;F<this._classImageEls.length;F++){var I=YAHOO.util.Dom.getXY(this._classImageEls[F]);if(I[1]<A&&I[0]<H){YAHOO.log('Image with id "'+this._classImageEls[F].id+'" is above the fold. Fetching image. (Image registered by class name with the group - may not have an id.)',"info","imageloader");YAHOO.util.Dom.removeClass(this._classImageEls[F],this.className)}}}};YAHOO.util.ImageLoader.group.prototype._fetchByClass=function(){if(!this.className){return }YAHOO.log('Fetching all images with class "'+this.className+'" in group "'+this.name+'".',"info","imageloader");if(this._classImageEls===null){this._classImageEls=YAHOO.util.Dom.getElementsByClassName(this.className)}YAHOO.util.Dom.removeClass(this._classImageEls,this.className)};YAHOO.util.ImageLoader.imgObj=function(B,A){this.domId=B;this.url=A;this.width=null;this.height=null;this.setVisible=false;this._fetched=false};YAHOO.util.ImageLoader.imgObj.prototype.fetch=function(){if(this._fetched){return }var A=document.getElementById(this.domId);if(!A){return }YAHOO.log('Fetching image with id "'+this.domId+'".',"info","imageloader");this._applyUrl(A);if(this.setVisible){A.style.visibility="visible"}if(this.width){A.width=this.width}if(this.height){A.height=this.height}this._fetched=true};YAHOO.util.ImageLoader.imgObj.prototype._applyUrl=function(A){};YAHOO.util.ImageLoader.bgImgObj=function(B,A){YAHOO.util.ImageLoader.bgImgObj.superclass.constructor.call(this,B,A)};YAHOO.lang.extend(YAHOO.util.ImageLoader.bgImgObj,YAHOO.util.ImageLoader.imgObj);YAHOO.util.ImageLoader.bgImgObj.prototype._applyUrl=function(A){A.style.backgroundImage="url('"+this.url+"')"};YAHOO.util.ImageLoader.srcImgObj=function(D,B,C,A){YAHOO.util.ImageLoader.srcImgObj.superclass.constructor.call(this,D,B);this.width=C;this.height=A};YAHOO.lang.extend(YAHOO.util.ImageLoader.srcImgObj,YAHOO.util.ImageLoader.imgObj);YAHOO.util.ImageLoader.srcImgObj.prototype._applyUrl=function(A){A.src=this.url};YAHOO.util.ImageLoader.pngBgImgObj=function(B,A){YAHOO.util.ImageLoader.pngBgImgObj.superclass.constructor.call(this,B,A)};YAHOO.lang.extend(YAHOO.util.ImageLoader.pngBgImgObj,YAHOO.util.ImageLoader.imgObj);YAHOO.util.ImageLoader.pngBgImgObj.prototype._applyUrl=function(A){if(YAHOO.env.ua.ie&&YAHOO.env.ua.ie<=6){A.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+this.url+'", sizingMethod="scale")'}else{A.style.backgroundImage="url('"+this.url+"')"}};YAHOO.register("imageloader",YAHOO.util.ImageLoader,{version:"2.3.0",build:"442"});