function NumericMarker(D,A,B,C){this.map=D;this.point=A;this.num=B;this.iconClassName=C;this.div=null;this.setMap(D)}NumericMarker.prototype=new google.maps.OverlayView();NumericMarker.prototype.onAdd=function(){this.div=document.createElement("div");this.div.style.position="absolute";this.div.className="poi-icon-2";this.div.offsetX=11;this.div.offsetY=22;this.setMode(false);this.div.innerHTML=this.num;var A=this.getPanes();A.overlayImage.appendChild(this.div);if(this.clickHandler){var B=this;google.maps.event.addDomListener(this.div,"click",function(){B.clickHandler(B.num)});google.maps.event.addDomListener(this.div,"mouseover",function(){B.mouseOverHandler(B.num)});google.maps.event.addDomListener(this.div,"mouseout",function(){B.mouseOutHandler(B.num)})}};NumericMarker.prototype.onRemove=function(){this.div.parentNode.removeChild(this.div);this.div=null};NumericMarker.prototype.draw=function(){var A=this.getProjection();var B=A.fromLatLngToDivPixel(this.point);this.div.style.left=B.x+"px";this.div.style.top=B.y+"px"};NumericMarker.prototype.setMode=function(A){if(A){this.div.className=this.iconClassName+"-selected";this.div.style.zIndex="100"}else{this.div.className=this.iconClassName;this.div.style.zIndex="90"}};NumericMarker.prototype.setEventHandlers=function(C,B,A){this.clickHandler=C;this.mouseOverHandler=B;this.mouseOutHandler=A};NumericMarker.prototype.remove=function(){this.div.parentNode.removeChild(this.div)};NumericMarker.prototype.copy=function(){return new NumericMarker(this.point,this.num)};NumericMarker.prototype.redraw=function(A){var B=this.map.fromLatLngToDivPixel(this.point);B.x-=this.div.offsetX;B.y-=this.div.offsetY;this.div.style.left=B.x+"px";this.div.style.top=B.y+"px"};NumericMarker.prototype.getX=function(){return parseInt(this.div.style.left)};NumericMarker.prototype.getY=function(){return parseInt(this.div.style.top)};NumericMarker.prototype.getPoint=function(){return this.point};NumericMarker.prototype.getDiv=function(){return this.div};var SWFUpload=function(A){this.initSWFUpload(A)};SWFUpload.prototype.initSWFUpload=function(B){try{this.customSettings={};this.settings=B;this.eventQueue=[];this.movieName="SWFUpload_"+SWFUpload.movieCount++;this.movieElement=null;SWFUpload.instances[this.movieName]=this;this.initSettings();this.loadFlash();this.displayDebugInfo()}catch(A){delete SWFUpload.instances[this.movieName];throw A}};SWFUpload.instances={};SWFUpload.movieCount=0;SWFUpload.version="2.2.0 Alpha";SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130};SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290};SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5};SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,START_UPLOAD:-120};SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(B,A){this.settings[B]=(this.settings[B]==undefined)?A:this.settings[B]};this.ensureDefault("upload_url","");this.ensureDefault("file_post_name","Filedata");this.ensureDefault("post_params",{});this.ensureDefault("use_query_string",false);this.ensureDefault("requeue_on_error",false);this.ensureDefault("file_types","*.*");this.ensureDefault("file_types_description","All Files");this.ensureDefault("file_size_limit",0);this.ensureDefault("file_upload_limit",0);this.ensureDefault("file_queue_limit",0);this.ensureDefault("flash_url","swfupload.swf");this.ensureDefault("prevent_swf_caching",true);this.ensureDefault("button_image_url","");this.ensureDefault("button_width",1);this.ensureDefault("button_height",1);this.ensureDefault("button_text","");this.ensureDefault("button_text_style","color: #000000; font-size: 16pt;");this.ensureDefault("button_text_top_padding",0);this.ensureDefault("button_text_left_padding",0);this.ensureDefault("button_action",SWFUpload.BUTTON_ACTION.SELECT_FILES);this.ensureDefault("button_disabled",false);this.ensureDefault("button_placeholder_id",null);this.ensureDefault("debug",false);this.settings.debug_enabled=this.settings.debug;this.settings.return_upload_start_handler=this.returnUploadStart;this.ensureDefault("swfupload_loaded_handler",null);this.ensureDefault("file_dialog_start_handler",null);this.ensureDefault("file_queued_handler",null);this.ensureDefault("file_queue_error_handler",null);this.ensureDefault("file_dialog_complete_handler",null);this.ensureDefault("upload_start_handler",null);this.ensureDefault("upload_progress_handler",null);this.ensureDefault("upload_error_handler",null);this.ensureDefault("upload_success_handler",null);this.ensureDefault("upload_complete_handler",null);this.ensureDefault("debug_handler",this.debugMessage);this.ensureDefault("custom_settings",{});this.customSettings=this.settings.custom_settings;if(this.settings.prevent_swf_caching){this.settings.flash_url=this.settings.flash_url+"?swfuploadrnd="+Math.floor(Math.random()*999999999)}delete this.ensureDefault};SWFUpload.prototype.loadFlash=function(){if(this.settings.button_placeholder_id!==""){this.replaceWithFlash()}else{this.appendFlash()}};SWFUpload.prototype.appendFlash=function(){var B,A;if(document.getElementById(this.movieName)!==null){throw"ID "+this.movieName+" is already in use. The Flash Object could not be added"}B=document.getElementsByTagName("body")[0];if(B==undefined){throw"Could not find the 'body' element."}A=document.createElement("div");A.style.width="1px";A.style.height="1px";A.style.overflow="hidden";B.appendChild(A);A.innerHTML=this.getFlashHTML()};SWFUpload.prototype.replaceWithFlash=function(){var A,B;if(document.getElementById(this.movieName)!==null){throw"ID "+this.movieName+" is already in use. The Flash Object could not be added"}A=document.getElementById(this.settings.button_placeholder_id);if(A==undefined){throw"Could not find the placeholder element."}B=document.createElement("div");B.innerHTML=this.getFlashHTML();A.parentNode.replaceChild(B.firstChild,A)};SWFUpload.prototype.getFlashHTML=function(){var A=this.settings.button_image_url===""?true:false;return['<object id="',this.movieName,'" type="application/x-shockwave-flash" data="',this.settings.flash_url,'" width="',this.settings.button_width,'" height="',this.settings.button_height,'" class="swfupload">','<param name="wmode" value="',A?"transparent":"window",'" />','<param name="movie" value="',this.settings.flash_url,'" />','<param name="quality" value="high" />','<param name="menu" value="false" />','<param name="allowScriptAccess" value="always" />','<param name="flashvars" value="'+this.getFlashVars()+'" />',"</object>"].join("")};SWFUpload.prototype.getFlashVars=function(){var A=this.buildParamString();return["movieName=",encodeURIComponent(this.movieName),"&amp;uploadURL=",encodeURIComponent(this.settings.upload_url),"&amp;useQueryString=",encodeURIComponent(this.settings.use_query_string),"&amp;requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&amp;params=",encodeURIComponent(A),"&amp;filePostName=",encodeURIComponent(this.settings.file_post_name),"&amp;fileTypes=",encodeURIComponent(this.settings.file_types),"&amp;fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&amp;fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&amp;fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&amp;fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&amp;debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&amp;buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&amp;buttonWidth=",encodeURIComponent(this.settings.button_width),"&amp;buttonHeight=",encodeURIComponent(this.settings.button_height),"&amp;buttonText=",encodeURIComponent(this.settings.button_text),"&amp;buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&amp;buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&amp;buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&amp;buttonAction=",encodeURIComponent(this.settings.button_action),"&amp;buttonDisabled=",encodeURIComponent(this.settings.button_disabled)].join("")
};SWFUpload.prototype.getMovieElement=function(){if(this.movieElement==undefined){this.movieElement=document.getElementById(this.movieName)}if(this.movieElement===null){throw"Could not find Flash element"}return this.movieElement};SWFUpload.prototype.buildParamString=function(){var C=this.settings.post_params;var B=[];if(typeof (C)==="object"){for(var A in C){if(C.hasOwnProperty(A)){B.push(encodeURIComponent(A.toString())+"="+encodeURIComponent(C[A].toString()))}}}return B.join("&amp;")};SWFUpload.prototype.destroy=function(){try{this.stopUpload();var B=null;try{B=this.getMovieElement()}catch(C){}if(B!=undefined&&B.parentNode!=undefined&&typeof B.parentNode.removeChild==="function"){var A=B.parentNode;if(A!=undefined){A.removeChild(B);if(A.parentNode!=undefined&&typeof A.parentNode.removeChild==="function"){A.parentNode.removeChild(A)}}}SWFUpload.instances[this.movieName]=null;delete SWFUpload.instances[this.movieName];delete this.movieElement;delete this.settings;delete this.customSettings;delete this.eventQueue;delete this.movieName;delete window[this.movieName];return true}catch(D){return false}};SWFUpload.prototype.displayDebugInfo=function(){this.debug(["---SWFUpload Instance Info---\n","Version: ",SWFUpload.version,"\n","Movie Name: ",this.movieName,"\n","Settings:\n","\t","upload_url:               ",this.settings.upload_url,"\n","\t","flash_url:                ",this.settings.flash_url,"\n","\t","use_query_string:         ",this.settings.use_query_string.toString(),"\n","\t","file_post_name:           ",this.settings.file_post_name,"\n","\t","post_params:              ",this.settings.post_params.toString(),"\n","\t","file_types:               ",this.settings.file_types,"\n","\t","file_types_description:   ",this.settings.file_types_description,"\n","\t","file_size_limit:          ",this.settings.file_size_limit,"\n","\t","file_upload_limit:        ",this.settings.file_upload_limit,"\n","\t","file_queue_limit:         ",this.settings.file_queue_limit,"\n","\t","debug:                    ",this.settings.debug.toString(),"\n","\t","prevent_swf_caching:      ",this.settings.prevent_swf_caching.toString(),"\n","\t","button_placeholder_id:    ",this.settings.button_placeholder_id.toString(),"\n","\t","button_image_url:         ",this.settings.button_image_url.toString(),"\n","\t","button_width:             ",this.settings.button_width.toString(),"\n","\t","button_height:            ",this.settings.button_height.toString(),"\n","\t","button_text:              ",this.settings.button_text.toString(),"\n","\t","button_text_style:        ",this.settings.button_text_style.toString(),"\n","\t","button_text_top_padding:  ",this.settings.button_text_top_padding.toString(),"\n","\t","button_text_left_padding: ",this.settings.button_text_left_padding.toString(),"\n","\t","button_action:            ",this.settings.button_action.toString(),"\n","\t","button_disabled:          ",this.settings.button_disabled.toString(),"\n","\t","custom_settings:          ",this.settings.custom_settings.toString(),"\n","Event Handlers:\n","\t","swfupload_loaded_handler assigned:  ",(typeof this.settings.swfupload_loaded_handler==="function").toString(),"\n","\t","file_dialog_start_handler assigned: ",(typeof this.settings.file_dialog_start_handler==="function").toString(),"\n","\t","file_queued_handler assigned:       ",(typeof this.settings.file_queued_handler==="function").toString(),"\n","\t","file_queue_error_handler assigned:  ",(typeof this.settings.file_queue_error_handler==="function").toString(),"\n","\t","upload_start_handler assigned:      ",(typeof this.settings.upload_start_handler==="function").toString(),"\n","\t","upload_progress_handler assigned:   ",(typeof this.settings.upload_progress_handler==="function").toString(),"\n","\t","upload_error_handler assigned:      ",(typeof this.settings.upload_error_handler==="function").toString(),"\n","\t","upload_success_handler assigned:    ",(typeof this.settings.upload_success_handler==="function").toString(),"\n","\t","upload_complete_handler assigned:   ",(typeof this.settings.upload_complete_handler==="function").toString(),"\n","\t","debug_handler assigned:             ",(typeof this.settings.debug_handler==="function").toString(),"\n"].join(""))};SWFUpload.prototype.addSetting=function(B,C,A){if(C==undefined){return(this.settings[B]=A)}else{return(this.settings[B]=C)}};SWFUpload.prototype.getSetting=function(A){if(this.settings[A]!=undefined){return this.settings[A]}return""};SWFUpload.prototype.callFlash=function(C,D){D=D||[];var A=this.getMovieElement();var B;if(typeof A[C]==="function"){if(D.length===0){B=A[C]()}else{if(D.length===1){B=A[C](D[0])}else{if(D.length===2){B=A[C](D[0],D[1])}else{if(D.length===3){B=A[C](D[0],D[1],D[2])}else{throw"Too many arguments"}}}}if(B!=undefined&&typeof B.post==="object"){B=this.unescapeFilePostParams(B)}return B}else{throw"Invalid function name: "+C}};SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile")};SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles")};SWFUpload.prototype.startUpload=function(A){this.callFlash("StartUpload",[A])};SWFUpload.prototype.cancelUpload=function(A){this.callFlash("CancelUpload",[A])};SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload")};SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats")};SWFUpload.prototype.setStats=function(A){this.callFlash("SetStats",[A])};SWFUpload.prototype.getFile=function(A){if(typeof (A)==="number"){return this.callFlash("GetFileByIndex",[A])}else{return this.callFlash("GetFile",[A])}};SWFUpload.prototype.addFileParam=function(A,B,C){return this.callFlash("AddFileParam",[A,B,C])};SWFUpload.prototype.removeFileParam=function(A,B){this.callFlash("RemoveFileParam",[A,B])};SWFUpload.prototype.setUploadURL=function(A){this.settings.upload_url=A.toString();this.callFlash("SetUploadURL",[A])};SWFUpload.prototype.setPostParams=function(A){this.settings.post_params=A;this.callFlash("SetPostParams",[A])};SWFUpload.prototype.addPostParam=function(A,B){this.settings.post_params[A]=B;this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.removePostParam=function(A){delete this.settings.post_params[A];this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.setFileTypes=function(A,B){this.settings.file_types=A;this.settings.file_types_description=B;this.callFlash("SetFileTypes",[A,B])};SWFUpload.prototype.setFileSizeLimit=function(A){this.settings.file_size_limit=A;this.callFlash("SetFileSizeLimit",[A])};SWFUpload.prototype.setFileUploadLimit=function(A){this.settings.file_upload_limit=A;this.callFlash("SetFileUploadLimit",[A])};SWFUpload.prototype.setFileQueueLimit=function(A){this.settings.file_queue_limit=A;this.callFlash("SetFileQueueLimit",[A])};SWFUpload.prototype.setFilePostName=function(A){this.settings.file_post_name=A;this.callFlash("SetFilePostName",[A])};SWFUpload.prototype.setUseQueryString=function(A){this.settings.use_query_string=A;this.callFlash("SetUseQueryString",[A])};SWFUpload.prototype.setRequeueOnError=function(A){this.settings.requeue_on_error=A;this.callFlash("SetRequeueOnError",[A])};SWFUpload.prototype.setDebugEnabled=function(A){this.settings.debug_enabled=A;this.callFlash("SetDebugEnabled",[A])};SWFUpload.prototype.setButtonImageURL=function(A){if(A==undefined){A=""}this.settings.button_image_url=A;this.callFlash("SetButtonImageURL",[A])};SWFUpload.prototype.setButtonDimensions=function(C,A){this.settings.button_width=C;this.settings.button_height=A;var B=this.getMovieElement();if(B!=undefined){B.style.width=C+"px";B.style.height=A+"px"}this.callFlash("SetButtonDimensions",[C,A])};SWFUpload.prototype.setButtonText=function(A){this.settings.button_text=A;this.callFlash("SetButtonText",[A])};SWFUpload.prototype.setButtonTextPadding=function(B,A){this.settings.button_text_top_padding=A;this.settings.button_text_left_padding=B;this.callFlash("SetButtonTextPadding",[B,A])};SWFUpload.prototype.setButtonTextStyle=function(A){this.settings.button_text_style=A;
this.callFlash("SetButtonTextStyle",[A])};SWFUpload.prototype.setButtonDisabled=function(A){this.settings.button_disabled=A;this.callFlash("SetButtonDisabled",[A])};SWFUpload.prototype.setButtonAction=function(A){this.settings.button_action=A;this.callFlash("SetButtonAction",[A])};SWFUpload.prototype.queueEvent=function(B,C){if(C==undefined){C=[]}else{if(!(C instanceof Array)){C=[C]}}var A=this;if(typeof this.settings[B]==="function"){this.eventQueue.push(function(){this.settings[B].apply(this,C)});setTimeout(function(){A.executeNextEvent()},0)}else{if(this.settings[B]!==null){throw"Event handler "+B+" is unknown or is not a function"}}};SWFUpload.prototype.executeNextEvent=function(){var A=this.eventQueue?this.eventQueue.shift():null;if(typeof (A)==="function"){A.apply(this)}};SWFUpload.prototype.unescapeFilePostParams=function(C){var E=/[$]([0-9a-f]{4})/i;var F={};var D;if(C!=undefined){for(var A in C.post){if(C.post.hasOwnProperty(A)){D=A;var B;while((B=E.exec(D))!==null){D=D.replace(B[0],String.fromCharCode(parseInt("0x"+B[1],16)))}F[D]=C.post[A]}}C.post=F}return C};SWFUpload.prototype.flashReady=function(){var A=this.getMovieElement();if(typeof A.StartUpload!=="function"){throw"ExternalInterface methods failed to initialize."}if(window[this.movieName]==undefined){window[this.movieName]=A}this.queueEvent("swfupload_loaded_handler")};SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler")};SWFUpload.prototype.fileQueued=function(A){A=this.unescapeFilePostParams(A);this.queueEvent("file_queued_handler",A)};SWFUpload.prototype.fileQueueError=function(A,C,B){A=this.unescapeFilePostParams(A);this.queueEvent("file_queue_error_handler",[A,C,B])};SWFUpload.prototype.fileDialogComplete=function(A,B){this.queueEvent("file_dialog_complete_handler",[A,B])};SWFUpload.prototype.uploadStart=function(A){A=this.unescapeFilePostParams(A);this.queueEvent("return_upload_start_handler",A)};SWFUpload.prototype.returnUploadStart=function(A){var B;if(typeof this.settings.upload_start_handler==="function"){A=this.unescapeFilePostParams(A);B=this.settings.upload_start_handler.call(this,A)}else{if(this.settings.upload_start_handler!=undefined){throw"upload_start_handler must be a function"}}if(B===undefined){B=true}B=!!B;this.callFlash("ReturnUploadStart",[B])};SWFUpload.prototype.uploadProgress=function(A,C,B){A=this.unescapeFilePostParams(A);this.queueEvent("upload_progress_handler",[A,C,B])};SWFUpload.prototype.uploadError=function(A,C,B){A=this.unescapeFilePostParams(A);this.queueEvent("upload_error_handler",[A,C,B])};SWFUpload.prototype.uploadSuccess=function(B,A){B=this.unescapeFilePostParams(B);this.queueEvent("upload_success_handler",[B,A])};SWFUpload.prototype.uploadComplete=function(A){A=this.unescapeFilePostParams(A);this.queueEvent("upload_complete_handler",A)};SWFUpload.prototype.debug=function(A){this.queueEvent("debug_handler",A)};SWFUpload.prototype.debugMessage=function(C){if(this.settings.debug){var A,D=[];if(typeof C==="object"&&typeof C.name==="string"&&typeof C.message==="string"){for(var B in C){if(C.hasOwnProperty(B)){D.push(B+": "+C[B])}}A=D.join("\n")||"";D=A.split("\n");A="EXCEPTION: "+D.join("\nEXCEPTION: ");SWFUpload.Console.writeLine(A)}else{SWFUpload.Console.writeLine(C)}}};SWFUpload.Console={};SWFUpload.Console.writeLine=function(D){var B,A;try{B=document.getElementById("SWFUpload_Console");if(!B){A=document.createElement("form");document.getElementsByTagName("body")[0].appendChild(A);B=document.createElement("textarea");B.id="SWFUpload_Console";B.style.fontFamily="monospace";B.setAttribute("wrap","off");B.wrap="off";B.style.overflow="auto";B.style.width="700px";B.style.height="350px";B.style.margin="5px";A.appendChild(B)}B.value+=D+"\n";B.scrollTop=B.scrollHeight-B.clientHeight}catch(C){alert("Exception: "+C.name+" Message: "+C.message)}};function WYSIWYG_Editor(F,B,E,G,D,A,C){this.isIE=navigator.userAgent.indexOf("MSIE")>=0;if(typeof (F)=="undefined"){alert("ERROR: No instance name was passed for the editor.");return false}else{this.instance_name=F}this.editor_area=B;this.field_name=F;if(typeof (E)=="undefined"){this.content=""}else{this.content=E}if(typeof (G)=="undefined"){this.wysiwyg_path="."}else{this.wysiwyg_path=G}if(D&&D>0){this.frame_width=D}else{this.frame_width=548}if(A&&A>0){this.frame_height=A}else{this.frame_height=150}this.minimal=C;this.allowsAnchors=false;this.wysiwyg_content=this.instance_name+"_WYSIWYG_Editor";this.wysiwyg_hidden=this.field_name;this.ta_rows=Math.round(this.frame_height/15);this.ta_cols=Math.round(this.frame_width/8);this.viewMode=1;this._X=this._Y=0;this.allow_mode_toggle=false;this.allow_speller=true;this.table_border=1;this.table_cell_padding=3;this.table_cell_spacing=0;this.isSpelling=false;this.isHtml=false;this.rteReady=false;this.wantsFocus=false}WYSIWYG_Editor.prototype.setAllowAnchors=function(A){this.allowsAnchors=A};WYSIWYG_Editor.prototype.setModeToggle=function(A){this.allow_mode_toggle=A};WYSIWYG_Editor.prototype.setSpellCheck=function(A){this.allow_speller=A};WYSIWYG_Editor.prototype.getFrameName=function(){return this.instance_name+"_WYSIWYG_Editor"};WYSIWYG_Editor.prototype.getFrameElement=function(){var A=window.document.getElementById(this.getFrameName());if(A==null){A=document.getElementbyId(this.wysiwyg_hidden)}return A};WYSIWYG_Editor.prototype.inHtmlMode=function(){return(this.viewMode==2)};WYSIWYG_Editor.prototype.getContentWindow=function(){var A=document.getElementById(this.wysiwyg_content);if(A==null){return null}else{return A.contentWindow}};WYSIWYG_Editor.prototype.getContent=function(){if(this.isSpelling){this.checkSpelling()}if(this.isHtml){this.toggleMode()}var A=this.getContentData();A=A.replace(/\n/g," ");A=this.replaceLinks(A);if(A.match(/^ *<br> *$/i)){A=""}return A};WYSIWYG_Editor.prototype.replaceLinks=function(A){if(!this.allowsAnchors){A=A.replace(/<A HREF=['"]HTTP:\/\/(.*?)['"]>(.*?)<\/A>/ig,"$2 ($1)");A=A.replace(/<A HREF=['"](.*?)['"]>(.*?)<\/A>/ig,"$2 ($1)");A=A.replace(/(.*?) \(\1\)/ig,"$1")}return A};WYSIWYG_Editor.prototype.getContentData=function(){var A=this.getContentWindow();if(A==null){return document.getElementById(this.wysiwyg_hidden).value}else{return A.document.body.innerHTML}};WYSIWYG_Editor.prototype.setContent=function(A){var B=this.getContentWindow();if(B==null){document.getElementById(this.wysiwyg_hidden).value=A}else{B.document.body.innerHTML=A}};function autoURLInsert(A){var C=A.keyCode?A.keyCode:A.which?A.which:A.charCode;if(C==34){var B=document.getElementById(this.wysiwyg_content).contentWindow.document.body.innerHTML;alert(B)}}WYSIWYG_Editor.prototype.applySetupQuirk=function(){var A=this.getContentWindow().document;A.body.style.fontSize="16px"};WYSIWYG_Editor.prototype.checkPaste=function(A){var B=YAHOO.util.Event.getCharCode(A);setTimeout(delegateCallback(this,this.preparePasteText),800)};WYSIWYG_Editor.prototype.doPaste=function(){this.doTextFormat("paste","");this.preparePasteText()};WYSIWYG_Editor.prototype.preparePasteText=function(){var A=this.getContent();var B=false;if(this.isIE){B=A.match(/schemas-microsoft-com:office:office/i)}else{B=A.match(/<meta name="ProgId" content="Word.Document">/i)}A=A.replace(/<BR>/ig,"-BREAK-");A=A.replace(/<style>.*?<\/style>/ig,"");if(B){A=A.replace(/<o:p>&nbsp;<\/o:p>/g,"-BREAK-&nbsp;-BREAK-");A=A.replace(/<w:.*?>.*?<\/w:.*?>/ig,"")}else{A=A.replace(/<\/P>/ig,"-BREAK-")}A=A.replace(/<SPAN .*?font-weight: ?bold.*?>(.*?)<\/SPAN>/ig,"-B-$1-B-");A=A.replace(/<SPAN .*?font-style: ?italic.*?>(.*?)<\/SPAN>/ig,"-I-$1-I-");A=A.replace(/<I>(.*?)<\/I>/ig,"-I-$1-I-");A=A.replace(/<EM>(.*?)<\/EM>/ig,"-I-$1-I-");A=A.replace(/<STRONG>(.*?)<\/STRONG>/ig,"-B-$1-B-");A=A.replace(/<B>(.*?)<\/B>/ig,"-B-$1-B-");A=A.replace(/<LI>(.*?)<\/LI>/ig,"-LI-$1-LI-");A=A.replace(/<UL>(.*?)<\/UL>/ig,"-UL-$1-UL-");A=A.replace(/<OL>(.*?)<\/OL>/ig,"-OL-$1-OL-");A=A.replace(/<SUP>(.*?)<\/SUP>/ig,"-SUP-$1-SUP-");A=A.replace(/<A HREF=['"](.*?)['"]>(.*?)<\/A>/ig,"-A-$1-$2-A-");A=A.replace(/<\/?.*?>/g," ");
A=A.replace(/-B-(.*?)-B-/g,"<B>$1</B>");A=A.replace(/-I-(.*?)-I-/g,"<I>$1</I>");A=A.replace(/-LI-(.*?)-LI-/g,"<LI>$1</LI>");A=A.replace(/-UL-(.*?)-UL-/g,"<UL>$1</UL>");A=A.replace(/-OL-(.*?)-OL-/g,"<OL>$1</OL>");A=A.replace(/-SUP-(.*?)-SUP-/g,"<SUP>$1</SUP>");A=A.replace(/-A-(.*?)-(.*?)-A-/g,"<A HREF='$1'>$2</A>");A=A.replace(/-BREAK-/g,"<BR>");A=A.replace(/<BR>\s*<BR>/ig,"<BR>");A=A.replace(/<BR>&nbsp;<BR>\s*$/ig,"");A=A.replace(/<BR>\s*$/ig,"");A=A.replace(/\n/g," ");this.setContent(A)};WYSIWYG_Editor.prototype.autoExpand=function(){var A=document.getElementById(this.wysiwyg_content);var B;if(this.isIE){B=A.contentWindow.document.body.scrollHeight}else{if(webBrowser.isSafari){B=A.contentWindow.document.body.scrollHeight}else{B=A.contentWindow.document.documentElement.clientHeight+20}}if(B>60&&(B-this.frame_height)>5){if(B>400){B=400}A.style.height=B+"px";this.frame_height=B}};WYSIWYG_Editor.prototype.display=function(){if(this.isSupported()){this._display_editor();var B=this.getContentWindow().document;B.open();B.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head>');B.write('<body onload="document.body.rteLoaded = true;">');B.write(this.content);B.write("</body></html>");B.close();this.applySetupQuirk();if(this.isIE){B.onkeypress=rteKeyPress;window.wysiwyg_content=this.wysiwyg_content}var A=this;setTimeout(function(){YAHOO.util.Event.addListener(B,"keypress",A.autoExpand,A,true);YAHOO.util.Event.addListener(B.body,"paste",A.checkPaste,A,true);A.focus()},500)}else{this._display_textarea();this.content=this.content.replace(/<BR>/ig,"\n");this._load_content()}this.autoExpand();this.recount=0;this.activateDesignMode()};WYSIWYG_Editor.prototype.activateDesignMode=function(){var A=this.getContentWindow();if(A.document.body.rteLoaded){this.rteReady=true;A.document.designMode="On";if(this.wantsFocus){this.focusNow()}}else{this.recount++;if(this.recount>200){alert("Can't load RTE")}else{setTimeout(delegateCallback(this,this.activateDesignMode),50)}}};WYSIWYG_Editor.prototype.focus=function(){if(this.rteReady){this.focusNow()}else{this.wantsFocus=true}};WYSIWYG_Editor.prototype.focusNow=function(){var A=this;setTimeout(function(){var B=A.getContentWindow();window.focus();B.focus()},100)};function rteKeyPress(){var B=document.getElementById(window.wysiwyg_content).contentWindow;if(B.event.keyCode==13){var A=B.document.selection.createRange();B.event.returnValue=false;A.pasteHTML("<br>");A.select()}}WYSIWYG_Editor.prototype._display_textarea=function(){var A="";A+='<input type="hidden" name="editorMode" value="textarea">';A+='<textarea name="'+this.wysiwyg_hidden+'" id="'+this.wysiwyg_hidden+'" rows="'+this.ta_rows+'" cols="'+this.ta_cols+'"></textarea><br>';A+='<div style="font-size:10; padding: 3px;">(WARNING: Your browser does not support the Rich Text Editor.  Please use Firefox or Internet Explorer to edit text style and insert images.)</div>';this.editor_area.innerHTML=A};WYSIWYG_Editor.prototype._display_editor=function(){var A="";A+='<input type="hidden" name="editorMode" value="rte">';A+='   <table cellpadding="0" cellspacing="0" id="'+this.instance_name+'_table" class="editorArea">';A+="    <tr>";A+="     <td>";if(!this.minimal){A+='      <table onselectstart="return false" style="-moz-user-select:none" width="100%" border="0" cellspacing="0" cellpadding="0">';A+='       <tr valign="top">';A+='        <td height="25" valign="middle" colspan="2" id="'+this.instance_name+'_spellbar" style="display:none">';A+='        <table cellspacing="0" cellpadding="0" style="padding-left:20px"><tr><td>';A+='            Spelling Mistakes: <span id="mistakeCount"></span>';A+="        </td></tr></table>";A+="        </td>";A+='        <td valign="top" colspan="2" id="'+this.instance_name+'_toolbars"><nobr>';A+='          <img alt="Bold" title="Bold" class="editorButton imgbold" src="http://ui.geckogo.com/ui/media/spacer.gif" onClick="'+this.instance_name+".doTextFormat('bold','')\">";A+='          <img alt="Italic" title="Italic" class="editorButton imgitalic" src="http://ui.geckogo.com/ui/media/spacer.gif" onClick="'+this.instance_name+".doTextFormat('italic','')\">";A+='         <img class="editorSeparator" alt="| imgseparator" src="http://ui.geckogo.com/ui/media/spacer.gif">';A+='          <img alt="Ordered List" title="Ordered List" class="editorButton imgordlist" src="http://ui.geckogo.com/ui/media/spacer.gif"  onClick="'+this.instance_name+".doTextFormat('insertorderedlist','')\">";A+='          <img alt="Bulleted List" title="Bulleted List" class="editorButton imgbullist" src="http://ui.geckogo.com/ui/media/spacer.gif" onClick="'+this.instance_name+".doTextFormat('insertunorderedlist','')\">";A+='          <img alt="Indent" title="Indent imgindent" src="http://ui.geckogo.com/ui/media/spacer.gif" class=editorButton onClick="'+this.instance_name+".doTextFormat('indent','')\">";A+='          <img alt="Outdent" title="Outdent imgoutdent" src="http://ui.geckogo.com/ui/media/spacer.gif" class=editorButton onClick="'+this.instance_name+".doTextFormat('outdent','')\">";A+='         <img class="editorSeparator" alt="| imgseparator" src="http://ui.geckogo.com/ui/media/spacer.gif">';if(this.allowsAnchors){A+='          <img alt="Hyperlink" title="Hyperlink" class="editorButton imglink" src="http://ui.geckogo.com/ui/media/spacer.gif" onClick="'+this.instance_name+".doTextFormat('createlink','')\">"}A+='          <img alt="Remove Formatting" title="Remove Formatting" class="editorButton imgunformat" src="http://ui.geckogo.com/ui/media/spacer.gif" onClick="'+this.instance_name+".doTextFormat('removeformat','')\">";A+='         <img class="editorSeparator" alt="| imgseparator" src="http://ui.geckogo.com/ui/media/spacer.gif">';A+='          <img alt="Undo" title="Undo" class="editorButton imgundo" src="http://ui.geckogo.com/ui/media/spacer.gif" onClick="'+this.instance_name+".doTextFormat('undo','')\">";A+='          <img alt="Redo" title="Redo" class="editorButton imgredo" src="http://ui.geckogo.com/ui/media/spacer.gif" onClick="'+this.instance_name+".doTextFormat('redo','')\">";A+="        </nobr></td>";A+='<td id="'+this.instance_name+'_extra_controls" align="right">';if(this.allow_mode_toggle){A+='          <img id="htmlMode" alt="Toggle Mode" title="Toggle Mode" class="editorButton" src="http://ui.geckogo.com/ui/editor/images/editor-html.png" onClick="'+this.instance_name+'.toggleMode()">'}A+='<img id="checkSpelling" alt="Check Spelling" onclick="'+this.instance_name+'.checkSpelling()" class="editorButton imgeditor-spelling" src="http://ui.geckogo.com/ui/media/spacer.gif" </td>';A+='<td id="'+this.instance_name+'_extra_controls_spelling" style="display:none" align="right">';A+='Click to resume editing: <img id="checkSpelling" alt="Check Spelling" onclick="'+this.instance_name+'.checkSpelling()" class="editorButton imgeditor-spelling" src="http://ui.geckogo.com/ui/media/spacer.gif" </td>';if(this.allow_mode_toggle){A+='<td id="'+this.instance_name+'_extra_controls_mode" align="right" style="display:none">';A+='Click to return to normal view: <img id="htmlMode" alt="Toggle Mode" title="Toggle Mode" class="editorButton imgeditor-html" src="http://ui.geckogo.com/ui/media/spacer.gif" onClick="'+this.instance_name+'.toggleMode()">'}A+="     </tr></table>";A+='       <div id="matchList" style="position:absolute; display:none; background-color:#fff; padding: 5px; border: solid 1px #000; z-index:1000"></div>'}A+='      <iframe id="'+this.wysiwyg_content+'" name="'+this.wysiwyg_content+'" class="editorFrame" style="width:'+this.frame_width+"px; height:"+this.frame_height+'px;" frameborder="0"></iframe>';A+="     </td>";A+="    </tr>";A+="   </table>";this.editor_area.innerHTML=A};WYSIWYG_Editor.prototype.doTextFormat=function(D,A,E){if((D=="forecolor")||(D=="hilitecolor")){this.getPalette(D,A,E)}else{if(D=="createlink"){var C=prompt("Enter a URL:","");if(document.getElementById(this.wysiwyg_content).contentWindow.document.queryCommandEnabled(D)){document.getElementById(this.wysiwyg_content).contentWindow.document.execCommand("CreateLink",false,C);this.getContentWindow().focus();return true}else{return false}}else{if(D=="removeformat"){var B=this.getContentData();B=B.replace(/<\/p>/gi,"<br>");B=B.replace(/<br>/gi,"\n");B=B.replace(/<p .*?>/gi,"");B=B.replace(/<\/?.+?>/gi,"");B=B.replace(/\n/gi,"<br>");
this.setContent(B)}if(document.getElementById(this.wysiwyg_content).contentWindow.document.queryCommandEnabled(D)){document.getElementById(this.wysiwyg_content).contentWindow.document.execCommand(D,false,A);this.getContentWindow().focus();return true}else{return false}}}};WYSIWYG_Editor.prototype._load_content=function(){document.getElementById(this.wysiwyg_hidden).value=this.content};WYSIWYG_Editor.prototype.toggleMode=function(){if(this.isMSIE()){this._toggle_mode_ie()}else{this._toggle_mode_gecko()}this.isHtml=!this.isHtml;var A=document.getElementById(this.instance_name+"_toolbars");if(A){if(this.isHtml){A.style.display="none";document.getElementById(this.instance_name+"_extra_controls").style.display="none";document.getElementById(this.instance_name+"_extra_controls_mode").style.display=""}else{A.style.display="";document.getElementById(this.instance_name+"_extra_controls").style.display="";document.getElementById(this.instance_name+"_extra_controls_mode").style.display="none"}}};WYSIWYG_Editor.prototype._toggle_mode_ie=function(){if(this.viewMode==2){document.getElementById(this.wysiwyg_content).contentWindow.document.body.innerHTML=document.getElementById(this.wysiwyg_content).contentWindow.document.body.innerText;document.getElementById(this.wysiwyg_content).contentWindow.document.body.style.fontFamily="";document.getElementById(this.wysiwyg_content).contentWindow.document.body.style.fontSize="";document.getElementById(this.instance_name+"_toolbars").style.display="";document.getElementById(this.wysiwyg_content).contentWindow.focus();this.applySetupQuirk();this.viewMode=1}else{document.getElementById(this.wysiwyg_content).contentWindow.document.body.innerText=document.getElementById(this.wysiwyg_content).contentWindow.document.body.innerHTML;document.getElementById(this.wysiwyg_content).contentWindow.document.body.style.fontFamily="monospace";document.getElementById(this.wysiwyg_content).contentWindow.document.body.style.fontSize="10pt";document.getElementById(this.wysiwyg_content).contentWindow.focus();this.viewMode=2}};WYSIWYG_Editor.prototype._toggle_mode_gecko=function(){if(this.viewMode==2){var A=document.getElementById(this.wysiwyg_content).contentWindow.document.body.ownerDocument.createRange();A.selectNodeContents(document.getElementById(this.wysiwyg_content).contentWindow.document.body);document.getElementById(this.wysiwyg_content).contentWindow.document.body.innerHTML=A.toString();document.getElementById(this.wysiwyg_content).contentWindow.document.body.style.fontFamily="";document.getElementById(this.wysiwyg_content).contentWindow.document.body.style.fontSize="";document.getElementById(this.instance_name+"_toolbars").style.display="";document.getElementById(this.wysiwyg_content).contentWindow.focus();this.viewMode=1}else{var A=document.createTextNode(document.getElementById(this.wysiwyg_content).contentWindow.document.body.innerHTML);document.getElementById(this.wysiwyg_content).contentWindow.document.body.innerHTML="";document.getElementById(this.wysiwyg_content).contentWindow.document.body.appendChild(A);document.getElementById(this.wysiwyg_content).contentWindow.document.body.style.fontFamily="monospace";document.getElementById(this.wysiwyg_content).contentWindow.document.body.style.fontSize="10pt";document.getElementById(this.wysiwyg_content).contentWindow.focus();this.viewMode=2}};WYSIWYG_Editor.prototype.insertTable=function(){colstext=prompt("Enter the number of columns per row.");rowstext=prompt("Enter the number of rows to create.");rows=parseInt(rowstext,"0");cols=parseInt(colstext,"0");if(this.isMSIE()){return this._insert_table_ie(cols,rows)}else{return this._insert_table_gecko(cols,rows)}};WYSIWYG_Editor.prototype._insert_table_ie=function(D,B){document.getElementById(this.wysiwyg_content).contentWindow.focus();var E=document.getElementById(this.wysiwyg_content).contentWindow.document.selection.createRange();if((B>0)&&(D>0)){var A='<table border="'+this.table_border+'" cellpadding="'+this.table_cell_padding+'" cellspacing="'+this.table_cell_spacing+'">';while(B>0){B--;var C=D;A=A+"<tr>";while(parseInt(C)>0){C--;A=A+"<td>&nbsp;</td>"}A=A+"</tr>"}A=A+"</table>";E.pasteHTML(A);document.getElementById(this.wysiwyg_content).contentWindow.focus()}return true};WYSIWYG_Editor.prototype._insert_table_gecko=function(B,A){contentWin=document.getElementById(this.wysiwyg_content).contentWindow;if((A>0)&&(B>0)){table=contentWin.document.createElement("table");table.setAttribute("border",this.table_border);table.setAttribute("cellpadding",this.table_cell_padding);table.setAttribute("cellspacing",this.table_cell_spacing);tbody=contentWin.document.createElement("tbody");for(i=0;i<A;i++){tr=contentWin.document.createElement("tr");for(j=0;j<B;j++){td=contentWin.document.createElement("td");br=contentWin.document.createElement("br");td.appendChild(br);tr.appendChild(td)}tbody.appendChild(tr)}table.appendChild(tbody);this._insert_element_gecko(contentWin,table)}return true};WYSIWYG_Editor.prototype._insert_element_gecko=function(G,D){var B=G.getSelection();var F=B.getRangeAt(0);B.removeAllRanges();F.deleteContents();var A=F.startContainer;var K=F.startOffset;F=document.createRange();if(A.nodeType==3&&D.nodeType==3){A.insertData(K,D.nodeValue);F.setEnd(A,K+D.length);F.setStart(A,K+D.length)}else{var C;if(A.nodeType==3){var E=A;A=E.parentNode;var L=E.nodeValue;var I=L.substr(0,K);var H=L.substr(K);var J=document.createTextNode(I);var C=document.createTextNode(H);A.insertBefore(C,E);A.insertBefore(D,C);A.insertBefore(J,D);A.removeChild(E)}else{C=A.childNodes[K];A.insertBefore(D,C)}}};WYSIWYG_Editor.prototype.setColor=function(A,C){if(typeof (pwin)=="object"){if(!pwin.closed){pwin.close()}}if(this.isMSIE()&&C=="hilitecolor"){C="backcolor"}var B=document.getElementById(this.wysiwyg_content).contentWindow.document.selection;if(B!=null){rng=B.createRange()}document.getElementById(this.wysiwyg_content).contentWindow.focus();if(document.getElementById(this.wysiwyg_content).contentWindow.document.queryCommandEnabled(C)){document.getElementById(this.wysiwyg_content).contentWindow.document.execCommand(C,false,A)}else{return false}document.getElementById(this.wysiwyg_content).contentWindow.focus();return true};WYSIWYG_Editor.prototype.getPalette=function(B,A,C){html=this._get_palette_html(B);if(typeof (pwin)=="object"){if(!pwin.closed){pwin.close()}}pwin=window.open("","colorPalette","dependent=yes, directories=no, fullscreen=no,hotkeys=no,height=125,width=192,left="+C.screenX+",top="+C.screenY+",locatoin=no,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,toolbar=no");pwin.document.write(html);pwin.document.close();pwin.focus()};WYSIWYG_Editor.prototype.isSupported=function(){return true};WYSIWYG_Editor.prototype.isMSIE=function(){return this.isIE};WYSIWYG_Editor.prototype._get_palette_html=function(D){s='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';s=s+"<html>";s=s+" <head>";s=s+'  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">';s=s+"  <title>Color Palette</title>";s=s+'  <style type="text/css">';s=s+"   <!--";s=s+"    html,body{margin: 0px; padding: 0px; color: black; background-color: white;}";s=s+"    td{border: black solid 1px;}";s=s+"    td:hover{border: white solid 1px;}";s=s+"   -->";s=s+"  </style>";s=s+" </head>";s=s+"";s=s+" <body>";s=s+'  <table border="0" cellpadding="0" cellspacing="2">';for(var C=0;C<7;C++){s=s+"   <tr>";for(var A=0;A<10;A++){var B=colors[C*10+A];s=s+'    <td id="c'+B+'" bgcolor="#'+B+'" width="15" height="15" onclick="str=this.id;color=str.replace(\'c\',\'#\');opener.'+this.instance_name+".setColor(color,'"+D+"');window.close();\"></td>"}}s=s+"  </table>";s=s+" </body>";s=s+"</html>";return s};var colors=new Array("FFFFFF","FFCCCC","FFCC99","FFFF99","FFFFCC","99FF99","99FFFF","CCFFFF","CCCCFF","FFCCFF","CCCCCC","FF6666","FF9966","FFFF66","FFFF33","66FF99","33FFFF","66FFFF","9999FF","FF99FF","C0C0C0","FF0000","FF9900","FFCC66","FFFF00","33FF33","66CCCC","33CCFF","6666CC","CC66CC","999999","CC0000","FF6600","FFCC33","FFCC00","33CC00","00CCCC","3366FF","6633FF","CC33CC","666666","990000","CC6600","CC9933","999900","009900","339999","3333FF","6600CC","993399","333333","660000","993300","996633","666600","006600","336666","000099","333399","663366","000000","330000","663300","663333","333300","003300","003333","000066","330099","330033");
WYSIWYG_Editor.prototype.setMediaSelectHandler=function(A){this.mediaSelectHandler=A};WYSIWYG_Editor.prototype.setActivitySelectHandler=function(A){this.activitySelectHandler=A};WYSIWYG_Editor.prototype.insertMedia=function(){this.mediaSelectHandler();var A=document.getElementById(this.wysiwyg_content).contentWindow.document.selection;if(A!=null){rng=A.createRange()}};WYSIWYG_Editor.prototype.insertActivity=function(){this.activitySelectHandler();var A=document.getElementById(this.wysiwyg_content).contentWindow.document.selection;if(A!=null){rng=A.createRange()}};WYSIWYG_Editor.prototype.addMedia=function(B,C){var A=document.getElementById(this.wysiwyg_content).contentWindow;A.focus();if(this.viewMode==1){A.document.execCommand("insertimage",false,B)}};WYSIWYG_Editor.prototype.selectText=function(F){var E=document.getElementById(this.wysiwyg_content);var C=E.contentWindow;C.focus();if(C.document.selection!=null){var A=C.document.selection.createRange();if(A.text==""){A.text=activityName;A=C.document.body.createTextRange();A.findText(activityName);A.select()}}else{var D=C.getSelection();var B=D.getRangeAt(D.rangeCount-1);if(B==""){B.selectNode(C.document.body);D.addRange(B)}}};WYSIWYG_Editor.prototype.addActivity=function(A,H){var G=document.getElementById(this.wysiwyg_content);var D=G.contentWindow;D.focus();if(D.document.selection!=null){var B=D.document.selection.createRange();if(B.text==""){B.text=H;B=D.document.body.createTextRange();B.findText(H);B.select()}}else{var F=D.getSelection();var C=F.getRangeAt(F.rangeCount-1);if(C==""){C=C.cloneRange();var E=G.contentDocument.createTextNode(H);C.insertNode(E);C.selectNode(E);F.addRange(C)}}if(this.viewMode==1){D.document.execCommand("CreateLink",false,A)}if(D.document.selection!=null){var B=D.document.body.createTextRange();B.collapse(false);B.select()}else{var F=D.getSelection();F.collapseToEnd()}};WYSIWYG_Editor.prototype.insertHTML=function(G){var F=document.getElementById(this.wysiwyg_content);var C=F.contentWindow;C.focus();if(C.document.selection!=null){var A=C.document.selection.createRange();if(A.text==""){A.text="MAGIC_MARKER"}}else{var E=C.getSelection();var B=E.getRangeAt(E.rangeCount-1);if(B==""){B=B.cloneRange();var D=F.contentDocument.createTextNode("MAGIC_MARKER");B.insertNode(D);B.selectNode(D);E.addRange(B)}}if(C.document.selection!=null){var A=C.document.selection.createRange();A.collapse(false);body=C.document.body}else{var E=C.getSelection();E.collapseToEnd();body=F.contentDocument.body}body.innerHTML=body.innerHTML.replace(/MAGIC_MARKER/,G)};WYSIWYG_Editor.prototype.checkSpelling=function(){if(window.openSpellingCheck){this.isSpelling=!this.isSpelling;this.renderSpellMode();if(this.isSpelling){window.openSpellingCheck(this)}else{window.closeSpellingCheck(this)}}};WYSIWYG_Editor.prototype.renderSpellMode=function(){var A=document.getElementById(this.instance_name+"_toolbars");if(A){var B=document.getElementById(this.instance_name+"_spellbar");if(this.isSpelling){A.style.display="none";B.style.display="";document.getElementById(this.instance_name+"_extra_controls").style.display="none";document.getElementById(this.instance_name+"_extra_controls_spelling").style.display=""}else{A.style.display="";B.style.display="none";document.getElementById(this.instance_name+"_extra_controls").style.display="";document.getElementById(this.instance_name+"_extra_controls_spelling").style.display="none";this.getContentWindow().focus()}}};WYSIWYG_Editor.prototype.setMistakes=function(A,B){document.getElementById("mistakeCount").innerHTML=B};var activeEditor;var textContent=null;var matches;var matchSet;var activeMatch;var activeMatchIndex=0;var activeMatchOcc;function openSpellingCheck(A){textContent=A.getContentData();activeEditor=A;text=textContent.replace(/<.*?>/g," ");text=text.replace(/&.*?;/g," ");var B="event=checkSpelling&text="+encode(text);YAHOO.util.Connect.asyncRequest("POST","/services/SpellChecker",{success:checkSpellingHandler,failure:function(C){}},B)}function checkSpellingHandler(F){var D=F.responseXML;matches=new Array();matchSet=new Object();var I=D.getElementsByTagName("mistake");for(var H=0;H<I.length;H++){var K=decode(I[H].getAttribute("word"));matches.push(K);var J=new Array();if(I[H].firstChild){J=I[H].firstChild.data.split(",");for(var G=0;G<J.length;G++){J[G]=decode(J[G])}}matchSet[K]=J}var A=new Array();for(var H=0;H<matches.length;H++){var K=matches[H];if(A[K]){continue}A[K]=true;var C=new RegExp("(\\b)"+K+"(\\b)","g");var B="@"+K+"@";textContent=textContent.replace(C,B);for(var G=0;G<20&&textContent.match(B);G++){var E="<span id='match"+H+"' class='occ"+G+"' style='color:#ff0000;font-weight:bold;'>"+K+"</span>";textContent=textContent.replace(B,E)}}mistakesLeft=matches.length;activeEditor.setMistakes(matches.length,mistakesLeft);activeEditor.setContent(textContent);YAHOO.util.Event.addListener(activeEditor.getFrameElement().contentWindow,"contextmenu",matchSuggest);YAHOO.util.Event.addListener(activeEditor.getFrameElement().contentWindow,"mousedown",matchSuggest)}function closeSpellingCheck(B){if(textContent==null){return }closeMenu();if(textContent!=null){var A=new RegExp("<span id='?match.*?>(.*?)</span>","ig");textContent=textContent.replace(A,"$1");B.setContent(textContent)}YAHOO.util.Event.removeListener(B.getFrameElement().contentWindow,"contextmenu");YAHOO.util.Event.removeListener(B.getFrameElement().contentWindow,"mousedown");textContent=null}function matchSuggest(K){var G=YAHOO.util.Event.getTarget(K);var B=activeEditor.getFrameElement();activeMatch=G.firstChild.data;if(G.id.match(/match\d*/)){activeMatchIndex=G.id.replace(/match/,"");activeMatchOcc=G.className.replace(/occ/,"");var L=YAHOO.util.Dom.getXY(G);var C=YAHOO.util.Dom.getXY(B);var I=C[0]+L[0];var H=C[1]+L[1]+20;var A=B.contentWindow;if(webBrowser.isIE||webBrowser.isOpera){H-=(A.document.documentElement.scrollTop+A.document.body.scrollTop-20)}else{H-=A.scrollY}var M=document.getElementById("matchList");M.style.display="";YAHOO.util.Dom.setXY(M,new Array(I,H));var F=matchSet[activeMatch];if(F){if(webBrowser.isNS&&webBrowser.realVersion<1.5){var J="<div id='newText' class='menuItem'><a class='plain' href='javascript:menuCall(\"newText\"); void 0;'>(Change word)</a></div>";for(var D=0;D<F.length;D++){J+="<div id='item"+D+"' class='menuItem'><a class='menuItemA' href='javascript:menuCall(\"item"+D+"\"); void 0'>"+F[D]+"</a></div>"}}else{var J="<div id='newText' class='menuItem'><a class='menuItemA' href='#' onclick='menuCall(\"newText\"); return false;' onmouseover='menuSelect(this.parentNode.id)' onmouseout='menuDeselect(this.parentNode.id)'>(Change word)</a></div>";for(var D=0;D<F.length;D++){J+="<div id='item"+D+"' class='menuItem'><a class='menuItemA' href='#' onclick='menuCall(this.parentNode.id); return false' onmouseover='menuSelect(this.parentNode.id)' onmouseout='menuDeselect(this.parentNode.id)'>"+F[D]+"</a></div>"}}M.innerHTML=J}}else{closeMenu()}var E=B.contentWindow;if(E.event){E.event.returnValue=false;E.event.cancelBubble=true}else{K.preventDefault();K.stopPropagation()}}function menuSelect(B){var A=document.getElementById(B);A.className="menuItemSelected";A.firstChild.className="menuItemSelectedA"}function menuDeselect(B){var A=document.getElementById(B);A.className="menuItem";A.firstChild.className="menuItemA"}function closeMenu(){var A=document.getElementById("matchList");A.style.display="none"}function menuCall(D){closeMenu();var B;if(D=="newText"){B=prompt("New text:","");if(!B){return false}}else{var A=parseInt(D.replace(/item/,""));B=matchSet[activeMatch][A]}matchSet[B]=matchSet[activeMatch];B="<span id='match"+activeMatchIndex+"' class='occ"+activeMatchOcc+"' style='color:#0000dd;font-weight:bold;'>"+B+"</span>";var C=new RegExp("<span id=[\"']match"+activeMatchIndex+"[\"'] class=[\"']occ"+activeMatchOcc+"\"?'? .*?>"+activeMatch+"</span>","i");textContent=textContent.replace(C,B);activeEditor.setContent(textContent);mistakesLeft--;activeEditor.setMistakes(matches.length,mistakesLeft);
return false}function nextMistake(){}function previousMistake(){}var pageChanged=false;function markPageChanged(){pageChanged=true}function resetChangableFields(){pageChanged=false}function registerChangableFields(C){if(!C){C=document.form}var A=C.elements;for(var B=0;B<A.length;B++){var D=A[B];YAHOO.util.Event.addListener(D,"change",function(){pageChanged=true})}}function onbeforeunloadInternalPage(){if(pageChanged){return confirm("If you leave without saving, your changes will be lost.\nAre you sure you want to leave this page?")}else{return true}}window.onbeforeunload=function(){if(pageChanged){return"If you leave without saving, your changes will be lost."}};function Photo(N,A,M,F,G,C,O,D,B,K,I,E,H,J,L){this.caption=N;this.smallPath=M;this.mediumPath=F;this.largePath=G;this.thumbnail=A;this.id=C;this.tags=O;this.locationName=D;this.width=B;this.height=K;this.blog=I;this.dateAdded=E;this.dateTaken=H;this.guideId=J;this.guideName=L}function Blog(B,C,A){this.blogId=B;this.blogName=C;this.entries=A}function BlogEntry(A,B){this.entryId=A;this.entryName=B}var SLIDESHOW_SIZE=320;function slideshowSetup(){SITE_BASE_URL="";PHOTOS_SERVICE_URL="/services/Photos";if(window.WIDGET_MODE){SITE_BASE_URL=geckoHome;PHOTOS_SERVICE_URL+=".php"}}function Slideshow(B,D,A){window.slideshow=this;slideshowSetup();this.area=D;this.queryUrl=B;this.itemIndex=0;this.results=new Array();this.showName=(A.showName)?A.showName:false;this.showLocation=(A.showLocation)?A.showLocation:false;this.showCaption=(A.showCaption)?A.showCaption:false;this.showFlag=(A.showFlag)?A.showFlag:false;this.showUpload=(A.showUpload)?A.showUpload:false;this.showCredit=(A.showCredit)?A.showCredit:false;this.showMakeCover=(A.showMakeCover)?A.showMakeCover:false;this.showInfoOnMouseOver=(A.showInfoOnMouseOver)?A.showInfoOnMouseOver:false;this.randomize=(A.randomize)?A.randomize:false;this.onEmptyResults=A.onEmptyResults;if(B&&D){var C=document.postForm;if(this.queryUrl.match(/guide=(\d+)/)){C.guide.value=RegExp.$1}if(this.queryUrl.match(/listing=(\d+)/)){C.listing.value=RegExp.$1}this.loadData()}}Slideshow.prototype.renderFrame=function(I,G,F,H){var E="<div class='slideshow-main'>";E+="<div class='slideshow-image'><img src='"+I.image+"' width='320' height='320'></div>";E+="<div class='slideshow-box-controls'>";if(G>0){E+="   <div class='pager-box' onclick='navSlideshowLeft()'>&lt;</div>"}else{E+="<div class='pager-box'></div>"}var B=5*Math.floor(G/5);for(var D=B;D<Math.min(B+5,F);D++){var A=(D==G)?"selected":"";E+="   <div class='pager-box "+A+"' onclick='navSlideshowIndex("+D+")'>"+(D+1)+"</div>"}if(G<F-1){E+="   <div class='pager-box' onclick='navSlideshowRight()'>&gt;</div>"}else{E+="<div class='pager-box'></div>"}if(this.showUpload){E+="<div class='photo-upload-box' onclick='uploadPhoto()'></div>"}E+="</div>";var C=(this.showInfoOnMouseOver)?"none":"block";E+="<div class='slideshow-popup' style='display:"+C+"'>";E+=this.getInfo(I,H);E+="</div>";E+="</div>";E+="</div>";E+="<div class='slideshow-extra-controls'>";if(this.showMakeCover){E+="<div class='slideshow-make-cover'><a href='#' onclick='return false' title='Make Cover'>Make cover</a></div>"}E+="</div>";return E};Slideshow.prototype.loadData=function(){var B=this;var A=this.queryUrl;YAHOO.util.Connect.asyncRequest("GET",A,{success:B.processResults,failure:function(C){},scope:B})};Slideshow.prototype.processResults=function(A){try{var C=JSON.parse(A.responseText);bbox=C.boundaries;this.results=C.results;if(this.results.length==0){if(this.onEmptyResults){this.onEmptyResults()}else{this.area.innerHTML="<div style='slideshow-none-available'>No photos available</div><div>Be first to upload a photo.  <div class='link' onclick='uploadPhoto()'>Upload Photo</div></div>"}return }if(this.randomize){this.results.sort(function(G,F){return 0.5-Math.random()})}memberPhotos=[];for(var D=0;D<this.results.length;D++){var B=this.results[D];memberPhotos.push(new Photo(B.caption,B.squareThumb,null,null,B.largePath,B.id,null,B.location,parseInt(B.width),parseInt(B.height),null,B.dateAdded,B.dateTaken))}this.renderItem()}catch(E){alert(E)}};Slideshow.prototype.renderItem=function(){var C=this.results[this.itemIndex];var A=(C.canRate=="true"||window.WIDGET_MODE);this.area.innerHTML=this.renderFrame(C,this.itemIndex,this.results.length,A);this.infoPopup=getFirstElementByClassName("slideshow-popup",this.area);this.setupInfo(C,A);if(this.showInfoOnMouseOver){var D=getFirstElementByClassName("slideshow-image",this.area);YAHOO.util.Event.addListener(D,"mouseover",this.showInfo,this,true);YAHOO.util.Event.addListener(D,"mouseout",this.hideInfo,this,true);YAHOO.util.Event.addListener(this.infoPopup,"mouseover",this.showInfo,this,true);YAHOO.util.Event.addListener(this.infoPopup,"mouseout",this.hideInfo,this,true)}if(this.showMakeCover){var B=getFirstElementByClassName("slideshow-make-cover",this.area);YAHOO.util.Event.addListener(B,"click",this.makeCoverPhoto,this,true)}};Slideshow.prototype.setupInfo=function(E,D){if(D){this.photoRating=new StarRating(E.userRating,5,"stars/rating-star-photo",14,14);var C=getFirstElementByClassName("photo-rating",this.area);this.photoRating.renderSelector(C);var B=getFirstElementByClassName("rate-photo-button",this.area);YAHOO.util.Event.addListener(B,"click",this.ratePhoto,this,true)}if(!E.userFlagged){var A=getFirstElementByClassName("flag-photo-button",this.area);YAHOO.util.Event.addListener(A,"click",this.flagPhoto,this,true)}};function navSlideshowLeft(){slideshow.moveLeft()}function navSlideshowRight(){slideshow.moveRight()}function navSlideshowIndex(A){slideshow.moveIndex(A)}Slideshow.prototype.moveIndex=function(A){if(A>=0&&A<this.results.length){this.itemIndex=A;this.renderItem()}};Slideshow.prototype.moveLeft=function(A){if(this.itemIndex-1>=0){this.itemIndex--;this.renderItem()}};Slideshow.prototype.moveRight=function(A){if(this.itemIndex+1<this.results.length){this.itemIndex++;this.renderItem()}};Slideshow.prototype.getInfo=function(B,A){var D=(B.url)?"onclick='slideshowClicked(\""+B.url+"\")'":"";var E="";E+="<div class='slideshow-box-info-bg'></div>";E+="<div class='slideshow-box-info clear_fix' "+D+"><div class='slideshow-name-info'>";if(this.showCaption){var C="";if(B.caption){C=B.caption;if(C.length>35){C=C.substring(0,35)+"..."}C="&quot;"+C+"&quot;"}E+="   <div class='slideshow-caption'>"+C+"</div>"}if(this.showName){E+="   <div class='slideshow-name'>"+B.name+"</div>"}if(this.showLocation){E+="   <div class='slideshow-guide-name'>"+B.guideName+"</div>"}if(this.showCredit&&B.userName){if(window.WIDGET_MODE){E+="<div class='slideshow-author'>By: "+B.userName+"</div>"}else{E+="<div class='slideshow-author'>By: <a target='_top' href='"+B.userLink+"'>"+B.userName+"</a></div>"}}E+="</div><div class='slideshow-rating-info'>";E+="   <div class='slideshow-rating'>"+new StarRating(B.rating,5,"stars/rating-star-photo",14,14).getHtml()+"</div>";var F=(B.reviewCount==1)?"1 review":B.reviewCount+" reviews";E+="   <div class='slideshow-reviews'>"+F+"</div>";E+="</div>";if(A){E+="<div class='slideshow-rating-controls'><div class='rating-label'>Rate this photo:</div><div class='photo-rating'></div><div class='link rate-photo-button'>Save</a></div></div>"}if(this.showFlag){if(B.userFlagged){E+="<div class='slideshow-flag'>Photo Flagged</div>"}else{E+="<div class='slideshow-flag flag-photo-button link' title='Flag inappropriate or irrelevant photos'>Flag</div>"}}E+="</div>";return E};Slideshow.prototype.showInfo=function(){this.cancelHide=true;if(this.infoPopupShown){return }var A=this.results[this.itemIndex];if(!A){return }this.infoPopupShown=true;this.infoPopup.style.display="block"};Slideshow.prototype.hideInfo=function(){this.cancelHide=false;setTimeout(delegateCallback(this,this.hideInfoSoon),300)};Slideshow.prototype.hideInfoSoon=function(){if(!this.cancelHide){this.infoPopup.style.display="none";this.infoPopupShown=false}};Slideshow.prototype.flagPhoto=function(){var B=this.results[this.itemIndex];var D="event=flagPhoto";if(B.id!=null){D+="&media="+B.id
}var A=null;if(B.flickrId!=null){A=B.flickrId}else{if(B.flickr_id!=null){A=B.flickr_id}}if(A!=null){D+="&flickr_id="+A;if(document.form.guide!=null){D+="&guide="+document.form.guide.value}if(document.form.item!=null){D+="&listing="+document.form.item.value}}B.userFlagged=true;var C=this;D+="&"+getSessionParams();YAHOO.util.Connect.asyncRequest("POST",PHOTOS_SERVICE_URL,{success:C.flagHandler,failure:function(E){},scope:C},D)};Slideshow.prototype.flagHandler=function(){var A=getFirstElementByClassName("slideshow-flag",this.area);A.style.display="none";this.infoPopupShown=false};Slideshow.prototype.ratePhoto=function(){var A=this.results[this.itemIndex];var C="event=ratePhoto";if(A.id!=null){C+="&media="+A.id}if(A.flickr_id!=null){C+="&flickr_id="+A.flickr_id;if(document.form.guide!=null){C+="&guide="+document.form.guide.value}if(document.form.item!=null){C+="&listing="+document.form.item.value}}rating=this.photoRating.getRating();C+="&rating="+rating;A.userRating=rating;var B=this;C+="&"+getSessionParams();YAHOO.util.Connect.asyncRequest("POST",PHOTOS_SERVICE_URL,{success:B.ratingHandler,failure:function(D){},scope:B},C)};Slideshow.prototype.ratingHandler=function(){var A=getFirstElementByClassName("slideshow-rating-controls",this.area);A.style.display="none"};Slideshow.prototype.makeCoverPhoto=function(){var A=this.results[this.itemIndex];var C="event=makeCoverPhoto";if(A.id!=null){C+="&media="+A.id}if(document.form.guide){C+="&guide="+document.form.guide.value}if(document.form.listing){C+="&listing="+document.form.listing.value}if(A.flickr_id){C+="&flickr_id="+A.flickr_id}var B=this;C+="&"+getSessionParams();YAHOO.util.Connect.asyncRequest("POST",PHOTOS_SERVICE_URL,{success:B.makeCoverPhotoHandler,scope:B},C)};Slideshow.prototype.makeCoverPhotoHandler=function(){alert("new cover applied!")};function viewAsSlideshow(){slideshow.viewAsSlideshow()}Slideshow.prototype.viewAsSlideshow=function(){if($("photoImage").src.indexOf("blank.gif")>0){return }openSlideshow(this.itemIndex)};function slideshowClicked(A){window.location=A}var photoUploaderPopup=null;function uploadPhoto(A){return new PhotoUpload({uploadCallback:A})}function PhotoUpload(A){this.uploadCallback=A.uploadCallback;this.cancelCallback=A.cancelCallback;this.selectPlace=A.selectPlace;this.placeRequired=A.placeRequired;this.contest=A.contest;this.inlineMode=A.inlineMode;if(photoUploaderPopup){return }if(A.cancelButtonText){$("cancelPhotoUpload").innerHTML="<span>"+A.cancelButtonText+"</span>"}this.PHOTOS_SERVICE_URL="/services/Photos";if(window.WIDGET_MODE){this.PHOTOS_SERVICE_URL+=".php"}var B=document.getElementById("addPhotoArea");if(this.inlineMode){B.style.display="block"}else{photoUploaderPopup=makePopup(B,"Add Some Photos...")}YAHOO.util.Event.addListener("submitPhotoUpload","click",this.submitPhotoUpload,this,true);YAHOO.util.Event.addListener("cancelPhotoUpload","click",this.cancelPhotoUpload,this,true);YAHOO.util.Event.addListener("cancelPhotoUpload2","click",this.cancelPhotoUpload,this,true);var C=document.postForm;var D=this;if(this.selectPlace){$("photoGuideArea").style.display="";this.photoGuideSelector=new GuideSelector(C.guide,C.guideName,"suggestedGuideAreaDisc",null,function(){D.displayListingBox()})}if(this.contest){$("contestArea").style.display=""}return this}PhotoUpload.prototype.displayListingBox=function(){var A=document.postForm;if(!this.photoListingSelector){$("photoListingArea").style.display="";this.photoListingSelector=new ListingSelector(A.listing,A.listingName,"suggestedListingAreaDisc","",function(){})}this.photoListingSelector.updateLocation(A.guide.value)};PhotoUpload.prototype.cancelPhotoUpload=function(){if(photoUploaderPopup){closePopup(photoUploaderPopup)}photoUploaderPopup=null;if(this.cancelCallback){this.cancelCallback()}};PhotoUpload.prototype.submitPhotoUpload=function(A){if(this.selectPlace&&this.placeRequired&&document.postForm.guide.value==""){this.showError("Please select a city, region, or country.");return }if(this.contest&&getRadioValue(document.postForm.category)==""){this.showError("Please select a category to enter the contest.");return }var B=this;requireActiveUser(function(){var C=document.getElementById("uploadPhotoControls");startSpinner(C);B.submitPhotoUploadNow(A)},"Please login or sign-up to edit this item.")};PhotoUpload.prototype.showError=function(A){$("photoErrors").innerHTML=A;$("photoErrors").style.display="block"};PhotoUpload.prototype.submitPhotoUploadNow=function(A){YAHOO.util.Event.stopEvent(A);var C=this;var B=document.postForm;YAHOO.util.Connect.setForm(B,true);YAHOO.util.Connect.asyncRequest("POST",this.PHOTOS_SERVICE_URL,{upload:function(E){var F=E.responseText;F=F.replace(/<\/?.*?>/g,"");var D=JSON.parse(F);endSpinner();if(D.error=="MISSING_PHOTO"){C.showError("Please select a photo to upload.");return }else{if(D.error){C.showError("Please select a photo to upload.");return }}if(C.uploadCallback){C.uploadCallback(D.id)}else{doReload()}}})};var swfu;switchStandardUpload=function(A){document.getElementById("singleUploadArea").style.display="";document.getElementById("multiUploadArea").style.display="none"};function initUploadMany(){var F="";var D=document.postForm;var C=D.guide.value;if(C){F+="&guide="+C}var E=D.listing.value;if(E){F+="&listing="+E}var B=D.blogEntry.value;if(B){F+="&blogEntry="+B}var A=getUserId();if(A){F+="&userId="+A}swfu=new SWFUpload({debug:false,file_size_limit:"30 MB",flash_url:"/ui/SWFUpload/swfupload.swf",upload_url:"/services/Photos?event=upload"+F,button_placeholder_id:"selectFiles",button_width:94,button_height:21,button_image_url:"http://ui.geckogo.com/ui/SWFUpload/select-files.png",button_action:SWFUpload.BUTTON_ACTION.SELECT_FILES,button_disable:false,file_types:"*.jpg;*.jpeg;*.png;*.gif",file_queued_handler:fileQueuedHandler,file_dialog_complete_handler:fileDialogComplete,upload_progress_handler:uploadProgressHandler,upload_error_handler:uploadErrorHandler,upload_complete_handler:uploadFileCompleteHandler})}function fileDialogComplete(A,C){try{if(C>0){document.getElementById("uploadList").style.visibility="visible";swfu.startUpload()}}catch(B){this.debug(B)}}function fileQueuedHandler(B,A){var D=document.getElementById("uploadList");var C=document.createElement("span");D.appendChild(C);C.innerHTML="<span class='queue-name'>"+B.name+"&nbsp;</span> <a id='"+B.id+"deletebtn' class='cancel-button' href='#' onclick='cancelFile(\""+B.id+"\");return false'><img src='http://ui.geckogo.com/ui/media/delete-plan.png'></a> &nbsp; &nbsp;";C.id=B.id;document.getElementById("uploadStatus").style.visibility="visible"}function uploadFileCompleteHandler(){if(swfu.getStats().files_queued>0){var A=document.getElementById(lastFile);A.parentNode.removeChild(A);swfu.startUpload()}else{document.getElementById("uploadList").innerHTML="";document.getElementById("uploadList").style.visibility="hidden";document.getElementById("uploadStatus").style.visibility="hidden";closePopup(photoUploaderPopup);photoUploaderPopup=null}}function uploadProgressHandler(C,E,A){lastFile=C.id;var D=E/A;var B=document.getElementById("statusBar");B.style.backgroundColor="#ffbb00";B.style.cssFloat="left";B.style.height="15px";B.style.width=(D*300)+"px"}function uploadErrorHandler(B,A,C){alert(B+", "+A.name+", "+C)}function cancelFile(B){var A=document.getElementById(B);A.parentNode.removeChild(A);swfu.cancelUpload(B)}function CancelUpload(){}var bookingPage;var listingType;var tpl;var slideshow;var map;var mode,tplId,sectionId;var textArea,editorArea,newSectionArea;var rte;var addAnchor;var photoVideoTabView;var entryNote="";var textContentLong;addOnload(init);YAHOO.util.Event.onAvailable("textContent",function(){var C=$("textContent");if(C.className!="empty"){textContentLong=C.innerHTML;var B=C.innerHTML;var A=620;if(C.innerHTML.length>A){B=B.trimSize(A)}B+=" <a href='#' onclick='showMoreText();return false'>Read More</a>";C.innerHTML=B}});function showMoreText(){var A=$("textArea");A.style.height="100%";A.style.overflow="visible";if(textContentLong){$("textContent").innerHTML=textContentLong
}$("controlArea").style.display=""}function showMore(A){var B=A.parentNode.previousSibling.previousSibling;B.style.display=""}function hideMore(A){var B=A.parentNode.parentNode;B.style.display="none"}function doSearch(){var A=window.location.pathname;var B=document.form.search.value;if(B){var C=document.getElementById("searchTerms");if(C&&C.innerText){B+=" "+C.innerText}window.location=A+"?search="+encode(B)}}function removeSearchTerm(){window.location=window.location.pathname}YAHOO.util.Event.onAvailable("guide",function(){bookingPage="overview";tpl=$("tpl");if(tpl){tpl=tpl.value;bookingPage="section-"+tpl}listingType=$("listingType");if(listingType){listingType=parseInt(listingType.value);bookingPage="explore-"+listingType}YAHOO.util.Event.onContentReady("checkHotelRates",function(){new BookingWidget("checkHotelRates",bookingCityName,bookingPage+"-main","inline")});YAHOO.util.Event.onAvailable("bookingWidgetLodging",function(){new BookingWidget("bookingWidgetLodging",bookingCityName,bookingPage+"-side","calendar-travelers")});YAHOO.util.Event.onAvailable("bookingWidgetCombo",function(){var A="";if(originAirports){A=originAirports.split(/,/)[0]}new BookingWidget("bookingWidgetCombo",bookingCityName,bookingPage+"-sideCombo","combo",A,destAirport)});YAHOO.util.Event.onAvailable("dealArea",function(){new BookingDeals("dealArea",bookingCityName,bookingGuideId,bookingPage+"-main","tabbed")});YAHOO.util.Event.onAvailable("sideDealArea",function(){new BookingDeals("sideDealArea",bookingCityName,bookingGuideId,bookingPage+"-side","combined")})});YAHOO.util.Event.onAvailable("guidePath",function(){new BreadcrumbPopup($("guidePath"),false,true);prepMhl()});function init(){registerEnter(document.form.search,doSearch);initMap();if(window.hotelGeo){initHotelMap(hotelGeo)}renderPhotos();renderResults();if(document.userForm.userType.value=="true"){var A=$("editGuideButton");if(A){A.style.display="block"}}}function renderPhotos(){if(!slideshow){initSlideshow()}}var videoReady=false;function renderVideos(){if(!videoReady){var A=videoCode.replace(/lid=17236/g,"lid="+document.form.videoId.value);$("videos").innerHTML=A;videoReady=true}photoVideoTabView.set("activeIndex",1);showHideArea("videos",true);showHideArea("photos",false)}var videoCode='<div id="widgetWrapper" style="width:300px; height:339px; font-family:\'Lucida Sans Unicode\', \'Lucida Grande\', sans-serif;"><object width="300" height="339"><param name="movie" value="http://tripfilms.s3.amazonaws.com/DestWidget.swf"></param><param name="FlashVars" value="lid=17236"></param><param name="wmode" value="transparent"></param><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"></param><embed src="http://tripfilms.s3.amazonaws.com/DestWidget.swf" FlashVars="lid=17236" type="application/x-shockwave-flash" wmode="transparent" allowFullScreen="true" allowScriptAccess="always" width="300" height="339"></embed></object><p style="font-size: 12px; width:300px; margin: 0 auto 4px;">Watch more travel videos at <a style="color: #656155; font-size: 1em; text-decoration: none; font-weight:bold;" href="http://www.tripfilms.com">www.tripfilms.com</a></p></div>';function initMap(){var B=document.form.geo.value.split(",");mapCenterLat=parseFloat(B[0]);mapCenterLng=parseFloat(B[1]);mapCenterZoom=parseInt(B[2]);var A={mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControl:false,center:new google.maps.LatLng(mapCenterLat,mapCenterLng),zoom:mapCenterZoom};map=new google.maps.Map($("map"),A);google.maps.event.addListener(map,"click",function(){var C=document.form.mapLink.value;if(listingType){C+="?listingType="+listingType}window.location=C})}function hasFilter(){return listingType}window.onunload=function(){if(window.GUnload){GUnload()}};function openEditor(A,C,B){if(!tpl){showMoreText();$("clipGuide").style.display="none"}if(tpl){mode="section"}else{mode="guide"}addAnchor=A;if(B){sectionId=null;tplId=C;textArea=addAnchor.parentNode}else{if(C){sectionId=C;tplId=tpl;textArea=addAnchor.parentNode.parentNode.previousSibling}else{sectionId=null;if(tpl){tplId=tpl}else{tplId=null}textArea=$("textContent")?$("textContent"):$("textArea")}}if(textArea.className.match(/empty/)){textArea.innerHTML="";textArea.className=""}myControlArea=$("controlArea");if(myControlArea){myControlArea.style.display="none"}if(mode=="section"){showHideArea("addSectionArea",false)}buildEditor()}function buildEditor(B){if(editorArea){saveEditor()}if(!editorArea){editorArea=document.createElement("DIV");textArea.parentNode.insertBefore(editorArea,textArea);var A="<div id='rteArea'></div>";A+="<div style='padding:5px'><a class='main-button' href='#' onclick='saveEditor(this);return false'><span>Save</span></a><a class='main-button' href='javascript:closeEditor()'><span>Cancel</span></a></div>";editorArea.innerHTML=A;var A=textArea.innerHTML;rte=new WYSIWYG_Editor("rte",editorArea.firstChild,A,"http://ui.geckogo.com/ui/editor",380,200);rte.setModeToggle(hasUserPriv());rte.setAllowAnchors(hasUserPriv());rte.display()}textArea.style.display="none"}function saveEditor(A){requireActiveUser(function(){saveEditorNow(A)},"Please login or sign-up to edit this item.")}function saveEditorNow(B){startSpinner(B);var A="";if(document.form.sectionName){A=document.form.sectionName.value}var F=rte.getContent();textArea.innerHTML=F;var C=document.form.guide.value;var E="event=saveText&guide="+C+"&name="+encode(A)+"&text="+encode(F)+"&mode="+mode;if(tplId){E+="&tpl="+tplId}if(sectionId){E+="&section="+sectionId}YAHOO.util.Connect.asyncRequest("POST","/Guides/",saveEditorHandler,E);var D=document.getElementById("emptyTextAreaMain");if(D){D.parentNode.removeChild(D)}var D=document.getElementById("emptyTextAreaSection");if(D){D.parentNode.removeChild(D)}}var saveEditorHandler={success:function(A){var B=getElementText("status",A.responseXML);if(B=="OK"){closeEditor()}else{displaySaveFailurePrompt()}endSpinner()},failure:function(A){endSpinner();displaySaveFailurePrompt()}};function displaySaveFailurePrompt(){alert("Your changes could not be saved.  Please try again.  If the problem continues, we may be experiencing technical difficulties.  Please save your work and add it later.")}function closeEditor(){textArea.style.display="block";editorArea.parentNode.removeChild(editorArea);editorArea=null;sectionId=null;if(myControlArea){showHideArea(myControlArea,true)}if(mode=="guide"){}else{showHideArea("addSectionArea",true)}if(newSectionArea){newSectionArea.parentNode.removeChild(newSectionArea);newSectionArea=null;window.location=window.location}}function addSection(){var A=document.form.guide.value;var B="/Guides/?event=getAvailableTemplates&guide="+A+"&tpl="+tpl;YAHOO.util.Connect.asyncRequest("GET",B,getAvailableTemplateHandler)}var tpls;var getAvailableTemplateHandler={success:function(A){var G=A.responseXML.getElementsByTagName("template");var D="";tpls=new Array();for(var B=0;B<G.length;B++){var E=new Object();E.id=G[B].getAttribute("id");E.name=G[B].firstChild.data;tpls.push(E);D+="<a href='javascript:selectTemplate("+B+")'>"+E.name+"</a><br>"}D+="<a href='javascript:selectTemplate(-1)'>(New Section)</a><br>";var C=document.getElementById("selectorArea");C.style.display="";C.innerHTML=D;var F=YAHOO.util.Dom.getXY("addSectionLink");F[1]+=20;YAHOO.util.Dom.setXY("selectorArea",F)},failure:function(A){}};function selectTemplate(A){newSectionArea=document.createElement("DIV");var B=document.getElementById("mainTitleArea").parentNode;B.appendChild(newSectionArea);var C;if(A==-1){tplId=tpl;mode="addFree";C="<input type='text' size='40' name='sectionName' value='New Section'>"}else{tplId=tpls[A].id;if(tplId=="main"){tplId=tpl}mode="addFixed";C=tpls[A].name}newSectionArea.innerHTML="<div class='sectionName'>"+C+"</div><div id='newSection'></div>";showHideArea("addSectionArea",false);textArea=document.getElementById("newSection");buildEditor();var D=YAHOO.util.Dom.getXY(newSectionArea);window.scrollTo(0,D[1]-100)}function hideSelector(){var A=document.getElementById("selectorArea");
A.style.display="none"}function initSlideshow(){if(!$("slideshowArea")){return }var A="/services/Listings?event=getInterests&mostPopular=true&mode=bigPic&guide="+document.form.guide.value;slideshow=new Slideshow(A,$("slideshowArea"),{showName:true,showLocation:(parseInt(document.form.guideType.value)!=4),showUpload:true,onEmptyResults:initSlideshowAll})}function initSlideshowAll(){var A="/services/Photos?event=getList&guide="+document.form.guide.value;slideshow=new Slideshow(A,$("slideshowArea"),{showName:true,showFlag:true,showCredit:true,showUpload:true,showLocation:(parseInt(document.form.guideType.value)!=4)})}function addListing(C){if(C==1){window.location="/Guides?event=displayEditor&item="}else{var A=document.form.guide.value;var B;if(C){B="/ListingEditor?event=displayMainEditor&guide="+A+"&listingType="+C}else{B="/Contribute.jsp"}window.location=B}}function renderResults(){var B=$("listingsResults");if(!B){return }var G=B.childNodes;var Q=parseInt(document.form.itemIndex.value);for(var O=0;O<G.length;O++){YAHOO.util.Event.addListener(G[O],"mouseover",showResultSelected,O+Q+1);YAHOO.util.Event.addListener(G[O],"mouseout",hideResultSelected,O+Q+1)}if(map){var A=mapCenterLat,P=mapCenterLng,M=mapCenterLat,F=mapCenterLng;var K=document.form.geoResults.value.split(/;/);var Q=parseInt(document.form.itemIndex.value);for(var O=0;O<K.length;O++){var L=K[O];if(!L){break}var H=L.split(/\,/);var I={lat:parseFloat(H[0]),lng:parseFloat(H[1])};if(I.lat!=0||I.lng!=0){var N=new google.maps.LatLng(I.lat,I.lng);var E=new NumericMarker(map,N,(O+Q+1),"poi-icon-2");E.setEventHandlers(markerClickHandler,markerOverHandlerResult,markerOutHandlerResult);E.url=I.url;markers.push(E);if(I.lat<A){A=I.lat}if(I.lat>M){M=I.lat}if(I.lng<P){P=I.lng}if(I.lng>F){F=I.lng}}}var D=(A+M)/2;var R=(P+F)/2;var J=new google.maps.LatLng(A,P);var C=new google.maps.LatLng(M,F);if(markers.length>1&&parseInt(tpl)>0){map.fitBounds(new google.maps.LatLngBounds(J,C))}}}function markerClickHandler(A){}var markers=new Array();function showResultSelected(A,D){var E=parseInt(document.form.itemIndex.value);D-=E+1;var C=YAHOO.util.Dom.get("listingsResults");var B=C.childNodes[D];B.className="result result-selected clear_fix";if(map&&markers.length>0){markers[D].setMode(true)}}function hideResultSelected(A,D){var E=parseInt(document.form.itemIndex.value);D-=E+1;var C=YAHOO.util.Dom.get("listingsResults");var B=C.childNodes[D];B.className="result clear_fix";if(map&&markers.length>0){markers[D].setMode(false)}}function markerOverHandlerResult(B){showResultSelected(null,B);var A=$("listingsResults");var D=A.scrollTop;var C=(B-1)*120;if(C<D||C>D+A.offsetHeight){A.scrollTop=C}}function markerOutHandlerResult(A){hideResultSelected(null,A)}var photoUploader;function addPhoto(){var A=document.getElementById("addPhotoArea");photoUploader=makePopup(A,"Add Some Photos...");tagSelector=new TagSelector(document.postForm.tagNames,"suggestedTagArea","optionalTagArea",12)}function checkFlights(K,L,A){costClick("flight:"+A);var F=K;var H=1;var C=new Date();C.setDate(C.getDate()+30);var G=new Date();G.setDate(G.getDate()+44);var E=C.getMonth()+1;var J=C.getDate();var D=G.getMonth()+1;var I=G.getDate();var B="http://www.mobissimo.com/validate_airsearch.php?t=geckogo&Type=roundtrip&Class=economy&depCity="+F+"&retCity="+L+"&depMonth="+E+"&depDay="+J+"&retMonth="+D+"&retDay="+I+"&NumTix="+H;window.open(B,"flights")}function checkHotels(J,A){costClick("hotels:"+A);J=J.split(",");var H=J[0];var E=J[J.length-1];var C=(J.length>2)?J[1]:"";var K=1;var D=new Date();D.setDate(D.getDate()+30);var I=new Date();I.setDate(I.getDate()+44);var G=D.getMonth()+1;var M=D.getDate();var F=I.getMonth()+1;var L=I.getDate();var B="http://www.mobissimo.com/validate_hotelsearch.php?t=geckogo&Type=roundtrip&Class=economy&dest="+encode(J)+"&arrMonth="+G+"&arrDay="+M+"&depMonth="+F+"&depDay="+L+"&numRooms=1&numGuests="+K;var B="http://www.mobissimo.com/validate_hotelsearch.php?t=geckogo&Type=roundtrip&Class=economy&dest="+encode(J)+"&arrMonth="+G+"&arrDay="+M+"&depMonth="+F+"&depDay="+L+"&numRooms=1&numGuests="+K;window.open(B,"hotels")}function costClick(A){logAction("guide","lead-"+A,true)}function goHistory(){window.location="/Guides?event=displayHistory&item="+document.form.guide.value}function goEditProperties(){window.location="/Guides?event=displayEditor&guide="+document.form.guide.value}function addTip(){window.location="/AddTip.html"}function clipGuide(C,A){var D=C||document.form.guide.value;var B=A||document.form.guideName.value;clipItem(D,B,"guide")}function clipListing(B,A){clipItem(B,A,"listing")}var tagQuery=new YAHOO.widget.DS_XHR("/services/Tags",["results","name","id"]);tagQuery.responseType=YAHOO.widget.DS_XHR.TYPE_JSON;tagQuery.scriptQueryParam="name";function TagSelector(A,D,C,B){this.tagField=A;this.optionalTagArea=C;this.entityType=B;this.selector=new YAHOO.widget.AutoComplete(A,D,tagQuery);this.selector.useShadow=true;this.selector.delimChar=",";this.selector.queryDelay=0.3;this.selector.maxResultsDisplayed=20;this.selector.tagSelector=this;this.selectedTags=new Array();this.selector.formatResult=function(E,F){return E[0]};this.selector.doBeforeExpandContainer=function(E,F,I,H){var G=YAHOO.util.Dom.getXY(E);G[1]+=YAHOO.util.Dom.get(E).offsetHeight;YAHOO.util.Dom.setXY(F,G);return true};this.selector.itemSelectEvent.subscribe(function(H,G){var E=G[0];var F=E.tagSelector;if(F.autoSubmit){F.autoSubmit();return }if(F.isSingleSelect){return }F.lastTagCount++;if(F.optionalTagArea){F.loadOptionalRelatedTags()}});this.selector.dataReturnEvent.subscribe(function(H,G){var E=G[0];var F=E.tagSelector;F.resultCount=G[2].length;if(F.matchCallback){F.matchCallback(F.resultCount)}});if(this.entityType!=11){this.updateListingType()}YAHOO.util.Event.addListener(this.tagField,"keypress",this.checkTagsKeyed,this,true);this.lastTagCount=this.tagField.value.split(/,/).length}TagSelector.prototype.setSingleSelect=function(A){this.isSingleSelect=A;if(this.isSingleSelect){this.selector.delimChar=""}};TagSelector.prototype.useShortlist=function(){tagQuery.scriptQueryAppend+="&shortlist=true"};TagSelector.prototype.setAutoSubmit=function(A){this.autoSubmit=A};TagSelector.prototype.setMatchCallback=function(A){this.matchCallback=A};TagSelector.prototype.checkTagsKeyed=function(){if(this.isSingleSelect){return }var A=this.tagField.value;A=A.replace(/\n/,",");A=A.replace(/, *,/,",");this.tagField.value=A;var B=this.tagField.value.split(/,/).length;if(B!=this.lastTagCount){this.lastTagCount=B;if(this.optionalTagArea){this.loadOptionalRelatedTags()}}};TagSelector.prototype.updateListingType=function(B){this.listingType=B;var A="event=getTagsWithSimilarName&entityType="+this.entityType;if(B){A+="&listingType="+B}tagQuery.scriptQueryAppend=A};TagSelector.prototype.loadOptionalRelatedTags=function(){var B=this;var A="/services/Tags?event=getRelatedTags&entityType="+this.entityType+"&listingType="+this.listingType+"&tags="+this.tagField.value;YAHOO.util.Connect.asyncRequest("GET",A,{success:B.renderOptionalRelatedTags,failure:function(C){},scope:B})};TagSelector.prototype.renderOptionalRelatedTags=function(B){var G=", "+this.tagField.value.toLowerCase()+", ";var E=JSON.parse(B.responseText);var L=new Array();for(var D=0;D<E.length;D++){var M=E[D];var K=RegExp(", "+M.name+", ");if(G.indexOf(", "+M.name.toLowerCase()+", ")>=0){continue}for(var C=0;C<L.length;C++){if(L[C].name==M.name){break}}if(C==L.length){L.push(M)}}var H=this.tagField.value;L.sort(function(O,N){if(O.mainName!=N.mainName){return H.indexOf(O.mainName)-H.indexOf(N.mainName)}else{if(O.name<N.name){return -1}else{if(O.name>N.name){return 1}else{return 0}}}});var F="<div style='font-weight:bold'>Related Tags:</div><div>";var I=null;for(var D=0;D<L.length;D++){var M=L[D];if(I!=null&&I!=M.mainName){F+="<div style='width:100px;height:1px;background-color:#000;margin:5px 0px;'></div>"}F+="<input type='checkbox' name='tag"+encode(M.name)+"' value='"+encode(M.name)+"' class='radioCheck'>"+M.name+"<BR>";I=M.mainName
}F+="</div>";var A=document.getElementById(this.optionalTagArea);A.innerHTML=F;if(L.length==0){A.style.display="none"}else{A.style.display="";var J=YAHOO.util.Dom.getXY(this.tagField);J[0]+=this.tagField.offsetWidth+20;YAHOO.util.Dom.setXY(A,J);for(var D=0;D<L.length;D++){YAHOO.util.Event.addListener(A.childNodes[D+1],"click",this.selectRelatedTag,this,true)}}};TagSelector.prototype.selectRelatedTag=function(A){var C=YAHOO.util.Event.getTarget(A);if(!C.checked){return }var D=C.name.substring(3);var B=decode(C.value);if(!this.tagField.value.match(/, *$/)){this.tagField.value+=", "}this.tagField.value+=B+", ";this.loadOptionalRelatedTags();this.tagField.focus()};TagSelector.prototype.toggleTag=function(B){var C=this.tagField.value;var A=(C.indexOf(B)<0);if(A){tagSelector.addTag(B)}else{tagSelector.removeTag(B)}return A};TagSelector.prototype.addTag=function(B){var A=this.tagField.value;if(A.length>0){if(!this.tagField.value.match(/, *$/)){A+=", "}}A+=B;this.tagField.value=A+", ";this.tagField.focus();this.loadOptionalRelatedTags()};TagSelector.prototype.removeTag=function(B){var A=this.tagField.value;A=A.replace(B,"");A=A.replace(/,\s*,/,",");A=A.replace(/^,\s*/,"");A=A.replace(/,\s*$/,"");this.tagField.value=A;this.tagField.focus();this.loadOptionalRelatedTags()};var COMMENT_SERVICE="/services/Comments";var SOCIAL_SERVICE="/services/Social";var working=false;function flagItem(C,B,A){establishActiveUser(function(){if(working){return }working=true;var D="event=saveFlag&item="+C+"&type="+B;YAHOO.util.Connect.asyncRequest("POST",SOCIAL_SERVICE,{success:function(E){var F=JSON.parse(E.responseText);if(F.result&&F.result=="OK"){A.innerHTML="Flagged!";A.style.backgroundImage="none"}working=false},failure:function(E){}},D)})}function voteThumbsUp(D,C,B,A){establishActiveUser(function(){if(working){return }working=true;var E="event=voteThumbsUp&item="+D+"&type="+C+"&vote="+A;E+="&"+getSessionParams();YAHOO.util.Connect.asyncRequest("POST",SOCIAL_SERVICE,{success:function(F){var G=JSON.parse(F.responseText);if(G.result&&G.result=="OK"){B.parentNode.innerHTML="Voted!"}else{if(G.error){var H=G.error.replace(/-/," ");showPrompt("Voting Failed",H)}}working=false},failure:function(F){}},E)})}function addComment(D,B,A,F){var C=document.getElementById("commentText"+D)||document.getElementById("commentText");var E=C.value;if(!E||E.length<3){showPrompt("Please type something longer");return }A.disabled=true;saveComment(D,B,E,function(H){var G=JSON.parse(H.responseText);var J=$("commentCount");if(J){J.innerHTML=parseInt(J.innerHTML)+1;J.parentNode.style.display=""}var I=document.createElement("DIV");$("commentArea").appendChild(I);I.innerHTML=G.html;displaySuccessBox(D);A.disabled=false;if(F){F(G.html)}})}function saveComment(B,A,C,D){establishActiveUser(function(){if(working){return }working=true;var E="event=addComment&text="+encode(C)+"&type="+A+"&item="+B;E+="&forGecko=true";E+="&"+getSessionParams();YAHOO.util.Connect.asyncRequest("POST",COMMENT_SERVICE,{success:function(F){if(D){D(F)}working=false},failure:function(F){}},E)},"Please login to comment")}function deleteComment(C,A,B,D){establishActiveUser(function(){if(working){return }working=true;var E="event=deleteComment&type="+A+"&item="+C;E+="&"+getSessionParams();YAHOO.util.Connect.asyncRequest("POST",COMMENT_SERVICE,{success:function(F){if(F.responseText.indexOf("OK")>=0){var G=$("commentCount");if(G){G.innerHTML=parseInt(G.innerHTML)-1}B=YAHOO.util.Dom.getAncestorByClassName(B,"comment");if(B){B.style.display="none"}}working=false},failure:function(F){}},E)})}var rtes=[];var tempRte;var iconText=new Array("Random note","I like!...","Muchos appreciation","Keep'em coming","Great writing","I like your thinking","You helped a brother out","You cracked me up","Holy street cred!","You're hardcore","Scary stuff","What the...?");var iconBody=new Array("","You very good for make information.  Tzequi!","Danke. Thank-you. Merci. Gracias. Arigato!","Just keep writing, just keep writing, I`ll keep reading. :)","Your writing is a work of art.","I find myself strangely attracted to your brain.","If it weren`t for you I would have fallen into a pit of snakes and died a slow horrible death.  Instead I got all my travel expenses paid for, found the love of my life and lived happily ever after.","You so funny when you say stuff.","Thugs and gang leaders from around the world wish they were you right now.","Holy moly you`re one tough cookie!","How`d you keep it together?  I would`ve peed myself silly if I`d been in your boots!","?...");var iconImages=new Array("compliment_random.png","compliment_like.png","compliment_appreciation.png","compliment_coming.png","compliment_great.png","compliment_thinking.png","compliment_helped.png","compliment_crackup.png","compliment_street.png","compliment_hardcore.png","compliment_scary.png","compliment_whatthe.png");function isNewText(B){if(B=="<br>"){return false}for(var A=0;A<iconBody.length;A++){if(iconBody[A]==B){return false}}return true}function displayComplimentBox(D){var C=document.getElementById("rte"+D);document.getElementById("box"+D).style.display="";tempRte=new WYSIWYG_Editor("tempRte",C,"","http://ui.geckogo.com/ui/editor",392,100);tempRte.setModeToggle(hasUserPriv());tempRte.setAllowAnchors(hasUserPriv());rtes[D]=tempRte;rtes[D].display();var B="<form name='form"+D+"'>";for(var A=0;A<iconText.length;A++){if(A%2==0){B+="<div>"}B+="<div class='compliment-box'><input type='radio' class='compliment-radio' name='icons' value='"+A+"' onclick='if(!isNewText(rtes["+D+"].getContent().toString())) { rtes["+D+'].setContent("'+iconBody[A]+"\") }'><img src='http://ui.geckogo.com/ui/media/"+iconImages[A]+"'><span class='compliment-text'>"+iconText[A]+"</span></div>";if((A+1)%2==0||A==iconText.length-1){B+="</div>"}}B+="</form>";document.getElementById("icons"+D).innerHTML=B}function closeComplimentBox(A){document.getElementById("box"+A).style.display="none"}var reviewId=null;function sendItemCompliment(H){reviewId=H;if(!loggedIn){establishActiveUser(complimentCallback);return }var F=null;var B=document.forms;var D=0;for(var C=0;!F&&C<B.length;C++){if(B[C].name.indexOf(H+"")>0){F=B[C]}}for(var C=0;C<F.icons.length;C++){if(F.icons[C].checked){D=F.icons[C].value}}var E=document.getElementById("box"+H);var A=rtes[H].getContent();while(A.indexOf("<br>")==0){A=A.replace("<br>","")}for(var C=A.toString().length-4;C>0;C-=4){if(A.substring(C,C+4)=="<br>"){A=A.substring(0,C)}else{break}}A=encode(A)||"";var G="event=addCompliment&relatedId="+H+"&text="+A+"&type="+D;YAHOO.util.Connect.asyncRequest("POST","/services/Compliments",{success:function(I){var J=I.responseText;if(J=="OK"){E.innerHTML="<b>Thank you, your compliment is posted!</b>";setTimeout("location.reload(true);",3000)}else{alert(J)}},failure:function(I){reportAjaxFailure()}},G)}function complimentCallback(A){if(A!="cancel"){loggedIn=true;sendItemCompliment(reviewId)}}function toggleCompliments(B){var A=document.getElementById("comments"+B);A.style.display=(A.style.display=="none")?"":"none"}function toggleInputBox(B){var A=document.getElementById("input"+B);A.style.display=(A.style.display=="none")?"":"none"}function displaySuccessBox(A){inputElem=document.getElementById("input"+A)||document.getElementById("inputBox");inputElem.style.display="none";succElem=document.getElementById("success"+A)||document.getElementById("successBox");succElem.style.display="";setTimeout("succElem.style.display='none';",4000)}function toggleCommentBox(D){var B=document.getElementById("comments"+D);var C=(B.style.display=="none")?"":"none";B.style.display=C;var A=document.getElementById("link"+D);if(A){A.style.display=C}}ListingSelector.SERVICE_NAME="/services/Listings";if(window.WIDGET_MODE){GuideSelector.SERVICE_NAME+=".php"}function ListingSelector(C,A,F,B,H,E){try{this.valueField=C;this.textField=A;this.optionArea=F;this.selectionCallback=H;this.invalidationCallback=E;this.findDistant=false;this.validListing=false;if(this.valueField&&this.valueField.value!=""){this.validListing=true}this.listingQuery=new YAHOO.widget.DS_XHR(ListingSelector.SERVICE_NAME,["results","name","id","lat","lng","listingType","guideName"]);
this.listingQuery.responseType=YAHOO.widget.DS_XHR.TYPE_JSON;this.listingQuery.scriptQueryParam="name";this.setServerParam(B);this.selector=new YAHOO.widget.AutoComplete(A,F,this.listingQuery);this.selector.useShadow=true;this.selector.maxResultsDisplayed=20;this.selector.autoHighlight=false;var G=this;this.selector.formatResult=function(I,J){var K=I[0];if(G.findDistant){K+=", "+I[5]}return K};this.selector.doBeforeExpandContainer=function(I,J,M,L){var K=YAHOO.util.Dom.getXY(I);K[1]+=YAHOO.util.Dom.get(I).offsetHeight;YAHOO.util.Dom.setXY(J,K);return true};this.selector.listingSelector=this;this.selector.textboxKeyEvent.subscribe(function(L,K){var I=K[0];var J=I.listingSelector;J.markEntryInvalid()});this.selector.itemSelectEvent.subscribe(function(L,K){var I=K[0];var J=I.listingSelector;J.name=K[2][0];J.id=K[2][1];J.lat=K[2][2];J.lng=K[2][3];J.listingType=K[2][4];if(J.valueField){J.valueField.value=J.id}J.markEntryValid()})}catch(D){alert(D)}}ListingSelector.prototype.setServerParam=function(A){this.serverParam=A;this.buildQuery()};ListingSelector.prototype.validateEntry=function(){var A=this;setTimeout(function(){if(!A.validListing){A.checkNameMatch()}},500)};ListingSelector.prototype.markEntryValid=function(){this.validListing=true;this.textField.style.backgroundColor="#fff";if(this.selectionCallback){this.selectionCallback()}};ListingSelector.prototype.markEntryInvalid=function(A){this.validListing=false;this.textField.style.backgroundColor="#fab327";if(this.invalidationCallback){this.invalidationCallback()}};ListingSelector.prototype.buildQuery=function(){var A="event=getSimilarNames&isNameQuery=true&skipPhotos=true&max=20";if(this.serverParam){A+="&"+this.serverParam}if(this.locationParams){A+="&"+this.locationParams}if(this.findDistant){A+="&findDistant=true"}this.listingQuery.scriptQueryAppend=A};ListingSelector.prototype.checkNameMatch=function(){var B=this.listingQuery.scriptQueryAppend+"&name="+encode(this.textField.value);var A=this;YAHOO.util.Connect.asyncRequest("GET",ListingSelector.SERVICE_NAME+"?"+B,{success:A.checkMatch,failure:function(C){},scope:A})};ListingSelector.prototype.checkMatch=function(A){var C=this.textField.value.toLowerCase();var D=JSON.parse(A.responseText);var E=D.results;for(var B=0;B<E.length;B++){var F=E[B];if(F.name.toLowerCase()==C){this.textField.value=F.name;if(this.valueField){this.valueField.value=F.id}this.markEntryValid();break}}};ListingSelector.prototype.setFindDistant=function(){this.findDistant=true};ListingSelector.prototype.updateLocation=function(A,C,B){if(A){this.locationParams="guide="+A}else{if(C&&B){this.locationParams="lat="+encode(C)+"&lng="+encode(B)}else{this.locationParams=null}}this.buildQuery()};var canvasUrl="";var DISCUSSION_SERVICE="/services/Discussions";var question="",tags="";var discGuide=null,discListing=null;var tagSelector,discGuideSelector,discListingSelector;var mainLimit=5;var discQuestions=[];var dWorking=false;function DiscussionBox(){displayDiscussionBox()}function AnswerBox(){loadDiscQuestions()}function hideErrorBox(){document.getElementById("discError").style.display="none";if(document.getElementById("discError2")){document.getElementById("discError2").style.display="none"}}function displayDiscError(B,A){if(A){A.innerHTML=B;A.style.display=""}else{document.getElementById("discError").innerHTML=B;document.getElementById("discError").style.display=""}}function displayDiscussionBox(){var A=document.getElementById("discQuestionBox");if(!A){return }A.style.display="";document.getElementById("discMainBox").className="disc-main-box"}function displayTagBox(){hideErrorBox();question=document.getElementById("discQuestion").value;if(!question||question.length<10){displayDiscError(Locale.DISCUSSION_ERROR_LONGER);return }question=question.capitalizeLine();if(document.getElementById("discQuestionBox")){document.getElementById("discQuestionBox").style.display="none"}document.getElementById("discTagBox").style.display="";tagSelector=new TagSelector(document.forms.discForm.tagNames,"suggestedTagAreaDisc","optionalTagAreaDisc","40");document.discForm.tagNames.focus()}function applyDiscCheckTag(C){var A=C.childNodes[0].value;var B=tagSelector.toggleTag(A);C.childNodes[0].checked=B}function displayGuideBox(){hideErrorBox();var A=document.forms.discForm;tags=A.tagNames.value;if(tags.length<2){displayDiscError(Locale.DISCUSSION_ERROR_TAGS,$("discError2"));return }document.getElementById("discTagBox").style.display="none";$("discDetailsBox").style.display="";if(discGuide){$("discGuideBox").style.display="none";displayListingBox()}else{A.discGuide.focus();discGuideSelector=new GuideSelector(null,A.discGuide,"suggestedGuideAreaDisc",null,function(){discGuide=discGuideSelector.id;displayListingBox()})}}function displayListingBox(){document.getElementById("discListingBox").style.display="";var A=document.discForm;discListingSelector=new ListingSelector(null,A.discListing,"suggestedListingAreaDisc","",function(){discListing=discListingSelector.id});if(discGuide){discListingSelector.updateLocation(discGuide)}A.discListing.focus()}function saveDiscussion(){hideErrorBox();var E=document.forms.discForm;var B=E.notifyEmail.value||"";var D=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;var A=document.getElementById("emailDiv").style.display=="";if(A&&!B.match(D)){displayDiscError(Locale.DISCUSSION_ERROR_EMAIL);return }document.getElementById("discDetailsBox").style.display="none";document.getElementById("discListingBox").style.display="none";document.getElementById("discSaving").style.display="";var C=E.emailFlag.checked;var F="event=addDiscussion&text="+encode(question)+"&tags="+encode(tags)+"&email="+encode(B)+"&notify="+C;if(discGuide){F+="&guide="+discGuide}if(discListing){F+="&listing="+discListing}F+="&"+getSessionParams();YAHOO.util.Connect.asyncRequest("POST",DISCUSSION_SERVICE,{success:function(I){var J=I.responseText;var H=J.indexOf("AUTH")<0?JSON.parse(J):J;var G=H.id?(H.id+""):"";if(G.match(/\d+/)){displayDiscSuccess(H.key)}else{if(H.indexOf("AUTH")>=0){establishActiveUser(function(K){if(K=="cancel"){document.getElementById("discListingBox").style.display="";document.getElementById("discDetailsBox").style.display="";document.getElementById("discSaving").style.display="none"}else{saveDiscussion()}})}else{document.getElementById("discSaving").style.display="none";displayDiscError("Could not save your question at this time, please try again later.",$("discError2"))}}},failure:function(G){document.getElementById("discSaving").style.display="none";displayDiscError("Could not save your question at this time, please try again later.")}},F)}function resetWizard(){document.getElementById("discSuccess").style.display="none";document.getElementById("discQuestionBox").style.display="";var C=document.getElementById("questionCount");if(C){C.innerHTML=parseInt(C.innerHTML)+1}document.getElementById("discQuestion").value="";document.getElementById("optionalTagAreaDisc").style.display="none";var B=document.forms.discForm;for(var A=0;A<B.tagOption.length;A++){B.tagOption[A].checked=false}discGuide=null;discListing=null;B.tagNames.value="";B.discGuide.value="";B.discListing.value="";B.emailFlag.checked=false}function displayDiscSuccess(A){document.getElementById("discSaving").style.display="none";document.getElementById("discSuccess").style.display="";if(document.getElementById("discFinalLink")){document.getElementById("discFinalLink").innerHTML="<a href='/Answer/"+A+"/'>Show me my question</a>"}}function loadDiscQuestions(){var A="event=getDiscussions&limit="+mainLimit;A+="&"+getSessionParams();YAHOO.util.Connect.asyncRequest("POST",DISCUSSION_SERVICE,{success:function(B){discQuestions=JSON.parse(B.responseText);displayAnswerBox()},failure:function(B){}},A)}function displayAnswerBox(){var D=document.getElementById("discussions");var F="";if(discQuestions.length<1){D.innerHTML=Locale.DISCUSSION_NONE;return 
}for(var E=0;E<discQuestions.length;E++){var B=discQuestions[E];var A="Anonymous";if(B.first_name){A=B.first_name}if(B.last_name){A+=" "+B.last_name}var G=(B.pic)?B.pic:"http://ui.geckogo.com/ui/media/no_pic_small.gif";var H="<a href='#' onclick='toggleAnswerArea("+B.id+");return false'>";F+="<div id='disc"+B.id+"' class='disc-box clear_fix'>";F+="<div class='left'>"+H+"<img src='"+G+"'></a></div>";F+="<div class='left answer-info-col'>";F+="<div class='disc-bold'>"+H+B.text+"</a></div>";F+="<div class='disc-small'>";if(B.guide){F+="<span>"+Locale.IN+": "+B.guideName+" - </span>"}F+="<span>"+Locale.DISCUSSION_ASKED_BY+": "+A+"</span>";F+="</div>";var J=(B.postCount==1)?Locale.FILTER_ANSWER:Locale.FILTER_ANSWERS;if(B.postCount>0){J=H+"<span id='cNum"+B.id+"'>"+B.postCount+"</span> "+J+"</a>"}else{J=""}F+="<div class='disc-small'>"+J+"&nbsp;&nbsp;&nbsp;"+H+Locale.FILTER_WRITE_ANSWER+"!</a></div>";F+="<div id='area"+B.id+"' class='quick-answer-main' style='display:none'>";F+="<a name='info"+B.id+"'></a><div class='info-box' id='success"+B.id+"' style='display:none; clear:both; width:355px'>"+Locale.FILTER_COMMENT_POSTED+"</div>";F+="<div id='input"+B.id+"' style='margin-top:5px'><div class='bold answer-header'>What do you want to say?</div>";F+="<div><textarea id='commentText"+B.id+"' class='answer-main-input'></textarea></div>";F+="<div style='text-align:right'><button type='button' onclick='addPost(\""+B.id+'", "discussion", "'+userId+'", "'+B.user+"\", this)' style='margin-right:5px'>"+Locale.DISCUSSION_SUBMIT+"</button><a href='#' onclick='toggleAnswerArea("+B.id+"); return false;'>"+Locale.QA_CANCEL+"</a></div>";F+="</div>";F+="</div>";F+="<div id='comments"+B.id+"' style='display:none'></div>";F+="</div>";F+="</div>"}D.innerHTML=F;for(var E=0;E<discQuestions.length;E++){F="";var B=discQuestions[E];for(var C=0;C<B.posts.length;C++){var I=B.posts[C];F+=renderPost(I.id,I.user,I.text,I.dateAdded,I.first_name,I.pic,userId,B.id,I.votes)}document.getElementById("comments"+B.id).innerHTML=F}}function toggleAnswerArea(C){var A,B;if(document.getElementById("area"+C)){B=document.getElementById("area"+C)}else{if(document.getElementById("input"+C)){B=document.getElementById("input"+C)}else{B=document.getElementById("inputBox")}}A=B.style.display;B.style.display=(A=="none")?"":"none";toggleCommentBox(C)}function toggleDiscArea(B){var A=document.getElementById("disc"+B).style.display;document.getElementById("disc"+B).style.display=(A=="none")?"":"none"}function toggleEmailLine(){hideErrorBox();var A=document.getElementById("emailDiv").style.display;document.getElementById("emailDiv").style.display=(A=="none")?"":"none"}var spText;var spDiscId;var spAuthorId;var spCallback;var spSource;var loggedIn=isLoggedIn();function postCallback(A){if(A!="cancel"){loggedIn=true;savePost(spText,spDiscId,spAuthorId,spCallback,spSource)}}function savePost(E,G,B,F,C){spText=E;spDiscId=G;spAuthorId=B;spCallback=F;spSource=C;if(!loggedIn){establishActiveUser(postCallback);return }if(A){return }var A=true;if(!C){C="discussion"}var D="event=addPost&text="+encode(E)+"&"+C+"="+G+"&author="+B;D+="&forGecko=true";D+="&"+getSessionParams();YAHOO.util.Connect.asyncRequest("POST",DISCUSSION_SERVICE,{success:function(H){if(F){F(H)}A=false},failure:function(H){}},D)}function deletePost(C,B){if(dWorking){return }dWorking=true;var A="event=deletePost&post="+C;A+="&"+getSessionParams();YAHOO.util.Connect.asyncRequest("POST",DISCUSSION_SERVICE,{success:function(D){if(D.responseText.indexOf("OK")>-1){if(B){document.getElementById("comment"+C).style.display="none";var E=document.getElementById("cNum"+B)||document.getElementById("cNum");if(E){E.innerHTML=parseInt(E.innerHTML)-1}}}dWorking=false},failure:function(D){}},A)}function addPost(G,E,B,C,A){var D=document.getElementById("commentText"+G)||document.getElementById("commentText");var F=D.value;if(!F||F.length<3){alert("Please type something longer");return }A.disabled=true;savePost(F,G,C,function(H){doReload()},E)}function renderPost(C,F,E,M,G,K,J,L,I){var H="post";var A="";var B=(K)?K:"http://ui.geckogo.com/ui/media/no_pic_small.gif";var D="<a onclick='return navLink(this.href)' href='/profile/"+F+"'>";if(!G){G=Locale.ANONYMOUS}A+="<div id='comment"+C+"' class='answer-row clear_fix' style='display:'>";A+="<div class='answer-left'>";A+="<div class='tipPic'>"+D+"<img src='"+B+"'></a></div>";A+="</div>";A+="<div class='answer-right'>";A+="<div class='c-info-row clear_fix'>";A+="<div class='c-info-name'>"+D+G+"</a> <span class='small'>says :</span></div>";A+="<div class='c-info-date' style='float:right'>"+M+"</div>";A+="</div>";E=E.replace(/%/,"%25");A+="<div class='answer-item' style='clear:both'>"+decode(E)+"</div>";A+="<div class='clear_fix'>";if(F==J||F==getActiveUserId()){A+="<div class='right'><a href='#' onclick='deletePost(\""+C+'", "'+L+"\"); return false;' class='small underline'>"+Locale.REMOVE+"</a></div>"}else{A+="<div class='left small' style='line-height:17px'>"+Locale.DISCUSSION_USEFUL+"&nbsp;&nbsp;";A+="<span class='small' style='position:relative; top:2px'><a href='#' onclick='voteThumbsUp(\""+C+"\", \"post\", this.parentNode.parentNode, \"1\"); return false;'><img src='http://ui.geckogo.com/ui/media/thumbsup-small.png' title='Thumbs Up'></a></span>";A+="<span class='small' style='padding-left:5px; position:relative; top:2px'><a href='#' onclick='voteThumbsUp(\""+C+"\", \"post\", this.parentNode.parentNode, \"-1\"); return false;'><img src='http://ui.geckogo.com/ui/media/thumbsdown-small.png' title='Thumbs Down'></a></span>";A+="</div>";if(I>0){I="+"+I}A+="<div class='small left' style='padding-left:5px; position:relative; top:2px'>(<span id='fCount"+C+"'>"+I+"</span>)</div>";A+="<div class='right'><span class='small' style='position:relative; top:2px'><a href='#' onclick='flagItem(\""+C+'", "'+H+"\", this.parentNode); return false;'><img title='Flag for abuse' src='http://ui.geckogo.com/ui/media/flag-abuse.png'></a></span></div>"}A+="</div>";A+="</div>";A+="</div>";return A}var discPopup=null;function openDiscussionPopup(A){hideErrorBox();question=document.getElementById("discQuestion").value;if(!question||question.length<10){displayDiscError(Locale.DISCUSSION_ERROR_LONGER);return }question=question.capitalizeLine();discListing=null;discGuide=A;discPopup=makePopup($("discMainPopup"),"Ask your travel question");$("discTagBox").style.display="";displayTagBox()}function closeDiscPopup(){closePopup(discPopup)}function initHotelMap(P){var N=$("hotelMap");if(!N){return }var S={mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControl:false};N=new google.maps.Map(N,S);markers.length=0;var B=mapCenterLat,R=mapCenterLng,M=mapCenterLat,G=mapCenterLng;var K=P.split(/;/);for(var Q=0;Q<K.length;Q++){var L=K[Q];if(L){var H=L.split(/\,/);var I={lat:parseFloat(H[0]),lng:parseFloat(H[1])};if(I.lat!=0||I.lng!=0){var O=new google.maps.LatLng(I.lat,I.lng);var E=new NumericMarker(N,O,(Q+1),"poi-icon-2");E.setEventHandlers(hotelMarkerClickHandler,hotelMarkerOverHandler,hotelMarkerOutHandler);E.url=I.url;markers.push(E);if(I.lat<B){B=I.lat}if(I.lat>M){M=I.lat}if(I.lng<R){R=I.lng}if(I.lng>G){G=I.lng}}}}var D=(B+M)/2;var U=(R+G)/2;var J=new google.maps.LatLng(B,R);var C=new google.maps.LatLng(M,G);if(markers.length>1){N.fitBounds(new google.maps.LatLngBounds(J,C))}else{var T=document.form.geo.value.split(",");mapCenterLat=parseFloat(T[0]);mapCenterLng=parseFloat(T[1]);var A=parseInt(T[2]);N.setCenter(new google.maps.LatLng(mapCenterLat,mapCenterLng),A)}var F=$("itemList").childNodes;for(var Q=0;Q<F.length;Q++){YAHOO.util.Event.addListener(F[Q],"mouseover",hotelShowItemSelected,Q);YAHOO.util.Event.addListener(F[Q],"mouseout",hotelHideItemSelected,Q)}}function hotelMarkerClickHandler(A){}function hotelShowItemSelected(A,D){var C=YAHOO.util.Dom.get("itemList");var B=C.childNodes[D];B.className="item item-selected";if(markers.length>0){markers[D-1].setMode(true)}}function hotelHideItemSelected(A,D){var C=YAHOO.util.Dom.get("itemList");var B=C.childNodes[D];B.className="item";if(markers.length>0){markers[D-1].setMode(false)}}function hotelMarkerOverHandler(B){hotelShowItemSelected(null,B);
var A=$("itemList");var D=A.scrollTop;var C=(B-1)*120;if(C<D||C>D+A.offsetHeight){A.scrollTop=C}}function hotelMarkerOutHandler(A){hotelHideItemSelected(null,A)}function BookingWidget(F,E,D,A,C,B){this.guideName=E;this.baseName=D.replace(/-/,"");this.originAirport=C;this.destAirport=B;$(F).innerHTML=this.getBookingView(A);this.setup(A)}BookingWidget.prototype.setup=function(A){this.setupBookingView(A);var B=this;YAHOO.util.Event.addListener($(this.baseName+"CheckRateButton"),"click",function(){B.checkRates(A)});if(A=="calendar-travelers"){this.urls={hotel:"http://rd.bookingbuddy.com/?r=bbs_geckogo_ros_v1_320250-h_006"}}else{if(A=="combo"){this.urls={air:"http://rd.bookingbuddy.com/?r=bbs_geckogo_ros_v2_320250-a_006",hotel:"http://rd.bookingbuddy.com/?r=bbs_geckogo_ros_v2_320250-h_006",car:"http://rd.bookingbuddy.com/?r=bbs_geckogo_ros_v2_320250-c_006",vacation:"http://rd.bookingbuddy.com/?r=bbs_geckogo_ros_v2_320250-v_006"}}else{this.urls={hotel:"http://rd.bookingbuddy.com/?r=bbs_geckogo_ros_300250-h_006"}}}};BookingWidget.prototype.setupBookingView=function(B){var H=this;var F=document.forms[this.baseName];if(B=="calendar-travelers"){this.dateField1=F[this.baseName+"Date1"];this.dateField2=F[this.baseName+"Date2"];var D=new Date();var E=D.getFullYear()%2000;D.setDate(D.getDate()+7);this.dateField1.value=(D.getMonth()+1)+"/"+D.getDate()+"/"+E;D.setDate(D.getDate()+7);this.dateField2.value=(D.getMonth()+1)+"/"+D.getDate()+"/"+E}else{if(B=="combo"){this.dateField1=F[this.baseName+"Date1"];this.dateField2=F[this.baseName+"Date2"];var D=new Date();var E=D.getFullYear()%2000;D.setDate(D.getDate()+7);this.dateField1.value=(D.getMonth()+1)+"/"+D.getDate()+"/"+E;D.setDate(D.getDate()+7);this.dateField2.value=(D.getMonth()+1)+"/"+D.getDate()+"/"+E;this.cityQuery=new YAHOO.util.XHRDataSource("/booking-buddy/ajax/");this.cityQuery.responseType=YAHOO.util.XHRDataSource.TYPE_JSON;this.cityQuery.responseSchema={resultsList:"items",fields:["value"]};this.cityQuery.doBeforeParseData=function(K,L,I){var J={items:L};return J};this.fromField=F[this.baseName+"From"];var G=document.createElement("DIV");this.fromField.parentNode.appendChild(G);G.className="autocomplete-results";this.acFrom=new YAHOO.widget.AutoComplete(this.fromField,G,this.cityQuery);this.acFrom.useShadow=true;this.acFrom.generateRequest=this.acRequestBuilder;this.acFrom.queryQuestionMark=false;this.toField=F[this.baseName+"To"];var A=document.createElement("DIV");this.toField.parentNode.appendChild(A);A.className="autocomplete-results";this.acTo=new YAHOO.widget.AutoComplete(this.toField,A,this.cityQuery);this.acTo.useShadow=true;this.acTo.generateRequest=this.acRequestBuilder;this.acTo.queryQuestionMark=false;var C=$(this.baseName+"Type").getElementsByTagName("INPUT");YAHOO.util.Event.addListener(C,"click",function(J){H.type=this.value;var I=(this.value=="air"||this.value=="vacation");$(H.baseName+"AirControls").style.display=(I)?"":"none"});this.fromField.value=this.originAirport;this.toField.value=(this.destAirport)?this.destAirport:this.guideName}else{this.monthField1=F[this.baseName+"Month1"];this.monthField2=F[this.baseName+"Month2"];this.dayField1=F[this.baseName+"Day1"];this.dayField2=F[this.baseName+"Day2"];this.travelerField=F[this.baseName+"Travelers"];this.renderMonths(this.monthField1);this.renderMonths(this.monthField2);this.renderDays(this.dayField1);this.renderDays(this.dayField2);var D=new Date();D.setDate(D.getDate()+7);this.monthField1.selectedIndex=D.getMonth();this.dayField1.selectedIndex=D.getDate();D.setDate(D.getDate()+7);this.monthField2.selectedIndex=D.getMonth();this.dayField2.selectedIndex=D.getDate()}}};BookingWidget.prototype.acRequestBuilder=function(C){var B={input:C,types:["airport"],limit:15};var A="?service=LocationSuggest.suggest&args=";A+=encodeParam(JSON.stringify(B));return A};BookingWidget.prototype.renderMonths=function(A){for(var B=0;B<SHORT_MONTHS.length;B++){var C=document.createElement("OPTION");C.innerHTML=SHORT_MONTHS[B];C.value=B+1;A.appendChild(C)}};BookingWidget.prototype.renderDays=function(A){for(var B=1;B<=31;B++){var C=document.createElement("OPTION");C.innerHTML=B;C.value=B;A.appendChild(C)}};BookingWidget.prototype.checkRates=function(C){var E=new Date();if(C=="combo"){fromDate=getDate(this.dateField1.value);toDate=getDate(this.dateField2.value)}else{if(C=="calendar-travelers"){fromDate=getDate(this.dateField1.value);toDate=getDate(this.dateField2.value)}else{fromDate=this.monthField1.value+"-"+this.dayField1.value+"-"+E.getFullYear();toDate=this.monthField2.value+"-"+this.dayField2.value+"-"+E.getFullYear()}}var H=this.guideName;var G="hotel";if(C=="combo"){H=this.toField.value;if(this.type){G=this.type}else{G="vacation"}}var A="1";var B=(this.travelerField)?this.travelerField.value:"1";var D=this.urls[G];D+="&num_travelers="+B;D+="&search_mode="+G;var F=(G=="air"||G=="vacation");if(C=="combo"&&F){D+="&search_type=roundtrip";D+="&departure_city="+this.fromField.value;D+="&arrival_city="+encodeParam(H);D+="&departure_date="+encodeParam(fromDate);D+="&return_date="+encodeParam(toDate)}else{if(C=="combo"&&G=="car"){D+="&pickup_city="+encodeParam(H);D+="&pickup_date="+encodeParam(fromDate);D+="&dropoff_date="+encodeParam(toDate)}else{D+="&arrival_city="+encodeParam(H);D+="&arrival_date="+encodeParam(fromDate);D+="&departure_date="+encodeParam(toDate);D+="&num_rooms="+A}}D+="&placement="+this.baseName;logAction("booking-widget",this.baseName,true,H+","+fromDate+","+toDate);openNewWindow(D)};function getDate(B){var C=B.split(/\//);var D=C[0];D=(D.length==2)?D:"0"+D;var A="20"+C[2];return D+"/"+C[1]+"/"+A}function encodeParam(A){A=A.replace(/%20/g," ");A=encode(A);A=A.replace(/-/g,"%2F");return A}BookingWidget.prototype.getBookingView=function(A){var B="";if(A=="calendar-travelers"){B+="<div><h2>Find Great Deals on Hotels in "+this.guideName+"</h2></div>";B+='<div class="check-controls"><form name="'+this.baseName+'">';B+='<div class="date-selector">Check-in:<br>';B+='<input type="text" size="10" name="'+this.baseName+'Date1">';B+="<a href=\"javascript:openCalendar('"+this.baseName+'Date1\')">&nbsp;<img style="vertical-align:-4px" src="http://ui.geckogo.com/ui/media/calendar.png"></a>';B+='</div><div class="date-selector">Check-out:<br>';B+='<input type="text" size="10" name="'+this.baseName+'Date2">';B+="<a href=\"javascript:openCalendar('"+this.baseName+'Date2\')">&nbsp;<img style="vertical-align:-4px" src="http://ui.geckogo.com/ui/media/calendar.png"></a>';B+="</div>";B+='<div class="traveler-selector">Adults:<br>';B+='<select name="'+this.baseName+'Travelers"><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option></select>';B+="</div>";B+='<div class="find-hotels" id="'+this.baseName+'CheckRateButton">Search</div>';B+="</form></div>";B+='<div class="clear-empty"></div>'}else{if(A=="combo"){B+="<div><h2>Find Great Travel Deals in "+this.guideName+'</h2></div><form name="'+this.baseName+'">';B+='<div class="check-radios" id="'+this.baseName+'Type"><input type="radio" name="checkCombo" value="air"><span>Flights</span> <input type="radio" name="checkCombo" checked value="vacation"><span>Flights+Hotels</span> <input type="radio" name="checkCombo" value="hotel"><span>Hotels</span> <input type="radio" name="checkCombo" value="car"><span>Cars</span></div>';B+='<div class="check-controls-air" id="'+this.baseName+'AirControls">';B+='<div class="place-selector">From:<br>';B+='<input type="text" size="20" name="'+this.baseName+'From">';B+='</div><div class="place-selector">To:<br>';B+='<input type="text" size="20" name="'+this.baseName+'To">';B+="</div>";B+='</div><div class="check-controls">';B+='<div class="date-selector">From:<br>';B+='<input type="text" size="10" name="'+this.baseName+'Date1">';B+="<a href=\"javascript:openCalendar('"+this.baseName+'Date1\')">&nbsp;<img style="vertical-align:-4px" src="http://ui.geckogo.com/ui/media/calendar.png"></a>';B+='</div><div class="date-selector">To:<br>';B+='<input type="text" size="10" name="'+this.baseName+'Date2">';
B+="<a href=\"javascript:openCalendar('"+this.baseName+'Date2\')">&nbsp;<img style="vertical-align:-4px" src="http://ui.geckogo.com/ui/media/calendar.png"></a>';B+="</div>";B+='<div class="traveler-selector">Adults:<br>';B+='<select name="'+this.baseName+'Travelers"><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option></select>';B+="</div>";B+='<div class="find-hotels" id="'+this.baseName+'CheckRateButton">Search</div>';B+="</div></form>";B+='<div class="clear-empty"></div>'}else{B+="<div>Planning to visit "+this.guideName+"?  Find the best rates for your stay:</div>";B+='<div class="check-controls"><form name="'+this.baseName+'">';B+='<div class="date-selector">';B+='<select name="'+this.baseName+'Month1" id="month1"></select>';B+='<select name="'+this.baseName+'Day1" id="day1"></select>';B+='</div> <div class="date-to"> to </div>';B+='<div class="date-selector">';B+='<select name="'+this.baseName+'Month2" id="month2"></select>';B+='<select name="'+this.baseName+'Day2" id="day2"></select>';B+='</div> <div class="find-hotels" id="'+this.baseName+'CheckRateButton">Find hotels</div>';B+="</form></div>";B+='<div class="clear-empty"></div>'}}return B};var calElem;function openCalendar(A){if(!calElem){calElem=document.createElement("div");document.body.appendChild(calElem);calElem.style.position="absolute";calElem.style.zIndex="1000"}calElem.style.display="";var B=A.replace(/Date\d/,"");var C=document.forms[B];var E=YAHOO.util.Dom.getXY(C[A]);E[1]+=5;YAHOO.util.Dom.setXY(calElem,E);var D=new YAHOO.widget.Calendar("cal",calElem,{title:"Select a date:",close:true,navigator:true});D.render();D.selectEvent.subscribe(function(G,H){var I=H[0].toString().split(",");var F=I[0].substring(2);I=I[1]+"/"+I[2]+"/"+F;D.hide();C[A].value=I})}function BookingDeals(E,D,C,B,A){this.guideName=D;this.guideId=C;this.baseName=B;this.elem=$(E);this.elem.innerHTML=this.getBookingView(A);this.setupBookingView(A)}BookingDeals.prototype.getBookingView=function(A){var D="";if(A=="tabbed"){D+="<div class='deal-container'>";D+="<div class='deal-header'>";D+="<div class='name'>Deals for "+this.guideName+" right now</div>";D+="</div>";D+="<div class='clear_fix labels' id='deal-tabs'>";for(var E in tabs){D+="<div id='"+E+"-label' class='deal-label"+(E=="car"?" last":"")+"'><a href='#' onclick='return false' class='tab-"+E+"'>"+tabs[E]+"</a></div>";tabs[E]=""}D+="</div>";D+="<div class='deal-body'>";for(var E in tabs){D+="<div id='"+E+"-body' "+(E==lastBookingBuddyType?"":"style='display:none'")+">Please wait while we get the deals...</div>"}D+="</div>";D+="</div>";D+="<div class='booking-provider'><span>Deals by <a href='http://www.bookingbuddy.com/'>BookingBuddy</a></span><br><span class='small'>*taxes, fees not included</span></div>"}else{var C=new Date();var B=SHORT_MONTHS[C.getMonth()]+" "+C.getDate();D+="<div class='deal-container'>";D+="<div class='deal-header'>";D+="<div class='name'>Best Deals for "+this.guideName+", "+B+"</div>";D+="</div>";D+="<div class='deal-body' id='dealBody'>";D+="</div>";D+="</div>";D+="<div class='booking-provider'><span>Deals by <a href='http://www.bookingbuddy.com/'>BookingBuddy</a></span><span class='small'>*taxes, fees not included</span></div>"}return D};BookingDeals.prototype.setupBookingView=function(A){var C=this;if(A=="tabbed"){this.getDeals($(lastBookingBuddyType+"-body"),lastBookingBuddyType,true);$(lastBookingBuddyType+"-label").className+=" selected";var D=$("deal-tabs");var B=D.getElementsByTagName("A");YAHOO.util.Event.addListener(B,"click",function(F){var E=this.className.replace(/tab-/,"");C.toggle(E)})}else{this.getDeals($("dealBody"),"Hotel",true)}};function encodeParam(A){A=A.replace(/%20/g," ");A=encode(A);A=A.replace(/-/g,"%2F");return A}var lastBookingBuddyType="Hotel";var tabs={};tabs.Hotel="HOTELS";tabs.Package="VACATION";tabs.Flight="AIRFARE";tabs.Cruise="CRUISE";tabs.Car="CAR";BookingDeals.prototype.getDeals=function(F,A,E){var D=this;var C="event=bookingBuddyDeals&limit=10&radius=25&guide="+this.guideId+"&type="+A;var B=window.deals[C];if(B){D.renderDeals(F,B,A,E)}else{YAHOO.util.Connect.asyncRequest("GET","/services/Guides?"+C,{success:function(G){var J=JSON.parse(G.responseText);var K=[];if(J.length){for(var H=0;H<J.length;H++){var I=J[H];if(I&&I.DealListing&&(!I.DealListing.ErrorInfo||!I.DealListing.ErrorInfo.ErrorText)){K=K.concat(I.DealListing.DealList.Deal)}}K.shuffle();if(K.length>7){K=K.slice(0,7)}}else{if(J&&J.DealListing&&(!J.DealListing.ErrorInfo||!J.DealListing.ErrorInfo.ErrorText)){K=J.DealListing.DealList.Deal;if(!K.length){K=[K]}}}window.deals[C]=K;D.renderDeals(F,K,A,E)},failure:function(G){}})}};window.deals={};BookingDeals.prototype.renderDeals=function(J,F,C,I){if(F.length==0){tabs[C]="No deals were found at this time.";if(I){this.elem.style.display="none"}else{J.innerHTML=tabs[C]}return }var G="";for(var E=0;E<F.length;E++){var D=F[E];var K=D.Title;var A=D.URL;A+="&placement="+this.baseName;A="/go.html?u="+encode(A)+"&t=booking-deals&m="+this.baseName;var H=D.Price;var B=D.SourceAdvertiserName;G+="<div class='clear_fix deal'>";G+="<div class='price'><a href='"+A+"'>"+H+"</a></div>";G+="<div class='details'>";G+="<div class='title'><a href='"+A+"'>"+K+"</a></div>";G+="<div class='source'><a href='"+A+"'>"+B+"</a></div>";G+="</div>";G+="</div>"}J.innerHTML=G;tabs[C]=G};BookingDeals.prototype.toggle=function(A){if(A==lastBookingBuddyType){return }$(lastBookingBuddyType+"-label").className="deal-label"+(lastBookingBuddyType=="car"?" last":"");$(A+"-label").className+=(A=="car"?" last":"")+" selected";$(lastBookingBuddyType+"-body").style.display="none";$(A+"-body").style.display="";lastBookingBuddyType=A;if(tabs[A]!=""){$(A+"-body").innerHTML=tabs[A]}else{this.getDeals($(lastBookingBuddyType+"-body"),lastBookingBuddyType,false)}};(function(){YAHOO.util.Config=function(A){if(A){this.init(A)}};var F=YAHOO.lang,E=YAHOO.util.CustomEvent,D=YAHOO.util.Config;D.CONFIG_CHANGED_EVENT="configChanged";D.BOOLEAN_TYPE="boolean";D.prototype={owner:null,queueInProgress:false,config:null,initialConfig:null,eventQueue:null,configChangedEvent:null,init:function(A){this.owner=A;this.configChangedEvent=this.createEvent(D.CONFIG_CHANGED_EVENT);this.configChangedEvent.signature=E.LIST;this.queueInProgress=false;this.config={};this.initialConfig={};this.eventQueue=[]},checkBoolean:function(A){return(typeof A==D.BOOLEAN_TYPE)},checkNumber:function(A){return(!isNaN(A))},fireEvent:function(C,A){var B=this.config[C];if(B&&B.event){B.event.fire(A)}},addProperty:function(A,B){A=A.toLowerCase();this.config[A]=B;B.event=this.createEvent(A,{scope:this.owner});B.event.signature=E.LIST;B.key=A;if(B.handler){B.event.subscribe(B.handler,this.owner)}this.setProperty(A,B.value,true);if(!B.suppressEvent){this.queueProperty(A,B.value)}},getConfig:function(){var H={},B=this.config,A,C;for(A in B){if(F.hasOwnProperty(B,A)){C=B[A];if(C&&C.event){H[A]=C.value}}}return H},getProperty:function(B){var A=this.config[B.toLowerCase()];if(A&&A.event){return A.value}else{return undefined}},resetProperty:function(B){B=B.toLowerCase();var A=this.config[B];if(A&&A.event){if(this.initialConfig[B]&&!F.isUndefined(this.initialConfig[B])){this.setProperty(B,this.initialConfig[B]);return true}}else{return false}},setProperty:function(C,A,H){var B;C=C.toLowerCase();if(this.queueInProgress&&!H){this.queueProperty(C,A);return true}else{B=this.config[C];if(B&&B.event){if(B.validator&&!B.validator(A)){return false}else{B.value=A;if(!H){this.fireEvent(C,A);this.configChangedEvent.fire([C,A])}return true}}else{return false}}},queueProperty:function(C,W){C=C.toLowerCase();var U=this.config[C],b=false,c,f,e,d,X,V,g,Z,Y,A,a,B,h;if(U&&U.event){if(!F.isUndefined(W)&&U.validator&&!U.validator(W)){return false}else{if(!F.isUndefined(W)){U.value=W}else{W=U.value}b=false;c=this.eventQueue.length;for(a=0;a<c;a++){f=this.eventQueue[a];if(f){e=f[0];d=f[1];if(e==C){this.eventQueue[a]=null;this.eventQueue.push([C,(!F.isUndefined(W)?W:d)]);
b=true;break}}}if(!b&&!F.isUndefined(W)){this.eventQueue.push([C,W])}}if(U.supercedes){X=U.supercedes.length;for(B=0;B<X;B++){V=U.supercedes[B];g=this.eventQueue.length;for(h=0;h<g;h++){Z=this.eventQueue[h];if(Z){Y=Z[0];A=Z[1];if(Y==V.toLowerCase()){this.eventQueue.push([Y,A]);this.eventQueue[h]=null;break}}}}}return true}else{return false}},refireEvent:function(B){B=B.toLowerCase();var A=this.config[B];if(A&&A.event&&!F.isUndefined(A.value)){if(this.queueInProgress){this.queueProperty(B)}else{this.fireEvent(B,A.value)}}},applyConfig:function(H,A){var B,C;if(A){C={};for(B in H){if(F.hasOwnProperty(H,B)){C[B.toLowerCase()]=H[B]}}this.initialConfig=C}for(B in H){if(F.hasOwnProperty(H,B)){this.queueProperty(B,H[B])}}},refresh:function(){var A;for(A in this.config){if(F.hasOwnProperty(this.config,A)){this.refireEvent(A)}}},fireQueue:function(){var I,A,J,B,C;this.queueInProgress=true;for(I=0;I<this.eventQueue.length;I++){A=this.eventQueue[I];if(A){J=A[0];B=A[1];C=this.config[J];C.value=B;this.fireEvent(J,B)}}this.queueInProgress=false;this.eventQueue=[]},subscribeToConfigEvent:function(I,C,A,J){var B=this.config[I.toLowerCase()];if(B&&B.event){if(!D.alreadySubscribed(B.event,C,A)){B.event.subscribe(C,A,J)}return true}else{return false}},unsubscribeFromConfigEvent:function(H,C,A){var B=this.config[H.toLowerCase()];if(B&&B.event){return B.event.unsubscribe(C,A)}else{return false}},toString:function(){var A="Config";if(this.owner){A+=" ["+this.owner.toString()+"]"}return A},outputEventQueue:function(){var H="",A,C,B=this.eventQueue.length;for(C=0;C<B;C++){A=this.eventQueue[C];if(A){H+=A[0]+"="+A[1]+", "}}return H},destroy:function(){var B=this.config,C,A;for(C in B){if(F.hasOwnProperty(B,C)){A=B[C];A.event.unsubscribeAll();A.event=null}}this.configChangedEvent.unsubscribeAll();this.configChangedEvent=null;this.owner=null;this.config=null;this.initialConfig=null;this.eventQueue=null}};D.alreadySubscribed=function(K,B,A){var J=K.subscribers.length,L,C;if(J>0){C=J-1;do{L=K.subscribers[C];if(L&&L.obj==A&&L.fn==B){return true}}while(C--)}return false};YAHOO.lang.augmentProto(D,YAHOO.util.EventProvider)}());YAHOO.widget.DateMath={DAY:"D",WEEK:"W",YEAR:"Y",MONTH:"M",ONE_DAY_MS:1000*60*60*24,WEEK_ONE_JAN_DATE:1,add:function(G,J,K){var H=new Date(G.getTime());switch(J){case this.MONTH:var I=G.getMonth()+K;var L=0;if(I<0){while(I<0){I+=12;L-=1}}else{if(I>11){while(I>11){I-=12;L+=1}}}H.setMonth(I);H.setFullYear(G.getFullYear()+L);break;case this.DAY:this._addDays(H,K);break;case this.YEAR:H.setFullYear(G.getFullYear()+K);break;case this.WEEK:this._addDays(H,(K*7));break}return H},_addDays:function(F,G){if(YAHOO.env.ua.webkit&&YAHOO.env.ua.webkit<420){if(G<0){for(var H=-128;G<H;G-=H){F.setDate(F.getDate()+H)}}else{for(var E=96;G>E;G-=E){F.setDate(F.getDate()+E)}}}F.setDate(F.getDate()+G)},subtract:function(D,E,F){return this.add(D,E,(F*-1))},before:function(E,F){var D=F.getTime();if(E.getTime()<D){return true}else{return false}},after:function(E,F){var D=F.getTime();if(E.getTime()>D){return true}else{return false}},between:function(F,D,E){if(this.after(F,D)&&this.before(F,E)){return true}else{return false}},getJan1:function(B){return this.getDate(B,0,1)},getDayOffset:function(H,F){var G=this.getJan1(F);var E=Math.ceil((H.getTime()-G.getTime())/this.ONE_DAY_MS);return E},getWeekNumber:function(b,Q,Y){Q=Q||0;Y=Y||this.WEEK_ONE_JAN_DATE;var X=this.clearTime(b),T,S;if(X.getDay()===Q){T=X}else{T=this.getFirstDayOfWeek(X,Q)}var W=T.getFullYear(),P=T.getTime();S=new Date(T.getTime()+6*this.ONE_DAY_MS);var Z;if(W!==S.getFullYear()&&S.getDate()>=Y){Z=1}else{var a=this.clearTime(this.getDate(W,0,Y)),R=this.getFirstDayOfWeek(a,Q);var V=Math.round((X.getTime()-R.getTime())/this.ONE_DAY_MS);var U=V%7;var O=(V-U)/7;Z=O+1}return Z},getFirstDayOfWeek:function(F,E){E=E||0;var H=F.getDay(),G=(H-E+7)%7;return this.subtract(F,this.DAY,G)},isYearOverlapWeek:function(D){var E=false;var F=this.add(D,this.DAY,6);if(F.getFullYear()!=D.getFullYear()){E=true}return E},isMonthOverlapWeek:function(D){var E=false;var F=this.add(D,this.DAY,6);if(F.getMonth()!=D.getMonth()){E=true}return E},findMonthStart:function(C){var D=this.getDate(C.getFullYear(),C.getMonth(),1);return D},findMonthEnd:function(H){var F=this.findMonthStart(H);var G=this.add(F,this.MONTH,1);var E=this.subtract(G,this.DAY,1);return E},clearTime:function(B){B.setHours(12,0,0,0);return B},getDate:function(F,E,G){var H=null;if(YAHOO.lang.isUndefined(G)){G=1}if(F>=100){H=new Date(F,E,G)}else{H=new Date();H.setFullYear(F);H.setMonth(E);H.setDate(G);H.setHours(0,0,0,0)}return H}};(function(){var K=YAHOO.util.Dom,G=YAHOO.util.Event,I=YAHOO.lang,J=YAHOO.widget.DateMath;function H(A,C,B){this.init.apply(this,arguments)}H.IMG_ROOT=null;H.DATE="D";H.MONTH_DAY="MD";H.WEEKDAY="WD";H.RANGE="R";H.MONTH="M";H.DISPLAY_DAYS=42;H.STOP_RENDER="S";H.SHORT="short";H.LONG="long";H.MEDIUM="medium";H.ONE_CHAR="1char";H._DEFAULT_CONFIG={PAGEDATE:{key:"pagedate",value:null},SELECTED:{key:"selected",value:null},TITLE:{key:"title",value:""},CLOSE:{key:"close",value:false},IFRAME:{key:"iframe",value:(YAHOO.env.ua.ie&&YAHOO.env.ua.ie<=6)?true:false},MINDATE:{key:"mindate",value:null},MAXDATE:{key:"maxdate",value:null},MULTI_SELECT:{key:"multi_select",value:false},START_WEEKDAY:{key:"start_weekday",value:0},SHOW_WEEKDAYS:{key:"show_weekdays",value:true},SHOW_WEEK_HEADER:{key:"show_week_header",value:false},SHOW_WEEK_FOOTER:{key:"show_week_footer",value:false},HIDE_BLANK_WEEKS:{key:"hide_blank_weeks",value:false},NAV_ARROW_LEFT:{key:"nav_arrow_left",value:null},NAV_ARROW_RIGHT:{key:"nav_arrow_right",value:null},MONTHS_SHORT:{key:"months_short",value:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},MONTHS_LONG:{key:"months_long",value:["January","February","March","April","May","June","July","August","September","October","November","December"]},WEEKDAYS_1CHAR:{key:"weekdays_1char",value:["S","M","T","W","T","F","S"]},WEEKDAYS_SHORT:{key:"weekdays_short",value:["Su","Mo","Tu","We","Th","Fr","Sa"]},WEEKDAYS_MEDIUM:{key:"weekdays_medium",value:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},WEEKDAYS_LONG:{key:"weekdays_long",value:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},LOCALE_MONTHS:{key:"locale_months",value:"long"},LOCALE_WEEKDAYS:{key:"locale_weekdays",value:"short"},DATE_DELIMITER:{key:"date_delimiter",value:","},DATE_FIELD_DELIMITER:{key:"date_field_delimiter",value:"/"},DATE_RANGE_DELIMITER:{key:"date_range_delimiter",value:"-"},MY_MONTH_POSITION:{key:"my_month_position",value:1},MY_YEAR_POSITION:{key:"my_year_position",value:2},MD_MONTH_POSITION:{key:"md_month_position",value:1},MD_DAY_POSITION:{key:"md_day_position",value:2},MDY_MONTH_POSITION:{key:"mdy_month_position",value:1},MDY_DAY_POSITION:{key:"mdy_day_position",value:2},MDY_YEAR_POSITION:{key:"mdy_year_position",value:3},MY_LABEL_MONTH_POSITION:{key:"my_label_month_position",value:1},MY_LABEL_YEAR_POSITION:{key:"my_label_year_position",value:2},MY_LABEL_MONTH_SUFFIX:{key:"my_label_month_suffix",value:" "},MY_LABEL_YEAR_SUFFIX:{key:"my_label_year_suffix",value:""},NAV:{key:"navigator",value:null},STRINGS:{key:"strings",value:{previousMonth:"Previous Month",nextMonth:"Next Month",close:"Close"},supercedes:["close","title"]}};var L=H._DEFAULT_CONFIG;H._EVENT_TYPES={BEFORE_SELECT:"beforeSelect",SELECT:"select",BEFORE_DESELECT:"beforeDeselect",DESELECT:"deselect",CHANGE_PAGE:"changePage",BEFORE_RENDER:"beforeRender",RENDER:"render",BEFORE_DESTROY:"beforeDestroy",DESTROY:"destroy",RESET:"reset",CLEAR:"clear",BEFORE_HIDE:"beforeHide",HIDE:"hide",BEFORE_SHOW:"beforeShow",SHOW:"show",BEFORE_HIDE_NAV:"beforeHideNav",HIDE_NAV:"hideNav",BEFORE_SHOW_NAV:"beforeShowNav",SHOW_NAV:"showNav",BEFORE_RENDER_NAV:"beforeRenderNav",RENDER_NAV:"renderNav"};H._STYLES={CSS_ROW_HEADER:"calrowhead",CSS_ROW_FOOTER:"calrowfoot",CSS_CELL:"calcell",CSS_CELL_SELECTOR:"selector",CSS_CELL_SELECTED:"selected",CSS_CELL_SELECTABLE:"selectable",CSS_CELL_RESTRICTED:"restricted",CSS_CELL_TODAY:"today",CSS_CELL_OOM:"oom",CSS_CELL_OOB:"previous",CSS_HEADER:"calheader",CSS_HEADER_TEXT:"calhead",CSS_BODY:"calbody",CSS_WEEKDAY_CELL:"calweekdaycell",CSS_WEEKDAY_ROW:"calweekdayrow",CSS_FOOTER:"calfoot",CSS_CALENDAR:"yui-calendar",CSS_SINGLE:"single",CSS_CONTAINER:"yui-calcontainer",CSS_NAV_LEFT:"calnavleft",CSS_NAV_RIGHT:"calnavright",CSS_NAV:"calnav",CSS_CLOSE:"calclose",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"};
H.prototype={Config:null,parent:null,index:-1,cells:null,cellDates:null,id:null,containerId:null,oDomContainer:null,today:null,renderStack:null,_renderStack:null,oNavigator:null,_selectedDates:null,domEventMap:null,_parseArgs:function(A){var B={id:null,container:null,config:null};if(A&&A.length&&A.length>0){switch(A.length){case 1:B.id=null;B.container=A[0];B.config=null;break;case 2:if(I.isObject(A[1])&&!A[1].tagName&&!(A[1] instanceof String)){B.id=null;B.container=A[0];B.config=A[1]}else{B.id=A[0];B.container=A[1];B.config=null}break;default:B.id=A[0];B.container=A[1];B.config=A[2];break}}else{}return B},init:function(A,C,B){var D=this._parseArgs(arguments);A=D.id;C=D.container;B=D.config;this.oDomContainer=K.get(C);if(!this.oDomContainer.id){this.oDomContainer.id=K.generateId()}if(!A){A=this.oDomContainer.id+"_t"}this.id=A;this.containerId=this.oDomContainer.id;this.initEvents();this.today=new Date();J.clearTime(this.today);this.cfg=new YAHOO.util.Config(this);this.Options={};this.Locale={};this.initStyles();K.addClass(this.oDomContainer,this.Style.CSS_CONTAINER);K.addClass(this.oDomContainer,this.Style.CSS_SINGLE);this.cellDates=[];this.cells=[];this.renderStack=[];this._renderStack=[];this.setupConfig();if(B){this.cfg.applyConfig(B,true)}this.cfg.fireQueue()},configIframe:function(C,D,B){var E=D[0];if(!this.parent){if(K.inDocument(this.oDomContainer)){if(E){var A=K.getStyle(this.oDomContainer,"position");if(A=="absolute"||A=="relative"){if(!K.inDocument(this.iframe)){this.iframe=document.createElement("iframe");this.iframe.src="javascript:false;";K.setStyle(this.iframe,"opacity","0");if(YAHOO.env.ua.ie&&YAHOO.env.ua.ie<=6){K.addClass(this.iframe,"fixedsize")}this.oDomContainer.insertBefore(this.iframe,this.oDomContainer.firstChild)}}}else{if(this.iframe){if(this.iframe.parentNode){this.iframe.parentNode.removeChild(this.iframe)}this.iframe=null}}}}},configTitle:function(D,E,C){var A=E[0];if(A){this.createTitleBar(A)}else{var B=this.cfg.getProperty(L.CLOSE.key);if(!B){this.removeTitleBar()}else{this.createTitleBar("&#160;")}}},configClose:function(D,E,C){var A=E[0],B=this.cfg.getProperty(L.TITLE.key);if(A){if(!B){this.createTitleBar("&#160;")}this.createCloseButton()}else{this.removeCloseButton();if(!B){this.removeTitleBar()}}},initEvents:function(){var C=H._EVENT_TYPES,A=YAHOO.util.CustomEvent,B=this;B.beforeSelectEvent=new A(C.BEFORE_SELECT);B.selectEvent=new A(C.SELECT);B.beforeDeselectEvent=new A(C.BEFORE_DESELECT);B.deselectEvent=new A(C.DESELECT);B.changePageEvent=new A(C.CHANGE_PAGE);B.beforeRenderEvent=new A(C.BEFORE_RENDER);B.renderEvent=new A(C.RENDER);B.beforeDestroyEvent=new A(C.BEFORE_DESTROY);B.destroyEvent=new A(C.DESTROY);B.resetEvent=new A(C.RESET);B.clearEvent=new A(C.CLEAR);B.beforeShowEvent=new A(C.BEFORE_SHOW);B.showEvent=new A(C.SHOW);B.beforeHideEvent=new A(C.BEFORE_HIDE);B.hideEvent=new A(C.HIDE);B.beforeShowNavEvent=new A(C.BEFORE_SHOW_NAV);B.showNavEvent=new A(C.SHOW_NAV);B.beforeHideNavEvent=new A(C.BEFORE_HIDE_NAV);B.hideNavEvent=new A(C.HIDE_NAV);B.beforeRenderNavEvent=new A(C.BEFORE_RENDER_NAV);B.renderNavEvent=new A(C.RENDER_NAV);B.beforeSelectEvent.subscribe(B.onBeforeSelect,this,true);B.selectEvent.subscribe(B.onSelect,this,true);B.beforeDeselectEvent.subscribe(B.onBeforeDeselect,this,true);B.deselectEvent.subscribe(B.onDeselect,this,true);B.changePageEvent.subscribe(B.onChangePage,this,true);B.renderEvent.subscribe(B.onRender,this,true);B.resetEvent.subscribe(B.onReset,this,true);B.clearEvent.subscribe(B.onClear,this,true)},doPreviousMonthNav:function(A,B){G.preventDefault(A);setTimeout(function(){B.previousMonth();var D=K.getElementsByClassName(B.Style.CSS_NAV_LEFT,"a",B.oDomContainer);if(D&&D[0]){try{D[0].focus()}catch(C){}}},0)},doNextMonthNav:function(A,B){G.preventDefault(A);setTimeout(function(){B.nextMonth();var D=K.getElementsByClassName(B.Style.CSS_NAV_RIGHT,"a",B.oDomContainer);if(D&&D[0]){try{D[0].focus()}catch(C){}}},0)},doSelectCell:function(F,X){var A,D,V,S;var E=G.getTarget(F),W=E.tagName.toLowerCase(),T=false;while(W!="td"&&!K.hasClass(E,X.Style.CSS_CELL_SELECTABLE)){if(!T&&W=="a"&&K.hasClass(E,X.Style.CSS_CELL_SELECTOR)){T=true}E=E.parentNode;W=E.tagName.toLowerCase();if(E==this.oDomContainer||W=="html"){return }}if(T){G.preventDefault(F)}A=E;if(K.hasClass(A,X.Style.CSS_CELL_SELECTABLE)){S=X.getIndexFromId(A.id);if(S>-1){D=X.cellDates[S];if(D){V=J.getDate(D[0],D[1]-1,D[2]);var B;if(X.Options.MULTI_SELECT){B=A.getElementsByTagName("a")[0];if(B){B.blur()}var U=X.cellDates[S];var C=X._indexOfSelectedFieldArray(U);if(C>-1){X.deselectCell(S)}else{X.selectCell(S)}}else{B=A.getElementsByTagName("a")[0];if(B){B.blur()}X.selectCell(S)}}}}},doCellMouseOver:function(A,B){var C;if(A){C=G.getTarget(A)}else{C=this}while(C.tagName&&C.tagName.toLowerCase()!="td"){C=C.parentNode;if(!C.tagName||C.tagName.toLowerCase()=="html"){return }}if(K.hasClass(C,B.Style.CSS_CELL_SELECTABLE)){K.addClass(C,B.Style.CSS_CELL_HOVER)}},doCellMouseOut:function(A,B){var C;if(A){C=G.getTarget(A)}else{C=this}while(C.tagName&&C.tagName.toLowerCase()!="td"){C=C.parentNode;if(!C.tagName||C.tagName.toLowerCase()=="html"){return }}if(K.hasClass(C,B.Style.CSS_CELL_SELECTABLE)){K.removeClass(C,B.Style.CSS_CELL_HOVER)}},setupConfig:function(){var B=this.cfg;B.addProperty(L.PAGEDATE.key,{value:new Date(),handler:this.configPageDate});B.addProperty(L.SELECTED.key,{value:[],handler:this.configSelected});B.addProperty(L.TITLE.key,{value:L.TITLE.value,handler:this.configTitle});B.addProperty(L.CLOSE.key,{value:L.CLOSE.value,handler:this.configClose});B.addProperty(L.IFRAME.key,{value:L.IFRAME.value,handler:this.configIframe,validator:B.checkBoolean});B.addProperty(L.MINDATE.key,{value:L.MINDATE.value,handler:this.configMinDate});B.addProperty(L.MAXDATE.key,{value:L.MAXDATE.value,handler:this.configMaxDate});B.addProperty(L.MULTI_SELECT.key,{value:L.MULTI_SELECT.value,handler:this.configOptions,validator:B.checkBoolean});B.addProperty(L.START_WEEKDAY.key,{value:L.START_WEEKDAY.value,handler:this.configOptions,validator:B.checkNumber});B.addProperty(L.SHOW_WEEKDAYS.key,{value:L.SHOW_WEEKDAYS.value,handler:this.configOptions,validator:B.checkBoolean});B.addProperty(L.SHOW_WEEK_HEADER.key,{value:L.SHOW_WEEK_HEADER.value,handler:this.configOptions,validator:B.checkBoolean});B.addProperty(L.SHOW_WEEK_FOOTER.key,{value:L.SHOW_WEEK_FOOTER.value,handler:this.configOptions,validator:B.checkBoolean});B.addProperty(L.HIDE_BLANK_WEEKS.key,{value:L.HIDE_BLANK_WEEKS.value,handler:this.configOptions,validator:B.checkBoolean});B.addProperty(L.NAV_ARROW_LEFT.key,{value:L.NAV_ARROW_LEFT.value,handler:this.configOptions});B.addProperty(L.NAV_ARROW_RIGHT.key,{value:L.NAV_ARROW_RIGHT.value,handler:this.configOptions});B.addProperty(L.MONTHS_SHORT.key,{value:L.MONTHS_SHORT.value,handler:this.configLocale});B.addProperty(L.MONTHS_LONG.key,{value:L.MONTHS_LONG.value,handler:this.configLocale});B.addProperty(L.WEEKDAYS_1CHAR.key,{value:L.WEEKDAYS_1CHAR.value,handler:this.configLocale});B.addProperty(L.WEEKDAYS_SHORT.key,{value:L.WEEKDAYS_SHORT.value,handler:this.configLocale});B.addProperty(L.WEEKDAYS_MEDIUM.key,{value:L.WEEKDAYS_MEDIUM.value,handler:this.configLocale});B.addProperty(L.WEEKDAYS_LONG.key,{value:L.WEEKDAYS_LONG.value,handler:this.configLocale});var A=function(){B.refireEvent(L.LOCALE_MONTHS.key);B.refireEvent(L.LOCALE_WEEKDAYS.key)};B.subscribeToConfigEvent(L.START_WEEKDAY.key,A,this,true);B.subscribeToConfigEvent(L.MONTHS_SHORT.key,A,this,true);B.subscribeToConfigEvent(L.MONTHS_LONG.key,A,this,true);B.subscribeToConfigEvent(L.WEEKDAYS_1CHAR.key,A,this,true);B.subscribeToConfigEvent(L.WEEKDAYS_SHORT.key,A,this,true);B.subscribeToConfigEvent(L.WEEKDAYS_MEDIUM.key,A,this,true);B.subscribeToConfigEvent(L.WEEKDAYS_LONG.key,A,this,true);B.addProperty(L.LOCALE_MONTHS.key,{value:L.LOCALE_MONTHS.value,handler:this.configLocaleValues});B.addProperty(L.LOCALE_WEEKDAYS.key,{value:L.LOCALE_WEEKDAYS.value,handler:this.configLocaleValues});B.addProperty(L.DATE_DELIMITER.key,{value:L.DATE_DELIMITER.value,handler:this.configLocale});
B.addProperty(L.DATE_FIELD_DELIMITER.key,{value:L.DATE_FIELD_DELIMITER.value,handler:this.configLocale});B.addProperty(L.DATE_RANGE_DELIMITER.key,{value:L.DATE_RANGE_DELIMITER.value,handler:this.configLocale});B.addProperty(L.MY_MONTH_POSITION.key,{value:L.MY_MONTH_POSITION.value,handler:this.configLocale,validator:B.checkNumber});B.addProperty(L.MY_YEAR_POSITION.key,{value:L.MY_YEAR_POSITION.value,handler:this.configLocale,validator:B.checkNumber});B.addProperty(L.MD_MONTH_POSITION.key,{value:L.MD_MONTH_POSITION.value,handler:this.configLocale,validator:B.checkNumber});B.addProperty(L.MD_DAY_POSITION.key,{value:L.MD_DAY_POSITION.value,handler:this.configLocale,validator:B.checkNumber});B.addProperty(L.MDY_MONTH_POSITION.key,{value:L.MDY_MONTH_POSITION.value,handler:this.configLocale,validator:B.checkNumber});B.addProperty(L.MDY_DAY_POSITION.key,{value:L.MDY_DAY_POSITION.value,handler:this.configLocale,validator:B.checkNumber});B.addProperty(L.MDY_YEAR_POSITION.key,{value:L.MDY_YEAR_POSITION.value,handler:this.configLocale,validator:B.checkNumber});B.addProperty(L.MY_LABEL_MONTH_POSITION.key,{value:L.MY_LABEL_MONTH_POSITION.value,handler:this.configLocale,validator:B.checkNumber});B.addProperty(L.MY_LABEL_YEAR_POSITION.key,{value:L.MY_LABEL_YEAR_POSITION.value,handler:this.configLocale,validator:B.checkNumber});B.addProperty(L.MY_LABEL_MONTH_SUFFIX.key,{value:L.MY_LABEL_MONTH_SUFFIX.value,handler:this.configLocale});B.addProperty(L.MY_LABEL_YEAR_SUFFIX.key,{value:L.MY_LABEL_YEAR_SUFFIX.value,handler:this.configLocale});B.addProperty(L.NAV.key,{value:L.NAV.value,handler:this.configNavigator});B.addProperty(L.STRINGS.key,{value:L.STRINGS.value,handler:this.configStrings,validator:function(C){return I.isObject(C)},supercedes:L.STRINGS.supercedes})},configStrings:function(C,D,B){var A=I.merge(L.STRINGS.value,D[0]);this.cfg.setProperty(L.STRINGS.key,A,true)},configPageDate:function(B,C,A){this.cfg.setProperty(L.PAGEDATE.key,this._parsePageDate(C[0]),true)},configMinDate:function(C,D,B){var A=D[0];if(I.isString(A)){A=this._parseDate(A);this.cfg.setProperty(L.MINDATE.key,J.getDate(A[0],(A[1]-1),A[2]))}},configMaxDate:function(C,D,B){var A=D[0];if(I.isString(A)){A=this._parseDate(A);this.cfg.setProperty(L.MAXDATE.key,J.getDate(A[0],(A[1]-1),A[2]))}},configSelected:function(C,E,A){var D=E[0],B=L.SELECTED.key;if(D){if(I.isString(D)){this.cfg.setProperty(B,this._parseDates(D),true)}}if(!this._selectedDates){this._selectedDates=this.cfg.getProperty(B)}},configOptions:function(B,C,A){this.Options[B.toUpperCase()]=C[0]},configLocale:function(B,C,A){this.Locale[B.toUpperCase()]=C[0];this.cfg.refireEvent(L.LOCALE_MONTHS.key);this.cfg.refireEvent(L.LOCALE_WEEKDAYS.key)},configLocaleValues:function(C,D,B){C=C.toLowerCase();var P=D[0],E=this.cfg,O=this.Locale;switch(C){case L.LOCALE_MONTHS.key:switch(P){case H.SHORT:O.LOCALE_MONTHS=E.getProperty(L.MONTHS_SHORT.key).concat();break;case H.LONG:O.LOCALE_MONTHS=E.getProperty(L.MONTHS_LONG.key).concat();break}break;case L.LOCALE_WEEKDAYS.key:switch(P){case H.ONE_CHAR:O.LOCALE_WEEKDAYS=E.getProperty(L.WEEKDAYS_1CHAR.key).concat();break;case H.SHORT:O.LOCALE_WEEKDAYS=E.getProperty(L.WEEKDAYS_SHORT.key).concat();break;case H.MEDIUM:O.LOCALE_WEEKDAYS=E.getProperty(L.WEEKDAYS_MEDIUM.key).concat();break;case H.LONG:O.LOCALE_WEEKDAYS=E.getProperty(L.WEEKDAYS_LONG.key).concat();break}var A=E.getProperty(L.START_WEEKDAY.key);if(A>0){for(var F=0;F<A;++F){O.LOCALE_WEEKDAYS.push(O.LOCALE_WEEKDAYS.shift())}}break}},configNavigator:function(C,D,B){var A=D[0];if(YAHOO.widget.CalendarNavigator&&(A===true||I.isObject(A))){if(!this.oNavigator){this.oNavigator=new YAHOO.widget.CalendarNavigator(this);this.beforeRenderEvent.subscribe(function(){if(!this.pages){this.oNavigator.erase()}},this,true)}}else{if(this.oNavigator){this.oNavigator.destroy();this.oNavigator=null}}},initStyles:function(){var A=H._STYLES;this.Style={CSS_ROW_HEADER:A.CSS_ROW_HEADER,CSS_ROW_FOOTER:A.CSS_ROW_FOOTER,CSS_CELL:A.CSS_CELL,CSS_CELL_SELECTOR:A.CSS_CELL_SELECTOR,CSS_CELL_SELECTED:A.CSS_CELL_SELECTED,CSS_CELL_SELECTABLE:A.CSS_CELL_SELECTABLE,CSS_CELL_RESTRICTED:A.CSS_CELL_RESTRICTED,CSS_CELL_TODAY:A.CSS_CELL_TODAY,CSS_CELL_OOM:A.CSS_CELL_OOM,CSS_CELL_OOB:A.CSS_CELL_OOB,CSS_HEADER:A.CSS_HEADER,CSS_HEADER_TEXT:A.CSS_HEADER_TEXT,CSS_BODY:A.CSS_BODY,CSS_WEEKDAY_CELL:A.CSS_WEEKDAY_CELL,CSS_WEEKDAY_ROW:A.CSS_WEEKDAY_ROW,CSS_FOOTER:A.CSS_FOOTER,CSS_CALENDAR:A.CSS_CALENDAR,CSS_SINGLE:A.CSS_SINGLE,CSS_CONTAINER:A.CSS_CONTAINER,CSS_NAV_LEFT:A.CSS_NAV_LEFT,CSS_NAV_RIGHT:A.CSS_NAV_RIGHT,CSS_NAV:A.CSS_NAV,CSS_CLOSE:A.CSS_CLOSE,CSS_CELL_TOP:A.CSS_CELL_TOP,CSS_CELL_LEFT:A.CSS_CELL_LEFT,CSS_CELL_RIGHT:A.CSS_CELL_RIGHT,CSS_CELL_BOTTOM:A.CSS_CELL_BOTTOM,CSS_CELL_HOVER:A.CSS_CELL_HOVER,CSS_CELL_HIGHLIGHT1:A.CSS_CELL_HIGHLIGHT1,CSS_CELL_HIGHLIGHT2:A.CSS_CELL_HIGHLIGHT2,CSS_CELL_HIGHLIGHT3:A.CSS_CELL_HIGHLIGHT3,CSS_CELL_HIGHLIGHT4:A.CSS_CELL_HIGHLIGHT4}},buildMonthLabel:function(){return this._buildMonthLabel(this.cfg.getProperty(L.PAGEDATE.key))},_buildMonthLabel:function(C){var A=this.Locale.LOCALE_MONTHS[C.getMonth()]+this.Locale.MY_LABEL_MONTH_SUFFIX,B=C.getFullYear()+this.Locale.MY_LABEL_YEAR_SUFFIX;if(this.Locale.MY_LABEL_MONTH_POSITION==2||this.Locale.MY_LABEL_YEAR_POSITION==1){return B+A}else{return A+B}},buildDayLabel:function(A){return A.getDate()},createTitleBar:function(B){var A=K.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE,"div",this.oDomContainer)[0]||document.createElement("div");A.className=YAHOO.widget.CalendarGroup.CSS_2UPTITLE;A.innerHTML=B;this.oDomContainer.insertBefore(A,this.oDomContainer.firstChild);K.addClass(this.oDomContainer,"withtitle");return A},removeTitleBar:function(){var A=K.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE,"div",this.oDomContainer)[0]||null;if(A){G.purgeElement(A);this.oDomContainer.removeChild(A)}K.removeClass(this.oDomContainer,"withtitle")},createCloseButton:function(){var C=YAHOO.widget.CalendarGroup.CSS_2UPCLOSE,A="us/my/bn/x_d.gif",B=K.getElementsByClassName("link-close","a",this.oDomContainer)[0],F=this.cfg.getProperty(L.STRINGS.key),E=(F&&F.close)?F.close:"";if(!B){B=document.createElement("a");G.addListener(B,"click",function(O,P){P.hide();G.preventDefault(O)},this)}B.href="#";B.className="link-close";if(H.IMG_ROOT!==null){var D=K.getElementsByClassName(C,"img",B)[0]||document.createElement("img");D.src=H.IMG_ROOT+A;D.className=C;B.appendChild(D)}else{B.innerHTML='<span class="'+C+" "+this.Style.CSS_CLOSE+'">'+E+"</span>"}this.oDomContainer.appendChild(B);return B},removeCloseButton:function(){var A=K.getElementsByClassName("link-close","a",this.oDomContainer)[0]||null;if(A){G.purgeElement(A);this.oDomContainer.removeChild(A)}},renderHeader:function(Z){var a=7,b="us/tr/callt.gif",l="us/tr/calrt.gif",c=this.cfg,f=c.getProperty(L.PAGEDATE.key),e=c.getProperty(L.STRINGS.key),C=(e&&e.previousMonth)?e.previousMonth:"",k=(e&&e.nextMonth)?e.nextMonth:"",d;if(c.getProperty(L.SHOW_WEEK_HEADER.key)){a+=1}if(c.getProperty(L.SHOW_WEEK_FOOTER.key)){a+=1}Z[Z.length]="<thead>";Z[Z.length]="<tr>";Z[Z.length]='<th colspan="'+a+'" class="'+this.Style.CSS_HEADER_TEXT+'">';Z[Z.length]='<div class="'+this.Style.CSS_HEADER+'">';var A,D=false;if(this.parent){if(this.index===0){A=true}if(this.index==(this.parent.cfg.getProperty("pages")-1)){D=true}}else{A=true;D=true}if(A){d=this._buildMonthLabel(J.subtract(f,J.MONTH,1));var Y=c.getProperty(L.NAV_ARROW_LEFT.key);if(Y===null&&H.IMG_ROOT!==null){Y=H.IMG_ROOT+b}var h=(Y===null)?"":' style="background-image:url('+Y+')"';Z[Z.length]='<a class="'+this.Style.CSS_NAV_LEFT+'"'+h+' href="#">'+C+" ("+d+")</a>"}var B=this.buildMonthLabel();var F=this.parent||this;if(F.cfg.getProperty("navigator")){B='<a class="'+this.Style.CSS_NAV+'" href="#">'+B+"</a>"}Z[Z.length]=B;if(D){d=this._buildMonthLabel(J.add(f,J.MONTH,1));var E=c.getProperty(L.NAV_ARROW_RIGHT.key);if(E===null&&H.IMG_ROOT!==null){E=H.IMG_ROOT+l}var g=(E===null)?"":' style="background-image:url('+E+')"';Z[Z.length]='<a class="'+this.Style.CSS_NAV_RIGHT+'"'+g+' href="#">'+k+" ("+d+")</a>"
}Z[Z.length]="</div>\n</th>\n</tr>";if(c.getProperty(L.SHOW_WEEKDAYS.key)){Z=this.buildWeekdays(Z)}Z[Z.length]="</thead>";return Z},buildWeekdays:function(A){A[A.length]='<tr class="'+this.Style.CSS_WEEKDAY_ROW+'">';if(this.cfg.getProperty(L.SHOW_WEEK_HEADER.key)){A[A.length]="<th>&#160;</th>"}for(var B=0;B<this.Locale.LOCALE_WEEKDAYS.length;++B){A[A.length]='<th class="calweekdaycell">'+this.Locale.LOCALE_WEEKDAYS[B]+"</th>"}if(this.cfg.getProperty(L.SHOW_WEEK_FOOTER.key)){A[A.length]="<th>&#160;</th>"}A[A.length]="</tr>";return A},renderBody:function(Ag,Ai){var A=this.cfg.getProperty(L.START_WEEKDAY.key);this.preMonthDays=Ag.getDay();if(A>0){this.preMonthDays-=A}if(this.preMonthDays<0){this.preMonthDays+=7}this.monthDays=J.findMonthEnd(Ag).getDate();this.postMonthDays=H.DISPLAY_DAYS-this.preMonthDays-this.monthDays;Ag=J.subtract(Ag,J.DAY,this.preMonthDays);var t,AP,AQ="w",Am="_cell",Ao="wd",Aa="d",AN,Ac,AE=this.today,AO=this.cfg,AF=AE.getFullYear(),Ab=AE.getMonth(),AT=AE.getDate(),AH=AO.getProperty(L.PAGEDATE.key),AU=AO.getProperty(L.HIDE_BLANK_WEEKS.key),Aj=AO.getProperty(L.SHOW_WEEK_FOOTER.key),Ap=AO.getProperty(L.SHOW_WEEK_HEADER.key),AI=AO.getProperty(L.MINDATE.key),F=AO.getProperty(L.MAXDATE.key);if(AI){AI=J.clearTime(AI)}if(F){F=J.clearTime(F)}Ai[Ai.length]='<tbody class="m'+(AH.getMonth()+1)+" "+this.Style.CSS_BODY+'">';var C=0,AM=document.createElement("div"),Ah=document.createElement("td");AM.appendChild(Ah);var AX=this.parent||this;for(var r=0;r<6;r++){t=J.getWeekNumber(Ag,A);AP=AQ+t;if(r!==0&&AU===true&&Ag.getMonth()!=AH.getMonth()){break}else{Ai[Ai.length]='<tr class="'+AP+'">';if(Ap){Ai=this.renderRowHeader(t,Ai)}for(var B=0;B<7;B++){AN=[];this.clearElement(Ah);Ah.className=this.Style.CSS_CELL;Ah.id=this.id+Am+C;if(Ag.getDate()==AT&&Ag.getMonth()==Ab&&Ag.getFullYear()==AF){AN[AN.length]=AX.renderCellStyleToday}var p=[Ag.getFullYear(),Ag.getMonth()+1,Ag.getDate()];this.cellDates[this.cellDates.length]=p;if(Ag.getMonth()!=AH.getMonth()){AN[AN.length]=AX.renderCellNotThisMonth}else{K.addClass(Ah,Ao+Ag.getDay());K.addClass(Ah,Aa+Ag.getDate());for(var AD=0;AD<this.renderStack.length;++AD){Ac=null;var AZ=this.renderStack[AD],Aq=AZ[0],AV,An,AR;switch(Aq){case H.DATE:AV=AZ[1][1];An=AZ[1][2];AR=AZ[1][0];if(Ag.getMonth()+1==AV&&Ag.getDate()==An&&Ag.getFullYear()==AR){Ac=AZ[2];this.renderStack.splice(AD,1)}break;case H.MONTH_DAY:AV=AZ[1][0];An=AZ[1][1];if(Ag.getMonth()+1==AV&&Ag.getDate()==An){Ac=AZ[2];this.renderStack.splice(AD,1)}break;case H.RANGE:var Ak=AZ[1][0],Al=AZ[1][1],Af=Ak[1],AJ=Ak[2],x=Ak[0],D=J.getDate(x,Af-1,AJ),AS=Al[1],Ad=Al[2],AW=Al[0],E=J.getDate(AW,AS-1,Ad);if(Ag.getTime()>=D.getTime()&&Ag.getTime()<=E.getTime()){Ac=AZ[2];if(Ag.getTime()==E.getTime()){this.renderStack.splice(AD,1)}}break;case H.WEEKDAY:var AL=AZ[1][0];if(Ag.getDay()+1==AL){Ac=AZ[2]}break;case H.MONTH:AV=AZ[1][0];if(Ag.getMonth()+1==AV){Ac=AZ[2]}break}if(Ac){AN[AN.length]=Ac}}}if(this._indexOfSelectedFieldArray(p)>-1){AN[AN.length]=AX.renderCellStyleSelected}if((AI&&(Ag.getTime()<AI.getTime()))||(F&&(Ag.getTime()>F.getTime()))){AN[AN.length]=AX.renderOutOfBoundsDate}else{AN[AN.length]=AX.styleCellDefault;AN[AN.length]=AX.renderCellDefault}for(var AY=0;AY<AN.length;++AY){if(AN[AY].call(AX,Ag,Ah)==H.STOP_RENDER){break}}Ag.setTime(Ag.getTime()+J.ONE_DAY_MS);Ag=J.clearTime(Ag);if(C>=0&&C<=6){K.addClass(Ah,this.Style.CSS_CELL_TOP)}if((C%7)===0){K.addClass(Ah,this.Style.CSS_CELL_LEFT)}if(((C+1)%7)===0){K.addClass(Ah,this.Style.CSS_CELL_RIGHT)}var Ae=this.postMonthDays;if(AU&&Ae>=7){var AG=Math.floor(Ae/7);for(var d=0;d<AG;++d){Ae-=7}}if(C>=((this.preMonthDays+Ae+this.monthDays)-7)){K.addClass(Ah,this.Style.CSS_CELL_BOTTOM)}Ai[Ai.length]=AM.innerHTML;C++}if(Aj){Ai=this.renderRowFooter(t,Ai)}Ai[Ai.length]="</tr>"}}Ai[Ai.length]="</tbody>";return Ai},renderFooter:function(A){return A},render:function(){this.beforeRenderEvent.fire();var A=J.findMonthStart(this.cfg.getProperty(L.PAGEDATE.key));this.resetRenderers();this.cellDates.length=0;G.purgeElement(this.oDomContainer,true);var B=[];B[B.length]='<table cellSpacing="0" class="'+this.Style.CSS_CALENDAR+" y"+A.getFullYear()+'" id="'+this.id+'">';B=this.renderHeader(B);B=this.renderBody(A,B);B=this.renderFooter(B);B[B.length]="</table>";this.oDomContainer.innerHTML=B.join("\n");this.applyListeners();this.cells=this.oDomContainer.getElementsByTagName("td");this.cfg.refireEvent(L.TITLE.key);this.cfg.refireEvent(L.CLOSE.key);this.cfg.refireEvent(L.IFRAME.key);this.renderEvent.fire()},applyListeners:function(){var D=this.oDomContainer,Y=this.parent||this,U="a",A="click";var T=K.getElementsByClassName(this.Style.CSS_NAV_LEFT,U,D),X=K.getElementsByClassName(this.Style.CSS_NAV_RIGHT,U,D);if(T&&T.length>0){this.linkLeft=T[0];G.addListener(this.linkLeft,A,this.doPreviousMonthNav,Y,true)}if(X&&X.length>0){this.linkRight=X[0];G.addListener(this.linkRight,A,this.doNextMonthNav,Y,true)}if(Y.cfg.getProperty("navigator")!==null){this.applyNavListeners()}if(this.domEventMap){var W,Z;for(var B in this.domEventMap){if(I.hasOwnProperty(this.domEventMap,B)){var F=this.domEventMap[B];if(!(F instanceof Array)){F=[F]}for(var V=0;V<F.length;V++){var C=F[V];Z=K.getElementsByClassName(B,C.tag,this.oDomContainer);for(var E=0;E<Z.length;E++){W=Z[E];G.addListener(W,C.event,C.handler,C.scope,C.correct)}}}}}G.addListener(this.oDomContainer,"click",this.doSelectCell,this);G.addListener(this.oDomContainer,"mouseover",this.doCellMouseOver,this);G.addListener(this.oDomContainer,"mouseout",this.doCellMouseOut,this)},applyNavListeners:function(){var B=this.parent||this,A=this,C=K.getElementsByClassName(this.Style.CSS_NAV,"a",this.oDomContainer);if(C.length>0){G.addListener(C,"click",function(O,P){var D=G.getTarget(O);if(this===D||K.isAncestor(this,D)){G.preventDefault(O)}var F=B.oNavigator;if(F){var E=A.cfg.getProperty("pagedate");F.setYear(E.getFullYear());F.setMonth(E.getMonth());F.show()}})}},getDateByCellId:function(A){var B=this.getDateFieldsByCellId(A);return(B)?J.getDate(B[0],B[1]-1,B[2]):null},getDateFieldsByCellId:function(A){A=this.getIndexFromId(A);return(A>-1)?this.cellDates[A]:null},getCellIndex:function(D){var E=-1;if(D){var F=D.getMonth(),O=D.getFullYear(),P=D.getDate(),B=this.cellDates;for(var C=0;C<B.length;++C){var A=B[C];if(A[0]===O&&A[1]===F+1&&A[2]===P){E=C;break}}}return E},getIndexFromId:function(A){var B=-1,C=A.lastIndexOf("_cell");if(C>-1){B=parseInt(A.substring(C+5),10)}return B},renderOutOfBoundsDate:function(A,B){K.addClass(B,this.Style.CSS_CELL_OOB);B.innerHTML=A.getDate();return H.STOP_RENDER},renderRowHeader:function(A,B){B[B.length]='<th class="calrowhead">'+A+"</th>";return B},renderRowFooter:function(A,B){B[B.length]='<th class="calrowfoot">'+A+"</th>";return B},renderCellDefault:function(A,B){B.innerHTML='<a href="#" class="'+this.Style.CSS_CELL_SELECTOR+'">'+this.buildDayLabel(A)+"</a>"},styleCellDefault:function(A,B){K.addClass(B,this.Style.CSS_CELL_SELECTABLE)},renderCellStyleHighlight1:function(A,B){K.addClass(B,this.Style.CSS_CELL_HIGHLIGHT1)},renderCellStyleHighlight2:function(A,B){K.addClass(B,this.Style.CSS_CELL_HIGHLIGHT2)},renderCellStyleHighlight3:function(A,B){K.addClass(B,this.Style.CSS_CELL_HIGHLIGHT3)},renderCellStyleHighlight4:function(A,B){K.addClass(B,this.Style.CSS_CELL_HIGHLIGHT4)},renderCellStyleToday:function(A,B){K.addClass(B,this.Style.CSS_CELL_TODAY)},renderCellStyleSelected:function(A,B){K.addClass(B,this.Style.CSS_CELL_SELECTED)},renderCellNotThisMonth:function(A,B){K.addClass(B,this.Style.CSS_CELL_OOM);B.innerHTML=A.getDate();return H.STOP_RENDER},renderBodyCellRestricted:function(A,B){K.addClass(B,this.Style.CSS_CELL);K.addClass(B,this.Style.CSS_CELL_RESTRICTED);B.innerHTML=A.getDate();return H.STOP_RENDER},addMonths:function(A){var B=L.PAGEDATE.key;this.cfg.setProperty(B,J.add(this.cfg.getProperty(B),J.MONTH,A));this.resetRenderers();this.changePageEvent.fire()},subtractMonths:function(A){var B=L.PAGEDATE.key;this.cfg.setProperty(B,J.subtract(this.cfg.getProperty(B),J.MONTH,A));this.resetRenderers();
this.changePageEvent.fire()},addYears:function(A){var B=L.PAGEDATE.key;this.cfg.setProperty(B,J.add(this.cfg.getProperty(B),J.YEAR,A));this.resetRenderers();this.changePageEvent.fire()},subtractYears:function(A){var B=L.PAGEDATE.key;this.cfg.setProperty(B,J.subtract(this.cfg.getProperty(B),J.YEAR,A));this.resetRenderers();this.changePageEvent.fire()},nextMonth:function(){this.addMonths(1)},previousMonth:function(){this.subtractMonths(1)},nextYear:function(){this.addYears(1)},previousYear:function(){this.subtractYears(1)},reset:function(){this.cfg.resetProperty(L.SELECTED.key);this.cfg.resetProperty(L.PAGEDATE.key);this.resetEvent.fire()},clear:function(){this.cfg.setProperty(L.SELECTED.key,[]);this.cfg.setProperty(L.PAGEDATE.key,new Date(this.today.getTime()));this.clearEvent.fire()},select:function(D){var A=this._toFieldArray(D),E=[],B=[],N=L.SELECTED.key;for(var F=0;F<A.length;++F){var C=A[F];if(!this.isDateOOB(this._toDate(C))){if(E.length===0){this.beforeSelectEvent.fire();B=this.cfg.getProperty(N)}E.push(C);if(this._indexOfSelectedFieldArray(C)==-1){B[B.length]=C}}}if(E.length>0){if(this.parent){this.parent.cfg.setProperty(N,B)}else{this.cfg.setProperty(N,B)}this.selectEvent.fire(E)}return this.getSelectedDates()},selectCell:function(C){var E=this.cells[C],O=this.cellDates[C],P=this._toDate(O),D=K.hasClass(E,this.Style.CSS_CELL_SELECTABLE);if(D){this.beforeSelectEvent.fire();var A=L.SELECTED.key;var B=this.cfg.getProperty(A);var F=O.concat();if(this._indexOfSelectedFieldArray(F)==-1){B[B.length]=F}if(this.parent){this.parent.cfg.setProperty(A,B)}else{this.cfg.setProperty(A,B)}this.renderCellStyleSelected(P,E);this.selectEvent.fire([F]);this.doCellMouseOut.call(E,null,this)}return this.getSelectedDates()},deselect:function(B){var F=this._toFieldArray(B),C=[],P=[],O=L.SELECTED.key;for(var E=0;E<F.length;++E){var A=F[E];if(!this.isDateOOB(this._toDate(A))){if(C.length===0){this.beforeDeselectEvent.fire();P=this.cfg.getProperty(O)}C.push(A);var D=this._indexOfSelectedFieldArray(A);if(D!=-1){P.splice(D,1)}}}if(C.length>0){if(this.parent){this.parent.cfg.setProperty(O,P)}else{this.cfg.setProperty(O,P)}this.deselectEvent.fire(C)}return this.getSelectedDates()},deselectCell:function(B){var E=this.cells[B],O=this.cellDates[B],D=this._indexOfSelectedFieldArray(O);var C=K.hasClass(E,this.Style.CSS_CELL_SELECTABLE);if(C){this.beforeDeselectEvent.fire();var A=this.cfg.getProperty(L.SELECTED.key),P=this._toDate(O),F=O.concat();if(D>-1){if(this.cfg.getProperty(L.PAGEDATE.key).getMonth()==P.getMonth()&&this.cfg.getProperty(L.PAGEDATE.key).getFullYear()==P.getFullYear()){K.removeClass(E,this.Style.CSS_CELL_SELECTED)}A.splice(D,1)}if(this.parent){this.parent.cfg.setProperty(L.SELECTED.key,A)}else{this.cfg.setProperty(L.SELECTED.key,A)}this.deselectEvent.fire(F)}return this.getSelectedDates()},deselectAll:function(){this.beforeDeselectEvent.fire();var A=L.SELECTED.key,D=this.cfg.getProperty(A),C=D.length,B=D.concat();if(this.parent){this.parent.cfg.setProperty(A,[])}else{this.cfg.setProperty(A,[])}if(C>0){this.deselectEvent.fire(B)}return this.getSelectedDates()},_toFieldArray:function(C){var D=[];if(C instanceof Date){D=[[C.getFullYear(),C.getMonth()+1,C.getDate()]]}else{if(I.isString(C)){D=this._parseDates(C)}else{if(I.isArray(C)){for(var B=0;B<C.length;++B){var A=C[B];D[D.length]=[A.getFullYear(),A.getMonth()+1,A.getDate()]}}}}return D},toDate:function(A){return this._toDate(A)},_toDate:function(A){if(A instanceof Date){return A}else{return J.getDate(A[0],A[1]-1,A[2])}},_fieldArraysAreEqual:function(A,B){var C=false;if(A[0]==B[0]&&A[1]==B[1]&&A[2]==B[2]){C=true}return C},_indexOfSelectedFieldArray:function(A){var B=-1,E=this.cfg.getProperty(L.SELECTED.key);for(var C=0;C<E.length;++C){var D=E[C];if(A[0]==D[0]&&A[1]==D[1]&&A[2]==D[2]){B=C;break}}return B},isDateOOM:function(A){return(A.getMonth()!=this.cfg.getProperty(L.PAGEDATE.key).getMonth())},isDateOOB:function(C){var B=this.cfg.getProperty(L.MINDATE.key),A=this.cfg.getProperty(L.MAXDATE.key),D=J;if(B){B=D.clearTime(B)}if(A){A=D.clearTime(A)}var E=new Date(C.getTime());E=D.clearTime(E);return((B&&E.getTime()<B.getTime())||(A&&E.getTime()>A.getTime()))},_parsePageDate:function(E){var B;if(E){if(E instanceof Date){B=J.findMonthStart(E)}else{var A,C,D;D=E.split(this.cfg.getProperty(L.DATE_FIELD_DELIMITER.key));A=parseInt(D[this.cfg.getProperty(L.MY_MONTH_POSITION.key)-1],10)-1;C=parseInt(D[this.cfg.getProperty(L.MY_YEAR_POSITION.key)-1],10);B=J.getDate(C,A,1)}}else{B=J.getDate(this.today.getFullYear(),this.today.getMonth(),1)}return B},onBeforeSelect:function(){if(this.cfg.getProperty(L.MULTI_SELECT.key)===false){if(this.parent){this.parent.callChildFunction("clearAllBodyCellStyles",this.Style.CSS_CELL_SELECTED);this.parent.deselectAll()}else{this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED);this.deselectAll()}}},onSelect:function(A){},onBeforeDeselect:function(){},onDeselect:function(A){},onChangePage:function(){this.render()},onRender:function(){},onReset:function(){this.render()},onClear:function(){this.render()},validate:function(){return true},_parseDate:function(B){var A=B.split(this.Locale.DATE_FIELD_DELIMITER),D;if(A.length==2){D=[A[this.Locale.MD_MONTH_POSITION-1],A[this.Locale.MD_DAY_POSITION-1]];D.type=H.MONTH_DAY}else{D=[A[this.Locale.MDY_YEAR_POSITION-1],A[this.Locale.MDY_MONTH_POSITION-1],A[this.Locale.MDY_DAY_POSITION-1]];D.type=H.DATE}for(var C=0;C<D.length;C++){D[C]=parseInt(D[C],10)}return D},_parseDates:function(S){var B=[],C=S.split(this.Locale.DATE_DELIMITER);for(var D=0;D<C.length;++D){var E=C[D];if(E.indexOf(this.Locale.DATE_RANGE_DELIMITER)!=-1){var T=E.split(this.Locale.DATE_RANGE_DELIMITER),F=this._parseDate(T[0]),A=this._parseDate(T[1]),Q=this._parseRange(F,A);B=B.concat(Q)}else{var R=this._parseDate(E);B.push(R)}}return B},_parseRange:function(E,A){var D=J.add(J.getDate(E[0],E[1]-1,E[2]),J.DAY,1),B=J.getDate(A[0],A[1]-1,A[2]),C=[];C.push(E);while(D.getTime()<=B.getTime()){C.push([D.getFullYear(),D.getMonth()+1,D.getDate()]);D=J.add(D,J.DAY,1)}return C},resetRenderers:function(){this.renderStack=this._renderStack.concat()},removeRenderers:function(){this._renderStack=[];this.renderStack=[]},clearElement:function(A){A.innerHTML="&#160;";A.className=""},addRenderer:function(E,D){var B=this._parseDates(E);for(var C=0;C<B.length;++C){var A=B[C];if(A.length==2){if(A[0] instanceof Array){this._addRenderer(H.RANGE,A,D)}else{this._addRenderer(H.MONTH_DAY,A,D)}}else{if(A.length==3){this._addRenderer(H.DATE,A,D)}}}},_addRenderer:function(C,B,D){var A=[C,B,D];this.renderStack.unshift(A);this._renderStack=this.renderStack.concat()},addMonthRenderer:function(A,B){this._addRenderer(H.MONTH,[A],B)},addWeekdayRenderer:function(A,B){this._addRenderer(H.WEEKDAY,[A],B)},clearAllBodyCellStyles:function(B){for(var A=0;A<this.cells.length;++A){K.removeClass(this.cells[A],B)}},setMonth:function(A){var C=L.PAGEDATE.key,B=this.cfg.getProperty(C);B.setMonth(parseInt(A,10));this.cfg.setProperty(C,B)},setYear:function(B){var C=L.PAGEDATE.key,A=this.cfg.getProperty(C);A.setFullYear(parseInt(B,10));this.cfg.setProperty(C,A)},getSelectedDates:function(){var C=[],D=this.cfg.getProperty(L.SELECTED.key);for(var A=0;A<D.length;++A){var B=D[A];var E=J.getDate(B[0],B[1]-1,B[2]);C.push(E)}C.sort(function(N,F){return N-F});return C},hide:function(){if(this.beforeHideEvent.fire()){this.oDomContainer.style.display="none";this.hideEvent.fire()}},show:function(){if(this.beforeShowEvent.fire()){this.oDomContainer.style.display="block";this.showEvent.fire()}},browser:(function(){var A=navigator.userAgent.toLowerCase();if(A.indexOf("opera")!=-1){return"opera"}else{if(A.indexOf("msie 7")!=-1){return"ie7"}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}}}}}})(),toString:function(){return"Calendar "+this.id},destroy:function(){if(this.beforeDestroyEvent.fire()){var A=this;if(A.navigator){A.navigator.destroy()}if(A.cfg){A.cfg.destroy()
}G.purgeElement(A.oDomContainer,true);K.removeClass(A.oDomContainer,"withtitle");K.removeClass(A.oDomContainer,A.Style.CSS_CONTAINER);K.removeClass(A.oDomContainer,A.Style.CSS_SINGLE);A.oDomContainer.innerHTML="";A.oDomContainer=null;A.cells=null;this.destroyEvent.fire()}}};YAHOO.widget.Calendar=H;YAHOO.widget.Calendar_Core=YAHOO.widget.Calendar;YAHOO.widget.Cal_Core=YAHOO.widget.Calendar})();(function(){var L=YAHOO.util.Dom,J=YAHOO.widget.DateMath,H=YAHOO.util.Event,K=YAHOO.lang,I=YAHOO.widget.Calendar;function N(A,C,B){if(arguments.length>0){this.init.apply(this,arguments)}}N._DEFAULT_CONFIG=I._DEFAULT_CONFIG;N._DEFAULT_CONFIG.PAGES={key:"pages",value:2};var M=N._DEFAULT_CONFIG;N.prototype={init:function(A,C,B){var D=this._parseArgs(arguments);A=D.id;C=D.container;B=D.config;this.oDomContainer=L.get(C);if(!this.oDomContainer.id){this.oDomContainer.id=L.generateId()}if(!A){A=this.oDomContainer.id+"_t"}this.id=A;this.containerId=this.oDomContainer.id;this.initEvents();this.initStyles();this.pages=[];L.addClass(this.oDomContainer,N.CSS_CONTAINER);L.addClass(this.oDomContainer,N.CSS_MULTI_UP);this.cfg=new YAHOO.util.Config(this);this.Options={};this.Locale={};this.setupConfig();if(B){this.cfg.applyConfig(B,true)}this.cfg.fireQueue();if(YAHOO.env.ua.opera){this.renderEvent.subscribe(this._fixWidth,this,true);this.showEvent.subscribe(this._fixWidth,this,true)}},setupConfig:function(){var A=this.cfg;A.addProperty(M.PAGES.key,{value:M.PAGES.value,validator:A.checkNumber,handler:this.configPages});A.addProperty(M.PAGEDATE.key,{value:new Date(),handler:this.configPageDate});A.addProperty(M.SELECTED.key,{value:[],handler:this.configSelected});A.addProperty(M.TITLE.key,{value:M.TITLE.value,handler:this.configTitle});A.addProperty(M.CLOSE.key,{value:M.CLOSE.value,handler:this.configClose});A.addProperty(M.IFRAME.key,{value:M.IFRAME.value,handler:this.configIframe,validator:A.checkBoolean});A.addProperty(M.MINDATE.key,{value:M.MINDATE.value,handler:this.delegateConfig});A.addProperty(M.MAXDATE.key,{value:M.MAXDATE.value,handler:this.delegateConfig});A.addProperty(M.MULTI_SELECT.key,{value:M.MULTI_SELECT.value,handler:this.delegateConfig,validator:A.checkBoolean});A.addProperty(M.START_WEEKDAY.key,{value:M.START_WEEKDAY.value,handler:this.delegateConfig,validator:A.checkNumber});A.addProperty(M.SHOW_WEEKDAYS.key,{value:M.SHOW_WEEKDAYS.value,handler:this.delegateConfig,validator:A.checkBoolean});A.addProperty(M.SHOW_WEEK_HEADER.key,{value:M.SHOW_WEEK_HEADER.value,handler:this.delegateConfig,validator:A.checkBoolean});A.addProperty(M.SHOW_WEEK_FOOTER.key,{value:M.SHOW_WEEK_FOOTER.value,handler:this.delegateConfig,validator:A.checkBoolean});A.addProperty(M.HIDE_BLANK_WEEKS.key,{value:M.HIDE_BLANK_WEEKS.value,handler:this.delegateConfig,validator:A.checkBoolean});A.addProperty(M.NAV_ARROW_LEFT.key,{value:M.NAV_ARROW_LEFT.value,handler:this.delegateConfig});A.addProperty(M.NAV_ARROW_RIGHT.key,{value:M.NAV_ARROW_RIGHT.value,handler:this.delegateConfig});A.addProperty(M.MONTHS_SHORT.key,{value:M.MONTHS_SHORT.value,handler:this.delegateConfig});A.addProperty(M.MONTHS_LONG.key,{value:M.MONTHS_LONG.value,handler:this.delegateConfig});A.addProperty(M.WEEKDAYS_1CHAR.key,{value:M.WEEKDAYS_1CHAR.value,handler:this.delegateConfig});A.addProperty(M.WEEKDAYS_SHORT.key,{value:M.WEEKDAYS_SHORT.value,handler:this.delegateConfig});A.addProperty(M.WEEKDAYS_MEDIUM.key,{value:M.WEEKDAYS_MEDIUM.value,handler:this.delegateConfig});A.addProperty(M.WEEKDAYS_LONG.key,{value:M.WEEKDAYS_LONG.value,handler:this.delegateConfig});A.addProperty(M.LOCALE_MONTHS.key,{value:M.LOCALE_MONTHS.value,handler:this.delegateConfig});A.addProperty(M.LOCALE_WEEKDAYS.key,{value:M.LOCALE_WEEKDAYS.value,handler:this.delegateConfig});A.addProperty(M.DATE_DELIMITER.key,{value:M.DATE_DELIMITER.value,handler:this.delegateConfig});A.addProperty(M.DATE_FIELD_DELIMITER.key,{value:M.DATE_FIELD_DELIMITER.value,handler:this.delegateConfig});A.addProperty(M.DATE_RANGE_DELIMITER.key,{value:M.DATE_RANGE_DELIMITER.value,handler:this.delegateConfig});A.addProperty(M.MY_MONTH_POSITION.key,{value:M.MY_MONTH_POSITION.value,handler:this.delegateConfig,validator:A.checkNumber});A.addProperty(M.MY_YEAR_POSITION.key,{value:M.MY_YEAR_POSITION.value,handler:this.delegateConfig,validator:A.checkNumber});A.addProperty(M.MD_MONTH_POSITION.key,{value:M.MD_MONTH_POSITION.value,handler:this.delegateConfig,validator:A.checkNumber});A.addProperty(M.MD_DAY_POSITION.key,{value:M.MD_DAY_POSITION.value,handler:this.delegateConfig,validator:A.checkNumber});A.addProperty(M.MDY_MONTH_POSITION.key,{value:M.MDY_MONTH_POSITION.value,handler:this.delegateConfig,validator:A.checkNumber});A.addProperty(M.MDY_DAY_POSITION.key,{value:M.MDY_DAY_POSITION.value,handler:this.delegateConfig,validator:A.checkNumber});A.addProperty(M.MDY_YEAR_POSITION.key,{value:M.MDY_YEAR_POSITION.value,handler:this.delegateConfig,validator:A.checkNumber});A.addProperty(M.MY_LABEL_MONTH_POSITION.key,{value:M.MY_LABEL_MONTH_POSITION.value,handler:this.delegateConfig,validator:A.checkNumber});A.addProperty(M.MY_LABEL_YEAR_POSITION.key,{value:M.MY_LABEL_YEAR_POSITION.value,handler:this.delegateConfig,validator:A.checkNumber});A.addProperty(M.MY_LABEL_MONTH_SUFFIX.key,{value:M.MY_LABEL_MONTH_SUFFIX.value,handler:this.delegateConfig});A.addProperty(M.MY_LABEL_YEAR_SUFFIX.key,{value:M.MY_LABEL_YEAR_SUFFIX.value,handler:this.delegateConfig});A.addProperty(M.NAV.key,{value:M.NAV.value,handler:this.configNavigator});A.addProperty(M.STRINGS.key,{value:M.STRINGS.value,handler:this.configStrings,validator:function(B){return K.isObject(B)},supercedes:M.STRINGS.supercedes})},initEvents:function(){var C=this,A="Event",F=YAHOO.util.CustomEvent;var D=function(U,G,V){for(var S=0;S<C.pages.length;++S){var T=C.pages[S];T[this.type+A].subscribe(U,G,V)}};var E=function(T,G){for(var R=0;R<C.pages.length;++R){var S=C.pages[R];S[this.type+A].unsubscribe(T,G)}};var B=I._EVENT_TYPES;C.beforeSelectEvent=new F(B.BEFORE_SELECT);C.beforeSelectEvent.subscribe=D;C.beforeSelectEvent.unsubscribe=E;C.selectEvent=new F(B.SELECT);C.selectEvent.subscribe=D;C.selectEvent.unsubscribe=E;C.beforeDeselectEvent=new F(B.BEFORE_DESELECT);C.beforeDeselectEvent.subscribe=D;C.beforeDeselectEvent.unsubscribe=E;C.deselectEvent=new F(B.DESELECT);C.deselectEvent.subscribe=D;C.deselectEvent.unsubscribe=E;C.changePageEvent=new F(B.CHANGE_PAGE);C.changePageEvent.subscribe=D;C.changePageEvent.unsubscribe=E;C.beforeRenderEvent=new F(B.BEFORE_RENDER);C.beforeRenderEvent.subscribe=D;C.beforeRenderEvent.unsubscribe=E;C.renderEvent=new F(B.RENDER);C.renderEvent.subscribe=D;C.renderEvent.unsubscribe=E;C.resetEvent=new F(B.RESET);C.resetEvent.subscribe=D;C.resetEvent.unsubscribe=E;C.clearEvent=new F(B.CLEAR);C.clearEvent.subscribe=D;C.clearEvent.unsubscribe=E;C.beforeShowEvent=new F(B.BEFORE_SHOW);C.showEvent=new F(B.SHOW);C.beforeHideEvent=new F(B.BEFORE_HIDE);C.hideEvent=new F(B.HIDE);C.beforeShowNavEvent=new F(B.BEFORE_SHOW_NAV);C.showNavEvent=new F(B.SHOW_NAV);C.beforeHideNavEvent=new F(B.BEFORE_HIDE_NAV);C.hideNavEvent=new F(B.HIDE_NAV);C.beforeRenderNavEvent=new F(B.BEFORE_RENDER_NAV);C.renderNavEvent=new F(B.RENDER_NAV);C.beforeDestroyEvent=new F(B.BEFORE_DESTROY);C.destroyEvent=new F(B.DESTROY)},configPages:function(E,F,X){var Z=F[0],b=M.PAGEDATE.key,A="_",D="groupcal",B="first-of-type",a="last-of-type";for(var c=0;c<Z;++c){var C=this.id+A+c,G=this.containerId+A+c,W=this.cfg.getConfig();W.close=false;W.title=false;W.navigator=null;var d=this.constructChild(C,G,W);var Y=d.cfg.getProperty(b);this._setMonthOnDate(Y,Y.getMonth()+c);d.cfg.setProperty(b,Y);L.removeClass(d.oDomContainer,this.Style.CSS_SINGLE);L.addClass(d.oDomContainer,D);if(c===0){L.addClass(d.oDomContainer,B)}if(c==(Z-1)){L.addClass(d.oDomContainer,a)}d.parent=this;d.index=c;this.pages[this.pages.length]=d}},configPageDate:function(B,C,E){var G=C[0],D;var F=M.PAGEDATE.key;for(var Q=0;Q<this.pages.length;++Q){var R=this.pages[Q];if(Q===0){D=R._parsePageDate(G);R.cfg.setProperty(F,D)
}else{var A=new Date(D);this._setMonthOnDate(A,A.getMonth()+Q);R.cfg.setProperty(F,A)}}},configSelected:function(C,E,A){var B=M.SELECTED.key;this.delegateConfig(C,E,A);var D=(this.pages.length>0)?this.pages[0].cfg.getProperty(B):[];this.cfg.setProperty(B,D,true)},delegateConfig:function(D,E,A){var F=E[0];var B;for(var C=0;C<this.pages.length;C++){B=this.pages[C];B.cfg.setProperty(D,F)}},setChildFunction:function(A,C){var D=this.cfg.getProperty(M.PAGES.key);for(var B=0;B<D;++B){this.pages[B][A]=C}},callChildFunction:function(F,D){var E=this.cfg.getProperty(M.PAGES.key);for(var A=0;A<E;++A){var B=this.pages[A];if(B[F]){var C=B[F];C.call(B,D)}}},constructChild:function(A,C,B){var D=document.getElementById(C);if(!D){D=document.createElement("div");D.id=C;this.oDomContainer.appendChild(D)}return new I(A,C,B)},setMonth:function(A){A=parseInt(A,10);var F;var D=M.PAGEDATE.key;for(var B=0;B<this.pages.length;++B){var C=this.pages[B];var E=C.cfg.getProperty(D);if(B===0){F=E.getFullYear()}else{E.setFullYear(F)}this._setMonthOnDate(E,A+B);C.cfg.setProperty(D,E)}},setYear:function(C){var D=M.PAGEDATE.key;C=parseInt(C,10);for(var A=0;A<this.pages.length;++A){var B=this.pages[A];var E=B.cfg.getProperty(D);if((E.getMonth()+1)==1&&A>0){C+=1}B.setYear(C)}},render:function(){this.renderHeader();for(var A=0;A<this.pages.length;++A){var B=this.pages[A];B.render()}this.renderFooter()},select:function(C){for(var A=0;A<this.pages.length;++A){var B=this.pages[A];B.select(C)}return this.getSelectedDates()},selectCell:function(C){for(var A=0;A<this.pages.length;++A){var B=this.pages[A];B.selectCell(C)}return this.getSelectedDates()},deselect:function(C){for(var A=0;A<this.pages.length;++A){var B=this.pages[A];B.deselect(C)}return this.getSelectedDates()},deselectAll:function(){for(var A=0;A<this.pages.length;++A){var B=this.pages[A];B.deselectAll()}return this.getSelectedDates()},deselectCell:function(C){for(var A=0;A<this.pages.length;++A){var B=this.pages[A];B.deselectCell(C)}return this.getSelectedDates()},reset:function(){for(var A=0;A<this.pages.length;++A){var B=this.pages[A];B.reset()}},clear:function(){for(var A=0;A<this.pages.length;++A){var B=this.pages[A];B.clear()}this.cfg.setProperty(M.SELECTED.key,[]);this.cfg.setProperty(M.PAGEDATE.key,new Date(this.pages[0].today.getTime()));this.render()},nextMonth:function(){for(var A=0;A<this.pages.length;++A){var B=this.pages[A];B.nextMonth()}},previousMonth:function(){for(var A=this.pages.length-1;A>=0;--A){var B=this.pages[A];B.previousMonth()}},nextYear:function(){for(var A=0;A<this.pages.length;++A){var B=this.pages[A];B.nextYear()}},previousYear:function(){for(var A=0;A<this.pages.length;++A){var B=this.pages[A];B.previousYear()}},getSelectedDates:function(){var C=[];var D=this.cfg.getProperty(M.SELECTED.key);for(var A=0;A<D.length;++A){var B=D[A];var E=J.getDate(B[0],B[1]-1,B[2]);C.push(E)}C.sort(function(F,G){return F-G});return C},addRenderer:function(D,C){for(var A=0;A<this.pages.length;++A){var B=this.pages[A];B.addRenderer(D,C)}},addMonthRenderer:function(A,D){for(var B=0;B<this.pages.length;++B){var C=this.pages[B];C.addMonthRenderer(A,D)}},addWeekdayRenderer:function(C,D){for(var A=0;A<this.pages.length;++A){var B=this.pages[A];B.addWeekdayRenderer(C,D)}},removeRenderers:function(){this.callChildFunction("removeRenderers")},renderHeader:function(){},renderFooter:function(){},addMonths:function(A){this.callChildFunction("addMonths",A)},subtractMonths:function(A){this.callChildFunction("subtractMonths",A)},addYears:function(A){this.callChildFunction("addYears",A)},subtractYears:function(A){this.callChildFunction("subtractYears",A)},getCalendarPage:function(B){var G=null;if(B){var F=B.getFullYear(),C=B.getMonth();var D=this.pages;for(var A=0;A<D.length;++A){var E=D[A].cfg.getProperty("pagedate");if(E.getFullYear()===F&&E.getMonth()===C){G=D[A];break}}}return G},_setMonthOnDate:function(B,A){if(YAHOO.env.ua.webkit&&YAHOO.env.ua.webkit<420&&(A<0||A>11)){var C=J.add(B,J.MONTH,A-B.getMonth());B.setTime(C.getTime())}else{B.setMonth(A)}},_fixWidth:function(){var C=0;for(var A=0;A<this.pages.length;++A){var B=this.pages[A];C+=B.oDomContainer.offsetWidth}if(C>0){this.oDomContainer.style.width=C+"px"}},toString:function(){return"CalendarGroup "+this.id},destroy:function(){if(this.beforeDestroyEvent.fire()){var A=this;if(A.navigator){A.navigator.destroy()}if(A.cfg){A.cfg.destroy()}H.purgeElement(A.oDomContainer,true);L.removeClass(A.oDomContainer,N.CSS_CONTAINER);L.removeClass(A.oDomContainer,N.CSS_MULTI_UP);for(var B=0,C=A.pages.length;B<C;B++){A.pages[B].destroy();A.pages[B]=null}A.oDomContainer.innerHTML="";A.oDomContainer=null;this.destroyEvent.fire()}}};N.CSS_CONTAINER="yui-calcontainer";N.CSS_MULTI_UP="multi";N.CSS_2UPTITLE="title";N.CSS_2UPCLOSE="close-icon";YAHOO.lang.augmentProto(N,I,"buildDayLabel","buildMonthLabel","renderOutOfBoundsDate","renderRowHeader","renderRowFooter","renderCellDefault","styleCellDefault","renderCellStyleHighlight1","renderCellStyleHighlight2","renderCellStyleHighlight3","renderCellStyleHighlight4","renderCellStyleToday","renderCellStyleSelected","renderCellNotThisMonth","renderBodyCellRestricted","initStyles","configTitle","configClose","configIframe","configStrings","configNavigator","createTitleBar","createCloseButton","removeTitleBar","removeCloseButton","hide","show","toDate","_toDate","_parseArgs","browser");YAHOO.widget.CalGrp=N;YAHOO.widget.CalendarGroup=N;YAHOO.widget.Calendar2up=function(A,C,B){this.init(A,C,B)};YAHOO.extend(YAHOO.widget.Calendar2up,N);YAHOO.widget.Cal2up=YAHOO.widget.Calendar2up})();YAHOO.widget.CalendarNavigator=function(B){this.init(B)};(function(){var B=YAHOO.widget.CalendarNavigator;B.CLASSES={NAV:"yui-cal-nav",NAV_VISIBLE:"yui-cal-nav-visible",MASK:"yui-cal-nav-mask",YEAR:"yui-cal-nav-y",MONTH:"yui-cal-nav-m",BUTTONS:"yui-cal-nav-b",BUTTON:"yui-cal-nav-btn",ERROR:"yui-cal-nav-e",YEAR_CTRL:"yui-cal-nav-yc",MONTH_CTRL:"yui-cal-nav-mc",INVALID:"yui-invalid",DEFAULT:"yui-default"};B._DEFAULT_CFG={strings:{month:"Month",year:"Year",submit:"Okay",cancel:"Cancel",invalidYear:"Year needs to be a number"},monthFormat:YAHOO.widget.Calendar.LONG,initialFocus:"year"};B.ID_SUFFIX="_nav";B.MONTH_SUFFIX="_month";B.YEAR_SUFFIX="_year";B.ERROR_SUFFIX="_error";B.CANCEL_SUFFIX="_cancel";B.SUBMIT_SUFFIX="_submit";B.YR_MAX_DIGITS=4;B.YR_MINOR_INC=1;B.YR_MAJOR_INC=10;B.UPDATE_DELAY=50;B.YR_PATTERN=/^\d+$/;B.TRIM=/^\s*(.*?)\s*$/})();YAHOO.widget.CalendarNavigator.prototype={id:null,cal:null,navEl:null,maskEl:null,yearEl:null,monthEl:null,errorEl:null,submitEl:null,cancelEl:null,firstCtrl:null,lastCtrl:null,_doc:null,_year:null,_month:0,__rendered:false,init:function(D){var E=D.oDomContainer;this.cal=D;this.id=E.id+YAHOO.widget.CalendarNavigator.ID_SUFFIX;this._doc=E.ownerDocument;var F=YAHOO.env.ua.ie;this.__isIEQuirks=(F&&((F<=6)||(F===7&&this._doc.compatMode=="BackCompat")))},show:function(){var B=YAHOO.widget.CalendarNavigator.CLASSES;if(this.cal.beforeShowNavEvent.fire()){if(!this.__rendered){this.render()}this.clearErrors();this._updateMonthUI();this._updateYearUI();this._show(this.navEl,true);this.setInitialFocus();this.showMask();YAHOO.util.Dom.addClass(this.cal.oDomContainer,B.NAV_VISIBLE);this.cal.showNavEvent.fire()}},hide:function(){var B=YAHOO.widget.CalendarNavigator.CLASSES;if(this.cal.beforeHideNavEvent.fire()){this._show(this.navEl,false);this.hideMask();YAHOO.util.Dom.removeClass(this.cal.oDomContainer,B.NAV_VISIBLE);this.cal.hideNavEvent.fire()}},showMask:function(){this._show(this.maskEl,true);if(this.__isIEQuirks){this._syncMask()}},hideMask:function(){this._show(this.maskEl,false)},getMonth:function(){return this._month},getYear:function(){return this._year},setMonth:function(B){if(B>=0&&B<12){this._month=B}this._updateMonthUI()},setYear:function(D){var C=YAHOO.widget.CalendarNavigator.YR_PATTERN;if(YAHOO.lang.isNumber(D)&&C.test(D+"")){this._year=D}this._updateYearUI()},render:function(){this.cal.beforeRenderNavEvent.fire();if(!this.__rendered){this.createNav();
this.createMask();this.applyListeners();this.__rendered=true}this.cal.renderNavEvent.fire()},createNav:function(){var H=YAHOO.widget.CalendarNavigator;var G=this._doc;var F=G.createElement("div");F.className=H.CLASSES.NAV;var E=this.renderNavContents([]);F.innerHTML=E.join("");this.cal.oDomContainer.appendChild(F);this.navEl=F;this.yearEl=G.getElementById(this.id+H.YEAR_SUFFIX);this.monthEl=G.getElementById(this.id+H.MONTH_SUFFIX);this.errorEl=G.getElementById(this.id+H.ERROR_SUFFIX);this.submitEl=G.getElementById(this.id+H.SUBMIT_SUFFIX);this.cancelEl=G.getElementById(this.id+H.CANCEL_SUFFIX);if(YAHOO.env.ua.gecko&&this.yearEl&&this.yearEl.type=="text"){this.yearEl.setAttribute("autocomplete","off")}this._setFirstLastElements()},createMask:function(){var D=YAHOO.widget.CalendarNavigator.CLASSES;var C=this._doc.createElement("div");C.className=D.MASK;this.cal.oDomContainer.appendChild(C);this.maskEl=C},_syncMask:function(){var D=this.cal.oDomContainer;if(D&&this.maskEl){var C=YAHOO.util.Dom.getRegion(D);YAHOO.util.Dom.setStyle(this.maskEl,"width",C.right-C.left+"px");YAHOO.util.Dom.setStyle(this.maskEl,"height",C.bottom-C.top+"px")}},renderNavContents:function(C){var G=YAHOO.widget.CalendarNavigator,F=G.CLASSES,H=C;H[H.length]='<div class="'+F.MONTH+'">';this.renderMonth(H);H[H.length]="</div>";H[H.length]='<div class="'+F.YEAR+'">';this.renderYear(H);H[H.length]="</div>";H[H.length]='<div class="'+F.BUTTONS+'">';this.renderButtons(H);H[H.length]="</div>";H[H.length]='<div class="'+F.ERROR+'" id="'+this.id+G.ERROR_SUFFIX+'"></div>';return H},renderMonth:function(O){var L=YAHOO.widget.CalendarNavigator,K=L.CLASSES;var J=this.id+L.MONTH_SUFFIX,M=this.__getCfg("monthFormat"),C=this.cal.cfg.getProperty((M==YAHOO.widget.Calendar.SHORT)?"MONTHS_SHORT":"MONTHS_LONG"),N=O;if(C&&C.length>0){N[N.length]='<label for="'+J+'">';N[N.length]=this.__getCfg("month",true);N[N.length]="</label>";N[N.length]='<select name="'+J+'" id="'+J+'" class="'+K.MONTH_CTRL+'">';for(var P=0;P<C.length;P++){N[N.length]='<option value="'+P+'">';N[N.length]=C[P];N[N.length]="</option>"}N[N.length]="</select>"}return N},renderYear:function(L){var J=YAHOO.widget.CalendarNavigator,I=J.CLASSES;var H=this.id+J.YEAR_SUFFIX,C=J.YR_MAX_DIGITS,K=L;K[K.length]='<label for="'+H+'">';K[K.length]=this.__getCfg("year",true);K[K.length]="</label>";K[K.length]='<input type="text" name="'+H+'" id="'+H+'" class="'+I.YEAR_CTRL+'" maxlength="'+C+'"/>';return K},renderButtons:function(C){var E=YAHOO.widget.CalendarNavigator.CLASSES;var F=C;F[F.length]='<span class="'+E.BUTTON+" "+E.DEFAULT+'">';F[F.length]='<button type="button" id="'+this.id+'_submit">';F[F.length]=this.__getCfg("submit",true);F[F.length]="</button>";F[F.length]="</span>";F[F.length]='<span class="'+E.BUTTON+'">';F[F.length]='<button type="button" id="'+this.id+'_cancel">';F[F.length]=this.__getCfg("cancel",true);F[F.length]="</button>";F[F.length]="</span>";return F},applyListeners:function(){var F=YAHOO.util.Event;function D(){if(this.validate()){this.setYear(this._getYearFromUI())}}function E(){this.setMonth(this._getMonthFromUI())}F.on(this.submitEl,"click",this.submit,this,true);F.on(this.cancelEl,"click",this.cancel,this,true);F.on(this.yearEl,"blur",D,this,true);F.on(this.monthEl,"change",E,this,true);if(this.__isIEQuirks){YAHOO.util.Event.on(this.cal.oDomContainer,"resize",this._syncMask,this,true)}this.applyKeyListeners()},purgeListeners:function(){var B=YAHOO.util.Event;B.removeListener(this.submitEl,"click",this.submit);B.removeListener(this.cancelEl,"click",this.cancel);B.removeListener(this.yearEl,"blur");B.removeListener(this.monthEl,"change");if(this.__isIEQuirks){B.removeListener(this.cal.oDomContainer,"resize",this._syncMask)}this.purgeKeyListeners()},applyKeyListeners:function(){var F=YAHOO.util.Event,E=YAHOO.env.ua;var G=(E.ie||E.webkit)?"keydown":"keypress";var H=(E.ie||E.opera||E.webkit)?"keydown":"keypress";F.on(this.yearEl,"keypress",this._handleEnterKey,this,true);F.on(this.yearEl,G,this._handleDirectionKeys,this,true);F.on(this.lastCtrl,H,this._handleTabKey,this,true);F.on(this.firstCtrl,H,this._handleShiftTabKey,this,true)},purgeKeyListeners:function(){var F=YAHOO.util.Event,E=YAHOO.env.ua;var G=(E.ie||E.webkit)?"keydown":"keypress";var H=(E.ie||E.opera||E.webkit)?"keydown":"keypress";F.removeListener(this.yearEl,"keypress",this._handleEnterKey);F.removeListener(this.yearEl,G,this._handleDirectionKeys);F.removeListener(this.lastCtrl,H,this._handleTabKey);F.removeListener(this.firstCtrl,H,this._handleShiftTabKey)},submit:function(){if(this.validate()){this.hide();this.setMonth(this._getMonthFromUI());this.setYear(this._getYearFromUI());var F=this.cal;var D=YAHOO.widget.CalendarNavigator.UPDATE_DELAY;if(D>0){var E=this;window.setTimeout(function(){E._update(F)},D)}else{this._update(F)}}},_update:function(B){B.setYear(this.getYear());B.setMonth(this.getMonth());B.render()},cancel:function(){this.hide()},validate:function(){if(this._getYearFromUI()!==null){this.clearErrors();return true}else{this.setYearError();this.setError(this.__getCfg("invalidYear",true));return false}},setError:function(B){if(this.errorEl){this.errorEl.innerHTML=B;this._show(this.errorEl,true)}},clearError:function(){if(this.errorEl){this.errorEl.innerHTML="";this._show(this.errorEl,false)}},setYearError:function(){YAHOO.util.Dom.addClass(this.yearEl,YAHOO.widget.CalendarNavigator.CLASSES.INVALID)},clearYearError:function(){YAHOO.util.Dom.removeClass(this.yearEl,YAHOO.widget.CalendarNavigator.CLASSES.INVALID)},clearErrors:function(){this.clearError();this.clearYearError()},setInitialFocus:function(){var E=this.submitEl,G=this.__getCfg("initialFocus");if(G&&G.toLowerCase){G=G.toLowerCase();if(G=="year"){E=this.yearEl;try{this.yearEl.select()}catch(H){}}else{if(G=="month"){E=this.monthEl}}}if(E&&YAHOO.lang.isFunction(E.focus)){try{E.focus()}catch(F){}}},erase:function(){if(this.__rendered){this.purgeListeners();this.yearEl=null;this.monthEl=null;this.errorEl=null;this.submitEl=null;this.cancelEl=null;this.firstCtrl=null;this.lastCtrl=null;if(this.navEl){this.navEl.innerHTML=""}var D=this.navEl.parentNode;if(D){D.removeChild(this.navEl)}this.navEl=null;var C=this.maskEl.parentNode;if(C){C.removeChild(this.maskEl)}this.maskEl=null;this.__rendered=false}},destroy:function(){this.erase();this._doc=null;this.cal=null;this.id=null},_show:function(D,C){if(D){YAHOO.util.Dom.setStyle(D,"display",(C)?"block":"none")}},_getMonthFromUI:function(){if(this.monthEl){return this.monthEl.selectedIndex}else{return 0}},_getYearFromUI:function(){var F=YAHOO.widget.CalendarNavigator;var D=null;if(this.yearEl){var E=this.yearEl.value;E=E.replace(F.TRIM,"$1");if(F.YR_PATTERN.test(E)){D=parseInt(E,10)}}return D},_updateYearUI:function(){if(this.yearEl&&this._year!==null){this.yearEl.value=this._year}},_updateMonthUI:function(){if(this.monthEl){this.monthEl.selectedIndex=this._month}},_setFirstLastElements:function(){this.firstCtrl=this.monthEl;this.lastCtrl=this.cancelEl;if(this.__isMac){if(YAHOO.env.ua.webkit&&YAHOO.env.ua.webkit<420){this.firstCtrl=this.monthEl;this.lastCtrl=this.yearEl}if(YAHOO.env.ua.gecko){this.firstCtrl=this.yearEl;this.lastCtrl=this.yearEl}}},_handleEnterKey:function(D){var C=YAHOO.util.KeyListener.KEY;if(YAHOO.util.Event.getCharCode(D)==C.ENTER){YAHOO.util.Event.preventDefault(D);this.submit()}},_handleDirectionKeys:function(I){var J=YAHOO.util.Event,E=YAHOO.util.KeyListener.KEY,L=YAHOO.widget.CalendarNavigator;var K=(this.yearEl.value)?parseInt(this.yearEl.value,10):null;if(isFinite(K)){var N=false;switch(J.getCharCode(I)){case E.UP:this.yearEl.value=K+L.YR_MINOR_INC;N=true;break;case E.DOWN:this.yearEl.value=Math.max(K-L.YR_MINOR_INC,0);N=true;break;case E.PAGE_UP:this.yearEl.value=K+L.YR_MAJOR_INC;N=true;break;case E.PAGE_DOWN:this.yearEl.value=Math.max(K-L.YR_MAJOR_INC,0);N=true;break;default:break}if(N){J.preventDefault(I);try{this.yearEl.select()}catch(M){}}}},_handleTabKey:function(F){var G=YAHOO.util.Event,E=YAHOO.util.KeyListener.KEY;if(G.getCharCode(F)==E.TAB&&!F.shiftKey){try{G.preventDefault(F);
this.firstCtrl.focus()}catch(H){}}},_handleShiftTabKey:function(F){var G=YAHOO.util.Event,E=YAHOO.util.KeyListener.KEY;if(F.shiftKey&&G.getCharCode(F)==E.TAB){try{G.preventDefault(F);this.lastCtrl.focus()}catch(H){}}},__getCfg:function(F,H){var G=YAHOO.widget.CalendarNavigator._DEFAULT_CFG;var E=this.cal.cfg.getProperty("navigator");if(H){return(E!==true&&E.strings&&E.strings[F])?E.strings[F]:G.strings[F]}else{return(E!==true&&E[F])?E[F]:G[F]}},__isMac:(navigator.userAgent.toLowerCase().indexOf("macintosh")!=-1)};YAHOO.register("calendar",YAHOO.widget.Calendar,{version:"2.6.0",build:"1321"});
