/*
* Copyright � 1999-2010 TeaLeaf Technology, Inc.  
* All rights reserved.
*
* THIS SOFTWARE IS PROVIDED BY TEALEAF ``AS IS'' 
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, 
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED.  
* IN NO EVENT SHALL TEALEAF BE LIABLE FOR ANY DIRECT, INDIRECT, 
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
* THE POSSIBILITY OF SUCH DAMAGE.
*
* @fileoverview 
* This is the configuration for the main UI Client Event Capture JavaScript.
* It contains versioning information and the the flag thant turns 
* the JavaScript into a true SDK.  
*
* @version 2010.12.22.1
*
*/
if (typeof TeaLeaf === "undefined") {
  TeaLeaf = {};
  TeaLeaf.Private = {};
  TeaLeaf.tlStartLoad = new Date();

  if (!TeaLeaf.Configuration) {
    TeaLeaf.Configuration = {
      "tlversion" :                 "2010.12.22.1",
      "tlinit" :                    false,
      "tlSDK" :                     false,

      "tlSetGUID":                  false,
      /* Sample GUID cookie config (only used when tlSetGUID is true) */
      "tlGUIDCookie":               {
                                      name: "TLGUID",
                                      // The following are optional
                                      valueLength: 32,
                                      valueSet: "0123456789ABCDEF",
                                      path: "",
                                      domain: "",
                                      expires: 0,    // minutes; 0 implies a session cookie
                                      secure: false
                                    },

      "tlurl":                      "/tealeaf.jsp",
      "tlsecureurl":                "/tealeaf.jsp",
      "xhrAsync":                   true,

      /* Cross-domain configuration (if any) */
      "xd_CommonDomain":            "",
      "xd_iframeID":                "",
      "xd_iframeSrcURL":            "",
      "xd_iframeSrcURLSecure":      ""
    };
  }
}
/*
* Copyright � 1999-2010 TeaLeaf Technology, Inc.  
* All rights reserved.
*
* THIS SOFTWARE IS PROVIDED BY TEALEAF ``AS IS'' 
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, 
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED.  
* IN NO EVENT SHALL TEALEAF BE LIABLE FOR ANY DIRECT, INDIRECT, 
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
* THE POSSIBILITY OF SUCH DAMAGE.
*
* @fileoverview 
* Configuration file for TeaLeafEvent.js   
*
* @version 2010.12.22.1
*
*/

if (typeof TeaLeaf !== "undefined" &&
    ((typeof TeaLeaf.replay === "function") ? !TeaLeaf.replay() : !TeaLeaf.replay) &&
    !TeaLeaf.Event)
{
	//	Constructor for the Event
    TeaLeaf.Event = function(type, subtype, source) {    
	    this.date = new Date();
	    if( subtype ) {
		    this.EventType    = type;
		    this.EventSubType = subtype;
		    if( source ) {
			    this.EventSource = source;
		    }
		    else{
		        //default is empty string
		        this.EventSource ="";
		    }
	    }
	    else {
		    this.EventType    = "CUSTOM";
		    this.EventSubType = type;
	    }
    }
    
   if(typeof TeaLeaf.Event.Configuration == "undefined"){  
        TeaLeaf.Event.Configuration = {
            "tlinit"                    : false,
            "tlqueueevents"             : true,
            "tlqueueeventstimer"        : 300000,
            "tlqueueeventsmaxsz"        : 12492,
            "tlshowexceptions"          : false,
            "tleventcount"              : 0,
            "tlexceptioncount"          : 0,
            "tlpageid"                  : "", 
            "tlinitflag"                : false,
            "tlbeforeunloadflag"        : false,
            "tlusetopqueue"             : false,
            "tllastdwelltime"           : "",
            "tlidoflastvisitedcontrol"  : "",
            "tleventunloadflag"         : true,
            "tleventbeforeunloadflag"   : true,
            "tlcatcherrors"             : true,
            /* tlcatchpopups
             * Set this to 'true' if you want the SDK to report on window.open() status.
             * Used to determine if popup windows were blocked on the client.
             */
            "tlcatchpopups"             : false,
            /* tlCatchAlerts
             * Set this to 'true' if you want the SDK to report on window.alert(),
             * window.confirm() and window.prompt() calls.
             */
            "tlCatchAlerts"             : false,
            "tlignoresendfailure"       : true,
            "tlasync"                   : true,
            "tlvisitorder"              : "",
            "t1970"                     : 0,
            "tlXP"                      : "",
		    "tlXPCount"                 : 0,
		    "tlXPTable"                 : "",
		    "tlmaxeventcount"           : 300,
		    "tlmaxeventexception"       : 10,


            tlResolution:[
                {"width": 799,       "height": 599,     "type": 0,  "displayText": "small"},
                {"width": 800,       "height": 600,     "type": 1,  "displayText": "800x600"},
                {"width": 1024,      "height": 760,     "type": 2,  "displayText": "1024x760"},
                {"width": 1280,      "height": 1024,    "type": 3,  "displayText": "1280x1024"},
                {"width": 1000000,   "height": 1000000, "type": 4,  "displayText": "large"}
            ],		             
            //This is the list of HTTP headers that are static and are
		    tlHTTPRequestHeadersSet:[
		        {"tlreqhttpheadername": "Content-Type",                     "tlsethttpheader": true,    "tlreqhttpheadervalue": "TeaLeaf.Event.tlGetContentType()"},
			    {"tlreqhttpheadername": "X-TeaLeafType",                    "tlsethttpheader": true,    "tlreqhttpheadervalue": "TeaLeaf.Event.tlEventType()"},
			    {"tlreqhttpheadername": "X-TeaLeafSubType",                 "tlsethttpheader": true,    "tlreqhttpheadervalue": "TeaLeaf.Event.tlEventSubType()"},
			    {"tlreqhttpheadername": "X-TeaLeaf-Page-Url",               "tlsethttpheader": true,    "tlreqhttpheadervalue": "TeaLeaf.Event.tlGetUrlPath()"},
                {"tlreqhttpheadername": "X-TeaLeaf-UIEventCapture-Version", "tlsethttpheader": true,    "tlreqhttpheadervalue": "TeaLeaf.Event.tlGetJSVersion()"}
		    ],   
		    //This is the list of HTTP headers that have the eval value at the time of POST
		    tlHTTPRequestHeadersEvalInit:[
			    {"tlreqhttpheadername": "X-TeaLeaf-Screen-Res",         "tlsethttpheader": true,    "tlreqhttpheadervalue": "TeaLeaf.Event.tlResolutionType(screen.width ,screen.height)"},
			    {"tlreqhttpheadername": "X-TeaLeaf-Browser-Res",        "tlsethttpheader": true,    "tlreqhttpheadervalue": "TeaLeaf.Event.tlResolutionTypeBrowser()"},
			    {"tlreqhttpheadername": "X-TeaLeaf-Page-Render",        "tlsethttpheader": true,    "tlreqhttpheadervalue": "TeaLeaf.Event.tlGetRenderTime()"},
			    {"tlreqhttpheadername": "X-TeaLeaf-Page-Objects",       "tlsethttpheader": true,    "tlreqhttpheadervalue": "TeaLeaf.Event.tlGetElementCount(\"object\")"},
			    {"tlreqhttpheadername": "X-TeaLeaf-Page-Img-Fail",      "tlsethttpheader": true,    "tlreqhttpheadervalue": "TeaLeaf.Event.tlBadImageCount()"}
		    ],  
		    tlHTTPRequestHeadersEvalBeforeUnload:[
			    {"tlreqhttpheadername": "X-TeaLeaf-Page-Cui-Events",    "tlsethttpheader": true,    "tlreqhttpheadervalue": "TeaLeaf.Event.tlGetEventCount()"},
			    {"tlreqhttpheadername": "X-TeaLeaf-Page-Cui-Bytes",     "tlsethttpheader": true,    "tlreqhttpheadervalue": "TeaLeaf.Request.GetTotalDataLength()"},
			    {"tlreqhttpheadername": "X-TeaLeaf-Page-Cui-Exceptions","tlsethttpheader": true,    "tlreqhttpheadervalue": "TeaLeaf.Event.tlGetExceptionCount()"},
			    {"tlreqhttpheadername": "X-TeaLeaf-Alert-Count",        "tlsethttpheader": true,    "tlreqhttpheadervalue": "TeaLeaf.Event.tlGetAlertCount()"},
			    {"tlreqhttpheadername": "X-TeaLeaf-Page-Dwell",         "tlsethttpheader": true,    "tlreqhttpheadervalue": "TeaLeaf.Event.tlGetDwellTime()"},
			    {"tlreqhttpheadername": "X-TeaLeaf-Page-Last-Field",    "tlsethttpheader": true,    "tlreqhttpheadervalue": "TeaLeaf.Event.tlGetLastVisitedElementID()"},   
			    {"tlreqhttpheadername": "X-TeaLeaf-Visit-Order",        "tlsethttpheader": true,    "tlreqhttpheadervalue": "TeaLeaf.Event.tlGetVisitOrder()"}   
		    ]   
        };  
    }   
}

/*
* Copyright � 1999-2010 TeaLeaf Technology, Inc.  
* All rights reserved.
*
* THIS SOFTWARE IS PROVIDED BY TEALEAF ``AS IS'' 
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, 
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED.  
* IN NO EVENT SHALL TEALEAF BE LIABLE FOR ANY DIRECT, INDIRECT, 
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
* THE POSSIBILITY OF SUCH DAMAGE.
*
* @fileoverview 
* This is the configuration for TeaLeafEnv.js  
*
* @version 2010.12.22.1
*
*/
if (typeof TeaLeaf !== "undefined" &&
    ((typeof TeaLeaf.replay === "function") ? !TeaLeaf.replay() : !TeaLeaf.replay) &&
    !TeaLeaf.Env)
{
	TeaLeaf.Env = {};

    if(typeof TeaLeaf.Env.Configuration == "undefined"){
        TeaLeaf.Env.Configuration = {
            "tlinit" : false,
            "tlinitpost" : true,
            
            tlPlugins : [
		        {"tlIEplugin": "ShockwaveFlash.ShockwaveFlash.1",         "tlpluginname": "Shockwave Flash",      "tlversion":"1.0",    "tlenable": false},    
		        {"tlIEplugin": "MediaPlayer.MediaPlayer.1",               "tlpluginname": "Windows Media Player", "tlversion":"",    "tlenable": false},
		        {"tlIEplugin": "PDF.PdfCtrl.1",                           "tlpluginname": "Adobe Acrobat",        "tlversion":"",     "tlenable": false},
		        {"tlIEplugin": "QuickTimeCheckObject.QuickTimeCheck.1",   "tlpluginname": "QuickTime",            "tlversion":"",     "tlenable": false}
			]
        };
    }
}
/*
* Copyright � 1999-2010 TeaLeaf Technology, Inc.  
* All rights reserved.
*
* THIS SOFTWARE IS PROVIDED BY TEALEAF ``AS IS'' 
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, 
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED.  
* IN NO EVENT SHALL TEALEAF BE LIABLE FOR ANY DIRECT, INDIRECT, 
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
* THE POSSIBILITY OF SUCH DAMAGE.
*
* @fileoverview 
* This is the configuration file for capturing Client Events that 
* happen on the rendered DOM. It proviedes the capabilty to block fields
* and turn off an on events on the Window and Document object. 
*
* @version 2010.12.22.1
*
*/
if (typeof TeaLeaf !== "undefined" &&
    ((typeof TeaLeaf.replay === "function") ? !TeaLeaf.replay() : !TeaLeaf.replay) &&
    !TeaLeaf.Client)
{
    TeaLeaf.Client = {};

    if(typeof TeaLeaf.Client.Configuration == "undefined"){
	    TeaLeaf.Client.Configuration = {
	        "tlinit" : false,
		    "tlpassword"         : 1,		// 1 no capture, 2 don't send value
		    "tlsendfocus"        : false,
		    "tlsendblur"         : false,
		    "tlunloadflag"       : true,
		    "tlactiontype"       : "No Submit",
		    "tlbeforeunloadflag" : true,
		    "tlcontrolsattached" : false,
		    "tlassignTLID"       : false,   
		    "tlscanupdate"       : 0,
		    "tlIEhref"           : false,
		    "tlEnableAttr"       : false,
		    "tlDiscardInvalidXPath"  : false,
		    "tlUniqueIDCheckEnabled" : false,

		    //	tlScheduledScan controls whether or not to periodically scan the DOM
		    //	for changes (and tag the appropriate nodes) at the interval defined by
		    //	tlscanupdate
		    tlScheduledScan : false,

		    //  tlExcludeTags controls whether to explicitly exclude or include the
		    //  tags listed in tlNodeTags when attaching to descendent elements using
		    //  TeaLeaf.Client.tlProcessNode(). See TeaLeaf.Client.tlTagNameAllowed()
		    tlExcludeTags : true,

		    //	If events are being cancelled, the document object will not catch events
		    //	since they are not being bubbled up. In order to combat this, we can attach
		    //	to every relevant item (see tlExcludeTags and tlNodeTags), except this may
		    //	result in duplicate events being captured.
		    tlUniversalAttach : false,

		    //  Option to store the xml of queued events on a page unload in a cookie, so
		    //  that it may be sent up with the next page's events. Since this may interfere
		    //  with the existing cookies on the site, this is disabled by default.
		    tlStoreQueueInCookie : false,

        //	This is where input fields can be globally blocked.  A few examples are shown
        //	below. Add or remove fields as appropriate. The parameters are
        //    name and/or id: JavaScript regular expression to match against the name and/or id of the field
        //    caseinsensitive (optional): the above regex match will be case insensitive.
        //    exclude (optional): If true, no value is sent (equivalent to setting the EmptyMask)
        //    mask: Callback function used to mask the element value. This can be a 3rd party custom function.
        //          The following masking functions are provided by default:
        //            PreserveMask(): Preserves the character type and value length according to the tlPrivacyMask setting below.
        //            BasicMask(): Returns a fixed string "XXXXXX" regardless of the element value.
        //            EmptyMask(): Returns the empty string "" regardless of the element value.
        //
        //  Note: The block rules are applied in the order they appear in the tlFieldBlock array.
        tlFieldBlock:[
			    {"name": "password|new_pass|cvn|cardNum|creditcard|pwd", "caseinsensitive": true,  "exclude": false, "mask": function () { return TeaLeaf.Client.PreserveMask.apply(this, arguments); }}
			],

	

	      // The mask used by the PreserveMask() masking function.
		    tlPrivacyMask: {
		      "upperChar":   "X",
		      "lowerChar":   "x",
		      "numericChar": "9",
		      "symbolChar":  "#"
		    },
		
		    //	This is the list of events we catch off of the window object
		    tlWindowHandlers:[
			    {"domevent": "resize",          "load": false,  "tlhandler": "TeaLeaf.Client.tlQueueResize"},
			    {"domevent": "focus",           "load": true,  "tlhandler": "TeaLeaf.Client.tlSetFocusTime"},
			    {"domevent": "help",            "load": true,  "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    {"domevent": "scroll",          "load": false,  "tlhandler": "TeaLeaf.Client.tlQueueScroll"},
			    {"domevent": "beforeprint",     "load": false,  "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    {"domevent": "afterprint",      "load": false,  "tlhandler": "TeaLeaf.Client.tlAddEvent"}
		    ],

		    //	This is the list of events we catch off of the document object
		    tlDocumentHandlers:[
			    {"domevent": "click",        "load": true,     "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    {"domevent": "dblclick",     "load": true,     "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    {"domevent": "keyup",        "load": true,     "tlhandler": "TeaLeaf.Client.tlQueueKey"},
			    {"domevent": "mousedown",    "load": true,     "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    {"domevent": "mouseup",      "load": false,     "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    {"domevent": "mouseover",    "load": false,     "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    {"domevent": "mouseout",      "load": false,     "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    //	This event is only caught once and turned off.  This is used to 
			    //	detect robots, since a robot will never have mouse movement.
			    {"domevent": "mousemove",    "load": false,     "tlhandler": "TeaLeaf.Client.tlUserMovement"}
		    ],
		    
		    tlSingleAttach:[
			    {"domelementID": "",    "domevent": "mousedown",    "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    {"domelementID": "",    "domevent": "mouseup",      "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    {"domelementID": "",    "domevent": "mouseover",    "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    {"domelementID": "",    "domevent": "mouseout",     "tlhandler": "TeaLeaf.Client.tlAddEvent"}
		    ],

            tlAttributeCapture:[
                {"tltagname":"a", "tlattributename":"href", "tlevent":"click"},
                {"tltagname":"button", "tlattributename":"value", "tlevent":"click"}
            ],
            

            tlIDBlackList:[
                /* Insert blacklist strings (JavaScript regular expressions) as a comma
                 * separated list here. Leave this empty for default behavior.
                 *
                 * WARNING: Use the blacklist with caution as any id that is matched by
                 * the blacklist will be ignored!
                 * Example:
                "random",
                "jQuery",
                "^gwt",
                "^GWT"
                */
            ],

            tlIDWhiteList:[
                /* Insert whitelist strings (JavaScript regular expressions) as a comma
                 * separated list here. Leave this empty for default behavior.
                 *
                 * WARNING: Use the whitelist with caution as any id that is NOT matched by
                 * the whitelist will be ignored!
                 * Example:
                "static$",
                "^unique"
                */
            ],

		    /*  tlNodeTags by default includes a list of tag names that are "unimportant"
		     *  or not rendered. The associated true/false value is used in conjunction with
		     *  tlExcludeTags - e.g. if tlExcludeTags is true and a node tag is true, it will
		     *  be excluded; if tlExcludeTags is true and a node tag is false, the tag will be
		     *  included. Similarly if tlExcludeTags is false (meaning to explicitly include the
		     *  listed node tags, those with "true" with be excluded.
		     */
		    tlNodeTags : {
		        "APPLET"    : true,
		        "ATTRIBUTE" : true,
			"B"	    : true,
		        "BASE"      : true,
			"BODY"	    : true,
		        "BR"        : true,
		        "CENTER"    : true,
		        "COL"       : true,
		        "COLGROUP"  : true,
		        "COMMENT"   : true,
			"DIV"	    : true,
		        "DEFAULT"   : true,
		        "DEL"       : true,
		        "EVENT"     : true,
		        "FONT"      : true,
			"FORM"	    : true,
			"HEAD"	    : true,
		        "HISTORY"   : true,
		        "HR"        : true,
		        "HTML"      : true,
		        "I"         : true,
		        "INS"       : true,
		        "LINK"      : true,
		        "MAP"       : true,
		        "META"      : true,
		        "NAMESPACE" : true,
		        "NAVIGGATOR" : true,
		        "NOBR"      : true,
		        "OPTION"    : true,
		        "P"         : true,
		        "PARAM"     : true,
		        "S"         : true,
		        "SCRIPT"    : true,
		        "SMALL"     : true,
		        "STRIKE"    : true,
		        "STRONG"    : true,
		        "STYLE"     : true,
		        "SUB"       : true,
		        "SUP"       : true,
		        "TH"        : true,
		        "TITLE"     : true,
		        "THEAD"     : true,
		        "TFOOT"     : true,
		        "TR"        : true,
		        "U"         : true
		    },

		    /*  tlSpecialChildNodeTags represents tags with a special
		     *  situation where the event that fires is attached to a
		     *  non-visual item that is inside the actual UI element.
                 *  Example would be a menu with a <nobr> tag inside to
                 *  keep the visual text of the menu on one line. The <nobr>
                 *  fires the event when we really want the parent menu.
		     */

		    tlSpecialChildNodeTags : {
		        "NOBR" : true,
		        "P"    : true
		    }
	    };
	    	
	    TeaLeaf.Client.Configuration.tlIdCounter = [];
    }
}

if(typeof TeaLeaf!=="undefined"&&((typeof TeaLeaf.replay==="function")?!TeaLeaf.replay():!TeaLeaf.replay)&&TeaLeaf.Configuration&&!TeaLeaf.Configuration.tlinit){TeaLeaf.Configuration.tlinit=true;if(!TeaLeaf.tlBrowser){TeaLeaf.tlBrowser={UNKNOWN:true}}if(!TeaLeaf.$C){TeaLeaf.$C=function(a){return a}}if(!Array.prototype.push){Array.prototype.stackEnd=0;Array.prototype.push=function(a){this[this.stackEnd]=a;this.stackEnd++}}if(!Array.prototype.pop){Array.prototype.pop=function(a){this.stackEnd--;return this[this.stackEnd]}}TeaLeaf.XHRFactory=(function(){var a;a=60000;function b(c){if((c>=200&&c<300)||c===304){return true}return false}return{createXHRObject:function(){var d,c,g;c=[function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP.6.0")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}];for(d=0;d<c.length;d++){try{g=c[d]()}catch(f){continue}if(g){this.createXHRObject=c[d];return g}}return null},xhrRequest:function(h,l,c,j,o,m,n){var f,d;if(!h||!l){return null}h=h.toUpperCase();if(!n){n=this.createXHRObject()}if(!n){return null}if(o){n.onreadystatechange=function(){var p,r;try{switch(n.readyState){case 0:break;case 1:break;case 2:if(m&&m.loaded){try{p=n.status;r=n.statusText}catch(q){if(!p){p=0}if(!r){r="None"}}finally{m.loaded(p,r)}}break;case 3:break;case 4:if(b(n.status)){if(m&&m.success){m.success(n.responseText,n.responseXML)}}else{if(m&&m.failure){m.failure(n.status,n.statusText)}}break;default:break}}catch(q){}}}n.open(h,l,o);if(c){for(f=0;f<c.length;f++){n.setRequestHeader(c[f].name,c[f].value)}}if(h!=="POST"||!j){j=null}n.send(j);try{d=setTimeout(function(){TeaLeaf.XHRFactory.deleteXHRObj(n)},a);n.timeoutID=d}catch(g){}return n},deleteXHRObj:function(c){if(c&&c.readyState!==4){if(c.abort){c.abort()}}if(c.timeoutID){clearTimeout(c.timeoutID);c.timeoutID=null}c.onreadystatechange=function(){};c=null}}})();TeaLeaf.Request=function(){var b,c,d,a;b=c=a=null;d="POST";this.getUrl=function(){var l,h,g,j,f;if(a){return a}l=TeaLeaf.Configuration;j=window.location;f=j.protocol;g=f+"//"+j.host;if(f=="http:"){h=l.tlurl}else{h=l.tlsecureurl}if(h.substr(0,1)=="/"){g+=h}else{g+=j.pathname.substr(0,j.pathname.lastIndexOf("/")+1)+h}return g};this.setUrl=function(f){a=f};this.getMethod=function(){return d};this.setMethod=function(f){d=f};this.getData=function(){return b};this.setData=function(f){var g;b=f;if(b){g=TeaLeaf.Request.totalDataLength||0;g+=b.length;TeaLeaf.Request.totalDataLength=g}};this.getHeaders=function(){return c};this.setHeaders=function(f){c=f};this.clear=function(){b=c=a=null}};TeaLeaf.Request.prototype={send:function(j){var a,c,b,d,h,g;h=TeaLeaf.Configuration;if(!h.xd_iframeID){g=TeaLeaf.XHRFactory.xhrRequest(this.getMethod(),this.getUrl(),this.getHeaders(),this.getData(),h.xhrAsync,j);if(!g){if(j&&j.failure){j.failure(0,"XHR request failed!")}return}}else{try{a=document.getElementById(h.xd_iframeID);if(!a||!a.contentWindow){if(j&&j.failure){j.failure(0,"Could not retrive cross-domain iframe target!")}return}c=a.contentWindow;if(c.postMessage&&window.JSON&&0){alert("Not implemented!")}else{d=c.TeaLeaf;if(d&&d.Request){b=new d.Request();b.clear();this.setUrl(b.getUrl());b.setHeaders(this.getHeaders());b.setData(this.getData());b.send(j)}}}catch(f){if(j&&j.failure){j.failure(0,(f.name?(f.name+": "+f.message):f.toString()))}return}}}};TeaLeaf.Request.GetTotalDataLength=function(){var a;a=TeaLeaf.Request.totalDataLength||0;return a};TeaLeaf.settlSDK=function(){TeaLeaf.Configuration.tlSDK=true};TeaLeaf.resettlSDK=function(){TeaLeaf.Configuration.tlSDK=false};TeaLeaf.tlSetPostURL=function(a){TeaLeaf.Configuration.tlurl=a};TeaLeaf.tlGetPostURL=function(){return TeaLeaf.Configuration.tlurl};TeaLeaf.makeRandomString=function(d,c){var b,a,f;if(!d||d<=0){return}if(!c){c="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890~!@#$%^+-?"}f="";for(b=0;b<d;b++){a=Math.floor(Math.random()*c.length);f+=c.charAt(a)}return f};TeaLeaf.tLoadObjs=[];TeaLeaf.addOnLoad=function(b,a){if(arguments.length===1){TeaLeaf.tLoadObjs.push(b)}else{if(arguments.length>1){TeaLeaf.tLoadObjs.push(b[a])}}};TeaLeaf.tlSetCookie=function(b,d,a,g,c,f){if(!b){return}document.cookie=b+"="+d+(a?(";expires="+a.toUTCString()):"")+";path="+(g?g:"/")+(c?(";domain="+c):"")+(f?";secure":"")};TeaLeaf.tlGetCookieValue=function(b){var d,a,l,f,g,h;h=b+"=";g=null;f=document.cookie.split(";");for(d=0;d<f.length;d++){l=f[d];for(a=0;l.charAt(a)==" ";a++){}if(a){l=l.substring(a,l.length)}if(l.indexOf(h)===0){g=l.substring(h.length,l.length);break}}return g};TeaLeaf.tlEraseCookie=function(b){var a;a=new Date(1970,1,1);TeaLeaf.tlSetCookie(b,"",a)};TeaLeaf.tlBrowserIsIE=function(){var a;a=TeaLeaf.tlBrowser;if(a){return !!a.MSIE}return false};TeaLeaf.tlBrowserIsMozilla=function(){var a;a=TeaLeaf.tlBrowser;if(a){return !!a.MOZILLA}return false};TeaLeaf.tlBrowserIsWebKit=function(){var a;a=TeaLeaf.tlBrowser;if(a){return !!a.WEBKIT}return false};TeaLeaf.tlBrowserIsOpera=function(){var a;a=TeaLeaf.tlBrowser;if(a){return !!a.OPERA}return false};TeaLeaf.tlBrowserIsUnknown=function(){var a;a=TeaLeaf.tlBrowser;if(a){return !!a.UNKNOWN}return false};TeaLeaf.PageSetup=function(){var f,n,c,j,m,b,d,l,h,a;if(document.readyState&&document.readyState!=="complete"){return}d=TeaLeaf;l=d.Configuration;h=l.tlGUIDCookie;if(d.PageSetup.Complete){return}d.PageSetup.Complete=true;if(d.PageSetup.Cleanup){d.PageSetup.Cleanup()}d.tlBrowser.UNKNOWN=false;a=navigator.userAgent.toLowerCase();if(/opera|presto/.test(a)){d.tlBrowser.OPERA=true}else{if(/(apple)?webkit|safari|chrome/.test(a)){d.tlBrowser.WEBKIT=true}else{if(/msie|trident/.test(a)){d.tlBrowser.MSIE=true}else{if(/^(?=.*?\b(mozilla|gecko|firefox)\b)((?!compatible).)*$/.test(a)){d.tlBrowser.MOZILLA=true}else{d.tlBrowser.UNKNOWN=true}}}}if(l.xd_CommonDomain){try{document.domain=l.xd_CommonDomain}catch(g){}}if(l.xd_iframeID){try{j=document.getElementById(l.xd_iframeID);if(!j){m=((window.location.protocol==="http:")?l.xd_iframeSrcURL:l.xd_iframeSrcURLSecure);if(m){j=document.createElement("IFRAME");if(j){j.id=l.xd_iframeID;j.src=m;j.style.display="none";j.style.visibility="hidden";document.body.appendChild(j)}}}}catch(g){}}if(l.tlSetGUID){if(!h||!h.name){}else{if(!h.valueLength){h.valueLength=32}if(!h.valueSet){h.valueSet="0123456789ABCDEF"}n=d.tlGetCookieValue(h.name);if(!n){b=new Date();n=d.makeRandomString(h.valueLength,h.valueSet);c=h.expires?new Date(b.getTime()+h.expires*60*1000):null;d.tlSetCookie(h.name,n,c,h.path,h.domain,h.secure)}}}if(!l.tlSDK){for(f=0;f<d.tLoadObjs.length;f++){d.tLoadObjs[f]()}}d.EndLoad=new Date()};if(document.readyState==="complete"){TeaLeaf.PageSetup()}else{if(document.addEventListener){document.addEventListener("DOMContentLoaded",TeaLeaf.PageSetup,false);window.addEventListener("load",TeaLeaf.PageSetup,false);TeaLeaf.PageSetup.Cleanup=function(){var a;a=TeaLeaf;document.removeEventListener("DOMContentLoaded",a.PageSetup,false);window.removeEventListener("load",a.PageSetup,false)}}else{if(document.attachEvent){document.attachEvent("onreadystatechange",TeaLeaf.PageSetup);window.attachEvent("onload",TeaLeaf.PageSetup);TeaLeaf.PageSetup.Cleanup=function(){var a;a=TeaLeaf;document.detachEvent("onreadystatechange",a.PageSetup);window.detachEvent("onload",a.PageSetup)}}else{if(typeof window.onload==="function"){TeaLeaf.OnLoad=window.onload}else{TeaLeaf.OnLoad=null}window.onload=function(){var a;a=TeaLeaf;a.PageSetup();window.onload=a.OnLoad;if(a.OnLoad){a.OnLoad()}}}}}}if(typeof TeaLeaf!=="undefined"&&((typeof TeaLeaf.replay==="function")?!TeaLeaf.replay():!TeaLeaf.replay)&&TeaLeaf.Event&&TeaLeaf.Event.Configuration){try{if(typeof TeaLeaf_PageID=="undefined"){TeaLeaf_PageID=null}}catch(e){TeaLeaf_PageID=null}TeaLeaf.Event.tlQueuedXML="";TeaLeaf.Event.tlQueuedXPXML="";TeaLeaf.Event.tlWindowObjects=[{tlWindowName:"",tlWindowObject:""}];TeaLeaf.Event.tlGetContentType=function(){var a="text/xml";return a};TeaLeaf.Event.tlGetTeaLeafXEvent=function(){var a=TeaLeaf.$C("ClientEvent");return a};TeaLeaf.Event.tlEventType=function(){var a;a=TeaLeaf.Event.SetType;TeaLeaf.Event.SetType="";return a};TeaLeaf.Event.tlEventSubType=function(){var a;a=TeaLeaf.Event.SetSubType;TeaLeaf.Event.SetSubType="";return a};TeaLeaf.Event.tlGetUrlPath=function(){var a=window.location.pathname;return a};TeaLeaf.Event.tlGetJSVersion=function(){return TeaLeaf.Configuration.tlversion};TeaLeaf.Event.tlResolutionType=function(d,a){var c=TeaLeaf.Event.Configuration.tlResolution;for(var b=0;b<c.length;b++){if(d<=c[b].width||a<=c[b].height){return c[b].type}}return c[c.length-1].type};TeaLeaf.Event.tlResolutionTypeBrowser=function(){var b=0;var a=0;if(window.innerWidth){b=window.innerWidth;a=window.innerHeight}else{if(document.documentElement&&document.documentElement.clientWidth){b=document.documentElement.clientWidth;a=document.documentElement.clientHeight}else{if(document.body&&document.body.clientWidth){b=document.body.clientWidth;a=document.body.clientHeight}else{var c=document.getElementsByTagName("body");if(c.length>0){b=c[0].clientWidth;a=c[0].clientHeight}}}}var d=TeaLeaf.Event.tlResolutionType(b,a);return d};TeaLeaf.Event.tlGetRenderTime=function(){return TeaLeaf.Event.PageLoadMilliSecs};TeaLeaf.Event.tlGetElementCount=function(a){return document.getElementsByName(a).length};TeaLeaf.Event.tlBadImageCount=function(){var c,f,d,a,b;f=0;d=document.images;b=d.length;for(c=0;c<b;c++){a=d[c];if((!a)||(typeof a.complete==="boolean"&&!a.complete)||(typeof a.naturalWidth!=="undefined"&&a.naturalWidth===0)){f++;continue}}return f};TeaLeaf.Event.tlFlashSend=function(c,b,f,a){var d=new TeaLeaf.Event(c,b);d.tlAddData(f.split(a));d.tlSend()};TeaLeaf.Event.tlShowFlashDebug=function(a,c){c+="<BR>";for(i=0;i<TeaLeaf.Event.tlWindowObjects.length;i++){if(TeaLeaf.Event.tlWindowObjects[i].tlWindowName==a){if(TeaLeaf.Event.tlWindowObjects[i].tlWindowObject.closed){TeaLeaf.Event.tlWindowObjects[i].tlWindowObject=window.open("",a,"width=600,height=300,scrollbars=yes,resizable=yes")}TeaLeaf.Event.tlWindowObjects[i].tlWindowObject.document.writeln(c.fontsize(2));TeaLeaf.Event.tlWindowObjects[i].tlWindowObject.scrollTo(0,50000);return}}var b=window.open("",a,"width=600,height=300,scrollbars=yes,resizable=yes");TeaLeaf.Event.tlWindowObjects.push({tlWindowName:a,tlWindowObject:b});b.document.writeln(c.fontsize(2))};TeaLeaf.Event.tlSetEventCount=function(a){TeaLeaf.Event.Configuration.tleventcount=a};TeaLeaf.Event.tlGetEventCount=function(){return TeaLeaf.Event.Configuration.tleventcount};TeaLeaf.Event.tlGetSendStringBytes=function(a){return a.length};TeaLeaf.Event.tlGetExceptionCount=function(){return(TeaLeaf.Event.Configuration.tlcatcherrors?TeaLeaf.Event.Configuration.tlexceptioncount:null)};TeaLeaf.Event.tlGetDwellTime=function(){return TeaLeaf.Event.tlDateDiff(TeaLeaf.tlStartLoad,TeaLeaf.Event.Configuration.tllastdwelltime)};TeaLeaf.Event.tlGetLastVisitedElementID=function(){return TeaLeaf.Event.Configuration.tlidoflastvisitedcontrol};TeaLeaf.Event.tlDateDiff=function(b,a){return Math.abs(b-a)};TeaLeaf.Event.tlGetVisitOrder=function(){return TeaLeaf.Event.Configuration.tlvisitorder};TeaLeaf.Event.tlFormatXML=function(a){if(a){if(a.replace){return a.replace(/&/g,"&amp;").replace(/\"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}return a}return""};TeaLeaf.Event.tlGetCookie=function(c){var b=document.cookie;var f=c+"=";var d=b.indexOf("; "+f);if(d==-1){d=b.indexOf(f);if(d!=0){return""}}else{d+=2}var a=document.cookie.indexOf(";",d);if(a==-1){a=b.length}return unescape(b.substring(d+f.length,a))};TeaLeaf.Event.tlGetHTTPHeaders=function(tlheaderconfig){var i,headers,value;headers=[];for(i=0;i<tlheaderconfig.length;i++){if(tlheaderconfig[i].tlsethttpheader){value=eval(tlheaderconfig[i].tlreqhttpheadervalue);if(value){headers.push({name:tlheaderconfig[i].tlreqhttpheadername,value:value})}}}return headers};TeaLeaf.Event.tlGetPageId=function(){if(TeaLeaf.Event.Configuration.tlpageid){return TeaLeaf.Event.Configuration.tlpageid}if(TeaLeaf_PageID){TeaLeaf.Event.Configuration.tlpageid=TeaLeaf_PageID;return TeaLeaf.Event.Configuration.tlpageid}TeaLeaf.Event.Configuration.tlpageid="ID"+TeaLeaf.tlStartLoad.getHours()+"H"+TeaLeaf.tlStartLoad.getMinutes()+"M"+TeaLeaf.tlStartLoad.getSeconds()+"S"+TeaLeaf.tlStartLoad.getMilliseconds()+"R"+Math.random();return TeaLeaf.Event.Configuration.tlpageid};TeaLeaf.Event.tlSendFailure=function(a,l,j){var d,g,b,c;g=new Date();d=Date.UTC(g.getUTCFullYear(),g.getUTCMonth(),g.getUTCDate(),g.getUTCHours(),g.getUTCMinutes(),g.getUTCSeconds(),g.getUTCMilliseconds());if(TeaLeaf.tlStartLoad){c=TeaLeaf.Event.tlDateDiff(g,TeaLeaf.tlStartLoad)}TeaLeaf.Event.Configuration.tleventcount++;TeaLeaf.Event.Configuration.tlexceptioncount++;b="<"+TeaLeaf.$C("ClientEvent")+" "+TeaLeaf.$C("Count")+'="'+TeaLeaf.Event.Configuration.tleventcount+'" '+TeaLeaf.$C("Type")+'="'+TeaLeaf.$C("INFO")+'" '+TeaLeaf.$C("SubType")+'="'+TeaLeaf.$C("EXCEPTION")+'" '+TeaLeaf.$C("FailedUrl")+'="'+TeaLeaf.Event.tlFormatXML(l)+'" '+TeaLeaf.$C("Message")+'="'+TeaLeaf.Event.tlFormatXML(j)+'" '+TeaLeaf.$C("TimeDuration")+'="'+c+'" '+TeaLeaf.$C("DateSince1970")+'="'+d+'" '+TeaLeaf.$C("PageId")+'="'+TeaLeaf.Event.tlGetPageId()+'"  />\r\n';try{TeaLeaf.Event.Configuration.tlasync=true;var f=new TeaLeaf.Event(TeaLeaf.$C("INFO"),TeaLeaf.$C("EXCEPTION"));f.tlSendXML(b,true)}catch(h){if(TeaLeaf.Event.Configuration.tlshowexceptions){alert(h.name+": "+h.message+"\r\n\r\nPos 4")}}};TeaLeaf.Event.tlGetTransport=function(){var a;if(window.XMLHttpRequest){try{a=new XMLHttpRequest()}catch(b){a=null}}else{if(window.ActiveXObject){try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){a=null}}}}return a};TeaLeaf.Event.TransportArray=[];TeaLeaf.Event.tlXMLHTTPObj=function(){var a=0;for(;a<TeaLeaf.Event.TransportArray.length;a++){if(TeaLeaf.Event.TransportArray[a]&&TeaLeaf.Event.TransportArray[a].readyState>0){if(TeaLeaf.Event.TransportArray[a].readyState==4){TeaLeaf.Event.TransportArray[a].abort();TeaLeaf.Event.TransportArray[a].onreadystatechange=new function(){};return TeaLeaf.Event.TransportArray[a]}}else{TeaLeaf.Event.TransportArray[a]=TeaLeaf.Event.tlGetTransport();return TeaLeaf.Event.TransportArray[a]}}TeaLeaf.Event.TransportArray[a]=TeaLeaf.Event.tlGetTransport();return TeaLeaf.Event.TransportArray[a]};TeaLeaf.Event.tlCleanXMLHTTPObj=function(b){var a=0;for(;a<TeaLeaf.Event.TransportArray.length;a++){if(b==TeaLeaf.Event.TransportArray[a]){TeaLeaf.Event.TransportArray[a]=null}}};TeaLeaf.Event.tlAddHandler=function(b,f,d,c){try{if(!b){return}if(b.addEventListener){b.addEventListener(f,d,c)}else{if(b.attachEvent){b.attachEvent("on"+f,d)}else{}}}catch(a){if(TeaLeaf.Event.Configuration.tlshowexceptions){alert(a.name+": "+a.message+"\r\n\r\nPos 4")}}};TeaLeaf.Event.tlRemoveHandler=function(b,f,d,c){try{if(!b){return}if(b.removeEventListener){b.removeEventListener(f,d,c)}else{if(b.detachEvent){b.detachEvent("on"+f,d)}}}catch(a){if(TeaLeaf.Event.Configuration.tlshowexceptions){alert(a.name+": "+a.message+"\r\n\r\nPos 5")}}};TeaLeaf.Event.tlFlushQueue=function(f){var h=null;var b=TeaLeaf.Event.Configuration.tlqueueeventstimer;var d=b*3;if(TeaLeaf.Event.Configuration.tlusetopqueue){var c=new Date();var g=(c-top.TeaLeaf.Event.TimeSent);if(top.TeaLeaf.Event.tlQueuedXML){if(f||g>=b){h=top.TeaLeaf.Event.tlQueuedXML;top.TeaLeaf.Event.tlQueuedXML="";top.TeaLeaf.Event.TimeSent=c}}if(!h){if(!f&&g<(b/2)){if(b>=d){b=d}else{b=(b*3)/2}}return b}}else{if(!TeaLeaf.Event.tlQueuedXML){return b}h=TeaLeaf.Event.tlQueuedXML;TeaLeaf.Event.tlQueuedXML=""}var a=new TeaLeaf.Event(TeaLeaf.$C("GUI"),TeaLeaf.$C("QUEUED"));a.tlSendXML(h);return b};TeaLeaf.Event.prototype.tlPushXML=function(a,c){if(!this.XMLStack){this.XMLStack=[]}if(c){}else{var b="  <"+a+" ";if(this.XMLData){this.XMLData+=b}else{this.XMLData=b}}};TeaLeaf.Event.prototype.tlPopXML=function(){if(this.XMLData){this.XMLData+="/>\r\n"}else{return false}};TeaLeaf.Event.prototype.tlAddData=function(a){var g="";if(this.XMLStack){for(var d=0;d<this.XMLStack.length;d++){g+="  "}}var f=[];for(var d=0;d<a.length;d+=2){var c=a[d];var b=TeaLeaf.Event.tlFormatXML(a[d+1]);if(c&&b){f[f.length]=g+c+'="'+b+'" '}}if(!this.XMLData){this.XMLData=""}this.XMLData+=f.join("");a=null};TeaLeaf.Event.prototype.tlSendXML=function(a,b){var m,c,g;try{g=new TeaLeaf.Request();if(!g){return}g.clear();var l=new Date();var d=Date.UTC(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate(),l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds());var j="<"+TeaLeaf.$C("ClientEventSet")+" "+TeaLeaf.$C("PostTimeStamp")+'="'+d+'" >';a=j+a+"</"+TeaLeaf.$C("ClientEventSet")+">";TeaLeaf.Event.Configuration.tlignoresendfailure=b;g.setData(a);c=[{name:"X-TeaLeaf",value:"ClientEvent"}];c=c.concat(TeaLeaf.Event.tlGetHTTPHeaders(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersSet));if(TeaLeaf.Event.Configuration.tlinitflag&&!TeaLeaf.Event.InitHeadersSent){c=c.concat(TeaLeaf.Event.tlGetHTTPHeaders(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalInit));TeaLeaf.Event.InitHeadersSent=true}if(TeaLeaf.Event.Configuration.tlbeforeunloadflag&&!TeaLeaf.Event.UnloadHeadersSent){c=c.concat(TeaLeaf.Event.tlGetHTTPHeaders(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalBeforeUnload));TeaLeaf.Event.UnloadHeadersSent=true}g.setHeaders(c);m={loaded:function(n,o){if(TeaLeaf.tlGetCookieValue("tlQueuedXML")){TeaLeaf.tlEraseCookie("tlQueuedXML")}},failure:function(n,o){if(!TeaLeaf.Event.Configuration.tlignoresendfailure){TeaLeaf.Event.Configuration.tlignoresendfailure=true;TeaLeaf.Event.tlSendFailure(g.getUrl(),g.getUrl(),"Status "+n+": "+o)}},success:function(n,o){TeaLeaf.Event.Configuration.tlignoresendfailure=false}};g.send(m)}catch(h){var f;f=g?g.getUrl():"none";if(TeaLeaf.Event.Configuration.tlshowexceptions){if(h.name){alert(h.name+": "+h.message+"\r\n\r\nURL: "+f+"\r\n\r\nPos 3 ")}else{alert(h+"\r\n\r\nURL: "+f+"\r\n\r\nPos 3 ")}}if(!TeaLeaf.Event.Configuration.tlignoresendfailure){TeaLeaf.Event.Configuration.tlignoresendfailure=true;TeaLeaf.Event.tlSendFailure(f,f,h.name?(h.name+": "+h.message):h.toString())}}};TeaLeaf.Event.prototype.tlSend=function(a){TeaLeaf.Event.Configuration.tleventcount++;if(this.XMLStack){while(this.XMLStack.length>0){this.tlPopXML()}}if(TeaLeaf.Event.Configuration.tleventcount>TeaLeaf.Event.Configuration.tlmaxeventcount){TeaLeaf.Event.tlFlushQueue();return}var b=Date.UTC(this.date.getUTCFullYear(),this.date.getUTCMonth(),this.date.getUTCDate(),this.date.getUTCHours(),this.date.getUTCMinutes(),this.date.getUTCSeconds(),this.date.getUTCMilliseconds());sendStr="<"+TeaLeaf.$C("ClientEvent")+" "+TeaLeaf.$C("Count")+'="'+TeaLeaf.Event.Configuration.tleventcount+'" '+TeaLeaf.$C("Type")+'="'+this.EventType+'" '+TeaLeaf.$C("SubType")+'="'+this.EventSubType+'" ';if(this.EventSource){sendStr+=TeaLeaf.$C("Source")+'="'+this.EventSource+'" '}if(!a){sendStr+=this.XMLData}if(TeaLeaf.tlStartLoad){sendStr+=TeaLeaf.$C("TimeDuration")+'="'+TeaLeaf.Event.tlDateDiff(this.date,TeaLeaf.tlStartLoad)+'" '}sendStr+=TeaLeaf.$C("DateSince1970")+'="'+b+'" ';sendStr+=TeaLeaf.$C("PageId")+'="'+TeaLeaf.Event.tlGetPageId()+'" ';if(a){sendStr+=">\r\n"+this.XMLData+"</"+TeaLeaf.$C("ClientEvent")+">\r\n"}else{sendStr+="/>\r\n"}if(TeaLeaf.Event.Configuration.tlqueueevents){if(TeaLeaf.Event.Configuration.tlusetopqueue){if(top.TeaLeaf.Event.tlQueuedXML){top.TeaLeaf.Event.tlQueuedXML+=sendStr}else{top.TeaLeaf.Event.tlQueuedXML=sendStr}}else{if(TeaLeaf.Event.tlQueuedXML){TeaLeaf.Event.tlQueuedXML+=sendStr}else{TeaLeaf.Event.tlQueuedXML=sendStr}}if(TeaLeaf.Event.Configuration.tlqueueeventsmaxsz<TeaLeaf.Event.tlQueuedXML.length){TeaLeaf.Event.tlFlushQueue()}return}try{this.tlSendXML(sendStr);this.XMLData=""}catch(c){}this.XMLData=""};TeaLeaf.Event.tlXMLEncode=function(a){if(a==null){return a}a=a.replace(/&/g,"&#38;");a=a.replace(/"/g,"&#34;");a=a.replace(/'/g,"&#39;");a=a.replace(/:/g,"&#58;");return a};TeaLeaf.Event.tlXMLDecode=function(a){if(a==null){return a}a=a.replace(/&#58;/g,":");a=a.replace(/&#39;/g,"'");a=a.replace(/&#34;/g,'"');a=a.replace(/&#38;/g,"&");return a};TeaLeaf.Event.tlEnableAllHTTPHeaders=function(a){if(a){if(a=="info"){TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersSet,true,"all")}else{if(a=="init"){TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalInit,true,"all")}else{if(a=="beforeunload"){TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalBeforeUnload,true,"all")}}}}else{TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersSet,true,"all");TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalInit,true,"all");TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalBeforeUnload,true,"all")}};TeaLeaf.Event.tlEnableHTTPHeader=function(a,b){if(a=="info"){TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersSet,true,b)}else{if(a=="init"){TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalInit,true,b)}else{if(a=="beforeunload"){TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalBeforeUnload,true,b)}}}};TeaLeaf.Event.tlDisableAllHTTPHeaders=function(a){if(a){if(a=="info"){TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersSet,false,"all")}else{if(a=="init"){TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalInit,false,"all")}else{if(a=="beforeunload"){TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalBeforeUnload,false,"all")}}}}else{TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersSet,false,"all");TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalInit,false,"all");TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalBeforeUnload,false,"all")}};TeaLeaf.Event.tlEnableQueueEvents=function(){TeaLeaf.Event.Configuration.tlqueueevents=true};TeaLeaf.Event.tlDisableQueueEvents=function(){TeaLeaf.Event.Configuration.tlqueueevents=false};TeaLeaf.Event.tlEnableShowExceptions=function(){TeaLeaf.Event.Configuration.tlshowexceptions=true};TeaLeaf.Event.tlDisableShowExceptions=function(){TeaLeaf.Event.Configuration.tlshowexceptions=false};TeaLeaf.Event.tlSetQueueEventTime=function(a){TeaLeaf.Event.Configuration.tlqueueeventstimer=a};TeaLeaf.Event.tlGetQueueEventTime=function(){return TeaLeaf.Event.Configuration.tlqueueeventstimer};TeaLeaf.Event.tlSetQueueEventMaxSize=function(a){TeaLeaf.Event.Configuration.tlqueueeventsmaxsz=a};TeaLeaf.Event.tlGetQueueEventMaxSize=function(){return TeaLeaf.Event.Configuration.tlqueueeventsmaxsz};TeaLeaf.Event.tlGetAlertCount=function(){var b,c,a;b=TeaLeaf;c=b.Event;a=c.getAlertCount?c.getAlertCount():0;return a};TeaLeaf.Event.tlEventJSONCfgUtil=function(d,c,a){for(var b=0;b<d.length;b++){if(a=="all"){d[b].load=c}else{if(a==d[b].domevent){d[b].load=c}}}};TeaLeaf.Event.tlErrorHandler=function(d,c,a){TeaLeaf.Event.Configuration.tlexceptioncount++;if(TeaLeaf.Event.Configuration.tlexceptioncount>TeaLeaf.Event.Configuration.tlmaxeventexception){return}if((typeof d!=="string")&&!c){return false}var b=new Date();if(!a){a="-"}var g=new TeaLeaf.Event(TeaLeaf.$C("INFO"),TeaLeaf.$C("EXCEPTION"));var f=[TeaLeaf.$C("Message"),d,TeaLeaf.$C("URL"),escape(c),TeaLeaf.$C("Line"),a];g.tlAddData(f);TeaLeaf.Event.Configuration.tlasync=true;g.tlSend();TeaLeaf.Event.tlFlushQueue();return false};TeaLeaf.Event.tlBeforeUnload=function(){if(TeaLeaf.Event.Configuration.tleventbeforeunloadflag==true){TeaLeaf.Event.Configuration.tleventunloadflag=false;var tlevt=new TeaLeaf.Event(TeaLeaf.$C("PERFORMANCE"),TeaLeaf.$C("BeforeUnload"));TeaLeaf.Event.SetType=tlevt.EventType;if(TeaLeaf.Event.SetSubType==""){TeaLeaf.Event.SetSubType=tlevt.EventSubType}else{TeaLeaf.Event.SetSubType+="; "+tlevt.EventSubType}TeaLeaf.Event.Configuration.tlbeforeunloadflag=true;TeaLeaf.Event.Configuration.tlignoresendfailure=true;TeaLeaf.Event.Configuration.tlasync=false;tlevt.tlSend();TeaLeaf.Event.tlFlushQueue(true)}TeaLeaf.Event.tlRemoveHandler(window,"beforeunload",eval(TeaLeaf.Event.tlBeforeUnload),false);TeaLeaf.Event.tlRemoveHandler(window,"unload",eval(TeaLeaf.Event.tlUnload),false)};TeaLeaf.Event.tlUnload=function(){if(TeaLeaf.Event.Configuration.tleventunloadflag){TeaLeaf.Event.Configuration.tllastdwelltime=new Date();TeaLeaf.Event.Configuration.tleventbeforeunloadflag=false;var tlevt=new TeaLeaf.Event(TeaLeaf.$C("PERFORMANCE"),TeaLeaf.$C("Unload"));TeaLeaf.Event.SetType=tlevt.EventType;if(TeaLeaf.Event.SetSubType==""){TeaLeaf.Event.SetSubType=tlevt.EventSubType}else{TeaLeaf.Event.SetSubType+="; "+tlevt.EventSubType}TeaLeaf.Event.Configuration.tlignoresendfailure=true;TeaLeaf.Event.Configuration.tlasync=false;tlevt.tlSend();TeaLeaf.Event.tlFlushQueue(true)}TeaLeaf.Event.tlRemoveHandler(window,"beforeunload",eval(TeaLeaf.Event.tlBeforeUnload),false);TeaLeaf.Event.tlRemoveHandler(window,"unload",eval(TeaLeaf.Event.tlUnload),false)};TeaLeaf.Event.EventSetup=function(){var T,TE,TECfg;T=TeaLeaf;TE=T.Event;TECfg=TE.Configuration;if(TECfg.tlCatchAlerts){(function(){var alertCount,originalAlert,originalConfirm,originalPrompt;alertCount=0;if(window.alert&&window.alert.apply){originalAlert=window.alert;window.alert=function(){var retVal;retVal=originalAlert.apply(window,arguments);alertCount++;return retVal}}if(window.confirm&&window.confirm.apply){originalConfirm=window.confirm;window.confirm=function(){var retVal;retVal=originalConfirm.apply(window,arguments);alertCount++;return retVal}}if(window.prompt&&window.prompt.apply){originalPrompt=window.prompt;window.prompt=function(){var retVal;retVal=originalPrompt.apply(window,arguments);alertCount++;return retVal}}TE.getAlertCount=function(){return alertCount}})()}if(TeaLeaf.Event.Configuration.tlcatcherrors){if(typeof window.onerror!=="function"){window.onerror=TeaLeaf.Event.tlErrorHandler}}if(!TeaLeaf.Client){TeaLeaf.Event.tlAddHandler(window,"beforeunload",eval(TeaLeaf.Event.tlBeforeUnload),false);TeaLeaf.Event.tlAddHandler(window,"unload",eval(TeaLeaf.Event.tlUnload),false)}if(TeaLeaf.Event.Configuration.tlqueueevents){TeaLeaf.Event.tlTimerRoutine=function(){var timeAmount=TeaLeaf.Event.Configuration.tlqueueeventstimer;try{timeAmount=TeaLeaf.Event.tlFlushQueue()}catch(exc){if(TeaLeaf.Event.Configuration.tlshowexceptions){alert(exc.name+": "+exc.message+"\r\n\r\nPos 7")}}setTimeout("TeaLeaf.Event.tlTimerRoutine()",timeAmount)};setTimeout("TeaLeaf.Event.tlTimerRoutine()",TeaLeaf.Event.Configuration.tlqueueeventstimer)}var tlnow=new Date();var t1970=Date.UTC(tlnow.getUTCFullYear(),tlnow.getUTCMonth(),tlnow.getUTCDate(),tlnow.getUTCHours(),tlnow.getUTCMinutes(),tlnow.getUTCSeconds(),tlnow.getUTCMilliseconds());TeaLeaf.Event.Configuration.t1970=t1970;TeaLeaf.Event.Loaded=true};TeaLeaf.Event.tlAddCustomEvent=function(b,d){var f,g,c,a,h;if(!b||typeof b!=="string"){b="custom"}if(!d||typeof d!=="object"){return}h=new TeaLeaf.Event(TeaLeaf.$C("CUSTOM"),b);f=0;a=[];for(g in d){if(g&&d.hasOwnProperty(g)){a[f++]=TeaLeaf.Event.tlXMLEncode(g);a[f++]=d[g].toString()}}h.tlAddData(a);h.tlSend()};if(TeaLeaf.Event.Configuration.tlinit==false){TeaLeaf.Event.Configuration.tlinit=true;TeaLeaf.Event.prototype.XMLData="";TeaLeaf.addOnLoad(TeaLeaf.Event.EventSetup)}}if(typeof TeaLeaf!=="undefined"&&((typeof TeaLeaf.replay==="function")?!TeaLeaf.replay():!TeaLeaf.replay)&&TeaLeaf.Env&&TeaLeaf.Env.Configuration){TeaLeaf.Env.tlSendPageSummary=function(){var c,a,b,d,h,f,g;c=TeaLeaf;a=c.Configuration;b=c.Env;d=c.Event;h=b.Configuration;f=d.Configuration;if(a.tlSDK||!h.tlinitpost){return}h.tlinitpost=false;g=new d(c.$C("PERFORMANCE"),c.$C("INIT"));d.PageLoadMilliSecs=d.tlDateDiff(c.tlStartLoad,g.date);d.SetType=g.EventType;if(!d.SetSubType){d.SetSubType=g.EventSubType}else{d.SetSubType+="; "+g.EventSubType}f.tlinitflag=true;b.tlInfo(g);b.tlDOMDocumentInfo(g);b.tlDOMWindowInfo(g);b.tlDOMScreenInfo(g);b.tlPluginInfo(g);g.tlSend(true)};TeaLeaf.Env.tlInfo=function(b){b.tlPushXML(TeaLeaf.$C("Info"));var a=[TeaLeaf.$C("PageLoadMilliSecs"),TeaLeaf.Event.tlGetRenderTime(),TeaLeaf.$C("Version"),TeaLeaf.Event.tlGetJSVersion(),TeaLeaf.$C("TimezoneOffset"),b.date.getTimezoneOffset()];b.tlAddData(a);b.tlPopXML()};TeaLeaf.Env.tlDOMDocumentInfo=function(d){var c,b,a;a=TeaLeaf;d.tlPushXML(a.$C("Document"));c=[a.$C("Title"),document.title,a.$C("Referer"),document.referer,a.$C("ContentType"),document.contentType,a.$C("LastModified"),document.lastModified,a.$C("CharacterSet"),document.characterSet,a.$C("Height"),document.height,a.$C("Width"),document.width];d.tlAddData(c);b=[a.$C("Anchors"),document.anchors.length,a.$C("Applets"),document.applets.length,a.$C("Embeds"),document.embeds.length,a.$C("Forms"),document.forms.length,a.$C("Images"),document.images.length,a.$C("BadImages"),(a.tlBrowserIsWebKit()?0:a.Event.tlBadImageCount()),a.$C("Links"),document.links.length,a.$C("Plugins"),document.plugins.length];d.tlAddData(b);d.tlPopXML()};TeaLeaf.Env.tlDOMWindowInfo=function(g){var b,f,c,a;b=TeaLeaf;g.tlPushXML(b.$C("Window"));f=[b.$C("WindowHref"),escape(window.location.href),b.$C("WindowProtocol"),window.location.protocol,b.$C("WindowHost"),window.location.host,b.$C("WindowHostName"),window.location.hostname,b.$C("WindowPort"),window.location.port,b.$C("WindowPathName"),window.location.pathname];g.tlAddData(f);if(window.innerHeight&&window.innerWidth){g.tlAddData([b.$C("ClientSize"),(window.innerHeight+"x"+window.innerWidth)])}else{if(document.body){if(document.body.clientWidth&&document.body.clientHeight){g.tlAddData([b.$C("ClientSize"),(document.body.clientHeight+"x"+document.body.clientWidth)])}}}c=[b.$C("FullScreen"),navigator.fullScreen,b.$C("Frames"),window.frames.length];if(typeof window.sessionStorage==="object"){try{a=window.sessionStorage.TLTWID;if(a==null){a=b.makeRandomString(6);window.sessionStorage.TLTWID=a}}catch(d){a=null}finally{g.tlAddData([b.$C("WindowId"),a])}}g.tlAddData(c);g.tlPopXML()};TeaLeaf.Env.tlDOMNavigatorInfo=function(b){b.tlPushXML(TeaLeaf.$C("Navigator"));var a=[TeaLeaf.$C("AppCodeName"),navigator.appCodeName,TeaLeaf.$C("AppName"),navigator.appName,TeaLeaf.$C("AppVersion"),navigator.appVersion,TeaLeaf.$C("BrowserLanguage"),navigator.browserLanguage,TeaLeaf.$C("CookieEnabled"),navigator.cookieEnabled,TeaLeaf.$C("CPUClass"),navigator.cpuClass,TeaLeaf.$C("Language"),navigator.language,TeaLeaf.$C("OSCPU"),navigator.oscpu,TeaLeaf.$C("Platform"),navigator.platform,TeaLeaf.$C("Product"),navigator.product,TeaLeaf.$C("SystemLanguage"),navigator.systemLanguage,TeaLeaf.$C("UserAgent"),navigator.userAgent,TeaLeaf.$C("UserLanguage"),navigator.userLanguage,TeaLeaf.$C("Vendor"),navigator.vendor,TeaLeaf.$C("VendorSub"),navigator.vendorSub];b.tlAddData(a);b.tlPopXML()};TeaLeaf.Env.tlDOMScreenInfo=function(b){b.tlPushXML(TeaLeaf.$C("Screen"));var a=[TeaLeaf.$C("AvailHeight"),screen.availHeight,TeaLeaf.$C("AvailLeft"),screen.availLeft,TeaLeaf.$C("AvailTop"),screen.availTop,TeaLeaf.$C("AvailWidth"),screen.availWidth,TeaLeaf.$C("BufferDepth"),screen.bufferDepth,TeaLeaf.$C("ColorDepth"),screen.colorDepth,TeaLeaf.$C("DeviceXDPI"),screen.deviceXDPI,TeaLeaf.$C("DeviceYDPI"),screen.deviceYDPI,TeaLeaf.$C("FontSmoothingEnabled"),screen.fontSmoothingEnabled,TeaLeaf.$C("Height"),screen.height,TeaLeaf.$C("Left"),screen.left,TeaLeaf.$C("LogicalXDPI"),screen.logicalXDPI,TeaLeaf.$C("LogicalYDPI"),screen.logicalYDPI,TeaLeaf.$C("Top"),screen.top,TeaLeaf.$C("UpdateInterval"),screen.updateInterval,TeaLeaf.$C("Width"),screen.width];b.tlAddData(a);b.tlPopXML()};TeaLeaf.Env.tlPluginInfo=function(l){if(window.ActiveXObject){for(var d=0;d<TeaLeaf.Env.Configuration.tlPlugins.length;d++){if(!TeaLeaf.Env.Configuration.tlPlugins[d].tlenable){continue}var b=TeaLeaf.Env.Configuration.tlPlugins[d].tlIEplugin;try{var a=new ActiveXObject(b);if(a){l.tlPushXML(TeaLeaf.$C("Plugin"));var h=[TeaLeaf.$C("Pluginname"),TeaLeaf.Env.Configuration.tlPlugins[d].tlpluginname,TeaLeaf.$C("Version"),TeaLeaf.Env.Configuration.tlPlugins[d].tlversion];l.tlAddData(h);l.tlPopXML()}}catch(g){}}}else{for(var d=0;d<navigator.plugins.length;d++){for(var c=0;c<TeaLeaf.Env.Configuration.tlPlugins.length;c++){if(!TeaLeaf.Env.Configuration.tlPlugins[c].tlenable){continue}var f=navigator.plugins[d].name.substr(0,TeaLeaf.Env.Configuration.tlPlugins[c].tlpluginname.length);if(f==TeaLeaf.Env.Configuration.tlPlugins[c].tlpluginname){TeaLeaf.Env.Configuration.tlPlugins[c].tlenable=false;l.tlPushXML(TeaLeaf.$C("Plugin"));var h=[TeaLeaf.$C("Pluginname"),TeaLeaf.Env.Configuration.tlPlugins[c].tlpluginname,TeaLeaf.$C("Version"),TeaLeaf.Env.Configuration.tlPlugins[c].tlversion];l.tlAddData(h);l.tlPopXML()}}}}};TeaLeaf.Env.CallInit=function(){TeaLeaf.addOnLoad(TeaLeaf.Env.tlSendPageSummary)};if(TeaLeaf.Env.Configuration.tlinit==false){TeaLeaf.Env.Configuration.tlinit=true;TeaLeaf.Env.CallInit()}}if(typeof TeaLeaf!=="undefined"&&((typeof TeaLeaf.replay==="function")?!TeaLeaf.replay():!TeaLeaf.replay)&&TeaLeaf.Client&&TeaLeaf.Client.Configuration){TeaLeaf.Client.tlTimeoutID=-1;TeaLeaf.Client.tlEnableAllEventHandlers=function(a){if(a){if(a==window){TeaLeaf.Client.tlClientJSONCfgUtil(TeaLeaf.Client.Configuration.tlWindowHandlers,true,"all")}else{if(a==document){TeaLeaf.Client.tlClientJSONCfgUtil(TeaLeaf.Client.Configuration.tlDocumentHandlers,true,"all")}}}else{TeaLeaf.Client.tlClientJSONCfgUtil(TeaLeaf.Client.Configuration.tlWindowHandlers,true,"all");TeaLeaf.Client.tlClientJSONCfgUtil(TeaLeaf.Client.Configuration.tlDocumentHandlers,true,"all")}};TeaLeaf.Client.tlEnableEventHandler=function(b,a){if(b==window){TeaLeaf.Client.tlClientJSONCfgUtil(TeaLeaf.Client.Configuration.tlWindowHandlers,true,a)}else{TeaLeaf.Client.tlClientJSONCfgUtil(TeaLeaf.Client.Configuration.tlDocumentHandlers,true,a)}};TeaLeaf.Client.tlDisableAllEventHandlers=function(a){if(a){if(a==window){TeaLeaf.Client.tlClientJSONCfgUtil(TeaLeaf.Client.Configuration.tlWindowHandlers,false,"all")}else{if(a==document){TeaLeaf.Client.tlClientJSONCfgUtil(TeaLeaf.Client.Configuration.tlDocumentHandlers,false,"all")}}}else{TeaLeaf.Client.tlClientJSONCfgUtil(TeaLeaf.Client.Configuration.tlWindowHandlers,false,"all");TeaLeaf.Client.tlClientJSONCfgUtil(TeaLeaf.Client.Configuration.tlDocumentHandlers,false,"all")}};TeaLeaf.Client.tlDisableEventHandlers=function(b,a){if(b==window){TeaLeaf.Client.tlClientJSONCfgUtil(TeaLeaf.Client.Configuration.tlWindowHandlers,false,a)}else{TeaLeaf.Client.tlClientJSONCfgUtil(TeaLeaf.Client.Configuration.tlDocumentHandlers,false,a)}};TeaLeaf.Client.tlClientJSONCfgUtil=function(d,c,a){for(var b=0;b<d.length;b++){if(a=="all"){d[b].load=c}else{if(a==d[b].domevent){d[b].load=c}}}};TeaLeaf.Client.tlHasUserMovement=false;TeaLeaf.Client.tlUserMovement=function(){TeaLeaf.Client.tlHasUserMovement=true;TeaLeaf.Event.tlRemoveHandler(document,"mousemove",TeaLeaf.Client.tlUserMovement,false)};TeaLeaf.Client.tlAddIdToControl=function(d){if((d.id&&d.id!="")||(d.name&&d.name!="")){return}var f=d.tagName;var g=TeaLeaf.Client.Configuration.tlIdCounter[f];if(g==undefined){TeaLeaf.Client.Configuration.tlIdCounter[f]=0}var a="_TL_"+f+"_"+TeaLeaf.Client.Configuration.tlIdCounter[f];var c=document.getElementById(a);var b=a;if(c){while(document.getElementById("_TL_"+f+"_"+TeaLeaf.Client.Configuration.tlIdCounter[f]++)){}}d.id=b;TeaLeaf.Client.Configuration.tlIdCounter[f]++};TeaLeaf.Client.tlFindinJSON=function(a,c){var d=TeaLeaf.Client.tlGetName(a);if(d){for(var b=0;b<c.length;b++){if(d==c[b].tlfieldname){return c[b]}}}};TeaLeaf.Client.EmptyMask=function(a){return""};TeaLeaf.Client.BasicMask=function(a){if(!a||!a.value){return null}return"XXXXXX"};TeaLeaf.Client.PreserveMask=function(b){var a,c;if(!b||!b.value){return null}a=TeaLeaf.Client.Configuration.tlPrivacyMask;c=b.value;c=c.replace(/[A-Z]/g,a.upperChar);c=c.replace(/[a-z]/g,a.lowerChar);c=c.replace(/[0-9]/g,a.numericChar);c=c.replace(/[^A-Za-z0-9]/g,a.symbolChar);return c};TeaLeaf.Client.getFieldBlockMatch=function(b){var a,c;c=TeaLeaf.Client.Configuration.tlFieldBlock;if(typeof b==="string"){b=document.getElementById(b)}if(!b){return null}for(a=0;a<c.length;a++){if(c[a].id){if(!c[a].idRE){c[a].idRE=new RegExp(c[a].id,(c[a].caseinsensitive?"i":""))}if(c[a].idRE.test(b.id)){return c[a]}}if(c[a].name){if(!c[a].nameRE){c[a].nameRE=new RegExp(c[a].name,(c[a].caseinsensitive?"i":""))}if(c[a].nameRE.test(b.name)){return c[a]}}}return null};TeaLeaf.Client.tlIsReplace=function(a){if(typeof a==="string"){a=document.getElementById(a)}if(!a){return false}if(TeaLeaf.Client.getFieldBlockMatch(a)){return true}if(a.type==="password"){return TeaLeaf.Client.Configuration.tlpassword===2}return false};TeaLeaf.Client.tlReplaceValue=function(a){var b;if(typeof a==="string"){a=document.getElementById(a)}if(!a){return null}b=TeaLeaf.Client.getFieldBlockMatch(a);if(b){return b.mask(a)}return a.value};TeaLeaf.Client.tlIsExcluded=function(a){var b;if(typeof a==="string"){a=document.getElementById(a)}if(!a){return false}b=TeaLeaf.Client.getFieldBlockMatch(a);if(b){return b.exclude}if(a.type==="password"){return TeaLeaf.Client.Configuration.tlpassword===2}return false};TeaLeaf.Client.tlGetName=function(c){if(c==null){return null}var b=c.id;if(b&&b!=""){return b}var a=c.name;if(a&&a!=""){return a}return null};TeaLeaf.Client.tlGetEventSource=function(b){var a;a=null;if(!b){return null}if(b.srcElement){a=b.srcElement}else{a=b.target;if(!a){a=b.explicitOriginalTarget}if(!a){a=b.originalTarget}}if(a&&!a.name){if(a.parentNode&&a.parentNode.tagName){if(a.parentNode.tagName=="A"||a.parentNode.tagName=="LINK"){a=a.parentNode}}}if(!a||!a.tagName){a=window.document.body}return a};TeaLeaf.Client.tlGetAnchor=function(c,b){if(c==null){return null}if(c.name&&c.name!=""){return null}var a;for(a=0;a<document.anchors.length;a++){if(document.anchors[a]==c){if(b){return"<AnchorElement>"+a+"</AnchorElement>\r\n"}else{return"Anchor-"+a}}}for(a=0;a<document.links.length;a++){if(document.links[a]==c){if(b){return"<LinkElement>"+a+"</LinkElement>\r\n"}else{return"Link-"+a}}}return null};TeaLeaf.Client.checkIsInput=function(a){if(typeof(a)=="string"){a=document.getElementById(a)}switch(a.tagName){case"INPUT":case"SELECT":case"TEXTAREA":return true}return false};TeaLeaf.Event.tlFormatXMLName=function(d){if(!d||d.length<=0){return null}var b="";if(!TeaLeaf.Event.tlNameStartChar(d.charCodeAt(0))){b="_"}var a=d.length;var c;for(c=0;c<a;c++){if(TeaLeaf.Event.tlNameChar(d.charCodeAt(c))){b=b+d.charAt(c)}else{b=b+"_"}}return b};TeaLeaf.Event.tlNameStartChar=function(a){return(a>=65&&a<=90)||a==95||(a>=97&&a<=122)||(a>=192&&a<=214)||(a>=216&&a<=246)||(a>=248&&a<=767)||(a>=880&&a<=893)||(a>=895&&a<=8191)||(a>=8204&&a<=8205)||(a>=8304&&a<=8591)||(a>=11264&&a<=12271)||(a>=12289&&a<=55295)||(a>=63744&&a<=64975)||(a>=65008&&a<=65533)};TeaLeaf.Event.tlNameChar=function(a){return TeaLeaf.Event.tlNameStartChar(a)||a==45||a==46||(a>=48&&a<=57)||a==183||(a>=768&&a<=879)||(a>=8255&&a<=8256)};TeaLeaf.Client.tlQueuedKeys="";TeaLeaf.Client.getNormalizedKeyCode=function(b){var a;if(!b||!b.keyCode||(b.keyCode<32&&b.keyCode!==8&&b.keyCode!==20)){return null}a="";if(b.ctrlKey){a+="c-"}if(b.altKey){a+="a-"}if(b.shiftKey){a+="s-"}if(!TeaLeaf.tlBrowserIsIE()){switch(b.keyCode){case 59:a+=186;break;default:a+=b.keyCode;break}}else{a+=b.keyCode}return a};TeaLeaf.Client.tlQueueKey=function(h){var f,d,g,c,a,b;c=TeaLeaf;a=c.Client;b=a.Configuration;a.tlSendResize();a.tlSendScroll();if(!h){h=window.event}d=a.tlGetEventSource(h);if(!d){return}if(!d.TeaLeafFocusTime){d.TeaLeafFocusTime=new Date()}if(a.tlQueuedKeySource){if(a.tlQueuedKeySource!=d){if(a.tlQueuedKeys&&a.tlQueuedKeys.length>0){a.tlSendKeys()}a.tlQueuedKeySource=d}}else{a.tlQueuedKeySource=d}f=a.tlGetName(d);if(!f){f=a.tlGetXPathFromNode(d);if(!f){if(!a.tlGetAnchor(d,false)){a.tlQueuedKeySource=null}return}else{a.tlQueuedKeySource=d}}else{if(a.tlIsReplace(d)){a.tlQueuedKeysCount++;return}if(a.tlIsExcluded(d)){a.tlQueuedKeys=null;a.tlQueuedKeysCount++;return}}g=a.getNormalizedKeyCode(h);if(g){if(a.tlQueuedKeys&&a.tlQueuedKeys.length>0){a.tlQueuedKeys+=";"}a.tlQueuedKeys+=g}};TeaLeaf.Client.tlSendKeys=function(){var p=TeaLeaf.Client,g,f;if(!p.tlQueuedKeySource||(!p.tlQueuedKeys&&!p.tlQueuedKeysCount)){return}var d=p.tlQueuedKeySource;var l=p.tlQueuedKeys;var s=p.tlQueuedKeysCount;p.tlQueuedKeySource=null;p.tlQueuedKeys="";p.tlQueuedKeysCount=0;f=p.tlGetXPathFromNode(d);if(!f&&p.Configuration.tlDiscardInvalidXPath){return}var q=false;if(TeaLeaf.Client.tlIsReplace(d)){q=true;return}var n=false;if(TeaLeaf.Client.tlIsExcluded(d)){n=true;l=null}var a=TeaLeaf.Client.tlGetName(d);var b=null;g=d.id;if(!TeaLeaf.Client.CheckIfIdValid(d)){g=""}var o=new TeaLeaf.Event(TeaLeaf.$C("GUI"),TeaLeaf.$C("KeyUp"));var m=[TeaLeaf.$C("Name"),d.name,TeaLeaf.$C("Id"),g,TeaLeaf.$C("Lev"),b,TeaLeaf.$C("ElementType"),d.type,TeaLeaf.$C("TagName"),d.tagName,TeaLeaf.$C("XPath"),f,TeaLeaf.$C("KeyCount"),s];o.tlAddData(m);if(n){o.tlAddData([TeaLeaf.$C("Excluded"),TeaLeaf.$C("True")])}else{if(q){var j=TeaLeaf.Client.tlGetReplaceValue(d);var r=[TeaLeaf.$C("ValueIn"),a,a,j,TeaLeaf.$C("KeyCode"),l];o.tlAddData(r)}else{var c=TeaLeaf.Event.tlFormatXMLName(a);if(!c){c=f;c=TeaLeaf.Event.tlFormatXMLName(c)}var h=[TeaLeaf.$C("ValueIn"),c,c,d.value,TeaLeaf.$C("KeyCode"),l];o.tlAddData(h)}}o.tlSend()};TeaLeaf.Client.tlSendResize=function(){if(!TeaLeaf.Client.ResizeClientX&&!TeaLeaf.Client.ResizeClientY){return}var b=new TeaLeaf.Event(TeaLeaf.$C("GUI"),TeaLeaf.$C("Resize"));var a=[TeaLeaf.$C("ClientX"),TeaLeaf.Client.ResizeClientX,TeaLeaf.$C("ClientY"),TeaLeaf.Client.ResizeClientY,TeaLeaf.$C("ScreenX"),TeaLeaf.Client.ResizeScreenX,TeaLeaf.$C("ScreenY"),TeaLeaf.Client.ResizeScreenY];b.tlAddData(a);TeaLeaf.Client.ResizeClientX=null;TeaLeaf.Client.ResizeClientY=null;TeaLeaf.Client.ResizeScreenX=null;TeaLeaf.Client.ResizeScreenY=null;b.tlSend()};TeaLeaf.Client.tlQueueScroll=function(a){TeaLeaf.Client.tlSendKeys();TeaLeaf.Client.tlSendResize();if(!a){a=window.event}if(a.clientX){TeaLeaf.Client.ScrollClientX=a.clientX;TeaLeaf.Client.ScrollClientY=a.clientY;TeaLeaf.Client.ScrollScreenX=a.screenX;TeaLeaf.Client.ScrollScreenY=a.screenY}else{TeaLeaf.Client.ScrollHeight=a.target.scrollHeight;TeaLeaf.Client.ScrollWidth=a.target.scrollWidth;TeaLeaf.Client.ScrollTop=a.target.scrollTop;TeaLeaf.Client.ScrollLeft=a.target.scrollLeft}};TeaLeaf.Client.tlSendScroll=function(){if(!TeaLeaf.Client.ScrollClientX&&!TeaLeaf.Client.ScrollHeight){return}var b=new TeaLeaf.Event(TeaLeaf.$C("GUI"),TeaLeaf.$C("Scroll"));var a=[TeaLeaf.$C("ClientX"),TeaLeaf.Client.ScrollClientX,TeaLeaf.$C("ClientY"),TeaLeaf.Client.ScrollClientY,TeaLeaf.$C("ScreenX"),TeaLeaf.Client.ScrollScreenX,TeaLeaf.$C("ScreenY"),TeaLeaf.Client.ScrollScreenY,TeaLeaf.$C("ScrollHeight"),TeaLeaf.Client.ScrollHeight,TeaLeaf.$C("ScrollWidth"),TeaLeaf.Client.ScrollWidth,TeaLeaf.$C("ScrollTop"),TeaLeaf.Client.ScrollTop,TeaLeaf.$C("ScrollLeft"),TeaLeaf.Client.ScrollLeft];b.tlAddData(a);TeaLeaf.Client.ScrollClientX=TeaLeaf.Client.ScrollClientY=null;TeaLeaf.Client.ScrollScreenX=TeaLeaf.Client.ScrollScreenY=null;TeaLeaf.Client.ScrollHeight=TeaLeaf.Client.ScrollWidth=null;TeaLeaf.Client.ScrollTop=TeaLeaf.Client.ScrollLeft=null;b.tlSend()};TeaLeaf.Client.tlFindAncestorByTag=function(b,a){var c=b.parentNode;while(c&&c!=window.document){if(c.nodeType!=1){continue}if(c.tagName==a){break}else{c=c.parentNode}}return c};TeaLeaf.Client.tlCheckBlackList=function(a){var d,c,b;if(!TeaLeaf.Client.Configuration.tlIDBlackList||!TeaLeaf.Client.Configuration.tlIDBlackList.length){return false}if(a){for(d=0;d<TeaLeaf.Client.Configuration.tlIDBlackList.length;d++){b=new RegExp(TeaLeaf.Client.Configuration.tlIDBlackList[d],"g");c=a.match(b);if(c){return true}}}return false};TeaLeaf.Client.tlCheckWhiteList=function(a){var d,c,b;if(!TeaLeaf.Client.Configuration.tlIDWhiteList||!TeaLeaf.Client.Configuration.tlIDWhiteList.length){return true}if(a){for(d=0;d<TeaLeaf.Client.Configuration.tlIDWhiteList.length;d++){b=new RegExp(TeaLeaf.Client.Configuration.tlIDWhiteList[d],"g");c=a.match(b);if(c){return true}}}return false};TeaLeaf.Client.tlGetXPathFromNode=function(a){if(!a){return null}var g=[];var l=a;var h=null;var m=null;for(var f in TeaLeaf.Client.Configuration.tlSpecialChildNodeTags){if(l.tagName.toString()==f){l=l.parentNode}}var d=false;for(d=TeaLeaf.Client.CheckIfIdValid(l);l!=window.document&&(!d);d=TeaLeaf.Client.CheckIfIdValid(l)){h=null;m=null;switch(l.tagName){case"TD":if(m=TeaLeaf.Client.tlFindAncestorByTag(l,"TR")){h=m.cells}break;case"TR":if(m=TeaLeaf.Client.tlFindAncestorByTag(l,"TABLE")){h=m.rows}break;case"OPTION":if(m=TeaLeaf.Client.tlFindAncestorByTag(l,"SELECT")){h=m.options}break;default:m=l.parentNode;if(!m){m=window.document}h=m.childNodes;break}if(h==null){return null}var c=0;for(var f=0;f<h.length;f++){if(h[f].nodeType==1&&h[f].tagName==l.tagName){if(h[f]==l){g[g.length]=[l.tagName.toUpperCase(),c];break}c++}}l=m}if(d){g[g.length]=[l.id]}if(!g.length){return null}var b=[];for(var f=g.length-1;f>=0;f--){if(g[f].length>1){b[b.length]="['"+g[f][0]+"',"+g[f][1]+"]"}else{b[b.length]="['"+g[f][0].toString().replace(/'/g,"\\'")+"']"}}return"["+b.join(",")+"]"};TeaLeaf.Client.CheckIfIdValid=function(a){var c;if(!a||!a.id||typeof(a.id)!="string"){return false}if(TeaLeaf.Client.tlCheckBlackList(a.id)===true){return false}if(TeaLeaf.Client.tlCheckWhiteList(a.id)===false){return false}if(!TeaLeaf.Client.Configuration.tlUniqueIDCheckEnabled){return true}c=a.id;a.id=(new Date()).getTime()+"_TeaLeaf";try{if(!document.getElementById(c)){a.id=c;return true}else{a.id=c;return false}}catch(b){return false}finally{a.id=c}};TeaLeaf.Client.tlGetNodeFromXPath=function(path,decode){if(path==null){return null}if(decode){path=TeaLeaf.Event.tlXMLDecode(path)}var xpath=eval(path);if(xpath==null){return null}var cur_node=window.document;for(var i=0;i<xpath.length;i++){found=false;if(xpath[i].length==1){cur_node=document.getElementById(xpath[i]);if(cur_node==null){return null}}else{k=0;switch(cur_node.tagName){case"TABLE":children=cur_node.rows;break;case"TR":children=cur_node.cells;break;case"SELECT":children=cur_node.options;break;default:children=cur_node.childNodes;break}for(var j=0;j<children.length;j++){if(children[j].nodeType!=1){continue}if(children[j].tagName.toUpperCase()==xpath[i][0]){if(k==xpath[i][1]){cur_node=children[j];found=true;break}k++}}if(!found){return null}}}return cur_node};window.TeaLeaf_Client_tlGetNodeFromXPath=TeaLeaf.Client.tlGetNodeFromXPath;TeaLeaf.Private.tlPrevEvent;TeaLeaf.Private.setLastProcessedEvent=function(b){var c=TeaLeaf.Private,a;if(!b){return}if(!c.tlPrevEvent){c.tlPrevEvent={}}c.tlPrevEvent.type=b.type;c.tlPrevEvent.button=b.button;c.tlPrevEvent.clientX=b.clientX;c.tlPrevEvent.clientY=b.clientY;if(typeof b.keyCode!=="undefined"){c.tlPrevEvent.keyCode=b.keyCode}else{c.tlPrevEvent.keyCode=a}if(typeof b.charCode!=="undefined"){c.tlPrevEvent.charCode=b.charCode}else{c.tlPrevEvent.charCode=a}if(typeof b.timeStamp!=="undefined"){if(b.timeStamp.getTime){c.tlPrevEvent.timeStamp=b.timeStamp.getTime()}else{c.tlPrevEvent.timeStamp=b.timeStamp}}else{c.tlPrevEvent.timeStamp=new Date().getTime()}if(typeof b.target!=="undefined"){c.tlPrevEvent.target=b.target}else{c.tlPrevEvent.target=a}if(typeof b.srcElement!=="undefined"){c.tlPrevEvent.srcElement=b.srcElement}else{c.tlPrevEvent.srcElement=a}};TeaLeaf.Private.getLastProcessedEvent=function(){return TeaLeaf.Private.tlPrevEvent};TeaLeaf.Client.isDuplicateEvent=function(a){var d=TeaLeaf.Private,c=d.getLastProcessedEvent();if(!c||!a){d.setLastProcessedEvent(a);return false}if(c.type!==a.type){d.setLastProcessedEvent(a);return false}if(c.target!==a.target){d.setLastProcessedEvent(a);return false}if(c.srcElement!==a.srcElement){d.setLastProcessedEvent(a);return false}if(c.button!==a.button){d.setLastProcessedEvent(a);return false}if(c.clientX!==a.clientX||c.clientY!==a.clientY){d.setLastProcessedEvent(a);return false}if(c.keyCode!==a.keyCode){d.setLastProcessedEvent(a);return false}if(typeof a.timeStamp!=="undefined"){var b=a.timeStamp.getTime?a.timeStamp.getTime():a.timeStamp;if(c.timeStamp!==b){d.setLastProcessedEvent(a);return false}}else{a.timeStamp=new Date().getTime();if(Math.abs(a.timeStamp-c.timeStamp)>300){d.setLastProcessedEvent(a);return false}}d.setLastProcessedEvent(a);return true};TeaLeaf.Client.tlCheckAttributes=function(g,h){var c=[];var b=TeaLeaf.Client.Configuration.tlAttributeCapture;for(var d=0;d<b.length;d++){if(b[d].tlevent==h.type){var j=b[d].tltagname.toLowerCase();var f=g.tagName.toLowerCase();if(j==f){var a=g.getAttribute(b[d].tlattributename);if(a){c.push(b[d].tlattributename,escape(a))}}}}return c};TeaLeaf.Client.tlAddEvent=function(a){var g=TeaLeaf,f=g.Client,t=f.Configuration,q,r,c,s,l,m,n,h,p,u,j,d,b,v,o;if(!a){a=window.event}r=f.tlGetEventSource(a);if(!r){return}o=f.tlGetXPathFromNode(r);if(!o&&t.tlDiscardInvalidXPath){return}m=[];if(t.tlEnableAttr){m=f.tlCheckAttributes(r,a)}f.tlSendKeys();f.tlSendResize();f.tlSendScroll();if(!r.TeaLeafFocusTime){switch(a.type.toLowerCase()){case"keyup":case"change":case"click":case"dblclick":case"mousedown":r.TeaLeafFocusTime=new Date();break}}if(a.type.toLowerCase()==="blur"&&r.type&&r.type.toLowerCase()==="application/x-shockwave-flash"){return}if(a.type.toLowerCase()==="click"&&f.checkIsInput(r)){g.Event.Configuration.tlidoflastvisitedcontrol=f.tlGetName(r)}if(a.type.toLowerCase()==="click"&&(r.tagName.toUpperCase()==="A")&&g.tlBrowserIsIE()){t.tlIEhref=false;p=r.href;if(p==="#"){t.tlIEhref=true}else{u="javascript:";n=p.substr(0,u.length);if(n.toLowerCase()==u){t.tlIEhref=true}}}h=new g.Event(g.$C("GUI"),a.type);d=f.tlGetName(r);b=r.id;if(!f.CheckIfIdValid(r)){b=""}s=[g.$C("Name"),r.name,g.$C("Id"),b,g.$C("ElementType"),r.type,g.$C("TagName"),r.tagName,g.$C("AltKey"),a.altKey?g.$C("True"):null,g.$C("CtrlKey"),a.ctrlKey?g.$C("True"):null,g.$C("ShiftKey"),a.shiftKey?g.$C("True"):null,g.$C("XPath"),o];h.tlAddData(s);if(t.tlEnableAttr&&m&&m.length>0){h.tlAddData(m)}if(a.type.toLowerCase()==="blur"&&r.TeaLeafFocusTime){c=new Date();h.tlAddData([g.$C("TimeInControl"),g.Event.tlDateDiff(c,r.TeaLeafFocusTime)]);r.TeaLeafFocusTime=null}if(f.tlIsExcluded(r)){h.tlAddData([g.$C("Excluded"),g.$C("True")])}else{v=null;j=null;l=[];if(!r.value&&a.type.toLowerCase()==="change"&&r.tagName.toUpperCase()==="SELECT"){q=r.selectedIndex;if(q>=0&&q<r.options.length){v=escape(r.options[q].text)}}else{v=f.tlReplaceValue(r)}if(v){j=g.Event.tlFormatXMLName(d);if(!j){j=o;j=g.Event.tlFormatXMLName(j)}l=[g.$C("ValueIn"),j,j,v]}if(r.type&&(r.type.toLowerCase()==="checkbox"||r.type.toLowerCase()==="radio")){l.push(g.$C("Checked"),r.checked?g.$C("True"):g.$C("False"))}h.tlAddData(l)}h.tlSend()};TeaLeaf.Client.tlHandleFormSubmit=function(h){TeaLeaf.Client.Configuration.tlactiontype="Submit";TeaLeaf.Client.tlSendKeys();TeaLeaf.Client.tlSendResize();TeaLeaf.Client.tlSendScroll();if(!h){h=window.event}var j=TeaLeaf.Client.tlGetEventSource(h);if(!j){return}var l;if(!j.name){var a=document.forms;for(l=0;l<a.length;l++){if(a[l]==j){j.name="Ordinal-"+l;break}}}if(!j.name){return}if(TeaLeaf.Client.tlIsReplace(j)){var n=TeaLeaf.Client.tlGetReplaceValue(j);var b=TeaLeaf.Client.tlGetName(j);var q=[TeaLeaf.$C("ValueIn"),b,b,n];p.tlAddData(q)}var p=new TeaLeaf.Event(TeaLeaf.$C("GUI"),h.type);var o=[TeaLeaf.$C("Name"),j.name,TeaLeaf.$C("Id"),j.id,TeaLeaf.$C("ElementType"),j.type,TeaLeaf.$C("TagName"),j.tagName,TeaLeaf.$C("AltKey"),h.altKey?TeaLeaf.$C("True"):null,TeaLeaf.$C("CtrlKey"),h.ctrlKey?TeaLeaf.$C("True"):null,TeaLeaf.$C("ShiftKey"),h.shiftKey?TeaLeaf.$C("True"):null,TeaLeaf.$C("NodeName"),h.nodeName,TeaLeaf.$C("NodeValue"),h.nodeValue,TeaLeaf.$C("VisitOrder"),TeaLeaf.Event.Configuration.tlvisitorder];p.tlAddData(o);var f=j.getElementsByTagName("INPUT");p.tlAddData([TeaLeaf.$C("InputFieldCount"),f.length]);p.tlPushXML(TeaLeaf.$C("InputFields"));for(l=0;l<f.length;l++){var d=f[l];if(!d.name){continue}p.tlPushXML(TeaLeaf.$C("Field")+l);var c=[TeaLeaf.$C("Name"),d.name,TeaLeaf.$C("Id"),d.id,TeaLeaf.$C("ElementType"),d.type,TeaLeaf.$C("TagName"),d.tagName];p.tlAddData(c);if(TeaLeaf.Client.tlIsExcluded(b)){p.tlAddData([TeaLeaf.$C("Excluded"),TeaLeaf.$C("True")])}else{if(TeaLeaf.Client.tlIsReplace(d.name)){var n=TeaLeaf.Client.tlGetReplaceValue(d);var b=TeaLeaf.Client.tlGetName(d);var q=[TeaLeaf.$C("ValueIn"),b,b,n];p.tlAddData(q)}else{var g=TeaLeaf.Event.tlFormatXMLName(d.name);var m=[TeaLeaf.$C("ValueIn"),g,g,d.value];p.tlAddData(m)}}p.tlPopXML()}p.tlPopXML();p.tlSend();TeaLeaf.Event.Configuration.tlvisitorder=""};TeaLeaf.Client.tlQueueResize=function(a){TeaLeaf.Client.tlSendKeys();TeaLeaf.Client.tlSendScroll();if(!a){a=window.event}if(a.clientX){TeaLeaf.ResizeClientX=a.clientX;TeaLeaf.ResizeClientY=a.clientY;TeaLeaf.ResizeScreenX=a.screenX;TeaLeaf.ResizeScreenY=a.screenY}else{TeaLeaf.ResizeClientX=a.target.width;TeaLeaf.ResizeClientY=a.target.height}};TeaLeaf.Client.tlHandleFormReset=function(c){TeaLeaf.Client.tlSendKeys();TeaLeaf.Client.tlSendResize();TeaLeaf.Client.tlSendScroll();if(!c){c=window.event}var d=TeaLeaf.Client.tlGetEventSource(c);if(!d){return}var f;if(!d.name){var a=document.forms;for(f=0;f<a.length;f++){if(a[f]==d){d.name="Ordinal-"+f;break}}}if(!d.name){return}if(TeaLeaf.Client.tlIsReplace(d)){var g=TeaLeaf.Client.tlGetReplaceValue(d);var b=TeaLeaf.Client.tlGetName(d);var l=[TeaLeaf.$C("ValueIn"),b,b,g];j.tlAddData(l)}var j=new TeaLeaf.Event(TeaLeaf.$C("GUI"),c.type);var h=[TeaLeaf.$C("Name"),d.name,TeaLeaf.$C("Id"),d.id,TeaLeaf.$C("ElementType"),d.type,TeaLeaf.$C("TagName"),d.tagName,TeaLeaf.$C("AltKey"),c.altKey?TeaLeaf.$C("True"):null,TeaLeaf.$C("CtrlKey"),c.ctrlKey?TeaLeaf.$C("True"):null,TeaLeaf.$C("ShiftKey"),c.shiftKey?TeaLeaf.$C("True"):null,TeaLeaf.$C("NodeName"),c.nodeName,TeaLeaf.$C("NodeValue"),c.nodeValue,TeaLeaf.$C("VisitOrder"),TeaLeaf.Event.Configuration.tlvisitorder];j.tlAddData(h);j.tlSend();TeaLeaf.tlVisitOrder=""};TeaLeaf.Client.tlBeforeUnload=function(){if(TeaLeaf.Client.tlBeforeUnloadFired){return}if(TeaLeaf.Client.Configuration.tlIEhref){TeaLeaf.Client.Configuration.tlIEhref=false;return}TeaLeaf.Client.tlBeforeUnloadFired=true;if(!TeaLeaf.Configuration.xhrAsyncOnUnload){TeaLeaf.Configuration.xhrAsync=false}if(TeaLeaf.Client.Configuration.tlStoreQueueInCookie){var c=new Date();c.setTime(c.getTime()+300000);var b=TeaLeaf.Event.tlQueuedXML.replace(/(\r|\n)/g,"").replace(/;/g,"%3B");TeaLeaf.tlSetCookie("tlQueuedXML",b,c,"/")}if(TeaLeaf.Client.Configuration.tlbeforeunloadflag==true){TeaLeaf.Event.Configuration.tllastdwelltime=new Date();TeaLeaf.Client.Configuration.tlunloadflag=false;var f=new TeaLeaf.Event(TeaLeaf.$C("PERFORMANCE"),TeaLeaf.$C("BeforeUnload"));TeaLeaf.Event.SetType=f.EventType;if(!TeaLeaf.Event.SetSubType){TeaLeaf.Event.SetSubType=f.EventSubType}else{TeaLeaf.Event.SetSubType+="; "+f.EventSubType}TeaLeaf.Event.Configuration.tlbeforeunloadflag=true;var a=[TeaLeaf.$C("MouseMove"),TeaLeaf.Client.tlHasUserMovement?TeaLeaf.$C("True"):TeaLeaf.$C("False"),TeaLeaf.$C("Action"),TeaLeaf.Client.Configuration.tlactiontype,TeaLeaf.$C("VisitOrder"),TeaLeaf.Event.Configuration.tlvisitorder,TeaLeaf.$C("Alerts"),TeaLeaf.Event.tlGetAlertCount()];f.tlAddData(a);TeaLeaf.Event.Configuration.tlasync=false;f.tlSend();TeaLeaf.Event.tlFlushQueue(true);TeaLeaf.Event.Configuration.tlvisitorder=""}setTimeout(function(){TeaLeaf.Client.tlBeforeUnloadFired=false;TeaLeaf.Configuration.xhrAsync=true},1000)};TeaLeaf.Client.tlUnload=function(){var c,a,b,h,d,f,g;c=TeaLeaf;a=c.Client;b=a.Configuration;h=c.Event;d=h.Configuration;a.tlDetachFromAllControls();if(!a.tlBeforeUnloadFired&&b.tlunloadflag){d.tllastdwelltime=new Date();b.tlbeforeunloadflag=false;g=new h(c.$C("PERFORMANCE"),c.$C("Unload"));h.SetType=g.EventType;if(!h.SetSubType){h.SetSubType=g.EventSubType}else{h.SetSubType+="; "+g.EventSubType}f=[c.$C("MouseMove"),a.tlHasUserMovement?c.$C("True"):c.$C("False"),c.$C("Action"),b.tlactiontype,c.$C("VisitOrder"),d.tlvisitorder];g.tlAddData(f);c.Configuration.xhrAsync=false;g.tlSend();h.tlFlushQueue(true);d.tlvisitorder=""}};TeaLeaf.Client.tlAttachToAllControls=function(){TeaLeaf.Client.Configuration.tlcontrolsattached=true;TeaLeaf.Event.tlAddHandler(window,"beforeunload",eval(TeaLeaf.Client.tlBeforeUnload),false);TeaLeaf.Event.tlAddHandler(window,"unload",eval(TeaLeaf.Client.tlUnload),false);TeaLeaf.Client.tlAttachToControls(window);try{var ind;for(ind=0;ind<window.frames.length;ind++){if(window==window.frames[ind]){continue}TeaLeaf.Client.tlAttachToControls(window.frames[ind])}}catch(e){}};TeaLeaf.Client.tlSingleAttach=function(){var tldomsingleelements=TeaLeaf.Client.Configuration.tlSingleAttach;for(var i=0;i<tldomsingleelements.length;i++){if(tldomsingleelements[i].domelementID&&tldomsingleelements[i].domelementID!=""){var tlelement=document.getElementById(tldomsingleelements[i].domelementID);if(tlelement){var func=eval(tldomsingleelements[i].tlhandler);TeaLeaf.Event.tlAddHandler(tlelement,tldomsingleelements[i].domevent,func,false)}}}};TeaLeaf.Client.tlAttachToControls=function(win){try{var handlers=TeaLeaf.Client.Configuration.tlWindowHandlers;for(var i=0;i<handlers.length;i++){if(handlers[i].load){var func=eval(handlers[i].tlhandler);TeaLeaf.Event.tlAddHandler(win,handlers[i].domevent,func,false)}}handlers=TeaLeaf.Client.Configuration.tlDocumentHandlers;for(var i=0;i<handlers.length;i++){if(handlers[i].load){var func=eval(handlers[i].tlhandler);TeaLeaf.Event.tlAddHandler(win.document,handlers[i].domevent,func,false)}}TeaLeaf.Client.tlProcessNode(win.document.body)}catch(e){}};TeaLeaf.Client.tlCheckAttach=function(control){var i,handlers,item_name,lower_item_name;if(control.TeaLeaf||control.TeaLeafExclude){return}control.TeaLeaf=true;if(TeaLeaf.Client.Configuration.tlassignTLID){TeaLeaf.Client.tlAddIdToControl(control)}switch(control.tagName){case"INPUT":case"SELECT":case"TEXTAREA":TeaLeaf.Event.tlAddHandler(control,"focus",TeaLeaf.Client.tlSetFocusTime,false);TeaLeaf.Event.tlAddHandler(control,"blur",TeaLeaf.Client.tlHandleBlur,false);TeaLeaf.Event.tlAddHandler(control,"change",TeaLeaf.Client.tlAddEvent,false);break}if(TeaLeaf.Client.Configuration.tlUniversalAttach){handlers=TeaLeaf.Client.Configuration.tlDocumentHandlers;for(i=0;i<handlers.length;i++){if(handlers[i].load){TeaLeaf.Event.tlAddHandler(control,handlers[i].domevent,eval(handlers[i].tlhandler),false)}}}};TeaLeaf.Client.tlCheckIndControls=function(d){try{if(d.document){var a=d.document.getElementsByTagName("INPUT");for(var b=0;b<a.length;b++){TeaLeaf.Client.tlCheckAttach(a[b])}a=d.document.getElementsByTagName("SELECT");for(var b=0;b<a.length;b++){TeaLeaf.Client.tlCheckAttach(a[b])}a=d.document.getElementsByTagName("BODY");if(a.length>0){a=a[0].getElementsByTagName("*");for(var b=0;b<a.length;b++){TeaLeaf.Client.tlCheckAttach(a[b])}}}}catch(c){}};TeaLeaf.Client.tlProcessNode=function(h,c){var f,b,d,a;if(typeof(h)==="string"){h=document.getElementById(h)}if(!h){h=window.document.body}try{switch(h.tagName){case"INPUT":case"SELECT":case"TEXTAREA":TeaLeaf.Client.tlCheckAttach(h);break;default:if(TeaLeaf.Client.Configuration.tlUniversalAttach&&TeaLeaf.Client.tlTagNameAllowed(h.tagName)){TeaLeaf.Client.tlCheckAttach(h)}break}if(!c){d=["INPUT","SELECT","TEXTAREA"];for(f=0;f<d.length;f++){a=h.getElementsByTagName(d[f]);for(b=0;b<a.length;b++){TeaLeaf.Client.tlCheckAttach(a[b])}}if(TeaLeaf.Client.Configuration.tlUniversalAttach){if(TeaLeaf.Client.Configuration.tlExcludeTags){a=h.getElementsByTagName("*");for(f=0;f<a.length;f++){if(TeaLeaf.Client.tlTagNameAllowed(a[f].tagName)){TeaLeaf.Client.tlCheckAttach(a[f])}}}else{for(f in TeaLeaf.Client.Configuration.tlNodeTags){a=h.getElementsByTagName(f);for(b=0;b<a.length;b++){TeaLeaf.Client.tlCheckAttach(a[b])}}}}}}catch(g){}};TeaLeaf.Client.tlSetFocusTime=function(b){if(!b){b=window.event}var a=TeaLeaf.Client.tlGetEventSource(b);if(!a||a.type=="application/x-shockwave-flash"){return}var a=TeaLeaf.Client.tlGetEventSource(b);if(!a){return}if(!a.TeaLeafFocusTime){a.TeaLeafFocusTime=new Date()}if(TeaLeaf.Client.Configuration.tlsendfocus){TeaLeaf.Client.tlAddEvent(b)}};TeaLeaf.Client.tlHandleBlur=function(b){if(!b){b=window.event}var a=TeaLeaf.Client.tlGetEventSource(b);if(!a||a.type=="application/x-shockwave-flash"){return}TeaLeaf.Client.tlEndVisit(a);if(TeaLeaf.Client.checkIsInput(a)){TeaLeaf.Event.Configuration.tlidoflastvisitedcontrol=TeaLeaf.Client.tlGetName(a)}if(TeaLeaf.Client.Configuration.tlsendblur){TeaLeaf.Client.tlAddEvent(b)}a.TeaLeafFocusTime=null};TeaLeaf.Client.tlEndVisit=function(c){if(c.TeaLeafFocusTime){var a=TeaLeaf.Client.tlGetName(c);if(!a){a=TeaLeaf.Client.tlGetAnchor(c,false);if(a){a="LEVEL"+a}else{a="unnamed"}}var d=TeaLeaf.Event.tlDateDiff(c.TeaLeafFocusTime,new Date());var b=a+":"+d;if(TeaLeaf.Event.Configuration.tlvisitorder!=""){TeaLeaf.Event.Configuration.tlvisitorder=TeaLeaf.Event.Configuration.tlvisitorder+";"+b}else{TeaLeaf.Event.Configuration.tlvisitorder=b}}};TeaLeaf.Client.tlDetachFromAllControls=function(){TeaLeaf.Client.Configuration.tlcontrolsattached=false;TeaLeaf.Client.tlDetachFromControls(window);try{var b;for(b=0;b<window.frames.length;b++){var a=window.frames[b];TeaLeaf.Client.tlDetachFromControls(a)}}catch(c){}};TeaLeaf.Client.tlDetachFromControls=function(win){try{var handlers=TeaLeaf.Client.Configuration.tlWindowHandlers;for(var i=0;i<handlers.length;i++){var func=eval(handlers[i].tlhandler);TeaLeaf.Event.tlRemoveHandler(win,handlers[i].domevent,func,false)}handlers=TeaLeaf.Client.Configuration.tlDocumentHandlers;for(var i=0;i<handlers.length;i++){var func=eval(handlers[i].tlhandler);TeaLeaf.Event.tlRemoveHandler(win.document,handlers[i].domevent,func,false)}var items=win.document.getElementsByTagName("INPUT");var i;for(i=0;i<items.length;i++){TeaLeaf.Event.tlRemoveHandler(items[i],"change",TeaLeaf.Client.tlAddEvent,false);TeaLeaf.Event.tlRemoveHandler(items[i],"blur",TeaLeaf.Client.tlHandleBlur,false);items[i].TeaLeaf=false}items=win.document.getElementsByTagName("SELECT");for(i=0;i<items.length;i++){TeaLeaf.Event.tlRemoveHandler(items[i],"change",TeaLeaf.Client.tlAddEvent,false);TeaLeaf.Event.tlRemoveHandler(items[i],"blur",TeaLeaf.Client.tlHandleBlur,false);items[i].TeaLeaf=false}}catch(e){}};TeaLeaf.Client.tlAttachToControl=function(domelement,eventtype,eventHandler){if(eventHandler){TeaLeaf.Event.tlAddHandler(domelement,eventtype,eventHandler,false)}else{TeaLeaf.Event.tlAddHandler(domelement,eventtype,eval(TeaLeaf.Client.tlAddEvent),false)}};TeaLeaf.Client.tlDetachFromControl=function(domelement,eventtype,eventHandler){if(eventHandler){TeaLeaf.Event.tlRemoveHandler(domelement,eventtype,eventHandler,false)}else{TeaLeaf.Event.tlRemoveHandler(domelement,eventtype,eval(TeaLeaf.Client.tlAddEvent),false)}};TeaLeaf.Client.tlScanForAdditions=function(){if(!TeaLeaf.Client.Configuration.tlScheduledScan){return}TeaLeaf.Client.tlProcessNode(document.body);try{for(var b=0;b<window.frames.length;b++){var a=window.frames[b];TeaLeaf.Client.tlProcessNode(a.document.body)}}catch(c){}window.clearTimeout(TeaLeaf.Client.tlTimeoutID);TeaLeaf.Client.tlTimeoutID=window.setTimeout(TeaLeaf.Client.tlScanForAdditions,TeaLeaf.Client.Configuration.tlscanupdate)};TeaLeaf.Client.tlTagNameAllowed=function(a){if(a==null){return false}var b=TeaLeaf.Client.Configuration.tlNodeTags[a];if(b==null){b=false}if(TeaLeaf.Client.Configuration.tlExcludeTags){return !b}else{return b}};TeaLeaf.Client.tlStartListeners=function(){TeaLeaf.Client.tlAttachToAllControls();TeaLeaf.Client.tlSingleAttach()};TeaLeaf.Client.tlEndListeners=function(){TeaLeaf.Event.tlFlushQueue(true);TeaLeaf.Client.tlDetachFromAllControls()};TeaLeaf.Client.tlSendValueChange=function(c,d){var j=new TeaLeaf.Event(TeaLeaf.$C("GUI"),d);var h=[TeaLeaf.$C("Name"),c.name,TeaLeaf.$C("Id"),c.id,TeaLeaf.$C("ElementType"),c.type];j.tlAddData(h);var f=TeaLeaf.Client.tlGetName(c);var b=TeaLeaf.Event.tlFormatXMLName(f);var a=TeaLeaf.Client.tlReplaceValue(c);var g=[TeaLeaf.$C("ValueIn"),b,b,a];j.tlAddData(g);j.tlSend()};TeaLeaf.Client.tlSetup=function(){var a=TeaLeaf.tlGetCookieValue("tlQueuedXML");if(a){TeaLeaf.Event.tlQueuedXML+=a.replace(/%3B/g,";")}TeaLeaf.Client.tlAttachToAllControls();TeaLeaf.Client.tlSingleAttach();if(TeaLeaf.Event.Configuration.tlcatchpopups){TeaLeaf.SavedWindowOpen=window.open;window.open=function(b,c,f,g){var h="blocked";var d;if(typeof TeaLeaf.SavedWindowOpen=="function"){d=TeaLeaf.SavedWindowOpen.apply(this,arguments)}else{b=b?b:"";c=c?c:"";f=f?f:"";d=TeaLeaf.SavedWindowOpen(b,c,f,g)}try{if(!d.closed){h="visible"}}catch(m){if(TeaLeaf.Event.Configuration.tlshowexceptions){alert(m.name+": "+m.message+"\r\n\r\nPos 8")}}var l=new TeaLeaf.Event(TeaLeaf.$C("GUI"),TeaLeaf.$C("WindowOpen"));var j=[TeaLeaf.$C("Status"),h,TeaLeaf.$C("URL"),escape(b),TeaLeaf.$C("Name"),c,TeaLeaf.$C("Features"),f,TeaLeaf.$C("Replace"),g];l.tlAddData(j);l.tlSend();return d}}window.clearTimeout(TeaLeaf.Client.tlTimeoutID);if(TeaLeaf.Client.Configuration.tlscanupdate>0){TeaLeaf.Client.tlTimeoutID=window.setTimeout(TeaLeaf.Client.tlScanForAdditions,TeaLeaf.Client.Configuration.tlscanupdate)}};TeaLeaf.Client.CallInit=function(){TeaLeaf.Event.tlRemoveHandler(window,"beforeunload",eval(TeaLeaf.Client.tlBeforeUnload),false);TeaLeaf.Event.tlRemoveHandler(window,"unload",eval(TeaLeaf.Client.tlUnload),false);TeaLeaf.addOnLoad(TeaLeaf.Client.tlSetup)};if(TeaLeaf.Client.Configuration.tlinit==false){TeaLeaf.Client.Configuration.tlinit=true;TeaLeaf.Client.CallInit()}};var Prototype={Version:"1.6.1",Browser:(function(){var B=navigator.userAgent;var A=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!A,Opera:A,WebKit:B.indexOf("AppleWebKit/")>-1,Gecko:B.indexOf("Gecko")>-1&&B.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(B)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var A=window.Element||window.HTMLElement;return !!(A&&A.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var D=document.createElement("div");var B=document.createElement("form");var A=false;if(D.__proto__&&(D.__proto__!==B.__proto__)){A=true}D=B=null;return A})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(A){return A}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var B;for(var D=0,A=arguments.length;D<A;D++){var E=arguments[D];try{B=E();break}catch(F){}}return B}};var Class=(function(){function D(){}function B(){var F=null,G=$A(arguments);if(Object.isFunction(G[0])){F=G.shift()}function E(){this.initialize.apply(this,arguments)}Object.extend(E,Class.Methods);E.superclass=F;E.subclasses=[];if(F){D.prototype=F.prototype;E.prototype=new D;F.subclasses.push(E)}for(var H=0;H<G.length;H++){E.addMethods(G[H])}if(!E.prototype.initialize){E.prototype.initialize=Prototype.emptyFunction}E.prototype.constructor=E;return E}function A(F){var I=this.superclass&&this.superclass.prototype;var H=Object.keys(F);if(!Object.keys({toString:true}).length){if(F.toString!=Object.prototype.toString){H.push("toString")}if(F.valueOf!=Object.prototype.valueOf){H.push("valueOf")}}for(var J=0,G=H.length;J<G;J++){var E=H[J],K=F[E];if(I&&Object.isFunction(K)&&K.argumentNames().first()=="$super"){var L=K;K=(function(M){return function(){return I[M].apply(this,arguments)}})(E).wrap(L);K.valueOf=L.valueOf.bind(L);K.toString=L.toString.bind(L)}this.prototype[E]=K}return this}return{create:B,Methods:{addMethods:A}}})();(function(){var F=Object.prototype.toString;function A(V,U){for(var T in U){V[T]=U[T]}return V}function P(T){try{if(D(T)){return"undefined"}if(T===null){return"null"}return T.inspect?T.inspect():String(T)}catch(U){if(U instanceof RangeError){return"..."}throw U}}function S(V){var W=typeof V;switch(W){case"undefined":case"function":case"unknown":return;case"boolean":return V.toString()}if(V===null){return"null"}if(V.toJSON){return V.toJSON()}if(J(V)){return}var U=[];for(var T in V){var X=S(V[T]);if(!D(X)){U.push(T.toJSON()+": "+X)}}return"{"+U.join(", ")+"}"}function H(T){return $H(T).toQueryString()}function E(T){return T&&T.toHTML?T.toHTML():String.interpret(T)}function Q(V){var U=[];for(var T in V){U.push(T)}return U}function O(V){var U=[];for(var T in V){U.push(V[T])}return U}function K(T){return A({},T)}function J(T){return !!(T&&T.nodeType==1)}function G(T){return F.call(T)=="[object Array]"}function L(T){return T instanceof Hash}function B(T){return typeof T==="function"}function I(T){return F.call(T)=="[object String]"}function M(T){return F.call(T)=="[object Number]"}function D(T){return typeof T==="undefined"}A(Object,{extend:A,inspect:P,toJSON:S,toQueryString:H,toHTML:E,keys:Q,values:O,clone:K,isElement:J,isArray:G,isHash:L,isFunction:B,isString:I,isNumber:M,isUndefined:D})})();Object.extend(Function.prototype,(function(){var L=Array.prototype.slice;function E(Q,O){var P=Q.length,M=O.length;while(M--){Q[P+M]=O[M]}return Q}function K(O,M){O=L.call(O,0);return E(O,M)}function D(){var M=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return M.length==1&&!M[0]?[]:M}function I(O){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var P=this,M=L.call(arguments,1);return function(){var Q=K(M,arguments);return P.apply(O,Q)}}function G(O){var P=this,M=L.call(arguments,1);return function(S){var Q=E([S||window.event],M);return P.apply(O,Q)}}function J(){if(!arguments.length){return this}var O=this,M=L.call(arguments,0);return function(){var P=K(M,arguments);return O.apply(this,P)}}function F(M){var P=this,O=L.call(arguments,1);M=M*1000;return window.setTimeout(function(){return P.apply(P,O)},M)}function A(){var M=E([0.01],arguments);return this.delay.apply(this,M)}function B(O){var M=this;return function(){var P=E([M.bind(this)],arguments);return O.apply(this,P)}}function H(){if(this._methodized){return this._methodized}var M=this;return this._methodized=function(){var O=E([this],arguments);return M.apply(null,O)}}return{argumentNames:D,bind:I,bindAsEventListener:G,curry:J,delay:F,defer:A,wrap:B,methodize:H}})());Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+'Z"'};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(A){return String(A).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};var PeriodicalExecuter=Class.create({initialize:function(A,B){this.callback=A;this.frequency=B;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},execute:function(){this.callback(this)},stop:function(){if(!this.timer){return}clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute();this.currentlyExecuting=false}catch(A){this.currentlyExecuting=false;throw A}}}});Object.extend(String,{interpret:function(A){return A==null?"":String(A)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,(function(){function prepareReplacement(replacement){if(Object.isFunction(replacement)){return replacement}var template=new Template(replacement);return function(match){return template.evaluate(match)}}function gsub(pattern,replacement){var result="",source=this,match;replacement=prepareReplacement(replacement);if(Object.isString(pattern)){pattern=RegExp.escape(pattern)}if(!(pattern.length||pattern.source)){replacement=replacement("");return replacement+source.split("").join(replacement)+replacement}while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length)}else{result+=source,source=""}}return result}function sub(pattern,replacement,count){replacement=prepareReplacement(replacement);count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0){return match[0]}return replacement(match)})}function scan(pattern,iterator){this.gsub(pattern,iterator);return String(this)}function truncate(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?"...":truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this)}function strip(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function stripTags(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")}function stripScripts(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")}function extractScripts(){var matchAll=new RegExp(Prototype.ScriptFragment,"img");var matchOne=new RegExp(Prototype.ScriptFragment,"im");return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||["",""])[1]})}function evalScripts(){return this.extractScripts().map(function(script){return eval(script)})}function escapeHTML(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function unescapeHTML(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function toQueryParams(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match){return{}}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift());var value=pair.length>1?pair.join("="):pair[0];if(value!=undefined){value=decodeURIComponent(value)}if(key in hash){if(!Object.isArray(hash[key])){hash[key]=[hash[key]]}hash[key].push(value)}else{hash[key]=value}}return hash})}function toArray(){return this.split("")}function succ(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)}function times(count){return count<1?"":new Array(count+1).join(this)}function camelize(){var parts=this.split("-"),len=parts.length;if(len==1){return parts[0]}var camelized=this.charAt(0)=="-"?parts[0].charAt(0).toUpperCase()+parts[0].substring(1):parts[0];for(var i=1;i<len;i++){camelized+=parts[i].charAt(0).toUpperCase()+parts[i].substring(1)}return camelized}function capitalize(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()}function underscore(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()}function dasherize(){return this.replace(/_/g,"-")}function inspect(useDoubleQuotes){var escapedString=this.replace(/[\x00-\x1f\\]/g,function(character){if(character in String.specialChar){return String.specialChar[character]}return"\\u00"+character.charCodeAt().toPaddedString(2,16)});if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'}return"'"+escapedString.replace(/'/g,"\\'")+"'"}function toJSON(){return this.inspect(true)}function unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")}function isJSON(){var str=this;if(str.blank()){return false}str=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str)}function evalJSON(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())}function include(pattern){return this.indexOf(pattern)>-1}function startsWith(pattern){return this.indexOf(pattern)===0}function endsWith(pattern){var d=this.length-pattern.length;return d>=0&&this.lastIndexOf(pattern)===d}function empty(){return this==""}function blank(){return/^\s*$/.test(this)}function interpolate(object,pattern){return new Template(this,pattern).evaluate(object)}return{gsub:gsub,sub:sub,scan:scan,truncate:truncate,strip:String.prototype.trim?String.prototype.trim:strip,stripTags:stripTags,stripScripts:stripScripts,extractScripts:extractScripts,evalScripts:evalScripts,escapeHTML:escapeHTML,unescapeHTML:unescapeHTML,toQueryParams:toQueryParams,parseQuery:toQueryParams,toArray:toArray,succ:succ,times:times,camelize:camelize,capitalize:capitalize,underscore:underscore,dasherize:dasherize,inspect:inspect,toJSON:toJSON,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:evalJSON,include:include,startsWith:startsWith,endsWith:endsWith,empty:empty,blank:blank,interpolate:interpolate}})());var Template=Class.create({initialize:function(B,A){this.template=B.toString();this.pattern=A||Template.Pattern},evaluate:function(A){if(A&&Object.isFunction(A.toTemplateReplacements)){A=A.toTemplateReplacements()}return this.template.gsub(this.pattern,function(G){if(A==null){return(G[1]+"")}var D=G[1]||"";if(D=="\\"){return G[2]}var E=A,H=G[3];var B=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;G=B.exec(H);if(G==null){return D}while(G!=null){var F=G[1].startsWith("[")?G[2].replace(/\\\\]/g,"]"):G[1];E=E[F];if(null==E||""==G[3]){break}H=H.substring("["==G[3]?G[1].length:G[0].length);G=B.exec(H)}return D+String.interpret(E)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function E(b,a){var Z=0;try{this._each(function(d){b.call(a,d,Z++)})}catch(c){if(c!=$break){throw c}}return this}function Q(Z,c,b){var a=-Z,d=[],e=this.toArray();if(Z<1){return e}while((a+=Z)<e.length){d.push(e.slice(a,a+Z))}return d.collect(c,b)}function D(a,Z){a=a||Prototype.K;var b=true;this.each(function(d,c){b=b&&!!a.call(Z,d,c);if(!b){throw $break}});return b}function J(a,Z){a=a||Prototype.K;var b=false;this.each(function(d,c){if(b=!!a.call(Z,d,c)){throw $break}});return b}function K(b,a){b=b||Prototype.K;var Z=[];this.each(function(d,c){Z.push(b.call(a,d,c))});return Z}function O(a,Z){var b;this.each(function(d,c){if(a.call(Z,d,c)){b=d;throw $break}});return b}function B(b,a){var Z=[];this.each(function(d,c){if(b.call(a,d,c)){Z.push(d)}});return Z}function I(Z,c,b){c=c||Prototype.K;var a=[];if(Object.isString(Z)){Z=new RegExp(RegExp.escape(Z))}this.each(function(e,d){if(Z.match(e)){a.push(c.call(b,e,d))}});return a}function A(Z){if(Object.isFunction(this.indexOf)){if(this.indexOf(Z)!=-1){return true}}var a=false;this.each(function(b){if(b==Z){a=true;throw $break}});return a}function S(Z,a){a=Object.isUndefined(a)?null:a;return this.eachSlice(Z,function(b){while(b.length<Z){b.push(a)}return b})}function X(Z,b,a){this.each(function(d,c){Z=b.call(a,Z,d,c)});return Z}function L(a){var Z=$A(arguments).slice(1);return this.map(function(b){return b[a].apply(b,Z)})}function T(a,Z){a=a||Prototype.K;var b;this.each(function(d,c){d=a.call(Z,d,c);if(b==null||d>=b){b=d}});return b}function P(a,Z){a=a||Prototype.K;var b;this.each(function(d,c){d=a.call(Z,d,c);if(b==null||d<b){b=d}});return b}function F(c,a){c=c||Prototype.K;var b=[],Z=[];this.each(function(e,d){(c.call(a,e,d)?b:Z).push(e)});return[b,Z]}function G(Z){var a=[];this.each(function(b){a.push(b[Z])});return a}function H(b,a){var Z=[];this.each(function(d,c){if(!b.call(a,d,c)){Z.push(d)}});return Z}function W(a,Z){return this.map(function(c,b){return{value:c,criteria:a.call(Z,c,b)}}).sort(function(f,e){var d=f.criteria,c=e.criteria;return d<c?-1:d>c?1:0}).pluck("value")}function U(){return this.map()}function V(){var a=Prototype.K,Z=$A(arguments);if(Object.isFunction(Z.last())){a=Z.pop()}var b=[this].concat(Z).map($A);return this.map(function(d,c){return a(b.pluck(c))})}function M(){return this.toArray().length}function Y(){return"#<Enumerable:"+this.toArray().inspect()+">"}return{each:E,eachSlice:Q,all:D,every:D,any:J,some:J,collect:K,map:K,detect:O,findAll:B,select:B,filter:B,grep:I,include:A,member:A,inGroupsOf:S,inject:X,invoke:L,max:T,min:P,partition:F,pluck:G,reject:H,sortBy:W,toArray:U,entries:U,zip:V,size:M,inspect:Y,find:O}})();function $A(D){if(!D){return[]}if("toArray" in Object(D)){return D.toArray()}var A=D.length||0,B=new Array(A);while(A--){B[A]=D[A]}return B}function $w(A){if(!Object.isString(A)){return[]}A=A.strip();return A?A.split(/\s+/):[]}Array.from=$A;(function(){var O=Array.prototype,S=O.slice,U=O.forEach;function B(a){for(var Z=0,Y=this.length;Z<Y;Z++){a(this[Z])}}if(!U){U=B}function P(){this.length=0;return this}function E(){return this[0]}function H(){return this[this.length-1]}function K(){return this.select(function(Y){return Y!=null})}function J(){return this.inject([],function(Z,Y){if(Object.isArray(Y)){return Z.concat(Y.flatten())}Z.push(Y);return Z})}function I(){var Y=S.call(arguments,0);return this.select(function(Z){return !Y.include(Z)})}function G(Y){return(Y!==false?this:this.toArray())._reverse()}function M(Y){return this.inject([],function(b,a,Z){if(0==Z||(Y?b.last()!=a:!b.include(a))){b.push(a)}return b})}function V(Y){return this.uniq().findAll(function(Z){return Y.detect(function(a){return Z===a})})}function W(){return S.call(this,0)}function L(){return this.length}function X(){return"["+this.map(Object.inspect).join(", ")+"]"}function Q(){var Y=[];this.each(function(Z){var a=Object.toJSON(Z);if(!Object.isUndefined(a)){Y.push(a)}});return"["+Y.join(", ")+"]"}function A(a,Z){Z||(Z=0);var Y=this.length;if(Z<0){Z=Y+Z}for(;Z<Y;Z++){if(this[Z]===a){return Z}}return -1}function T(Z,Y){Y=isNaN(Y)?this.length:(Y<0?this.length+Y:Y)+1;var a=this.slice(0,Y).reverse().indexOf(Z);return(a<0)?a:Y-a-1}function D(){var d=S.call(this,0),b;for(var a=0,Y=arguments.length;a<Y;a++){b=arguments[a];if(Object.isArray(b)&&!("callee" in b)){for(var Z=0,c=b.length;Z<c;Z++){d.push(b[Z])}}else{d.push(b)}}return d}Object.extend(O,Enumerable);if(!O._reverse){O._reverse=O.reverse}Object.extend(O,{_each:U,clear:P,first:E,last:H,compact:K,flatten:J,without:I,reverse:G,uniq:M,intersect:V,clone:W,toArray:W,size:L,inspect:X,toJSON:Q});var F=(function(){return[].concat(arguments)[0][0]!==1})(1,2);if(F){O.concat=D}if(!O.indexOf){O.indexOf=A}if(!O.lastIndexOf){O.lastIndexOf=T}})();function $H(A){return new Hash(A)}var Hash=Class.create(Enumerable,(function(){function E(T){this._object=Object.isHash(T)?T.toObject():Object.clone(T)}function F(U){for(var T in this._object){var V=this._object[T],W=[T,V];W.key=T;W.value=V;U(W)}}function L(T,U){return this._object[T]=U}function B(T){if(this._object[T]!==Object.prototype[T]){return this._object[T]}}function S(T){var U=this._object[T];delete this._object[T];return U}function K(){return Object.clone(this._object)}function Q(){return this.pluck("key")}function O(){return this.pluck("value")}function H(U){var T=this.detect(function(V){return V.value===U});return T&&T.key}function J(T){return this.clone().update(T)}function D(T){return new Hash(T).inject(this,function(U,V){U.set(V.key,V.value);return U})}function A(T,U){if(Object.isUndefined(U)){return T}return T+"="+encodeURIComponent(String.interpret(U))}function G(){return this.inject([],function(U,W){var T=encodeURIComponent(W.key),V=W.value;if(V&&typeof V=="object"){if(Object.isArray(V)){return U.concat(V.map(A.curry(T)))}}else{U.push(A(T,V))}return U}).join("&")}function M(){return"#<Hash:{"+this.map(function(T){return T.map(Object.inspect).join(": ")}).join(", ")+"}>"}function P(){return Object.toJSON(this.toObject())}function I(){return new Hash(this)}return{initialize:E,_each:F,set:L,get:B,unset:S,toObject:K,toTemplateReplacements:K,keys:Q,values:O,index:H,merge:J,update:D,toQueryString:G,inspect:M,toJSON:P,clone:I}})());Hash.from=$H;Object.extend(Number.prototype,(function(){function E(){return this.toPaddedString(2,16)}function F(){return this+1}function A(L,K){$R(0,this,true).each(L,K);return this}function B(K,M){var L=this.toString(M||10);return"0".times(K-L.length)+L}function I(){return isFinite(this)?this.toString():"null"}function J(){return Math.abs(this)}function H(){return Math.round(this)}function G(){return Math.ceil(this)}function D(){return Math.floor(this)}return{toColorPart:E,succ:F,times:A,toPaddedString:B,toJSON:I,abs:J,round:H,ceil:G,floor:D}})());function $R(D,A,B){return new ObjectRange(D,A,B)}var ObjectRange=Class.create(Enumerable,(function(){function B(G,E,F){this.start=G;this.end=E;this.exclusive=F}function D(E){var F=this.start;while(this.include(F)){E(F);F=F.succ()}}function A(E){if(E<this.start){return false}if(this.exclusive){return E<this.end}return E<=this.end}return{initialize:B,_each:D,include:A}})());var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(A){this.responders._each(A)},register:function(A){if(!this.include(A)){this.responders.push(A)}},unregister:function(A){this.responders=this.responders.without(A)},dispatch:function(D,B,E,A){this.each(function(F){if(Object.isFunction(F[D])){try{F[D].apply(F,[B,E,A])}catch(G){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(A){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};Object.extend(this.options,A||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters)){this.options.parameters=this.options.parameters.toQueryParams()}else{if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()}}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,A,B){$super(B);this.transport=Ajax.getTransport();this.request(A)},request:function(A){this.url=A;this.method=this.options.method;var E=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){E._method=this.method;this.method="post"}this.parameters=E;if(E=Object.toQueryString(E)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+E}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){E+="&_="}}}try{var B=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(B)}Ajax.Responders.dispatch("onCreate",this,B);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||E):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(D){this.dispatchException(D)}},onStateChange:function(){var A=this.transport.readyState;if(A>1&&!((A==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var F={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){F["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){F.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var B=this.options.requestHeaders;if(Object.isFunction(B.push)){for(var E=0,A=B.length;E<A;E+=2){F[B[E]]=B[E+1]}}else{$H(B).each(function(G){F[G.key]=G.value})}}for(var D in F){this.transport.setRequestHeader(D,F[D])}},success:function(){var A=this.getStatus();return !A||(A>=200&&A<300)},getStatus:function(){try{return this.transport.status||0}catch(A){return 0}},respondToReadyState:function(A){var D=Ajax.Request.Events[A],B=new Ajax.Response(this);if(D=="Complete"){try{this._complete=true;(this.options["on"+B.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(B,B.headerJSON)}catch(F){this.dispatchException(F)}var E=B.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&E&&E.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+D]||Prototype.emptyFunction)(B,B.headerJSON);Ajax.Responders.dispatch("on"+D,this,B,B.headerJSON)}catch(F){this.dispatchException(F)}if(D=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var A=this.url.match(/^\s*https?:\/\/[^\/]*/);return !A||(A[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))},getHeader:function(A){try{return this.transport.getResponseHeader(A)||null}catch(B){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(A){(this.options.onException||Prototype.emptyFunction)(this,A);Ajax.Responders.dispatch("onException",this,A)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(D){this.request=D;var E=this.transport=D.transport,A=this.readyState=E.readyState;if((A>2&&!Prototype.Browser.IE)||A==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(E.responseText);this.headerJSON=this._getHeaderJSON()}if(A==4){var B=E.responseXML;this.responseXML=Object.isUndefined(B)?null:B;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(A){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(A){return null}},getResponseHeader:function(A){return this.transport.getResponseHeader(A)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var A=this.getHeader("X-JSON");if(!A){return null}A=decodeURIComponent(escape(A));try{return A.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(B){this.request.dispatchException(B)}},_getResponseJSON:function(){var A=this.request.options;if(!A.evalJSON||(A.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(A.sanitizeJSON||!this.request.isSameOrigin())}catch(B){this.request.dispatchException(B)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,D,A,B){this.container={success:(D.success||D),failure:(D.failure||(D.success?null:D))};B=Object.clone(B);var E=B.onComplete;B.onComplete=(function(G,F){this.updateContent(G.responseText);if(Object.isFunction(E)){E(G,F)}}).bind(this);$super(A,B)},updateContent:function(E){var B=this.container[this.success()?"success":"failure"],D=this.options;if(!D.evalScripts){E=E.stripScripts()}if(B=$(B)){if(D.insertion){if(Object.isString(D.insertion)){var A={};A[D.insertion]=E;B.insert(A)}else{D.insertion(B,E)}}else{B.update(E)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,D,A,B){$super(B);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=D;this.url=A;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(A){if(this.options.decay){this.decay=(A.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=A.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(D){if(arguments.length>1){for(var E=0,A=[],B=arguments.length;E<B;E++){A.push($(arguments[E]))}return A}if(Object.isString(D)){D=document.getElementById(D)}return Element.extend(D)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(G,E){var D=[];var F=document.evaluate(G,$(E)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var B=0,A=F.snapshotLength;B<A;B++){D.push(Element.extend(F.snapshotItem(B)))}return D}}if(!window.Node){var Node={}}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})}(function(A){var B=(function(){var F=document.createElement("form");var G=document.createElement("input");var E=document.documentElement;G.setAttribute("name","test");F.appendChild(G);E.appendChild(F);var H=F.elements?(typeof F.elements.test=="undefined"):null;E.removeChild(F);F=G=null;return H})();var D=A.Element;A.Element=function(G,F){F=F||{};G=G.toLowerCase();var E=Element.cache;if(B&&F.name){G="<"+G+' name="'+F.name+'">';delete F.name;return Element.writeAttribute(document.createElement(G),F)}if(!E[G]){E[G]=Element.extend(document.createElement(G))}return Element.writeAttribute(E[G].cloneNode(false),F)};Object.extend(A.Element,D||{});if(D){A.Element.prototype=D.prototype}})(this);Element.cache={};Element.idCounter=1;Element.Methods={visible:function(A){return $(A).style.display!="none"},toggle:function(A){A=$(A);Element[Element.visible(A)?"hide":"show"](A);return A},hide:function(A){A=$(A);A.style.display="none";return A},show:function(A){A=$(A);A.style.display="";return A},remove:function(A){A=$(A);A.parentNode.removeChild(A);return A},update:(function(){var B=(function(){var F=document.createElement("select"),G=true;F.innerHTML='<option value="test">test</option>';if(F.options&&F.options[0]){G=F.options[0].nodeName.toUpperCase()!=="OPTION"}F=null;return G})();var A=(function(){try{var F=document.createElement("table");if(F&&F.tBodies){F.innerHTML="<tbody><tr><td>test</td></tr></tbody>";var H=typeof F.tBodies[0]=="undefined";F=null;return H}}catch(G){return true}})();var E=(function(){var F=document.createElement("script"),H=false;try{F.appendChild(document.createTextNode(""));H=!F.firstChild||F.firstChild&&F.firstChild.nodeType!==3}catch(G){H=true}F=null;return H})();function D(G,H){G=$(G);if(H&&H.toElement){H=H.toElement()}if(Object.isElement(H)){return G.update().insert(H)}H=Object.toHTML(H);var F=G.tagName.toUpperCase();if(F==="SCRIPT"&&E){G.text=H;return G}if(B||A){if(F in Element._insertionTranslations.tags){while(G.firstChild){G.removeChild(G.firstChild)}Element._getContentFromAnonymousElement(F,H.stripScripts()).each(function(I){G.appendChild(I)})}else{G.innerHTML=H.stripScripts()}}else{G.innerHTML=H.stripScripts()}H.evalScripts.bind(H).defer();return G}return D})(),replace:function(B,D){B=$(B);if(D&&D.toElement){D=D.toElement()}else{if(!Object.isElement(D)){D=Object.toHTML(D);var A=B.ownerDocument.createRange();A.selectNode(B);D.evalScripts.bind(D).defer();D=A.createContextualFragment(D.stripScripts())}}B.parentNode.replaceChild(D,B);return B},insert:function(E,G){E=$(E);if(Object.isString(G)||Object.isNumber(G)||Object.isElement(G)||(G&&(G.toElement||G.toHTML))){G={bottom:G}}var F,B,D,H;for(var A in G){F=G[A];A=A.toLowerCase();B=Element._insertionTranslations[A];if(F&&F.toElement){F=F.toElement()}if(Object.isElement(F)){B(E,F);continue}F=Object.toHTML(F);D=((A=="before"||A=="after")?E.parentNode:E).tagName.toUpperCase();H=Element._getContentFromAnonymousElement(D,F.stripScripts());if(A=="top"||A=="after"){H.reverse()}H.each(B.curry(E));F.evalScripts.bind(F).defer()}return E},wrap:function(B,D,A){B=$(B);if(Object.isElement(D)){$(D).writeAttribute(A||{})}else{if(Object.isString(D)){D=new Element(D,A)}else{D=new Element("div",D)}}if(B.parentNode){B.parentNode.replaceChild(D,B)}D.appendChild(B);return D},inspect:function(A){A=$(A);var B="<"+A.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(G){var D=G.first(),E=G.last();var F=(A[D]||"").toString();if(F){B+=" "+E+"="+F.inspect(true)}});return B+">"},recursivelyCollect:function(D,B){D=$(D);var A=[];while(D=D[B]){if(D.nodeType==1){A.push(Element.extend(D))}}return A},ancestors:function(A){return Element.recursivelyCollect(A,"parentNode")},descendants:function(A){return Element.select(A,"*")},firstDescendant:function(A){A=$(A).firstChild;while(A&&A.nodeType!=1){A=A.nextSibling}return $(A)},immediateDescendants:function(A){if(!(A=$(A).firstChild)){return[]}while(A&&A.nodeType!=1){A=A.nextSibling}if(A){return[A].concat($(A).nextSiblings())}return[]},previousSiblings:function(A){return Element.recursivelyCollect(A,"previousSibling")},nextSiblings:function(A){return Element.recursivelyCollect(A,"nextSibling")},siblings:function(A){A=$(A);return Element.previousSiblings(A).reverse().concat(Element.nextSiblings(A))},match:function(B,A){if(Object.isString(A)){A=new Selector(A)}return A.match($(B))},up:function(D,E,B){D=$(D);if(arguments.length==1){return $(D.parentNode)}var A=Element.ancestors(D);return Object.isNumber(E)?A[E]:Selector.findElement(A,E,B)},down:function(B,D,A){B=$(B);if(arguments.length==1){return Element.firstDescendant(B)}return Object.isNumber(D)?Element.descendants(B)[D]:Element.select(B,D)[A||0]},previous:function(B,E,A){B=$(B);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(B))}var D=Element.previousSiblings(B);return Object.isNumber(E)?D[E]:Selector.findElement(D,E,A)},next:function(B,E,A){B=$(B);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(B))}var D=Element.nextSiblings(B);return Object.isNumber(E)?D[E]:Selector.findElement(D,E,A)},select:function(B){var A=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(B,A)},adjacent:function(B){var A=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(B.parentNode,A).without(B)},identify:function(A){A=$(A);var B=Element.readAttribute(A,"id");if(B){return B}do{B="anonymous_element_"+Element.idCounter++}while($(B));Element.writeAttribute(A,"id",B);return B},readAttribute:function(B,A){B=$(B);if(Prototype.Browser.IE){var D=Element._attributeTranslations.read;if(D.values[A]){return D.values[A](B,A)}if(D.names[A]){A=D.names[A]}if(A.include(":")){return(!B.attributes||!B.attributes[A])?null:B.attributes[A].value}}return B.getAttribute(A)},writeAttribute:function(E,D,G){E=$(E);var B={},F=Element._attributeTranslations.write;if(typeof D=="object"){B=D}else{B[D]=Object.isUndefined(G)?true:G}for(var A in B){D=F.names[A]||A;G=B[A];if(F.values[A]){D=F.values[A](E,G)}if(G===false||G===null){E.removeAttribute(D)}else{if(G===true){E.setAttribute(D,D)}else{E.setAttribute(D,G)}}}return E},getHeight:function(A){return Element.getDimensions(A).height},getWidth:function(A){return Element.getDimensions(A).width},classNames:function(A){return new Element.ClassNames(A)},hasClassName:function(B,A){if(!(B=$(B))){return}var D=B.className;return(D.length>0&&(D==A||new RegExp("(^|\\s)"+A+"(\\s|$)").test(D)))},addClassName:function(B,A){if(!(B=$(B))){return}if(!Element.hasClassName(B,A)){B.className+=(B.className?" ":"")+A}return B},removeClassName:function(B,A){if(!(B=$(B))){return}B.className=B.className.replace(new RegExp("(^|\\s+)"+A+"(\\s+|$)")," ").strip();return B},toggleClassName:function(B,A){if(!(B=$(B))){return}return Element[Element.hasClassName(B,A)?"removeClassName":"addClassName"](B,A)},cleanWhitespace:function(B){B=$(B);var D=B.firstChild;while(D){var A=D.nextSibling;if(D.nodeType==3&&!/\S/.test(D.nodeValue)){B.removeChild(D)}D=A}return B},empty:function(A){return $(A).innerHTML.blank()},descendantOf:function(B,A){B=$(B),A=$(A);if(B.compareDocumentPosition){return(B.compareDocumentPosition(A)&8)===8}if(A.contains){return A.contains(B)&&A!==B}while(B=B.parentNode){if(B==A){return true}}return false},scrollTo:function(A){A=$(A);var B=Element.cumulativeOffset(A);window.scrollTo(B[0],B[1]);return A},getStyle:function(A,D){A=$(A);D=D=="float"?"cssFloat":D.camelize();var E=A.style[D];if(!E||E=="auto"){var B=document.defaultView.getComputedStyle(A,null);E=B?B[D]:null}if(D=="opacity"){return E?parseFloat(E):1}return E=="auto"?null:E},getOpacity:function(A){return $(A).getStyle("opacity")},setStyle:function(F,D){F=$(F);var B=F.style,E;if(Object.isString(D)){F.style.cssText+=";"+D;return D.include("opacity")?F.setOpacity(D.match(/opacity:\s*(\d?\.?\d*)/)[1]):F}for(var A in D){if(A=="opacity"){F.setOpacity(D[A])}else{B[(A=="float"||A=="cssFloat")?(Object.isUndefined(B.styleFloat)?"cssFloat":"styleFloat"):A]=D[A]}}return F},setOpacity:function(A,B){A=$(A);A.style.opacity=(B==1||B==="")?"":(B<0.00001)?0:B;return A},getDimensions:function(D){D=$(D);var H=Element.getStyle(D,"display");if(H!="none"&&H!=null){return{width:D.offsetWidth,height:D.offsetHeight}}var F=D.style;var A=F.visibility;var B=F.position;var E=F.display;F.visibility="hidden";if(B!="fixed"){F.position="absolute"}F.display="block";var I=D.clientWidth;var G=D.clientHeight;F.display=E;F.position=B;F.visibility=A;return{width:I,height:G}},makePositioned:function(A){A=$(A);var B=Element.getStyle(A,"position");if(B=="static"||!B){A._madePositioned=true;A.style.position="relative";if(Prototype.Browser.Opera){A.style.top=0;A.style.left=0}}return A},undoPositioned:function(A){A=$(A);if(A._madePositioned){A._madePositioned=undefined;A.style.position=A.style.top=A.style.left=A.style.bottom=A.style.right=""}return A},makeClipping:function(A){A=$(A);if(A._overflow){return A}A._overflow=Element.getStyle(A,"overflow")||"auto";if(A._overflow!=="hidden"){A.style.overflow="hidden"}return A},undoClipping:function(A){A=$(A);if(!A._overflow){return A}A.style.overflow=A._overflow=="auto"?"":A._overflow;A._overflow=null;return A},cumulativeOffset:function(A){var B=0,D=0;do{B+=A.offsetTop||0;D+=A.offsetLeft||0;A=A.offsetParent}while(A);return Element._returnOffset(D,B)},positionedOffset:function(A){var B=0,E=0;do{B+=A.offsetTop||0;E+=A.offsetLeft||0;A=A.offsetParent;if(A){if(A.tagName.toUpperCase()=="BODY"){break}var D=Element.getStyle(A,"position");if(D!=="static"){break}}}while(A);return Element._returnOffset(E,B)},absolutize:function(B){B=$(B);if(Element.getStyle(B,"position")=="absolute"){return B}var A=Element.positionedOffset(B);var G=A[1];var F=A[0];var D=B.clientWidth;var E=B.clientHeight;B._originalLeft=F-parseFloat(B.style.left||0);B._originalTop=G-parseFloat(B.style.top||0);B._originalWidth=B.style.width;B._originalHeight=B.style.height;B.style.position="absolute";B.style.top=G+"px";B.style.left=F+"px";B.style.width=D+"px";B.style.height=E+"px";return B},relativize:function(A){A=$(A);if(Element.getStyle(A,"position")=="relative"){return A}A.style.position="relative";var D=parseFloat(A.style.top||0)-(A._originalTop||0);var B=parseFloat(A.style.left||0)-(A._originalLeft||0);A.style.top=D+"px";A.style.left=B+"px";A.style.height=A._originalHeight;A.style.width=A._originalWidth;return A},cumulativeScrollOffset:function(A){var B=0,D=0;do{B+=A.scrollTop||0;D+=A.scrollLeft||0;A=A.parentNode}while(A);return Element._returnOffset(D,B)},getOffsetParent:function(A){if(A.offsetParent){return $(A.offsetParent)}if(A==document.body){return $(A)}while((A=A.parentNode)&&A!=document.body){if(Element.getStyle(A,"position")!="static"){return $(A)}}return $(document.body)},viewportOffset:function(D){var B=0,E=0;var A=D;do{B+=A.offsetTop||0;E+=A.offsetLeft||0;if(A.offsetParent==document.body&&Element.getStyle(A,"position")=="absolute"){break}}while(A=A.offsetParent);A=D;do{if(!Prototype.Browser.Opera||(A.tagName&&(A.tagName.toUpperCase()=="BODY"))){B-=A.scrollTop||0;E-=A.scrollLeft||0}}while(A=A.parentNode);return Element._returnOffset(E,B)},clonePosition:function(D,A){var E=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});A=$(A);var F=Element.viewportOffset(A);D=$(D);var G=[0,0];var B=null;if(Element.getStyle(D,"position")=="absolute"){B=Element.getOffsetParent(D);G=Element.viewportOffset(B)}if(B==document.body){G[0]-=document.body.offsetLeft;G[1]-=document.body.offsetTop}if(E.setLeft){D.style.left=(F[0]-G[0]+E.offsetLeft)+"px"}if(E.setTop){D.style.top=(F[1]-G[1]+E.offsetTop)+"px"}if(E.setWidth){D.style.width=A.offsetWidth+"px"}if(E.setHeight){D.style.height=A.offsetHeight+"px"}return D}};Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(A,D,E){switch(E){case"left":case"top":case"right":case"bottom":if(A(D,"position")==="static"){return null}case"height":case"width":if(!Element.visible(D)){return null}var F=parseInt(A(D,E),10);if(F!==D["offset"+E.capitalize()]){return F+"px"}var B;if(E==="height"){B=["border-top-width","padding-top","padding-bottom","border-bottom-width"]}else{B=["border-left-width","padding-left","padding-right","border-right-width"]}return B.inject(F,function(H,G){var I=A(D,G);return I===null?H:H-parseInt(I,10)})+"px";default:return A(D,E)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(A,B,D){if(D==="title"){return B.title}return A(B,D)})}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(B,D){D=$(D);try{D.offsetParent}catch(F){return $(document.body)}var A=D.getStyle("position");if(A!=="static"){return B(D)}D.setStyle({position:"relative"});var E=B(D);D.setStyle({position:A});return E});$w("positionedOffset viewportOffset").each(function(A){Element.Methods[A]=Element.Methods[A].wrap(function(D,E){E=$(E);try{E.offsetParent}catch(H){return Element._returnOffset(0,0)}var B=E.getStyle("position");if(B!=="static"){return D(E)}var F=E.getOffsetParent();if(F&&F.getStyle("position")==="fixed"){F.setStyle({zoom:1})}E.setStyle({position:"relative"});var G=D(E);E.setStyle({position:B});return G})});Element.Methods.cumulativeOffset=Element.Methods.cumulativeOffset.wrap(function(A,B){try{B.offsetParent}catch(D){return Element._returnOffset(0,0)}return A(B)});Element.Methods.getStyle=function(A,B){A=$(A);B=(B=="float"||B=="cssFloat")?"styleFloat":B.camelize();var D=A.style[B];if(!D&&A.currentStyle){D=A.currentStyle[B]}if(B=="opacity"){if(D=(A.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(D[1]){return parseFloat(D[1])/100}}return 1}if(D=="auto"){if((B=="width"||B=="height")&&(A.getStyle("display")!="none")){return A["offset"+B.capitalize()]+"px"}return null}return D};Element.Methods.setOpacity=function(D,F){function G(H){return H.replace(/alpha\([^\)]*\)/gi,"")}D=$(D);var B=D.currentStyle;if((B&&!B.hasLayout)||(!B&&D.style.zoom=="normal")){D.style.zoom=1}var A=D.getStyle("filter"),E=D.style;if(F==1||F===""){(A=G(A))?E.filter=A:E.removeAttribute("filter");return D}else{if(F<0.00001){F=0}}E.filter=G(A)+"alpha(opacity="+(F*100)+")";return D};Element._attributeTranslations=(function(){var D="className";var B="for";var A=document.createElement("div");A.setAttribute(D,"x");if(A.className!=="x"){A.setAttribute("class","x");if(A.className==="x"){D="class"}}A=null;A=document.createElement("label");A.setAttribute(B,"x");if(A.htmlFor!=="x"){A.setAttribute("htmlFor","x");if(A.htmlFor==="x"){B="htmlFor"}}A=null;return{read:{names:{"class":D,className:D,"for":B,htmlFor:B},values:{_getAttr:function(E,F){return E.getAttribute(F)},_getAttr2:function(E,F){return E.getAttribute(F,2)},_getAttrNode:function(E,G){var F=E.getAttributeNode(G);return F?F.value:""},_getEv:(function(){var E=document.createElement("div");E.onclick=Prototype.emptyFunction;var G=E.getAttribute("onclick");var F;if(String(G).indexOf("{")>-1){F=function(H,I){I=H.getAttribute(I);if(!I){return null}I=I.toString();I=I.split("{")[1];I=I.split("}")[0];return I.strip()}}else{if(G===""){F=function(H,I){I=H.getAttribute(I);if(!I){return null}return I.strip()}}}E=null;return F})(),_flag:function(E,F){return $(E).hasAttribute(F)?F:null},style:function(E){return E.style.cssText.toLowerCase()},title:function(E){return E.title}}}}})();Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(A,B){A.checked=!!B},style:function(A,B){A.style.cssText=B?B:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(A){Element._attributeTranslations.write.names[A.toLowerCase()]=A;Element._attributeTranslations.has[A.toLowerCase()]=A});(function(A){Object.extend(A,{href:A._getAttr2,src:A._getAttr2,type:A._getAttr,action:A._getAttrNode,disabled:A._flag,checked:A._flag,readonly:A._flag,multiple:A._flag,onload:A._getEv,onunload:A._getEv,onclick:A._getEv,ondblclick:A._getEv,onmousedown:A._getEv,onmouseup:A._getEv,onmouseover:A._getEv,onmousemove:A._getEv,onmouseout:A._getEv,onfocus:A._getEv,onblur:A._getEv,onkeypress:A._getEv,onkeydown:A._getEv,onkeyup:A._getEv,onsubmit:A._getEv,onreset:A._getEv,onselect:A._getEv,onchange:A._getEv})})(Element._attributeTranslations.read.values);if(Prototype.BrowserFeatures.ElementExtensions){(function(){function A(D){var B=D.getElementsByTagName("*"),F=[];for(var E=0,G;G=B[E];E++){if(G.tagName!=="!"){F.push(G)}}return F}Element.Methods.down=function(D,E,B){D=$(D);if(arguments.length==1){return D.firstDescendant()}return Object.isNumber(E)?A(D)[E]:Element.select(D,E)[B||0]}})()}}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(A,B){A=$(A);A.style.opacity=(B==1)?0.999999:(B==="")?"":(B<0.00001)?0:B;return A}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(A,B){A=$(A);A.style.opacity=(B==1||B==="")?"":(B<0.00001)?0:B;if(B==1){if(A.tagName.toUpperCase()=="IMG"&&A.width){A.width++;A.width--}else{try{var E=document.createTextNode(" ");A.appendChild(E);A.removeChild(E)}catch(D){}}}return A};Element.Methods.cumulativeOffset=function(A){var B=0,D=0;do{B+=A.offsetTop||0;D+=A.offsetLeft||0;if(A.offsetParent==document.body){if(Element.getStyle(A,"position")=="absolute"){break}}A=A.offsetParent}while(A);return Element._returnOffset(D,B)}}}}}if("outerHTML" in document.documentElement){Element.Methods.replace=function(F,G){F=$(F);if(G&&G.toElement){G=G.toElement()}if(Object.isElement(G)){F.parentNode.replaceChild(G,F);return F}G=Object.toHTML(G);var D=F.parentNode,E=D.tagName.toUpperCase();if(Element._insertionTranslations.tags[E]){var B=F.next();var A=Element._getContentFromAnonymousElement(E,G.stripScripts());D.removeChild(F);if(B){A.each(function(H){D.insertBefore(H,B)})}else{A.each(function(H){D.appendChild(H)})}}else{F.outerHTML=G.stripScripts()}G.evalScripts.bind(G).defer();return F}}Element._returnOffset=function(A,B){var D=[A,B];D.left=A;D.top=B;return D};Element._getContentFromAnonymousElement=function(A,D){var E=new Element("div"),B=Element._insertionTranslations.tags[A];if(B){E.innerHTML=B[0]+D+B[1];B[2].times(function(){E=E.firstChild})}else{E.innerHTML=D}return $A(E.childNodes)};Element._insertionTranslations={before:function(A,B){A.parentNode.insertBefore(B,A)},top:function(A,B){A.insertBefore(B,A.firstChild)},bottom:function(A,B){A.appendChild(B)},after:function(A,B){A.parentNode.insertBefore(B,A.nextSibling)},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};(function(){var A=Element._insertionTranslations.tags;Object.extend(A,{THEAD:A.TBODY,TFOOT:A.TBODY,TH:A.TD})})();Element.Methods.Simulated={hasAttribute:function(A,D){D=Element._attributeTranslations.has[D]||D;var B=$(A).getAttributeNode(D);return !!(B&&B.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);(function(A){if(!Prototype.BrowserFeatures.ElementExtensions&&A.__proto__){window.HTMLElement={};window.HTMLElement.prototype=A.__proto__;Prototype.BrowserFeatures.ElementExtensions=true}A=null})(document.createElement("div"));Element.extend=(function(){function D(H){if(typeof window.Element!="undefined"){var J=window.Element.prototype;if(J){var L="_"+(Math.random()+"").slice(2);var I=document.createElement(H);J[L]="x";var K=(I[L]!=="x");delete J[L];I=null;return K}}return false}function B(J,I){for(var H in I){var K=I[H];if(Object.isFunction(K)&&!(H in J)){J[H]=K.methodize()}}}var A=D("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(A){return function(H){if(H&&typeof H._extendedByPrototype=="undefined"){var I=H.tagName;if(I&&(/^(?:object|applet|embed)$/i.test(I))){B(H,Element.Methods);B(H,Element.Methods.Simulated);B(H,Element.Methods.ByTag[I.toUpperCase()])}}return H}}return Prototype.K}var F={},E=Element.Methods.ByTag;var G=Object.extend(function(J){if(!J||typeof J._extendedByPrototype!="undefined"||J.nodeType!=1||J==window){return J}var H=Object.clone(F),I=J.tagName.toUpperCase();if(E[I]){Object.extend(H,E[I])}B(J,H);J._extendedByPrototype=Prototype.emptyFunction;return J},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(F,Element.Methods);Object.extend(F,Element.Methods.Simulated)}}});G.refresh();return G})();Element.hasAttribute=function(A,B){if(A.hasAttribute){return A.hasAttribute(B)}return Element.Methods.Simulated.hasAttribute(A,B)};Element.addMethods=function(D){var K=Prototype.BrowserFeatures,E=Element.Methods.ByTag;if(!D){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var H=D;D=arguments[1]}if(!H){Object.extend(Element.Methods,D||{})}else{if(Object.isArray(H)){H.each(A)}else{A(H)}}function A(F){F=F.toUpperCase();if(!Element.Methods.ByTag[F]){Element.Methods.ByTag[F]={}}Object.extend(Element.Methods.ByTag[F],D)}function B(M,Q,P){P=P||false;for(var F in M){var O=M[F];if(!Object.isFunction(O)){continue}if(!P||!(F in Q)){Q[F]=O.methodize()}}}function G(O){var F;var P={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};if(P[O]){F="HTML"+P[O]+"Element"}if(window[F]){return window[F]}F="HTML"+O+"Element";if(window[F]){return window[F]}F="HTML"+O.capitalize()+"Element";if(window[F]){return window[F]}var M=document.createElement(O);var Q=M.__proto__||M.constructor.prototype;M=null;return Q}var J=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(K.ElementExtensions){B(Element.Methods,J);B(Element.Methods.Simulated,J,true)}if(K.SpecificElementExtensions){for(var L in Element.Methods.ByTag){var I=G(L);if(Object.isUndefined(I)){continue}B(E[L],I.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){return{width:this.getWidth(),height:this.getHeight()}},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};(function(E){var I=Prototype.Browser,H=document,F,D={};function A(){if(I.WebKit&&!H.evaluate){return document}if(I.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body}return document.documentElement}function G(B){if(!F){F=A()}D[B]="client"+B;E["get"+B]=function(){return F[D[B]]};return E["get"+B]()}E.getWidth=G.curry("Width");E.getHeight=G.curry("Height")})(document.viewport);Element.Storage={UID:1};Element.addMethods({getStorage:function(A){if(!(A=$(A))){return}var B;if(A===window){B=0}else{if(typeof A._prototypeUID==="undefined"){A._prototypeUID=[Element.Storage.UID++]}B=A._prototypeUID[0]}if(!Element.Storage[B]){Element.Storage[B]=$H()}return Element.Storage[B]},store:function(A,B,D){if(!(A=$(A))){return}if(arguments.length===2){Element.getStorage(A).update(B)}else{Element.getStorage(A).set(B,D)}return A},retrieve:function(A,B,D){if(!(A=$(A))){return}var F=Element.getStorage(A),E=F.get(B);if(Object.isUndefined(E)){F.set(B,D);E=D}return E},clone:function(B,A){if(!(B=$(B))){return}var F=B.cloneNode(A);F._prototypeUID=void 0;if(A){var E=Element.select(F,"*"),D=E.length;while(D--){E[D]._prototypeUID=void 0}}return Element.extend(F)}});var Selector=Class.create({initialize:function(A){this.expression=A.strip();if(this.shouldUseSelectorsAPI()){this.mode="selectorsAPI"}else{if(this.shouldUseXPath()){this.mode="xpath";this.compileXPathMatcher()}else{this.mode="normal";this.compileMatcher()}}},shouldUseXPath:(function(){var A=(function(){var F=false;if(document.evaluate&&window.XPathResult){var D=document.createElement("div");D.innerHTML="<ul><li></li></ul><div><ul><li></li></ul></div>";var B=".//*[local-name()='ul' or local-name()='UL']//*[local-name()='li' or local-name()='LI']";var E=document.evaluate(B,D,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);F=(E.snapshotLength!==2);D=null}return F})();return function(){if(!Prototype.BrowserFeatures.XPath){return false}var B=this.expression;if(Prototype.Browser.WebKit&&(B.include("-of-type")||B.include(":empty"))){return false}if((/(\[[\w-]*?:|:checked)/).test(B)){return false}if(A){return false}return true}})(),shouldUseSelectorsAPI:function(){if(!Prototype.BrowserFeatures.SelectorsAPI){return false}if(Selector.CASE_INSENSITIVE_CLASS_NAMES){return false}if(!Selector._div){Selector._div=new Element("div")}try{Selector._div.querySelector(this.expression)}catch(A){return false}return true},compileMatcher:function(){var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m,len=ps.length,name;if(Selector._cache[e]){this.matcher=Selector._cache[e];return}this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i=0;i<len;i++){p=ps[i].re;name=ps[i].name;if(m=e.match(p)){this.matcher.push(Object.isFunction(c[name])?c[name](m):new Template(c[name]).evaluate(m));e=e.replace(m[0],"");break}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher},compileXPathMatcher:function(){var H=this.expression,I=Selector.patterns,D=Selector.xpath,G,B,A=I.length,E;if(Selector._cache[H]){this.xpath=Selector._cache[H];return}this.matcher=[".//*"];while(H&&G!=H&&(/\S/).test(H)){G=H;for(var F=0;F<A;F++){E=I[F].name;if(B=H.match(I[F].re)){this.matcher.push(Object.isFunction(D[E])?D[E](B):new Template(D[E]).evaluate(B));H=H.replace(B[0],"");break}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath},findElements:function(A){A=A||document;var D=this.expression,B;switch(this.mode){case"selectorsAPI":if(A!==document){var E=A.id,F=$(A).identify();F=F.replace(/([\.:])/g,"\\$1");D="#"+F+" "+D}B=$A(A.querySelectorAll(D)).map(Element.extend);A.id=E;return B;case"xpath":return document._getElementsByXPath(this.xpath,A);default:return this.matcher(A)}},match:function(I){this.tokens=[];var O=this.expression,B=Selector.patterns,G=Selector.assertions;var A,E,F,M=B.length,D;while(O&&A!==O&&(/\S/).test(O)){A=O;for(var J=0;J<M;J++){E=B[J].re;D=B[J].name;if(F=O.match(E)){if(G[D]){this.tokens.push([D,Object.clone(F)]);O=O.replace(F[0],"")}else{return this.findElements(document).include(I)}}}}var L=true,D,K;for(var J=0,H;H=this.tokens[J];J++){D=H[0],K=H[1];if(!Selector.assertions[D](I,K)){L=false;break}}return L},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+">"}});if(Prototype.BrowserFeatures.SelectorsAPI&&document.compatMode==="BackCompat"){Selector.CASE_INSENSITIVE_CLASS_NAMES=(function(){var D=document.createElement("div"),A=document.createElement("span");D.id="prototype_test_id";A.className="Test";D.appendChild(A);var B=(D.querySelector("#prototype_test_id .test")!==null);D=A=null;return B})()}Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(A){if(A[1]=="*"){return""}return"[local-name()='"+A[1].toLowerCase()+"' or local-name()='"+A[1].toUpperCase()+"']"},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(A){A[1]=A[1].toLowerCase();return new Template("[@#{1}]").evaluate(A)},attr:function(A){A[1]=A[1].toLowerCase();A[3]=A[5]||A[6];return new Template(Selector.xpath.operators[A[2]]).evaluate(A)},pseudo:function(A){var B=Selector.xpath.pseudos[A[1]];if(!B){return""}if(Object.isFunction(B)){return B(A)}return new Template(Selector.xpath.pseudos[A[1]]).evaluate(A)},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]",empty:"[count(*) = 0 and (count(text()) = 0)]",checked:"[@checked]",disabled:"[(@disabled) and (@type!='hidden')]",enabled:"[not(@disabled) and (@type!='hidden')]",not:function(F){var I=F[6],D=Selector.patterns,J=Selector.xpath,A,K,H=D.length,B;var E=[];while(I&&A!=I&&(/\S/).test(I)){A=I;for(var G=0;G<H;G++){B=D[G].name;if(F=I.match(D[G].re)){K=Object.isFunction(J[B])?J[B](F):new Template(J[B]).evaluate(F);E.push("("+K.substring(1,K.length-1)+")");I=I.replace(F[0],"");break}}}return"[not("+E.join(" and ")+")]"},"nth-child":function(A){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",A)},"nth-last-child":function(A){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",A)},"nth-of-type":function(A){return Selector.xpath.pseudos.nth("position() ",A)},"nth-last-of-type":function(A){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",A)},"first-of-type":function(A){A[6]="1";return Selector.xpath.pseudos["nth-of-type"](A)},"last-of-type":function(A){A[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](A)},"only-of-type":function(A){var B=Selector.xpath.pseudos;return B["first-of-type"](A)+B["last-of-type"](A)},nth:function(E,B){var H,G=B[6],F;if(G=="even"){G="2n+0"}if(G=="odd"){G="2n+1"}if(H=G.match(/^(\d+)$/)){return"["+E+"= "+H[1]+"]"}if(H=G.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(H[1]=="-"){H[1]=-1}var D=H[1]?Number(H[1]):1;var A=H[2]?Number(H[2]):0;F="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(F).evaluate({fragment:E,a:D,b:A})}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);      c = false;',className:'n = h.className(n, r, "#{1}", c);    c = false;',id:'n = h.id(n, r, "#{1}", c);           c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(A){A[3]=(A[5]||A[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(A)},pseudo:function(A){if(A[6]){A[6]=A[6].replace(/"/g,'\\"')}return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(A)},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:[{name:"laterSibling",re:/^\s*~\s*/},{name:"child",re:/^\s*>\s*/},{name:"adjacent",re:/^\s*\+\s*/},{name:"descendant",re:/^\s/},{name:"tagName",re:/^\s*(\*|[\w\-]+)(\b|$)?/},{name:"id",re:/^#([\w\-\*]+)(\b|$)/},{name:"className",re:/^\.([\w\-\*]+)(\b|$)/},{name:"pseudo",re:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/},{name:"attrPresence",re:/^\[((?:[\w-]+:)?[\w-]+)\]/},{name:"attr",re:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/}],assertions:{tagName:function(A,B){return B[1].toUpperCase()==A.tagName.toUpperCase()},className:function(A,B){return Element.hasClassName(A,B[1])},id:function(A,B){return A.id===B[1]},attrPresence:function(A,B){return Element.hasAttribute(A,B[1])},attr:function(B,D){var A=Element.readAttribute(B,D[1]);return A&&Selector.operators[D[2]](A,D[5]||D[6])}},handlers:{concat:function(B,A){for(var D=0,E;E=A[D];D++){B.push(E)}return B},mark:function(A){var E=Prototype.emptyFunction;for(var B=0,D;D=A[B];B++){D._countedByPrototype=E}return A},unmark:(function(){var A=(function(){var D=document.createElement("div"),F=false,B="_countedByPrototype",E="x";D[B]=E;F=(D.getAttribute(B)===E);D=null;return F})();return A?function(B){for(var D=0,E;E=B[D];D++){E.removeAttribute("_countedByPrototype")}return B}:function(B){for(var D=0,E;E=B[D];D++){E._countedByPrototype=void 0}return B}})(),index:function(G,D,H){G._countedByPrototype=Prototype.emptyFunction;if(D){for(var A=G.childNodes,E=A.length-1,B=1;E>=0;E--){var F=A[E];if(F.nodeType==1&&(!H||F._countedByPrototype)){F.nodeIndex=B++}}}else{for(var E=0,B=1,A=G.childNodes;F=A[E];E++){if(F.nodeType==1&&(!H||F._countedByPrototype)){F.nodeIndex=B++}}}},unique:function(B){if(B.length==0){return B}var E=[],F;for(var D=0,A=B.length;D<A;D++){if(typeof(F=B[D])._countedByPrototype=="undefined"){F._countedByPrototype=Prototype.emptyFunction;E.push(Element.extend(F))}}return Selector.handlers.unmark(E)},descendant:function(A){var E=Selector.handlers;for(var D=0,B=[],F;F=A[D];D++){E.concat(B,F.getElementsByTagName("*"))}return B},child:function(A){var F=Selector.handlers;for(var E=0,D=[],G;G=A[E];E++){for(var B=0,H;H=G.childNodes[B];B++){if(H.nodeType==1&&H.tagName!="!"){D.push(H)}}}return D},adjacent:function(A){for(var D=0,B=[],F;F=A[D];D++){var E=this.nextElementSibling(F);if(E){B.push(E)}}return B},laterSibling:function(A){var E=Selector.handlers;for(var D=0,B=[],F;F=A[D];D++){E.concat(B,Element.nextSiblings(F))}return B},nextElementSibling:function(A){while(A=A.nextSibling){if(A.nodeType==1){return A}}return null},previousElementSibling:function(A){while(A=A.previousSibling){if(A.nodeType==1){return A}}return null},tagName:function(A,I,G,H){var J=G.toUpperCase();var E=[],F=Selector.handlers;if(A){if(H){if(H=="descendant"){for(var D=0,B;B=A[D];D++){F.concat(E,B.getElementsByTagName(G))}return E}else{A=this[H](A)}if(G=="*"){return A}}for(var D=0,B;B=A[D];D++){if(B.tagName.toUpperCase()===J){E.push(B)}}return E}else{return I.getElementsByTagName(G)}},id:function(A,J,B,H){var I=$(B),G=Selector.handlers;if(J==document){if(!I){return[]}if(!A){return[I]}}else{if(!J.sourceIndex||J.sourceIndex<1){var A=J.getElementsByTagName("*");for(var E=0,D;D=A[E];E++){if(D.id===B){return[D]}}}}if(A){if(H){if(H=="child"){for(var F=0,D;D=A[F];F++){if(I.parentNode==D){return[I]}}}else{if(H=="descendant"){for(var F=0,D;D=A[F];F++){if(Element.descendantOf(I,D)){return[I]}}}else{if(H=="adjacent"){for(var F=0,D;D=A[F];F++){if(Selector.handlers.previousElementSibling(I)==D){return[I]}}}else{A=G[H](A)}}}}for(var F=0,D;D=A[F];F++){if(D==I){return[I]}}return[]}return(I&&Element.descendantOf(I,J))?[I]:[]},className:function(E,B,D,A){if(E&&A){E=this[A](E)}return Selector.handlers.byClassName(E,B,D)},byClassName:function(D,A,B){if(!D){D=Selector.handlers.descendant([A])}var I=" "+B+" ";for(var F=0,E=[],H,G;H=D[F];F++){G=H.className;if(G.length==0){continue}if(G==B||(" "+G+" ").include(I)){E.push(H)}}return E},attrPresence:function(E,D,A,B){if(!E){E=D.getElementsByTagName("*")}if(E&&B){E=this[B](E)}var G=[];for(var F=0,H;H=E[F];F++){if(Element.hasAttribute(H,A)){G.push(H)}}return G},attr:function(A,J,I,K,H,G){if(!A){A=J.getElementsByTagName("*")}if(A&&G){A=this[G](A)}var L=Selector.operators[H],E=[];for(var D=0,B;B=A[D];D++){var F=Element.readAttribute(B,I);if(F===null){continue}if(L(F,K)){E.push(B)}}return E},pseudo:function(D,E,F,B,A){if(D&&A){D=this[A](D)}if(!D){D=B.getElementsByTagName("*")}return Selector.pseudos[E](D,F,B)}},pseudos:{"first-child":function(B,G,A){for(var E=0,D=[],F;F=B[E];E++){if(Selector.handlers.previousElementSibling(F)){continue}D.push(F)}return D},"last-child":function(B,G,A){for(var E=0,D=[],F;F=B[E];E++){if(Selector.handlers.nextElementSibling(F)){continue}D.push(F)}return D},"only-child":function(B,H,A){var F=Selector.handlers;for(var E=0,D=[],G;G=B[E];E++){if(!F.previousElementSibling(G)&&!F.nextElementSibling(G)){D.push(G)}}return D},"nth-child":function(B,D,A){return Selector.pseudos.nth(B,D,A)},"nth-last-child":function(B,D,A){return Selector.pseudos.nth(B,D,A,true)},"nth-of-type":function(B,D,A){return Selector.pseudos.nth(B,D,A,false,true)},"nth-last-of-type":function(B,D,A){return Selector.pseudos.nth(B,D,A,true,true)},"first-of-type":function(B,D,A){return Selector.pseudos.nth(B,"1",A,false,true)},"last-of-type":function(B,D,A){return Selector.pseudos.nth(B,"1",A,true,true)},"only-of-type":function(B,E,A){var D=Selector.pseudos;return D["last-of-type"](D["first-of-type"](B,E,A),E,A)},getIndices:function(B,A,D){if(B==0){return A>0?[A]:[]}return $R(1,D).inject([],function(E,F){if(0==(F-A)%B&&(F-A)/B>=0){E.push(F)}return E})},nth:function(A,B,P,M,L){if(A.length==0){return[]}if(B=="even"){B="2n+0"}if(B=="odd"){B="2n+1"}var K=Selector.handlers,J=[],D=[],F;K.mark(A);for(var I=0,E;E=A[I];I++){if(!E.parentNode._countedByPrototype){K.index(E.parentNode,M,L);D.push(E.parentNode)}}if(B.match(/^\d+$/)){B=Number(B);for(var I=0,E;E=A[I];I++){if(E.nodeIndex==B){J.push(E)}}}else{if(F=B.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(F[1]=="-"){F[1]=-1}var Q=F[1]?Number(F[1]):1;var O=F[2]?Number(F[2]):0;var S=Selector.pseudos.getIndices(Q,O,A.length);for(var I=0,E,G=S.length;E=A[I];I++){for(var H=0;H<G;H++){if(E.nodeIndex==S[H]){J.push(E)}}}}}K.unmark(A);K.unmark(D);return J},empty:function(B,G,A){for(var E=0,D=[],F;F=B[E];E++){if(F.tagName=="!"||F.firstChild){continue}D.push(F)}return D},not:function(A,E,J){var H=Selector.handlers,K,D;var I=new Selector(E).findElements(J);H.mark(I);for(var G=0,F=[],B;B=A[G];G++){if(!B._countedByPrototype){F.push(B)}}H.unmark(I);return F},enabled:function(B,G,A){for(var E=0,D=[],F;F=B[E];E++){if(!F.disabled&&(!F.type||F.type!=="hidden")){D.push(F)}}return D},disabled:function(B,G,A){for(var E=0,D=[],F;F=B[E];E++){if(F.disabled){D.push(F)}}return D},checked:function(B,G,A){for(var E=0,D=[],F;F=B[E];E++){if(F.checked){D.push(F)}}return D}},operators:{"=":function(B,A){return B==A},"!=":function(B,A){return B!=A},"^=":function(B,A){return B==A||B&&B.startsWith(A)},"$=":function(B,A){return B==A||B&&B.endsWith(A)},"*=":function(B,A){return B==A||B&&B.include(A)},"~=":function(B,A){return(" "+B+" ").include(" "+A+" ")},"|=":function(B,A){return("-"+(B||"").toUpperCase()+"-").include("-"+(A||"").toUpperCase()+"-")}},split:function(B){var A=[];B.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(D){A.push(D[1].strip())});return A},matchElements:function(A,H){var G=$$(H),F=Selector.handlers;F.mark(G);for(var E=0,D=[],B;B=A[E];E++){if(B._countedByPrototype){D.push(B)}}F.unmark(G);return D},findElement:function(A,D,B){if(Object.isNumber(D)){B=D;D=false}return Selector.matchElements(A,D||"*")[B||0]},findChildElements:function(D,H){H=Selector.split(H.join(","));var F=[],G=Selector.handlers;for(var E=0,B=H.length,A;E<B;E++){A=new Selector(H[E].strip());G.concat(F,A.findElements(D))}return(B>1)?G.unique(F):F}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(B,A){for(var D=0,E;E=A[D];D++){if(E.tagName!=="!"){B.push(E)}}return B}})}function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(A){A=$(A);A.reset();return A},serializeElements:function(D,F){if(typeof F!="object"){F={hash:!!F}}else{if(Object.isUndefined(F.hash)){F.hash=true}}var E,H,B=false,A=F.submit;var G=D.inject({},function(J,I){if(!I.disabled&&I.name){E=I.name;H=$(I).getValue();if(H!=null&&I.type!="file"&&(I.type!="submit"||(!B&&A!==false&&(!A||E==A)&&(B=true)))){if(E in J){if(!Object.isArray(J[E])){J[E]=[J[E]]}J[E].push(H)}else{J[E]=H}}}return J});return F.hash?G:Object.toQueryString(G)}};Form.Methods={serialize:function(B,A){return Form.serializeElements(Form.getElements(B),A)},getElements:function(G){var B=$(G).getElementsByTagName("*"),E,A=[],D=Form.Element.Serializers;for(var F=0;E=B[F];F++){A.push(E)}return A.inject([],function(H,I){if(D[I.tagName.toLowerCase()]){H.push(Element.extend(I))}return H})},getInputs:function(H,F,D){H=$(H);var G=H.getElementsByTagName("input");if(!F&&!D){return $A(G).map(Element.extend)}for(var E=0,I=[],A=G.length;E<A;E++){var B=G[E];if((F&&B.type!=F)||(D&&B.name!=D)){continue}I.push(Element.extend(B))}return I},disable:function(A){A=$(A);Form.getElements(A).invoke("disable");return A},enable:function(A){A=$(A);Form.getElements(A).invoke("enable");return A},findFirstElement:function(D){var A=$(D).getElements().findAll(function(E){return"hidden"!=E.type&&!E.disabled});var B=A.findAll(function(E){return E.hasAttribute("tabIndex")&&E.tabIndex>=0}).sortBy(function(E){return E.tabIndex}).first();return B?B:A.find(function(E){return/^(?:input|select|textarea)$/i.test(E.tagName)})},focusFirstElement:function(A){A=$(A);A.findFirstElement().activate();return A},request:function(D,B){D=$(D),B=Object.clone(B||{});var E=B.parameters,A=D.readAttribute("action")||"";if(A.blank()){A=window.location.href}B.parameters=D.serialize(true);if(E){if(Object.isString(E)){E=E.toQueryParams()}Object.extend(B.parameters,E)}if(D.hasAttribute("method")&&!B.method){B.method=D.method}return new Ajax.Request(A,B)}};Form.Element={focus:function(A){$(A).focus();return A},select:function(A){$(A).select();return A}};Form.Element.Methods={serialize:function(A){A=$(A);if(!A.disabled&&A.name){var B=A.getValue();if(B!=undefined){var D={};D[A.name]=B;return Object.toQueryString(D)}}return""},getValue:function(A){A=$(A);var B=A.tagName.toLowerCase();return Form.Element.Serializers[B](A)},setValue:function(A,B){A=$(A);var D=A.tagName.toLowerCase();Form.Element.Serializers[D](A,B);return A},clear:function(A){$(A).value="";return A},present:function(A){return $(A).value!=""},activate:function(A){A=$(A);try{A.focus();if(A.select&&(A.tagName.toLowerCase()!="input"||!(/^(?:button|reset|submit)$/i.test(A.type)))){A.select()}}catch(B){}return A},disable:function(A){A=$(A);A.disabled=true;return A},enable:function(A){A=$(A);A.disabled=false;return A}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(A,B){switch(A.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(A,B);default:return Form.Element.Serializers.textarea(A,B)}},inputSelector:function(A,B){if(Object.isUndefined(B)){return A.checked?A.value:null}else{A.checked=!!B}},textarea:function(A,B){if(Object.isUndefined(B)){return A.value}else{A.value=B}},select:function(B,G){if(Object.isUndefined(G)){return this[B.type=="select-one"?"selectOne":"selectMany"](B)}else{var E,F,H=!Object.isArray(G);for(var D=0,A=B.length;D<A;D++){E=B.options[D];F=this.optionValue(E);if(H){if(F==G){E.selected=true;return}}else{E.selected=G.include(F)}}}},selectOne:function(B){var A=B.selectedIndex;return A>=0?this.optionValue(B.options[A]):null},selectMany:function(B){var F,A=B.length;if(!A){return null}for(var E=0,F=[];E<A;E++){var D=B.options[E];if(D.selected){F.push(this.optionValue(D))}}return F},optionValue:function(A){return Element.extend(A).hasAttribute("value")?A.value:A.text}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,A,D,B){$super(B,D);this.element=$(A);this.lastValue=this.getValue()},execute:function(){var A=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(A)?this.lastValue!=A:String(this.lastValue)!=String(A)){this.callback(this.element,A);this.lastValue=A}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=Class.create({initialize:function(A,B){this.element=$(A);this.callback=B;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var A=this.getValue();if(this.lastValue!=A){this.callback(this.element,A);this.lastValue=A}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(A){if(A.type){switch(A.type.toLowerCase()){case"checkbox":case"radio":Event.observe(A,"click",this.onElementEvent.bind(this));break;default:Event.observe(A,"change",this.onElementEvent.bind(this));break}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});(function(){var Z={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{}};var H=document.documentElement;var O="onmouseenter" in H&&"onmouseleave" in H;var U;if(window.attachEvent){var J={0:1,1:4,2:2};U=function(b,a){return window.MouseEvent&&b instanceof MouseEvent?b.button===a:b.button===J[a]}}else{if(Prototype.Browser.WebKit){U=function(b,a){switch(a){case 0:return b.which==1&&!b.metaKey;case 1:return b.which==1&&b.metaKey;default:return false}}}else{U=function(b,a){return b.which?(b.which===a+1):(b.button===a)}}}function S(a){return U(a,0)}function T(a){return U(a,1)}function M(a){return U(a,2)}function K(c){c=Z.extend(c);var b=c.target,a=c.type,d=c.currentTarget;if(d&&d.tagName){if(a==="load"||a==="error"||(a==="click"&&d.tagName.toLowerCase()==="input"&&d.type==="radio")){b=d}}if(b.nodeType==Node.TEXT_NODE){b=b.parentNode}return Element.extend(b)}function X(c,d){var b=Z.element(c);if(!d){return b}var a=[b].concat(b.ancestors());return Selector.findElement(a,d,0)}function V(a){return{x:E(a),y:D(a)}}function E(c){var b=document.documentElement,a=document.body||{scrollLeft:0};return c.pageX||(c.clientX+(b.scrollLeft||a.scrollLeft)-(b.clientLeft||0))}function D(c){var b=document.documentElement,a=document.body||{scrollTop:0};return c.pageY||(c.clientY+(b.scrollTop||a.scrollTop)-(b.clientTop||0))}function Q(a){Z.extend(a);a.preventDefault();a.stopPropagation();a.stopped=true}Z.Methods={isLeftClick:S,isMiddleClick:T,isRightClick:M,element:K,findElement:X,pointer:V,pointerX:E,pointerY:D,stop:Q};var W=Object.keys(Z.Methods).inject({},function(a,b){a[b]=Z.Methods[b].methodize();return a});if(window.addEventListener){Z.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(Z.prototype,W);Z.extend=Prototype.K}if(window.attachEvent){function G(b){var a;switch(b.type){case"mouseover":a=b.fromElement;break;case"mouseout":a=b.toElement;break;default:return null}return Element.extend(a)}Object.extend(W,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});Z.extend=function(b,a){if(!b){return false}if(b.stop){return b}var c=Z.pointer(b);Object.extend(b,{target:b.srcElement||a,relatedTarget:G(b),pageX:c.x,pageY:c.y});return Object.extend(b,W)}}function B(b,a,e){var d=Element.retrieve(b,"prototype_event_registry");if(Object.isUndefined(d)){F.push(b);d=Element.retrieve(b,"prototype_event_registry",$H())}var f=d.get(a);if(Object.isUndefined(f)){f=[];d.set(a,f)}if(f.pluck("handler").include(e)){return false}var c;if(a.include(":")){c=function(g){if(Object.isUndefined(g.eventName)){return false}if(g.eventName!==a){return false}Z.extend(g,b);e.call(b,g)}}else{if(!O&&(a==="mouseenter"||a==="mouseleave")){if(a==="mouseenter"||a==="mouseleave"){c=function(h){Z.extend(h,b);var g=h.relatedTarget;while(g&&g!==b){try{g=g.parentNode}catch(k){g=b}}if(g===b){return}e.call(b,h)}}}else{c=function(g){Z.extend(g,b);e.call(b,g)}}}c.handler=e;f.push(c);return c}function I(){for(var b=0,a=F.length;b<a;b++){Z.stopObserving(F[b]);F[b]=null}}var F=[];if(Prototype.Browser.IE){window.attachEvent("onunload",I)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}var A=Prototype.K;if(!O){A=function(a){var b={mouseenter:"mouseover",mouseleave:"mouseout"};return a in b?b[a]:a}}function P(b,a,e){b=$(b);var d=B(b,a,e);if(!d){return b}if(a.include(":")){if(b.addEventListener){b.addEventListener("dataavailable",d,false)}else{b.attachEvent("ondataavailable",d);b.attachEvent("onfilterchange",d)}}else{var c=A(a);if(b.addEventListener){b.addEventListener(c,d,false)}else{b.attachEvent("on"+c,d)}}return b}function L(b,a,g){b=$(b);var f=Element.retrieve(b,"prototype_event_registry");if(Object.isUndefined(f)){return b}if(a&&!g){var c=f.get(a);if(Object.isUndefined(c)){return b}c.each(function(h){Element.stopObserving(b,a,h.handler)});return b}else{if(!a){f.each(function(l){var h=l.key,k=l.value;k.each(function(m){Element.stopObserving(b,h,m.handler)})});return b}}var c=f.get(a);if(!c){return}var e=c.find(function(h){return h.handler===g});if(!e){return b}var d=A(a);if(a.include(":")){if(b.removeEventListener){b.removeEventListener("dataavailable",e,false)}else{b.detachEvent("ondataavailable",e);b.detachEvent("onfilterchange",e)}}else{if(b.removeEventListener){b.removeEventListener(d,e,false)}else{b.detachEvent("on"+d,e)}}f.set(a,c.without(e));return b}function Y(c,b,a,e){c=$(c);if(Object.isUndefined(e)){e=true}if(c==document&&document.createEvent&&!c.dispatchEvent){c=document.documentElement}var d;if(document.createEvent){d=document.createEvent("HTMLEvents");d.initEvent("dataavailable",true,true)}else{d=document.createEventObject();d.eventType=e?"ondataavailable":"onfilterchange"}d.eventName=b;d.memo=a||{};if(document.createEvent){c.dispatchEvent(d)}else{c.fireEvent(d.eventType,d)}return Z.extend(d)}Object.extend(Z,Z.Methods);Object.extend(Z,{fire:Y,observe:P,stopObserving:L});Element.addMethods({fire:Y,observe:P,stopObserving:L});Object.extend(document,{fire:Y.methodize(),observe:P.methodize(),stopObserving:L.methodize(),loaded:false});if(window.Event){Object.extend(window.Event,Z)}else{window.Event=Z}})();(function(){var E;function A(){if(document.loaded){return}if(E){window.clearTimeout(E)}document.loaded=true;document.fire("dom:loaded")}function D(){if(document.readyState==="complete"){document.stopObserving("readystatechange",D);A()}}function B(){try{document.documentElement.doScroll("left")}catch(F){E=B.defer();return}A()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",A,false)}else{document.observe("readystatechange",D);if(window==top){E=B.defer()}}Event.observe(window,"load",A)})();Element.addMethods();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(A,B){return Element.insert(A,{before:B})},Top:function(A,B){return Element.insert(A,{top:B})},Bottom:function(A,B){return Element.insert(A,{bottom:B})},After:function(A,B){return Element.insert(A,{after:B})}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},within:function(B,A,D){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(B,A,D)}this.xcomp=A;this.ycomp=D;this.offset=Element.cumulativeOffset(B);return(D>=this.offset[1]&&D<this.offset[1]+B.offsetHeight&&A>=this.offset[0]&&A<this.offset[0]+B.offsetWidth)},withinIncludingScrolloffsets:function(B,A,E){var D=Element.cumulativeScrollOffset(B);this.xcomp=A+D[0]-this.deltaX;this.ycomp=E+D[1]-this.deltaY;this.offset=Element.cumulativeOffset(B);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+B.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+B.offsetWidth)},overlap:function(B,A){if(!B){return 0}if(B=="vertical"){return((this.offset[1]+A.offsetHeight)-this.ycomp)/A.offsetHeight}if(B=="horizontal"){return((this.offset[0]+A.offsetWidth)-this.xcomp)/A.offsetWidth}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(A){Position.prepare();return Element.absolutize(A)},relativize:function(A){Position.prepare();return Element.relativize(A)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(A,D,B){B=B||{};return Element.clonePosition(D,A,B)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(B){function A(D){return D.blank()?null:"[contains(concat(' ', @class, ' '), ' "+D+" ')]"}B.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(E,D){D=D.toString().strip();var F=/\s/.test(D)?$w(D).map(A).join(""):A(D);return F?document._getElementsByXPath(".//*"+F,E):[]}:function(G,F){F=F.toString().strip();var D=[],I=(/\s/.test(F)?$w(F):null);if(!I&&!F){return D}var E=$(G).getElementsByTagName("*");F=" "+F+" ";for(var H=0,K,J;K=E[H];H++){if(K.className&&(J=" "+K.className+" ")&&(J.include(F)||(I&&I.all(function(L){return !L.toString().blank()&&J.include(" "+L+" ")})))){D.push(Element.extend(K))}}return D};return function(D,E){return $(E||document.body).getElementsByClassName(D)}}(Element.Methods)}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(A){this.element=$(A)},_each:function(A){this.element.className.split(/\s+/).select(function(B){return B.length>0})._each(A)},set:function(A){this.element.className=A},add:function(A){if(this.include(A)){return}this.set($A(this).concat(A).join(" "))},remove:function(A){if(!this.include(A)){return}this.set($A(this).without(A).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);Object.extend(Class.Methods,{logMethods:function(B){var B=B||{},D=(B.id&&B.id+".")||"",E=!!B.trace,G=this.prototype;for(var F in G){var A=G.hasOwnProperty(F)?"":" (inherited)";if((E||!A)&&Object.isFunction(G[F])){G[F]=G[F].wrap(function(I,J,H){return function(K){(B.callback||log.info)(I+J+H);return K.apply(this,$A(arguments).slice(1))}}(D,F,A))}}}});Element.exception=undefined;Element.addMethods({getElementsByTagAndClass:function(D,A){var B=arguments[0];var D=arguments[1];var A=arguments[2];var E=B.getElementsByTagName(D);return $A(E).inject([],function(G,F){if(F.className.match(new RegExp("(^|\\s)"+A+"(\\s|$)"))){G.push(Element.extend(F))}return G})},getNthElementByClassName:function(){if(arguments.length<3){return Element.exception}var E=arguments[0];var B=arguments[1];var A=parseInt(arguments[2]);var D=(arguments[3]?arguments[3]:"*");if(isNaN(A)){return Element.exception}var G=$A((E||document.body).getElementsByTagName(D));if(A==0){return Element.exception}else{if(A<0){G.reverse(true);A=Math.abs(A)}}var H=0;var I=null;for(var F=0;F<G.length;F++){if(G[F].className.match(new RegExp("(^|\\s)"+B+"(\\s|$)"))){H++;if(H==A){I=Element.extend(G[F]);break}}}return I},getFirstElementByClassName:function(){var D=arguments[0];var A=arguments[1];var B=arguments[2];if(B){return D.getNthElementByClassName(A,1,B)}else{return D.getNthElementByClassName(A,1)}},getLastElementByClassName:function(){var D=arguments[0];var A=arguments[1];var B=arguments[2];if(B){return D.getNthElementByClassName(A,-1,B)}else{return D.getNthElementByClassName(A,-1)}},containsElementWithClassName:function(){if(arguments.length<2){return null}var D=arguments[0];var A=arguments[1];var B=arguments[2];var E=null;if(B){E=D.getNthElementByClassName(A,1,arguments[2])}else{E=D.getNthElementByClassName(A,1)}if(E){return true}else{return false}},getElementsByAttribute:function(){if(arguments.length<2){return null}var D=arguments[0];var G=arguments[1];if(G.toLowerCase()=="class"||G.toLowerCase()=="classname"){log.error("getElementsByAttribute does not support 'class' or 'className' as the attribute parameter");return null}var B=D.getElementsByTagName(arguments[2]||"*");var F=$A();var H=B.length;for(var E=0;E<H;E++){var A=B[E];if(A.getAttribute(G)){F.push(Element.extend(A))}}return F},getParentByTagName:function(){var D=$A(arguments),B=D.shift(),A=D[0].toUpperCase();while(B.parentNode){if(B.tagName==A){return Element.extend(B)}B=B.parentNode}return null},getParentByClassName:function(){var D=$A(arguments),B=D.shift(),A=D[0];while(B.tagName!="HTML"){if(B.hasClassName(A)){return Element.extend(B)}B=$(B.parentNode)}return null},getParentByAttribute:function(){var B=$A(arguments),A=B.shift(),D=B[0];while(A.tagName!="HTML"){if(A.hasAttribute(D)){return Element.extend(A)}A=$(A.parentNode)}return null},toggleClasses:function(E,D){var B=$A(arguments),A=B.shift();if(Element.hasClassName(A,B[0])){Element.removeClassName(A,B[0]),Element.addClassName(A,B[1])}else{if(Element.hasClassName(A,B[1])){Element.removeClassName(A,B[1]),Element.addClassName(A,B[0])}}},visibleByClass:function(){var A=arguments[0];var B=true;if(A.hasClassName("noneTableRow")||A.hasClassName("noneTableRowGroup")||A.hasClassName("noneBlock")||A.hasClassName("noneInline")||A.hasClassName("hidden")||(A.style.display=="none")||(A.style.visibility=="hidden")){B=false}return B},hideByClass:function(){for(var B=0;B<arguments.length;B++){var A=$(arguments[B]);if(A.visibleByClass()){if(A.hasClassName("tableRow")){A.removeClassName("tableRow");A.addClassName("noneTableRow")}else{if(A.hasClassName("tableRowGroup")){A.removeClassName("tableRowGroup");A.addClassName("noneTableRowGroup")}else{if(A.hasClassName("block")){A.removeClassName("block");A.addClassName("noneBlock")}else{if(A.hasClassName("inline")){A.removeClassName("inline");A.addClassName("noneInline")}else{if(A.hasClassName("visible")){A.removeClassName("visible");A.addClassName("hidden")}else{log.error("hideByClass(): missing required class for "+A)}}}}}}}if(arguments.length==1){return $(arguments[0])}},showByClass:function(){for(var B=0;B<arguments.length;B++){var A=$(arguments[B]);if(!A.visibleByClass()){if(A.hasClassName("noneTableRow")){A.removeClassName("noneTableRow");A.addClassName("tableRow")}else{if(A.hasClassName("noneTableRowGroup")){A.removeClassName("noneTableRowGroup");A.addClassName("tableRowGroup")}else{if(A.hasClassName("noneBlock")){A.removeClassName("noneBlock");A.addClassName("block")}else{if(A.hasClassName("noneInline")){A.removeClassName("noneInline");A.addClassName("inline")}else{if(A.hasClassName("hidden")){A.removeClassName("hidden");A.addClassName("visible")}else{log.error("showByClass(): missing required class for "+A)}}}}}}}if(arguments.length==1){return $(arguments[0])}},toggleByClass:function(){for(var B=0;B<arguments.length;B++){var A=$(arguments[B]);if(A.visibleByClass()){A.hideByClass()}else{A.showByClass()}}},getParams:function(){var result="null";var element=arguments[0];this.params=null;var attr=(arguments[1]||"params");if(typeof(element)=="object"&&element.getAttribute(attr)){var jsonRaw=element.getAttribute(attr);var convertedString=jsonRaw.unescapeJSON();try{result=eval("({"+convertedString+"})")}catch(error){Errors.capture(error,"Error converting attributes to json object  ["+convertedString+"]")}return result}},getAgents:function(){var result;var element=arguments[0];this.params=null;if(typeof(element)=="object"&&element.getAttribute("agent")){var jsonRaw=element.getAttribute("agent");var convertedString=jsonRaw.unescapeJSON();try{result=eval("(["+convertedString+"])")}catch(error){Errors.capture(error,"Error converting attributes to json object  ["+convertedString+"]")}return result}},getPosition:function(){var B=arguments[0];var A=Position.cumulativeOffset(B);return{x:A[0],y:A[1],units:"px"}},getPositionOffset:function(A){return Position.delta(arguments[0],arguments[1])},destroy:function(){var A=$(arguments[0]);if(A){if(A.innerHTML){A.innerHTML=""}if(A.parentNode){A.parentNode.removeChild(A)}else{log.warning("Element.destroy(): no parent node - element not in DOM?")}}return null},updateAndFocus:function(E){log.debug("updateAndFocus - updating");var D=arguments[0];var F=arguments[1]?arguments[1]:1000;if(D){var B=function(){if(this&&this.parentNode&&(this.parentNode.nodeType===1)){log.debug("updateAndFocus - setting focus: "+this);this.focus()}else{log.warning("Element.updateAndFocus(): attempting to focus on a node that is not nodeType 1 (ELEMENT_NODE).Target of focus was probably removed from the document during the delay")}}.bind(D);if(window.virtualBufferManager){window.virtualBufferManager.update();clearTimeout(window.virtualBufferManager.timeout)}else{log.error("Element.updateAndFocus(): virtualBufferManager does not exist!")}var A=setTimeout(B,F);if(window.virtualBufferManager){window.virtualBufferManager.timeout=A}return A}else{log.error("Element.updateAndFocus must have an element to operate on!")}},isDOMReady:function(){var A=function(B){if(B.nextSibling){return true}else{if(B.nodeName=="HTML"){return false}else{return A(B.parentNode)}}};if(Page.isDOMReady){return true}else{return A(arguments[0])}},rendered:function(){var A=arguments[0];if(A.getStyle("display")=="none"){return false}else{if(A.tagName=="HTML"){return true}else{return A.up().rendered()}}},cumulativeOffset:function(A){var D=0,E=0;do{if(Element.getStyle(A,"position")=="fixed"){var B=Position.calculateScroll();D+=B.y+A.offsetTop;E+=B.x+A.offsetLeft;A=null}else{D+=A.offsetTop||0;E+=A.offsetLeft||0;A=$(A.offsetParent)}}while(A);return Element._returnOffset(E,D)}});String.prototype.unescapeJSON=function(){var A=this.toString();A=A.replace(/!#/,"{");A=A.replace(/#!/,"}");A=A.replace(/\r/g," ");A=A.replace(/\n/g," ");A=A.replace(/'\s*/g,"'");A=A.replace(/'\s*(,|$|}|])/gm,"QUOTE_CONSTANT$1");A=A.replace(/((\[|:|,)\s*)'/mg,"$1QUOTE_CONSTANT");A=A.replace(/'/gm,"\\'");A=A.replace(/QUOTE_CONSTANT/gm,"'");A=A.replace(/models\['([^']*)']/g,"models[\\'$1\\']");return A};String.prototype.escapeRegex=function(){return this.toString().replace(/([\[|\\|\^|\$|\.|\||\?|\*|\+|\(|\)])/gm,"\\$1")};Form.HiddenField={add:function(B,A,E){var D=document.createElement("INPUT");D.setAttribute("name",A);D.setAttribute("type","hidden");D.setAttribute("value",E);log.debug("adding hidden field:"+A+":"+E);B.appendChild(D)}};Form.Element.resetValue=function(B){var A=B.getElementsByTagName("select")[0];if(A){A.selectedIndex=0}var E=B.getElementsByTagName("input");if(E){for(var D=0;E[D];D++){switch(E[D].type){case"radio":case"checkbox":E[D].checked=false;break;case"text":case"password":E[D].value="";break}}}};Object.extend(String.prototype,{stripNoScripts:function(){return this.replace(new RegExp("(?:<noscript.*?>)((\n|\r|.)*?)(?:</noscript>)","img"),"")},upperCaseFirst:function(){var A=this.substr(0,1).toUpperCase();return this.substr(0,1).toUpperCase()+this.substr(1,this.length)}});Date.prototype.getShortYear=function(){var A=new String(this.getFullYear());return A.substring(2)};Function.prototype.bindAsEventListener=function(B){var D=this,A=$A(arguments),B=A.shift();return function(E){return D.apply(B,[(E||window.event)].concat(A).concat($A(arguments)))}};Object.extend(Event,{onDOMReady:function onDOMReady(f){if(!onDOMReady._readyCallbacks){var domReady=(function(){if(onDOMReady.done){return}onDOMReady.done=true;if(onDOMReady._timer){clearInterval(onDOMReady._timer)}onDOMReady._readyCallbacks.each(function(f){f()});onDOMReady._readyCallbacks=null}).bind(this);if(document.addEventListener){document.addEventListener("DOMContentLoaded",domReady,false);
/*@cc_on @*/
/*@if (@_win32)
				  document.write("<script id=__ie_onload defer src=/cacheable/empty.js><\/script>");
				  document.getElementById("__ie_onload").onreadystatechange = function() {
					if (this.readyState == "complete") domReady();
				  };
				  /*@end @*/
}if(/WebKit/i.test(navigator.userAgent)){onDOMReady._timer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){domReady()}},10)}Event.observe(window,"load",domReady);onDOMReady._readyCallbacks=[]}if(onDOMReady.done){f()}else{onDOMReady._readyCallbacks.push(f)}},findElementByTagName:function(D,B){var A=Event.element(D);while(A.parentNode&&(!A.tagName||(A.tagName.toUpperCase()!=B.toUpperCase()))){A=A.parentNode}return A}});var Units={PX_TO_EM:12,EM_TO_PX:1/12,TYPE:"px"};Position.putInViewport=function(A,G){var F=Position.calculateViewport();var J=Position.calculateScroll();var D=Position.calculatePageHeight();G.dim=G.getDimensions();G.pos=G.getPosition();A.pos=Position.cumulativeOffset(A);A.dim=A.getDimensions();A.pos=A.getPosition();var B=A.pos.x-G.dim.width;if(A.pos.x+A.dim.width+G.dim.width<=F.width||B<=0){B=A.dim.width+A.pos.x}var I=(parseInt(J.x)+F.width-(B+G.dim.width)>=0);if(Units.TYPE=="em"){B=B/Units.PX_TO_EM}G.setStyle({left:B+Units.TYPE});F=Position.calculateViewport();var H=A.pos.y+(A.dim.height/2);if(F.height<G.dim.height||parseInt(J.y)-H>=0){H=parseInt(J.y)}else{if(H+G.dim.height>=parseInt(J.y)+F.height){H=H-(H+G.dim.height-(parseInt(J.y)+F.height))}}var E=(parseInt(J.y)+F.height-(H+G.dim.height)>=0);if(Units.TYPE=="em"){H=H/Units.PX_TO_EM}G.setStyle({top:H+Units.TYPE});return{x:B,y:H,inViewport:(I&&E),units:Units.TYPE}};Position.delta=function(A,B){A.pos=A.getPosition();B.pos=B.getPosition();return{x:(B.pos.x-A.pos.x),y:(B.pos.y-A.pos.y),units:"px"}};Position.calculatePageHeight=function(){var A=0;if(document.documentElement.scrollHeight>document.documentElement.offsetHeight){A=document.documentElement.scrollHeight}else{A=document.documentElement.offsetHeight}return{height:A,units:"px"}};Position.calculateScroll=function(){var B=0,A=0;if(window.pageYOffset&&window.pageXOffset){B=window.pageYOffset;A=window.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollTop){B=document.documentElement.scrollTop;A=document.documentElement.scrollLeft}else{if(document.body){B=document.body.scrollTop;A=document.body.scrollLeft}}}return{x:A,y:B,units:"px"}};Position.calculateViewport=function(){var D=document.documentElement;var B=window.innerHeight;var A=window.innerWidth;if(B!=null&&D.clientHeight!=null){B=(D.clientHeight<B&&D.clientHeight>0)?D.clientHeight:B;A=(D.clientWidth<window.innerWidth&&D.clientWidth>0)?D.clientWidth:A}else{if(D&&D.clientHeight){B=D.clientHeight;A=D.clientWidth}else{if(document.body){B=document.body.clientHeight;A=document.body.clientWidth}}}return{height:B,width:A,units:"px"}};Ajax.Request.prototype.abort=function(){this.transport.onreadystatechange=Prototype.emptyFunction;this.transport.abort();Ajax.activeRequestCount--};Ajax.PartialRequest=function(A,B){try{var E=function(){var G=A.split("?")[1];var F=B.parameters;if(typeof F!="undefined"&&typeof G!="undefined"){throw new Error("Cannot resolve both parameters and queryString in Ajax.PartialRequest. Must choose either parameters or querystring.")}if(typeof F=="undefined"&&typeof G=="undefined"){return""}return F||G}();if(!E.match(/req=partial/)){var E=E.split("&");E.push("rep=partial");E=E.join("&")}B.parameters=E;new Ajax.Request(A.split("?")[0],B)}catch(D){Errors.capture(D)}};var ManagedEventObservers=Class.create();ManagedEventObservers.prototype={initialize:function(){this.observers=$A()},add:function(A,B,E,D){if(arguments.length>=3){A=$(A);D=D||false;Event.observe(A,B,E,D);this.observers.push([A,B,E,D])}else{throw new Error("ManagedEventObservers.add(): too few parameters")}},getFirstTriggerElement:function(){if(this.observers[0]){return this.observers[0][0]}else{return null}},remove:function(A){if($(A)){for(var B=0;B<this.observers.length;B++){if(this.observers[B][0]==A){Event.stopObserving.apply(this,this.observers[B]);this.observers[B][0]=null;this.observers.splice(B)}}}},clear:function(){for(var A=0;A<this.observers.length;A++){Event.stopObserving.apply(this,this.observers[A]);this.observers[A][0]=null}this.observers.clear();return null},isWatchingElement:function(A){var D=false;if($(A)){for(var B=0;B<this.observers.length;B++){if(this.observers[B][0]==A){D=true}}}return D}};var virtualBufferManager={initialize:function(){var A=document.createElement("input");A.type="hidden";A.name="virtualBufferHiddenField";A.value="0";this.hiddenField=document.body.appendChild(A);log.debug("virtualBufferManager initialized")},update:function(){if(this.hiddenField){if(this.hiddenField.value==="0"){this.hiddenField.value="1"}else{this.hiddenField.value="0"}log.debug("virtualBufferManager.update: "+this.hiddenField.value)}else{log.error("virtualBufferManager has not been initialized, it should have been")}}};Event.onDOMReady(window.virtualBufferManager.initialize.bind(virtualBufferManager));var Profiler={items:{},start:function(A){this.items[A]=new Object();this.items[A].startTime=new Date()},stop:function(A){if(this.items[A]){this.items[A].endTime=new Date();this.log(A)}else{log.warning("No profiler of label: "+A+" was found")}},log:function(A){this.items[A].elapsedTime=((this.items[A].endTime-this.items[A].startTime)/1000);if(this.items[A].elapsedTime==undefined){this.items[A].elapsedTime=0}var B=(A+" elapsedTime: "+this.items[A].elapsedTime+" secs");if(this.items[A].elapsedTime>=0.1){log.warning(B)}else{log.debug(B)}},toString:function(){var A=["latency profile"];for(props in this.items){A.push(props+":"+Profiler.items[props].elapsedTime)}return A.join(",\n")}};var log=new function(){this.debug=function(){};this.info=function(){};this.warning=function(){};this.error=function(){}};var Errors={list:[],capture:function(B){var A=$A(arguments),F=A.shift();var G=["name","message","description","number","fileName","sourceURL","lineNumber","line"];var E=A;for(var D=0;D<G.length;D++){if(F[G[D]]!==undefined){E.push(G[D]+":"+F[G[D]])}}if(B.message&&B.message=="Object doesn't support this property or method"){log.error("If IE only, this error often means that you are trying to use prototype.js Element extensions (eg: .getElementByClassName) on a non-extended element")}this.list.push(E);log.error(""+E.join(",\n"))},toString:function(){if(this.list.length>0){var B=["JavaScript Error"];for(var A=0;A<this.list.length;A++){B.push(this.list[A])}return B.join("")}}};var Inspector={unpack:function(A){result=[];for(prop in A){result.push(prop+":"+A[prop])}return result.join("\n")}};var report=function(A){window.open("","report").document.write("<pre>"+A+"</pre>")};String.prototype.deleteQueryStringParam=function(E,D){var B=new RegExp("^&|&$","g");var A=new RegExp("&&","g");String.prototype.deleteQueryStringParam=function(I,G){var F=I+(G===true?"[^&]*":"=[^&]*");var H=new RegExp(F,"g");return this.replace(H,"").replace(A,"&").replace(B,"")};return this.deleteQueryStringParam(E,D)};var $QS=QueryString=function(A){A=A.replace(/&amp;/g,"&");var B=A.split("&");return{addParam:function(F){for(var E=0,D=arguments.length;E<D;E++){B.push(arguments[E])}B=B.uniq();return this},removeParam:function(F){for(var E=0,D=arguments.length;E<D;E++){B=B.without(arguments[E])}return this},toString:function(){return B.join("&")}}};var PersistUtil={initialized:false,ready:function(){if(!this.initialized&&Persist.type){Persist.remove("cookie");Persist.remove("flash");this.initialized=true}return this.initialized}};(function(){var A={hashRegex:/^#/,ieHashPrefix:"/",ieHashPrefixRegex:/^\//,init:function(){this.lastHash="";var E=Prototype.Browser.IE&&(!document.documentMode||document.documentMode<8);if(E){var D=window.location.hash.replace(this.hashRegex,"");this.iframe=$(document.createElement("iframe"));this.iframe.src="javascript:false";this.iframe.addClassName("noneBlock");document.body.insertBefore(this.iframe,$("bodyWrapper"));this.iframe=this.iframe.contentWindow;if(D.search(this.ieHashPrefixRegex)==-1){D=this.ieHashPrefix+D;window.location.replace("#"+D)}this.updateIFrame(D);document.observe("click",(function(H){var G=H.findElement("a");if(G){if(G.href.split("#")[0]==window.location.href.split("#")[0]){var I=G.href.split("#")[1];var F=$(I);if(F&&!F.rendered()){H.preventDefault();window.location.href=G.href.replace("#","#"+this.ieHashPrefix)}}}}).bindAsEventListener(this))}if("onhashchange" in window&&!E){Event.observe(window,"hashchange",this.observeHash.bindAsEventListener(this))}else{window.setInterval(this.observeHash.bindAsEventListener(this),100)}document.observe("hash:check",(function(){document.fire("hash:change",{hash:this.iframe?this.lastHash.replace(this.ieHashPrefixRegex,""):this.lastHash})}).bindAsEventListener(this));this.observeHash(true)},observeHash:function(E){var F=window.location.hash.replace(this.hashRegex,"");if(this.iframe){var D=this.iframe.document.location.hash.replace(this.hashRegex,"");if(F!==this.lastHash){if(F.search(this.ieHashPrefixRegex)==-1){F=this.ieHashPrefix+F;window.location.replace("#"+F)}if(F!==D){this.updateIFrame(F)}}else{if(D!==this.lastHash){window.location.href=window.location.href.split("#")[0]+"#"+D}}}if(F!==this.lastHash||E){if(!this.iframe&&F.search(this.ieHashPrefixRegex)!=-1){F=F.replace(this.ieHashPrefixRegex,"");window.location.replace("#"+F)}this.lastHash=F;document.fire("hash:change",{hash:this.iframe?F.replace(this.ieHashPrefixRegex,""):F})}},updateIFrame:function(D){this.iframe.document.open().close();this.iframe.document.location.hash="#"+D}};document.observe("hash:check",function B(){document.stopObserving("hash:check",B);A.init.call(A)})})();(function(){var B={};this.processTemplate=function A(F,E){var D=!/\W/.test(F)?B[F]=B[F]||A(document.getElementById(F).innerHTML.split("\\").join("\\\\")):new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+F.replace(/[\r\t\n]/g," ").replace(/'(?=[^~]*~>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<~=(.*?)~>/g,"',$1,'").split("<~").join("');").split("~>").join("p.push('")+"');}return p.join('');");return E?D(E):D}})();var FacebookSDK={session:null,callbacks:[],loading:false,initialized:false,initParams:{},load:function(G,B){if(G){this.callbacks.push(G)}if(this.loading){return}this.loading=true;this.initParams=B.params.initParams;var A=B.element;var E=document.createElement("div");E.id="fb-root";A.insert({top:E});var D=this.initParams.locale||"en_US";var F=document.createElement("script");F.async=true;F.src=document.location.protocol+"//connect.facebook.net/"+D+"/all.js";E.appendChild(F);fbAsyncInit=function(){this.initSdk()}.bind(this)},loaded:function(A){if(A){A()}},callback:function(){this.load=this.loaded;while(this.callbacks.length){(this.callbacks.shift())()}},initSdk:function(){if(this.initialized){return}var D=this.initParams;var F=window.location.protocol+"//"+window.location.host,B="/script/vendor/facebook/facebook-channel.htm",A="/script/vendor/facebook/facebook-channel-secure.htm",E=F+(document.location.protocol.toLowerCase()==="http:"?B:A);FB.init({appId:D.appId,status:true,cookie:true,channelUrl:E});this.initialized=true;this.callback()}};var GoogleMapAPILoader={callbacks:[],loading:false,load:function(E,D,F){if(E){this.callbacks.push(E)}if(this.loading){return}this.loading=true;var A=(window.location.protocol==="https:")?"https://maps-api-ssl.google.com/":"http://maps.google.com/";var B=document.createElement("SCRIPT");B.type="text/javascript";A+="maps/api/js?client=gme-orbitz&sensor="+(F?true:false)+"&callback=GoogleMapAPILoader.callback&v=3.3&language="+D;B.src=A;document.getElementsByTagName("HEAD")[0].appendChild(B)},loaded:function(A){if(A){A()}},callback:function(){this.load=this.loaded;while(this.callbacks.length){(this.callbacks.shift())()}}};var GoogleMapUtil={getStreetView:function(B,D){var A=new google.maps.StreetViewService();A.getPanoramaByLocation(B,50,function(E,F){if(F==google.maps.StreetViewStatus.OK){if(typeof D==="function"){D(E)}}else{if(F==google.maps.StreetViewStatus.ZERO_RESULTS){log.info("GoogleMapUtil: Streetview unavailable for this location")}else{if(F==google.maps.StreetViewStatus.UNKNOWN_ERROR){log.error("GoogleMapUtil: Streetview server error")}else{log.error("GoogleMapUtil: Streetview unknown error")}}}})},calculateBearing:function(B,F){var G=F.lat()-B.lat();var A=F.lng()-B.lng();var D=Math.atan2(A,G);var E=D*180/Math.PI;if(E<0){E+=360}return E}};var DialogManager=Class.create({initialize:function(A){this.dialogs=$A();this.$element=Element.extend(A);this.openListener=this.dialogOpen.bindAsEventListener(this);this.$element.observe("dialog:dialogOpen",this.openListener)},close:function(){this.dialogs.each(function(A){A.close()});this.dialogs.clear()},dialogOpen:function(A){if(A&&A.memo&&A.memo.dialog){this.dialogs.push(A.memo.dialog)}},destroy:function(){this.close();this.dialogs=null;this.$element.stopObserving("dialog:dialogOpen",this.openListener);this.$element=null}});var Dialog={};Dialog.Base={version:"Dialog 1.5",setProperties:function(B,D,A){this.type=B;this.content=D;this.triggerContext;this.options={anchorName:"",triggerEvent:"click",closeLabel:"",dialogGroup:"",topBoundaryText:"",bottomBoundaryText:"",wrapLinkText:"",sessionTimeoutUrl:"",closeElements:$A(),classes:"",hasCustomPositioningContext:false,setUp:function(){},tearDown:function(){}};Object.extend(this.options,A||{});this.isOpen=false;this.activated=false;this.layoutBuilt=false;this.triggers=new ManagedEventObservers();this.managedEventObservers=new ManagedEventObservers();this.closeEventObservers=new ManagedEventObservers();if(this.options.dialogGroup){this.dialogGroup=this.options.dialogGroup;document.observe("dialog:dialogOpen",this.closeByGroup.bindAsEventListener(this))}},createMarkup:function(){log.error("You have not defined createMarkup() for your "+this.type+" object.")},showDialog:function(){log.error("You have not defined showDialog() for your "+this.type+" object.")},positionInViewport:function(){log.error("You have not defined positionInViewport() for your "+this.type+" object.")},open:function(A){log.error("You have not defined open() for your "+this.type+" object.")},close:function(A){log.error("You have not defined close() for your "+this.type+" object.")},closeByGroup:function(A){if(!A||!A.memo){return}if(A.memo.dialog.options.dialogGroup===this.dialogGroup&&this.isOpen){this.close()}},createDialogDivs:function(){log.debug("createDialogDivs");this.markup={dialogWrapper:new Element("div",{"class":"dialogWrapper "+this.type.toLowerCase()+" "+this.options.classes}),topBoundary:new Element("p",{"class":"offscreen"}),bottomBoundary:new Element("p",{"class":"offscreen"}),dialogAnchor:new Element("a",{"class":"dialogAnchor"}),top:new Element("div",{"class":"dialogTop"}),main:new Element("div",{"class":"dialogMain"}),bottom:new Element("div",{"class":"dialogBottom"}),topLeft:new Element("div",{"class":"dialogTopLeft"}),topRight:new Element("div",{"class":"dialogTopRight"}),topCloseLink:new Element("a",{"class":"dialogTopCloseLink dialogCloseLink",href:"javascript:void(0);",tabIndex:"-1"}),mainRight:new Element("div",{"class":"dialogMainRight"}),mainContent:new Element("div",{"class":"dialogMainContent"}),mainInfo:new Element("div",{"class":"dialogMainInfo"}),dialogTitle:new Element("div",{"class":"dialogTitle"}),dialogTitleH3:new Element("h3"),bottomContent:new Element("div",{"class":"dialogBottomContent"}),bottomLeft:new Element("div",{"class":"dialogBottomLeft"}),bottomRight:new Element("div",{"class":"dialogBottomRight"}),bottomCloseLink:new Element("a",{"class":"dialogBottomCloseLink dialogCloseLink offscreen",href:"javascript:void(0);",tabIndex:"-1"}),wrapLink:new Element("a",{"class":"dialogWrapLink offscreen"})};if(this.options.id){this.markup.dialogWrapper.id=this.options.id}this.markup.topCloseLink.innerHTML=this.options.closeLabel;this.options.closeElements.push(this.markup.topCloseLink);this.markup.bottomCloseLink.innerHTML=this.options.closeLabel;this.options.closeElements.push(this.markup.bottomCloseLink);this.markup.topBoundary.innerHTML=this.options.topBoundaryText;this.markup.dialogWrapper.appendChild(this.markup.topBoundary);if(this.options.anchorName!==""){this.markup.dialogAnchor.name="_"+this.options.anchorName;this.markup.dialogAnchor.tabIndex="-1";this.markup.dialogWrapper.appendChild(this.markup.dialogAnchor);this.markup.wrapLink.tabIndex="-1";this.markup.wrapLink.href="#"+this.markup.dialogAnchor.name;this.markup.wrapLink.innerHTML=this.options.wrapLinkText}this.markup.dialogWrapper.appendChild(this.markup.top);this.markup.dialogWrapper.appendChild(this.markup.main);this.markup.dialogWrapper.appendChild(this.markup.bottom);this.markup.dialogWrapper.appendChild(this.markup.wrapLink);this.markup.bottomBoundary.innerHTML=this.options.bottomBoundaryText;this.markup.dialogWrapper.appendChild(this.markup.bottomBoundary);this.markup.top.appendChild(this.markup.topLeft);this.markup.top.appendChild(this.markup.topRight);this.markup.main.appendChild(this.markup.mainRight);this.markup.mainRight.appendChild(this.markup.mainContent);this.markup.mainContent.appendChild(this.markup.topCloseLink);if(this.options.heading){this.markup.dialogTitleH3.innerHTML=this.options.heading;this.markup.dialogTitle.appendChild(this.markup.dialogTitleH3);this.markup.mainContent.appendChild(this.markup.dialogTitle);if(this.options.transparentHeading){this.markup.dialogTitle.addClassName("transparentHeading")}}this.markup.mainContent.appendChild(this.markup.mainInfo);this.markup.mainContent.appendChild(this.markup.bottomCloseLink);this.markup.bottom.appendChild(this.markup.bottomLeft);this.markup.bottom.appendChild(this.markup.bottomRight)},createShim:function(){if(navigator.userAgent.toLowerCase().indexOf("msie 6")!==-1){log.debug("is ie6, creating shim");this.markup.shim=this.markup.shim?this.markup.shim.destroy():null;this.markup.shim=Element.extend(document.createElement("div"));var F=Element.extend(document.createElement("iframe"));F.style.display="none";this.markup.shim.appendChild(F);this.markup.shim.className="dialogShim "+this.options.classes;F.src="/cacheable/empty.html";F.scrolling="no";F.frameBorder="0";this.triggerContext.activeDialogsContainer.insertBefore(this.markup.shim,this.markup.dialogWrapper);this.markup.shim.style.top=this.markup.dialogWrapper.style.top;this.markup.shim.style.left=this.markup.dialogWrapper.style.left;var D=this.markup.shim.currentStyle.paddingTop.replace("px","")*1;var E=this.markup.shim.currentStyle.paddingRight.replace("px","")*1;var A=this.markup.shim.currentStyle.paddingBottom.replace("px","")*1;var B=this.markup.shim.currentStyle.paddingLeft.replace("px","")*1;F.style.width=(this.dialogBoundingBox.x2-this.dialogBoundingBox.x1-E-B)+"px";F.style.height=(this.dialogBoundingBox.y2-this.dialogBoundingBox.y1-D-A)+"px";F.style.display="block"}},attachTriggers:function(B){if(Object.isArray(B)){if(this.triggers instanceof ManagedEventObservers){for(var A=0;B[A];A++){if(this.options.triggerEvent=="mouseover"){this.triggers.add(B[A],"mouseover",this.open.bindAsEventListener(this))}this.triggers.add(B[A],"click",this.open.bindAsEventListener(this))}log.debug("Dialog.Base triggers attached: "+B.length)}else{log.error("Dialog.Base.prototype.triggers not instance of ManagedEventObservers")}}else{log.error("newTriggers parameter either undefined, or is not an array")}},attachCloseListeners:function(B){if(this.options.closeElements){for(var A=0;this.options.closeElements[A];A++){if(!this.options.closeElements[A].isAttached){this.closeEventObservers.add(this.options.closeElements[A],"click",B);this.options.closeElements[A].isAttached=true}}}var D=this.markup.mainInfo.getElementsByClassName("closeListener");for(var A=0;D[A];A++){if(!D[A].isAttached){this.managedEventObservers.add(D[A],"click",B);D[A].isAttached=true}}},getTrigger:function(A){if(this.triggers.isWatchingElement(A)){this.trigger=$(A)}else{this.trigger=$(A).ancestors().find(function(B){return this.triggers.isWatchingElement(B)}.bind(this));if(!this.trigger){this.trigger=$(A)}}},inspectTrigger:function(A){this.getTrigger(A);this.trigger.pos=this.trigger.getPosition();this.trigger.dim=this.trigger.getDimensions();this.triggerContext={};if(this.options.hasCustomPositioningContext){this.triggerContext.element=this.trigger.up(".dialogPositioningContext")}else{this.triggerContext.element=this.trigger.up(".dialogWrapper, #bodyWrapper, body")}if(this.triggerContext.element===$(document.body)){this.triggerContext.pos={x:0,y:0}}else{this.triggerContext.pos=this.triggerContext.element.getPosition()}this.triggerContext.activeDialogsContainer=this.triggerContext.element.childElements().find(function(B){return B.hasClassName("activeDialogs")});if(!this.triggerContext.activeDialogsContainer){this.triggerContext.activeDialogsContainer=new Element("div",{"class":"activeDialogs"});this.triggerContext.element.appendChild(this.triggerContext.activeDialogsContainer)}log.debug("Dialog.Base.trigger: "+this.trigger.tagName+", pos: "+this.trigger.pos.x+", "+this.trigger.pos.y+" dim: "+this.trigger.dim.width+", "+this.trigger.dim.height+", triggerContext: "+this.triggerContext+", triggerContextPos: "+this.triggerContext.pos.x+", "+this.triggerContext.pos.y)},wrapFocus:function(A){A.preventDefault();this.focusCloseLink()},attachFocusWrapListeners:function(){this.managedEventObservers.add(this.markup.wrapLink,"click",this.wrapFocus.bindAsEventListener(this))},getContent:function(){if(this.response){log.debug("Dialog.Base.getContent: response");this.showDialog(this.response)}else{if(!this.content){log.debug("Dialog.Base.getContent: null")}else{if(this.content.domNode){this.content.domNode=$(this.content.domNode);log.debug("Dialog.Base.getContent - domNode: "+this.content.domNode);this.showDialog(this.content.domNode.cloneNode(true))}else{if(this.content.url){log.debug("Dialog.Base.getContent - url: "+this.content.url);this.content.url=this.content.url.replace("&amp;","&");this.content.url=this.content.url.replace("&amp;","&");this.request=new Ajax.Request(this.content.url,{method:(this.options.ajaxParameters)?"post":"get",parameters:(this.options.ajaxParameters)?this.options.ajaxParameters:"",onComplete:this.showDialog.bind(this),onSuccess:function(A){log.debug(A.status+": Dialog.Base.getContent() content.url successful");if(this.options.sessionTimeoutUrl&&A.responseText.indexOf("<html")!=-1){this.sessionHasExpired=true;top.location.href=this.options.sessionTimeoutUrl}}.bind(this)})}else{if(this.content.string){log.debug("Dialog.Base.getContent - markup: "+this.content.string);this.showDialog(this)}else{if(this.content.jsTemplate){log.debug("Dialog.Base.getContent - jsTemplate: "+this.content.jsTemplate);this.showDialog(this)}else{log.error("Dialog.response is null and Dialog.content not a recognized type")}}}}}}},populateDialog:function(){if(this.response){if(this.options.interstitial){this.markup.mainInfo.innerHTML=""}if(this.content.domNode){var A=$(this.content.domNode).immediateDescendants();log.debug("populateDialog: "+A.length+" nodes");for(var D=0;D<A.length;D++){this.markup.mainInfo.appendChild(A[D])}}else{if(this.content.url&&this.response.responseText){this.markup.mainInfo.update(this.response.responseText);Page.initializeDOMFragment(this.markup.mainInfo)}else{if(this.content.string){this.markup.mainInfo.update(this.content.string);Page.initializeDOMFragment(this.markup.mainInfo)}else{if(this.content.jsTemplate){log.debug("Dialog.populateDialog: jsTemplate - dataAttribute name: "+this.content.jsTemplate.dataAttributeName);try{var E=this.trigger.readAttribute(this.content.jsTemplate.dataAttributeName)||this.trigger.getParentByAttribute(this.content.jsTemplate.dataAttributeName).readAttribute(this.content.jsTemplate.dataAttributeName);dataJSON=E.unescapeJSON().evalJSON();if(dataJSON.microContentHeading){this.resetHeading(dataJSON.microContentHeading)}this.markup.mainInfo.update(processTemplate(this.content.jsTemplate.id,dataJSON))}catch(B){log.error("EXCEPTION: Dialog.populateDialog: unable process template - "+B.message)}Page.initializeDOMFragment(this.markup.mainInfo)}else{log.error("Dialog.populateDialog: unable to determine response type")}}}}this.markup.backToTopLink=this.markup.mainInfo.getLastElementByClassName("footnoteBackToTop","A");if(this.markup.backToTopLink){this.markup.backToTopLink.style.display="none"}}},depopulateDialog:function(){if(this.markup.backToTopLink){this.markup.backToTopLink.style.display="inline"}if(this.markup.mainInfo){if(this.content.domNode){var A=this.markup.mainInfo.immediateDescendants();for(var B=0;B<A.length;B++){this.content.domNode.appendChild(A[B])}}this.markup.mainInfo.innerHTML=""}},appendToDOM:function(){if(this.triggerContext.activeDialogsContainer){this.triggerContext.activeDialogsContainer.appendChild(this.markup.dialogWrapper);this.markup.dialogWrapper.setStyle({visibility:"hidden"})}else{log.error("Dialog.Base.appendToDOM: couldn't find 'triggerContext.activeDialogContainer' container to insert new dialog")}},_removeFromDOM:function(){log.debug("Dialog._removeFromDOM()");if(this.triggerContext){this.triggerContext.element=null;this.triggerContext.activeDialogsContainer=null;this.triggerContext=null}this.markup.backToTopLink=null;this.markup.shim=this.markup.shim?this.markup.shim.destroy():null;this.markup.bottomRight=this.markup.bottomRight?this.markup.bottomRight.destroy():null;this.markup.bottomLeft=this.markup.bottomLeft?this.markup.bottomLeft.destroy():null;this.markup.bottomContent=this.markup.bottomContent?this.markup.bottomContent.destroy():null;this.markup.bottomCloseLink=this.markup.bottomCloseLink?this.markup.bottomCloseLink.destroy():null;this.markup.mainInfo=this.markup.mainInfo?this.markup.mainInfo.destroy():null;this.markup.mainContent=this.markup.mainContent?this.markup.mainContent.destroy():null;this.markup.mainRight=this.markup.mainRight?this.markup.mainRight.destroy():null;this.markup.topCloseLink=this.markup.topCloseLink?this.markup.topCloseLink.destroy():null;this.markup.topRight=this.markup.topRight?this.markup.topRight.destroy():null;this.markup.topLeft=this.markup.topLeft?this.markup.topLeft.destroy():null;this.markup.dialogTitleH3=this.markup.dialogTitleH3?this.markup.dialogTitleH3.destroy():null;this.markup.dialogTitle=this.markup.dialogTitle?this.markup.dialogTitle.destroy():null;this.markup.wrapLink=this.markup.wrapLink?this.markup.wrapLink.destroy():null;this.markup.bottom=this.markup.bottom?this.markup.bottom.destroy():null;this.markup.main=this.markup.main?this.markup.main.destroy():null;this.markup.top=this.markup.top?this.markup.top.destroy():null;this.markup.dialogAnchor=this.markup.dialogAnchor?this.markup.dialogAnchor.destroy():null;this.markup.topBoundary=this.markup.topBoundary?this.markup.topBoundary.destroy():null;this.markup.dialogWrapper=this.markup.dialogWrapper?this.markup.dialogWrapper.destroy():null},focusCloseLink:function(){clearTimeout(this.focusTimeout);if(this.markup.topCloseLink){var A=this.markup.topCloseLink.updateAndFocus(1500);this.focusTimeout=A;var B=function(D){log.debug("Clearing close link focus timeout");clearTimeout(A);this.stopObserving("mousedown",B)};$("bodyWrapper").observe("mousedown",B)}},resetHeading:function(A){this.markup.dialogTitleH3.innerHTML=A}};var Microcontent=Class.create(Dialog.Base,{initialize:function(A,E,F){var D={triggerEvent:"mouseover",heading:null,triggerDelay:0,compact:false,displayBeak:true,preferredPosition:"bottomRight",debug:{enabled:false}};var A=$A(A);Object.extend(D,F||{});this.setProperties("Microcontent",E,D);this.attachTriggers(A);if(this.options.triggerEvent=="mouseover"){for(var B=0;A[B];B++){this.triggers.add(A[B],"mouseout",this.clearTriggerFocus.bindAsEventListener(this))}}else{if(this.options.triggerEvent=="click"){}else{log.error("Microcontent.options.triggerEvent: "+this.options.triggerEvent+" is not a recognized event type")}}this.focusListeners=new ManagedEventObservers();this.focusListenersAttached=false},createMarkup:function(){this.createDialogDivs();if(this.options.displayBeak){this.markup.beak=Element.extend(document.createElement("div"));this.markup.dialogWrapper.appendChild(this.markup.beak)}},showDialog:function(B){try{if(this.markup.dialogWrapper){$(this.trigger).fire("dialog:dialogOpen",{dialog:this});this.response=B;this.populateDialog();this.attachCloseListeners(this.close.bindAsEventListener(this));this.focusListenersAttached=this.attachFocusListeners();this.attachFocusWrapListeners();this.appendToDOM();this.buildLayout();var D=this.trigger.pos.y;if(Units.TYPE=="em"){D=D/Units.PX_TO_EM}this.markup.dialogWrapper.setStyle({top:D+Units.TYPE});this.positionInViewport();this.options.setUp();this.markup.dialogWrapper.setStyle({visibility:"visible"});this.focusCloseLink();this.manager=new DialogManager(this.markup.dialogWrapper);this.isOpen=true;window.setTimeout(function(){this.createShim()}.bind(this),0)}else{log.error("Microcontent.showDialog: markup.dialogWrapper doesn't exist")}}catch(A){log.error("EXCEPTION: Microcontent.showDialog: "+A.message)}finally{this.activated=false}},positionInViewport:function(){var Q={x1:this.trigger.pos.x-this.triggerContext.pos.x,y1:this.trigger.pos.y-this.triggerContext.pos.y,x2:this.trigger.pos.x-this.triggerContext.pos.x+this.trigger.dim.width,y2:this.trigger.pos.y-this.triggerContext.pos.y+this.trigger.dim.height};if(this.options.displayBeak){var J={x:Q.x1,y:Q.y1+(this.trigger.dim.height/2)};var K={x:Q.x2,y:Q.y1+(this.trigger.dim.height/2)}}else{var J={x:Q.x2,y:Q.y1+(this.trigger.dim.height/2)};var K={x:Q.x1,y:Q.y1+(this.trigger.dim.height/2)}}var e=this.markup.dialogWrapper.getDimensions();var W=function(){var o=0;var m=0;var h;var g;if(this.markup.main.currentStyle){if(this.options.displayBeak){var f=this.markup.beak.currentStyle;var o=(f.height.replace("px",""))*1;var m=(f.width.replace("px",""))*1}var l=this.markup.main.currentStyle;var k=this.markup.mainRight.currentStyle;var h=(l.paddingLeft.replace("px",""))*1;var g=(k.paddingRight.replace("px",""))*1}else{if(this.options.displayBeak){var f=document.defaultView.getComputedStyle(this.markup.beak,"");var o=(f.getPropertyValue("height").replace("px",""))*1;var m=(f.getPropertyValue("width").replace("px",""))*1}var l=document.defaultView.getComputedStyle(this.markup.main,"");var k=document.defaultView.getComputedStyle(this.markup.mainRight,"");var h=(l.getPropertyValue("padding-left").replace("px",""))*1;var g=(k.getPropertyValue("padding-right").replace("px",""))*1}if(this.options.displayBeak){this.offsets={top:(this.markup.bottom.dim.height+(o/2)),right:m-h,bottom:(0-this.markup.top.dim.height-(o/2)),left:(0-(m-g))}}else{this.offsets={top:this.markup.bottom.dim.height,right:0-h*2,bottom:0-this.markup.top.dim.height/2,left:g*2}}this.beakHeight=o}.bind(this);var H=function(){if(this.options.displayBeak){this.markup.beak.className="microcontentBeakRight";this.markup.beak.setStyle({left:e.width+"px"})}W()}.bind(this);var d=function(){if(this.options.displayBeak){this.markup.beak.className="microcontentBeakLeft";this.markup.beak.setStyle({left:"0"})}W()}.bind(this);d();var A={x1:K.x+this.offsets.right+this.triggerContext.pos.x,y1:K.y-e.height+this.offsets.top+this.triggerContext.pos.y,x2:K.x+e.width+this.offsets.right+this.triggerContext.pos.x,y2:K.y+this.offsets.top+this.triggerContext.pos.y};var U={x1:K.x+this.offsets.right+this.triggerContext.pos.x,y1:K.y+this.offsets.bottom+this.triggerContext.pos.y,x2:K.x+e.width+this.offsets.right+this.triggerContext.pos.x,y2:K.y+e.height+this.offsets.bottom+this.triggerContext.pos.y};H();var I={x1:J.x-e.width+this.offsets.left+this.triggerContext.pos.x,y1:J.y-e.height+this.offsets.top+this.triggerContext.pos.y,x2:J.x+this.offsets.left+this.triggerContext.pos.x,y2:J.y+this.offsets.top+this.triggerContext.pos.y};var Z={x1:J.x-e.width+this.offsets.left+this.triggerContext.pos.x,y1:J.y+this.offsets.bottom+this.triggerContext.pos.y,x2:J.x+this.offsets.left+this.triggerContext.pos.x,y2:J.y+e.height+this.offsets.bottom+this.triggerContext.pos.y};var Y=Position.calculateViewport();var S=Position.calculateScroll();var F={x1:S.x,y1:S.y,x2:(S.x+Y.width),y2:(S.y+Y.height)};var E=(U.x2<=F.x2)&&(U.y2<=F.y2);var O=(Z.x1>=F.x1)&&(Z.y2<=F.y2);var D=(A.x2<=F.x2)&&(A.y1>=F.y1);var c=(I.x1>=F.x1)&&(I.y1>=F.y1);this.debugPosition({dialogWrapperDimensions:e,topRightBoundingBox:A,topLeftBoundingBox:I,bottomRightBoundingBox:U,bottomLeftBoundingBox:Z,bottomRightGood:E,bottomLeftGood:O,topRightGood:D,topLeftGood:c});this.dialogBoundingBox;var B=function(){H();this.markup.dialogWrapper.setStyle({left:((this.dialogBoundingBox.x1-this.triggerContext.pos.x)/Units.PX_TO_EM)+"em"})}.bind(this);var T=function(){d();this.markup.dialogWrapper.setStyle({left:((this.dialogBoundingBox.x1-this.triggerContext.pos.x)/Units.PX_TO_EM)+"em"})}.bind(this);var V=function(){if(this.options.displayBeak){this.markup.beak.setStyle({top:this.markup.top.dim.height+this.markup.main.dim.height-this.beakHeight+"px"})}this.markup.dialogWrapper.setStyle({top:((this.dialogBoundingBox.y1-this.triggerContext.pos.y)/Units.PX_TO_EM)+"em"})}.bind(this);var G=function(){if(this.options.displayBeak){this.markup.beak.setStyle({top:this.markup.top.dim.height+"px"})}this.markup.dialogWrapper.setStyle({top:((this.dialogBoundingBox.y1-this.triggerContext.pos.y)/Units.PX_TO_EM)+"em"})}.bind(this);var a=function(){this.dialogBoundingBox=U;T();G()}.bind(this);var L=function(){this.dialogBoundingBox=A;T();V()}.bind(this);var b=function(){this.dialogBoundingBox=Z;B();G()}.bind(this);var M=function(){this.dialogBoundingBox=I;B();V()}.bind(this);var P=a;var X=false;if(this.options.preferredPosition=="bottomRight"){if(E){X=true}P=a}else{if(this.options.preferredPosition=="topRight"){if(D){X=true}P=L}else{if(this.options.preferredPosition=="bottomLeft"){if(O){X=true}P=b}else{if(this.options.preferredPosition=="topLeft"){if(c){X=true}P=M}}}}if(X){P()}else{if(E){a()}else{if(D){L()}else{if(O){b()}else{if(c){M()}else{P()}}}}}},open:function(B){log.debug("Microcontent.open()");if(B){B.preventDefault()}if(this.isOpen){this.close(B)}if(this.isOpen==false&&this.activated==false){this.triggerFocused=true;this.dialogFocused=false;this.activated=true;var A=$(Event.element(B));this.inspectTrigger(A);if(!this.markup||!this.markup.dialogWrapper){this.createMarkup()}setTimeout(function(){if(this.triggerFocused){this.getContent()}}.bind(this),this.options.triggerDelay)}else{this.focusCloseLink();log.error("already open or activated: isOpen:"+this.isOpen+", activated:"+this.activated)}},close:function(A){if(!this.isOpen){return}log.debug("Microcontent.close()");if(A){A.preventDefault()}if(this.manager){this.manager.destroy();this.manager=null}this.focusListeners.clear();this.focusListenersAttached=false;this.managedEventObservers.clear();this.closeEventObservers.clear();if(this.options.tearDown){this.options.tearDown()}this.depopulateDialog();this.removeFromDOM();this.triggerFocused=false;this.dialogFocused=false;this.activated=false;if(this.trigger.type!=="mouseover"){this.trigger.updateAndFocus()}this.isOpen=false;this.cleanUpDebug()},attachFocusListeners:function(){if(this.focusListenersAttached==false&&this.options.triggerEvent!="click"){this.focusListeners.add(this.markup.dialogWrapper,"mouseover",this.setDialogFocus.bindAsEventListener(this));this.focusListeners.add(this.markup.dialogWrapper,"mouseout",this.clearDialogFocus.bindAsEventListener(this));return true}else{return false}},checkFocus:function(){setTimeout(function(){if(this.dialogFocused==false&&this.triggerFocused==false){this.close()}}.bind(this),200)},clearTriggerFocus:function(){log.debug("trigger mouse out");this.triggerFocused=false;this.checkFocus()},setDialogFocus:function(){log.debug("dialog mouseover");this.dialogFocused=true;this.triggerFocused=false},clearDialogFocus:function(){log.debug("dialog mouseout");this.dialogFocused=false;this.checkFocus()},buildLayout:function(){if(!this.layoutBuilt){if(this.options.compact){this.markup.dialogWrapper.addClassName("dialogCompact")}this.markup.bottom.removeClassName("dialogBottom");this.markup.bottom.addClassName("dialogBottomCompact");this.markup.top.dim=this.markup.top.getDimensions();this.markup.bottom.dim=this.markup.bottom.getDimensions();this.markup.main.dim=this.markup.main.getDimensions();this.layoutBuilt=true}},removeFromDOM:function(){this.markup.beak=this.markup.beak?this.markup.beak.destroy():null;this._removeFromDOM();this.layoutBuilt=false},destroy:function(){this.content=null;this.options=null;this.closeEventObservers=this.closeEventObservers.clear();for(var A=0;A<this.managedEventObservers.observers.length;A++){this.managedEventObservers.observers[A][0].isAttached=null}this.managedEventObservers=this.managedEventObservers.clear();this.focusListeners=this.focusListeners.clear()},inspectPositioningData:function(A,E,D){var B="Microcontent.inspectPositioningData:<br/>viewport.height: "+A.height+"<br/>scroll.y: "+E.y+"<br/>this.markup.dialogWrapper.dim: "+this.markup.dialogWrapper.dim.width+","+this.markup.dialogWrapper.dim.height+"<br/>this.markup.dialogWrapper.pos: "+this.markup.dialogWrapper.pos.x+","+this.markup.dialogWrapper.pos.y+"<br/>this.trigger: "+this.trigger+"<br/>this.trigger.pos: "+this.trigger.pos.x+","+this.trigger.pos.y+"<br/>this.trigger.dim: "+this.trigger.dim.width+","+this.trigger.dim.height+"<br/>"+log.info(B)},debugPosition:function(B){log.debug("bottomRightGood: "+B.bottomRightGood+", bottomLeftGood: "+B.bottomLeftGood+", topRightGood: "+B.topRightGood+", topLeftGood: "+B.topLeftGood);var H="border:3px solid green;";var E="border:3px dashed red;";var D=B.topRightGood?H:E;var A=B.topLeftGood?H:E;var F=B.bottomRightGood?H:E;var G=B.bottomLeftGood?H:E;if(this.options.debug.enabled){this.options.debug.topRightDebugBox=new Element("div",{style:D+"z-index:40; top:"+B.topRightBoundingBox.y1+"px; left:"+B.topRightBoundingBox.x1+"px; width:"+(B.dialogWrapperDimensions.width-6)+"px; height:"+(B.dialogWrapperDimensions.height-6)+"px; position:absolute;"});this.options.debug.topLeftDebugBox=new Element("div",{style:A+"z-index:40; top:"+B.topLeftBoundingBox.y1+"px; left:"+B.topLeftBoundingBox.x1+"px; width:"+(B.dialogWrapperDimensions.width-6)+"px; height:"+(B.dialogWrapperDimensions.height-6)+"px; position:absolute;"});this.options.debug.bottomRightDebugBox=new Element("div",{style:F+"z-index:40; top:"+B.bottomRightBoundingBox.y1+"px; left:"+B.bottomRightBoundingBox.x1+"px; width:"+(B.dialogWrapperDimensions.width-6)+"px; height:"+(B.dialogWrapperDimensions.height-6)+"px; position:absolute;"});this.options.debug.bottomLeftDebugBox=new Element("div",{style:G+"z-index:40; top:"+B.bottomLeftBoundingBox.y1+"px; left:"+B.bottomLeftBoundingBox.x1+"px; width:"+(B.dialogWrapperDimensions.width-6)+"px; height:"+(B.dialogWrapperDimensions.height-6)+"px; position:absolute;"});$("bodyWrapper").appendChild(this.options.debug.topRightDebugBox);$("bodyWrapper").appendChild(this.options.debug.topLeftDebugBox);$("bodyWrapper").appendChild(this.options.debug.bottomRightDebugBox);$("bodyWrapper").appendChild(this.options.debug.bottomLeftDebugBox)}},cleanUpDebug:function(){if(this.options.debug.enabled){this.options.debug.topRightDebugBox.remove();this.options.debug.topLeftDebugBox.remove();this.options.debug.bottomRightDebugBox.remove();this.options.debug.bottomLeftDebugBox.remove()}}});var Lightbox=Class.create(Dialog.Base,{initialize:function(A,D,E){var B={triggerEvent:"click",interstitial:"",id:"",compact:false,openOnInit:false};Object.extend(B,E||{});this.setProperties("Lightbox",D,B);this.isFixedAtTop=null;this.isFixedAtBottom=null;this.positionFixedUnsupportedVal=null;this.attachTriggers(A);if(this.options.openOnInit){this.open()}},createMask:function(){var A=Position.calculatePageHeight();this.markup.mask=Element.extend(document.createElement("div"));this.markup.mask.className="dialogMask";this.markup.mask.style.height=A.height+A.units},createMarkup:function(){this.createDialogDivs();this.createMask()},showDialog:function(A){log.debug("Lightbox.showDialog()");if(!this.sessionHasExpired){this.displayContent(A);this.activated=false}},positionFixedUnsupported:function(){if(this.positionFixedUnsupportedVal==null){this.positionFixedUnsupportedVal=this.markup.dialogWrapper.getStyle("position")=="absolute"}return this.positionFixedUnsupportedVal},positionInViewport:function(){var A=Position.calculateViewport();var B=Position.calculateScroll();this.markup.dialogWrapper.dim=this.markup.dialogWrapper.getDimensions();if(this.positionFixedUnsupported()){this.markup.dialogWrapper.setStyle({top:B.y+"px"})}else{this.markup.dialogWrapper.setStyle({top:"0px"})}if(this.markup.dialogWrapper.dim.width<A.width){this.markup.dialogWrapper.setStyle({left:(A.width-this.markup.dialogWrapper.dim.width)/2+"px"})}this.isFixedAtTop=true;this.isFixedAtBottom=false;this.inspectScrollData(A,B,Position.calculatePageHeight())},open:function(B){if(this.isOpen==false&&this.activated==false){this.activated=true;if(B){var A=$(Event.element(B));this.inspectTrigger(A);this.options.setUp(B)}else{if(this.triggers&&this.triggers instanceof ManagedEventObservers){var A=this.triggers.getFirstTriggerElement();this.inspectTrigger(A)}this.options.setUp()}this.createMarkup();this.showMask();this.displayLightbox();setTimeout(this.getContent.bind(this),250)}else{this.focusCloseLink();log.error("isOpen: "+this.isOpen+", activated: "+this.activated+" either the lightbox is already open or activated, see Lightbox.open")}B.preventDefault()},close:function(A){A.preventDefault();if(this.request){log.debug("aborting request");this.request.abort();this.request=null}this.trigger.focus();if(this.markup.dialogWrapper){this.markup.dialogWrapper.style.visibility="hidden"}if(this.manager){this.manager.destroy();this.manager=null}this.managedEventObservers.clear();this.closeEventObservers.clear();this.depopulateDialog();this.hideMask();this.markup.mask=this.markup.mask?this.markup.mask.destroy():null;this.removeFromDOM();if(this.options.tearDown){this.options.tearDown()}window.virtualBufferManager.update();this.activated=false;this.isOpen=false;this.lastScroll=null;this.bottomOfDialog=null;this.dialogViewportDiff=null;this.isFixedAtBottom=false;this.isFixedAtTop=false;this.dialogSelects.clear();this.response=null},showMask:function(){if(this.markup.mask){this.allSelects=$A(document.getElementsByTagName("select")).each(function(A){A.style.visibility="hidden";return Element.extend(A)});this.triggerContext.activeDialogsContainer.appendChild(this.markup.mask);this.options.closeElements.push(this.markup.mask);this.markup.mask.style.display="block";this.closeEventObservers.add(this.markup.mask,"click",this.close.bindAsEventListener(this))}else{log.error("this.markup.mask doesn't exist")}},hideMask:function(){if(this.markup.mask){this.markup.mask.style.display="none"}if(this.allSelects){this.allSelects.each(function(A){A.style.visibility="inherit"});this.allSelects.clear()}},resizeMask:function(){var A=Position.calculatePageHeight();this.markup.mask.dim=this.markup.mask.getDimensions();if(A.height>this.markup.mask.dim.height){this.markup.mask.setStyle({height:A.height+"px"})}},buildLayout:function(){if(!this.layoutBuilt){if(this.options.compact){this.markup.bottom.removeClassName("dialogBottom");this.markup.bottom.addClassName("dialogBottomCompact")}else{this.markup.bottomCloseLink.removeClassName("offscreen")}this.appendToDOM();this.markup.dialogWrapper.addClassName("fixed");this.layoutBuilt=true}},resize:function(){log.debug("Lightbox.resize");this.resizeMask();this.isFixedAtBottom=false},attachResizeListeners:function(B,E){var D;if(arguments.length>1&&$(E).getElementsByClassName){D=$(E).getElementsByClassName("resizeListener")}else{D=this.markup.dialogWrapper.getElementsByClassName("resizeListener")}for(var A=0;D[A];A++){this.managedEventObservers.add(D[A],"click",B)}},displayLightbox:function(){if(this.content.url){this.markup.mainInfo.innerHTML=this.options.interstitial}this.buildLayout();this.onWindowScroll();this.managedEventObservers.add(window,"scroll",this.onWindowScroll.bindAsEventListener(this));this.managedEventObservers.add(window,"resize",this.onWindowResize.bindAsEventListener(this));this.attachCloseListeners(this.close.bindAsEventListener(this));this.attachFocusWrapListeners();this.positionInViewport();this.markup.dialogWrapper.style.visibility="visible";setTimeout(this.resize.bind(this),250);this.markup.dialogAnchor.updateAndFocus();$(this.trigger).fire("dialog:dialogOpen",{dialog:this});this.manager=new DialogManager(this.markup.dialogWrapper);this.isOpen=true;log.debug("end Lightbox.displayLightbox")},displayContent:function(A){this.response=A;this.populateDialog();this.dialogSelects=$A(this.markup.dialogWrapper.getElementsByTagName("select")).each(function(B){B.style.visibility="inherit";return Element.extend(B)});this.attachCloseListeners(this.close.bindAsEventListener(this));this.attachResizeListeners(this.onLightboxResize.bindAsEventListener(this));setTimeout(this.resize.bind(this),250);this.focusCloseLink()},replaceContent:function(A,D){if(this.isOpen==true&&this.activated==false){this.activated=true;this.response=null;this.managedEventObservers.clear();this.markup.mainInfo.innerHTML=this.options.interstitial;this.resize();var E=Position.calculatePageHeight();this.markup.mask.dim=this.markup.mask.getDimensions();if(E.height>this.markup.mask.dim.height){this.markup.mask.setStyle({height:E.height+"px"})}if(arguments.length>1){var B=$H(D).toQueryString()}if(A.indexOf("?")!=-1){this.content={url:A+"&"+B}}else{this.content={url:A+"?"+B}}this.focusCloseLink();this.getContent()}else{if(this.isOpen==false){log.error("called replaceContent on a Lightbox that was not open")}}},onWindowResize:function(){this.positionInViewport();var A=Position.calculateViewport()},onLightboxResize:function(){setTimeout(this.resize.bind(this),0)},onWindowScroll:function(){var A=Position.calculateViewport();var D=Position.calculateScroll();var B=Position.calculatePageHeight();this.markup.dialogWrapper.dim=this.markup.dialogWrapper.getDimensions();this.markup.dialogWrapper.pos=this.markup.dialogWrapper.getPosition();if(this.markup.dialogWrapper.dim.height<A.height){this.bottomOfDialog=null;this.dialogViewportDiff=null;this.markup.dialogWrapper.addClassName("fixed");this.isFixedAtTop=true;this.isFixedAtBottom=false;if(this.positionFixedUnsupported()){this.markup.dialogWrapper.setStyle({top:D.y+"px"})}else{this.markup.dialogWrapper.setStyle({top:"0px"})}}else{if(this.markup.dialogWrapper.dim.height>A.height){this.bottomOfDialog=this.markup.dialogWrapper.pos.y+this.markup.dialogWrapper.dim.height;this.dialogViewportDiff=this.markup.dialogWrapper.dim.height-A.height;if(this.markup.dialogWrapper.pos.y<D.y&&this.bottomOfDialog>(D.y+A.height)){this.isFixedAtTop=false;this.isFixedAtBottom=false;if(this.markup.dialogWrapper.hasClassName("fixed")){this.markup.dialogWrapper.setStyle({top:this.markup.dialogWrapper.pos.y+"px"});this.markup.dialogWrapper.removeClassName("fixed")}}if(this.lastScroll!=null){if(D.y>this.lastScroll.y){if(this.isFixedAtTop){this.markup.dialogWrapper.removeClassName("fixed");this.markup.dialogWrapper.setStyle({top:this.lastScroll.y+"px"});this.isFixedAtTop=false;this.bottomOfDialog=this.lastScroll.y+this.markup.dialogWrapper.dim.height}if((D.y+A.height)>this.bottomOfDialog){if(!this.isFixedAtBottom){this.markup.dialogWrapper.addClassName("fixed");this.isFixedAtBottom=true}if(this.positionFixedUnsupported()){this.markup.dialogWrapper.setStyle({top:(D.y-this.dialogViewportDiff)+"px"})}else{this.markup.dialogWrapper.setStyle({top:-(this.dialogViewportDiff)+"px"})}}}else{if(D.y<this.lastScroll.y){if(this.positionFixedUnsupported()&&D.y<=this.markup.dialogWrapper.pos.y){this.markup.dialogWrapper.setStyle({top:D.y+"px"})}else{if(this.isFixedAtBottom){this.markup.dialogWrapper.removeClassName("fixed");this.markup.dialogWrapper.setStyle({top:this.lastScroll.y-this.dialogViewportDiff+"px"});this.isFixedAtBottom=false}if(D.y<=this.markup.dialogWrapper.pos.y&&!this.isFixedAtTop){this.markup.dialogWrapper.addClassName("fixed");this.markup.dialogWrapper.setStyle({top:0});this.isFixedAtTop=true}}}}}}}this.lastScroll=D},inspectScrollData:function(A,E,D){var B="Lightbox.inspectScrollData:<br/>viewport.height: "+A.height+"<br/>scroll.y: "+E.y+"<br/>page.height: "+D.height+"<br/>this.markup.dialogWrapper.dim.height: "+this.markup.dialogWrapper.dim.height+"<br/>this.markup.dialogWrapper.pos.y: "+this.markup.dialogWrapper.pos.y+"<br/>this.markup.dialogWrapper.style.top: "+this.markup.dialogWrapper.style.top+"<br/>this.bottomOfDialog: "+this.bottomOfDialog+"<br/>this.dialogViewportDiff: "+this.dialogViewportDiff+"<br/>this.markup.dialogWrapper.className: "+this.markup.dialogWrapper.className+"<br/>this.isFixedAtTop: "+this.isFixedAtTop+"<br/>this.isFixedAtBottom: "+this.isFixedAtBottom+"<br/>this.positionFixedUnsupported: "+this.positionFixedUnsupported();if(this.lastScroll!=null){B="this.lastScroll.y: "+this.lastScroll.y+"<br/>"+B}log.info(B)},removeFromDOM:function(){this._removeFromDOM();this.layoutBuilt=false},destroy:function(){this.markup.mask.dim=null;this.markup.mask=this.markup.mask.destroy();this.removeFromDOM();this.closeEventObservers.clear();this.activated=null;this.isFixedAtBottom=null;this.isFixedAtTop=null;this.isOpen=null;this.lastScroll=null;this.managedEventObservers=null;this.options.closeLabel=null;this.options.heading=null;this.options.id=null;this.options.interstitial=null;this.options.sessionTimeoutUrl=null;this.options.triggerEvent=null;this.options.setUp=function(){};this.options.tearDown=function(){};this.positionFixedUnsupportedVal=null;this.layoutBuilt=null;this.content=null;this.triggers.clear()}});var ContainedLightbox=Class.create(Lightbox,{initialize:function($super,A,B,D){$super(A,B,D)},createMask:function(){var A=this.triggerContext.element.getHeight();this.markup.mask=Element.extend(document.createElement("div"));this.markup.mask.className="dialogMask";this.markup.mask.style.height=A+"px"},showMask:function(){if(this.markup.mask){this.allSelects=$A(this.triggerContext.element.getElementsByTagName("select")).each(function(D){D.style.visibility="hidden";return Element.extend(D)});this.triggerContext.activeDialogsContainer.appendChild(this.markup.mask);this.options.closeElements.push(this.markup.mask);this.markup.mask.style.display="block";for(var B=0,A=this.options.closeEvents.length;B<A;B++){this.closeEventObservers.add(document,this.options.closeEvents[B],this.close.bindAsEventListener(this))}this.closeEventObservers.add(this.markup.mask,"click",this.close.bindAsEventListener(this))}else{log.error("this.markup.mask doesn't exist")}},inspectTrigger:function(A){this.getTrigger(A);this.triggerContext={};this.triggerContext.element=this.trigger.up(this.options.container);this.triggerContext.activeDialogsContainer=new DialogPositioningContext(this.triggerContext.element).activeDialogContainer},positionInViewport:function(){var B=(this.markup.mask.getHeight()-this.markup.dialogWrapper.getHeight())/2;var A=(this.markup.mask.getWidth()-this.markup.dialogWrapper.getWidth())/2;this.markup.dialogWrapper.setStyle({top:B+"px",left:A+"px"})},resize:function(){this.positionInViewport()},appendToDOM:function($super){$super();var A=(this.triggerContext.element.getStyle("zIndex")||0);this.triggerContext.activeDialogsContainer.setStyle({zIndex:A+1});this.markup.mask.setStyle({zIndex:A+2});this.markup.dialogWrapper.setStyle({zIndex:A+3})},onWindowResize:function(){},onLightboxResize:function(){},onWindowScroll:function(){}});var ChangeSearchLightbox=Class.create(Lightbox,{initialize:function($super,A,B,E){$super(A,B,E);var D=this.content.url;if(D.indexOf("book")!=-1){this.content.url="/book/bookingpath"}else{this.content.url="/shop/searchForm"}D=D.substr(D.indexOf("?")+1);D=D.replace(/&amp(;|%3B)/g,"&");D=D.replace(/\+/g,"%20");D="changeSearch=true&"+D;this.options.ajaxParameters=D}});var DialogPositioningContext=Class.create({initialize:function(A){this.element=A;this.element.addClassName("dialogPositioningContext");this.activeDialogContainer=new Element("div",{"class":"activeDialogs"});this.element.appendChild(this.activeDialogContainer)}});String.prototype.parseColor=function(){var A="#";if(this.slice(0,4)=="rgb("){var D=this.slice(4,this.length-1).split(",");var B=0;do{A+=parseInt(D[B]).toColorPart()}while(++B<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var B=1;B<4;B++){A+=(this.charAt(B)+this.charAt(B)).toLowerCase()}}if(this.length==7){A=this.toLowerCase()}}}return(A.length==7?A:(arguments[0]||this))};Element.collectTextNodes=function(A){return $A($(A).childNodes).collect(function(B){return(B.nodeType==3?B.nodeValue:(B.hasChildNodes()?Element.collectTextNodes(B):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(B,A){return $A($(B).childNodes).collect(function(D){return(D.nodeType==3?D.nodeValue:((D.hasChildNodes()&&!Element.hasClassName(D,A))?Element.collectTextNodesIgnoreClass(D,A):""))}).flatten().join("")};Element.setContentZoom=function(B,A){B=$(B);B.setStyle({fontSize:(A/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return B};Element.getInlineOpacity=function(A){return $(A).style.opacity||""};Element.forceRerendering=function(A){try{A=$(A);var D=document.createTextNode(" ");A.appendChild(D);A.removeChild(D)}catch(B){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(A){return(-Math.cos(A*Math.PI)/2)+0.5},reverse:function(A){return 1-A},flicker:function(A){var A=((-Math.cos(A*Math.PI)/4)+0.75)+Math.random()/4;return A>1?1:A},wobble:function(A){return(-Math.cos(A*Math.PI*(9*A))/2)+0.5},pulse:function(B,A){return(-Math.cos((B*((A||5)-0.5)*2)*Math.PI)/2)+0.5},spring:function(A){return 1-(Math.cos(A*4.5*Math.PI)*Math.exp(-A*6))},none:function(A){return 0},full:function(A){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(A){var B="position:relative";if(Prototype.Browser.IE){B+=";zoom:1"}A=$(A);$A(A.childNodes).each(function(D){if(D.nodeType==3){D.nodeValue.toArray().each(function(E){A.insertBefore(new Element("span",{style:B}).update(E==" "?String.fromCharCode(160):E),D)});Element.remove(D)}})},multiple:function(D,B){var A;if(((typeof D=="object")||Object.isFunction(D))&&(D.length)){A=D}else{A=$(D).childNodes}var E=Object.extend({speed:0.1,delay:0},arguments[2]||{});var F=E.delay;$A(A).each(function(H,G){new B(H,Object.extend(E,{delay:G*E.speed+F}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(B,A){B=$(B);A=(A||"appear").toLowerCase();var D=Object.extend({queue:{position:"end",scope:(B.id||"global"),limit:1}},arguments[2]||{});Effect[B.visible()?Effect.PAIRS[A][1]:Effect.PAIRS[A][0]](B,D)}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(A){this.effects._each(A)},add:function(B){var D=new Date().getTime();var A=Object.isString(B.options.queue)?B.options.queue:B.options.queue.position;switch(A){case"front":this.effects.findAll(function(E){return E.state=="idle"}).each(function(E){E.startOn+=B.finishOn;E.finishOn+=B.finishOn});break;case"with-last":D=this.effects.pluck("startOn").max()||D;break;case"end":D=this.effects.pluck("finishOn").max()||D;break}B.startOn+=D;B.finishOn+=D;if(!B.options.queue.limit||(this.effects.length<B.options.queue.limit)){this.effects.push(B)}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)}},remove:function(A){this.effects=this.effects.reject(function(B){return B==A});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var D=new Date().getTime();for(var B=0,A=this.effects.length;B<A;B++){this.effects[B]&&this.effects[B].loop(D)}}});Effect.Queues={instances:$H(),get:function(A){if(!Object.isString(A)){return A}return this.instances.get(A)||this.instances.set(A,new Effect.ScopedQueue())}};Effect.Queue=Effect.Queues.get("global");Effect.Base=Class.create({position:null,start:function(A){function B(E,D){return((E[D+"Internal"]?"this.options."+D+"Internal(this);":"")+(E[D]?"this.options."+D+"(this);":""))}if(A&&A.transition===false){A.transition=Effect.Transitions.linear}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),A||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;this.render=(function(){function D(F,E){if(F.options[E+"Internal"]){F.options[E+"Internal"](F)}if(F.options[E]){F.options[E](F)}}return function(E){if(this.state==="idle"){this.state="running";D(this,"beforeSetup");if(this.setup){this.setup()}D(this,"afterSetup")}if(this.state==="running"){E=(this.options.transition(E)*this.fromToDelta)+this.options.from;this.position=E;D(this,"beforeUpdate");if(this.update){this.update(E)}D(this,"afterUpdate")}}})();this.event("beforeStart");if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this)}},loop:function(A){if(A>=this.startOn){if(A>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return}var D=(A-this.startOn)/this.totalTime,B=(D*this.totalFrames).round();if(B>this.currentFrame){this.render(D);this.currentFrame=B}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(A){if(this.options[A+"Internal"]){this.options[A+"Internal"](this)}if(this.options[A]){this.options[A](this)}},inspect:function(){var A=$H();for(property in this){if(!Object.isFunction(this[property])){A.set(property,this[property])}}return"#<Effect:"+A.inspect()+",options:"+$H(this.options).inspect()+">"}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(A){this.effects=A||[];this.start(arguments[1])},update:function(A){this.effects.invoke("render",A)},finish:function(A){this.effects.each(function(B){B.render(1);B.cancel();B.event("beforeFinish");if(B.finish){B.finish(A)}B.event("afterFinish")})}});Effect.Tween=Class.create(Effect.Base,{initialize:function(D,G,F){D=Object.isString(D)?$(D):D;var A=$A(arguments),E=A.last(),B=A.length==5?A[3]:null;this.method=Object.isFunction(E)?E.bind(D):Object.isFunction(D[E])?D[E].bind(D):function(H){D[E]=H};this.start(Object.extend({from:G,to:F},B||{}))},update:function(A){this.method(A)}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(A){this.element=$(A);if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var B=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(B)},update:function(A){this.element.setOpacity(A)}});Effect.Move=Class.create(Effect.Base,{initialize:function(A){this.element=$(A);if(!this.element){throw (Effect._elementDoesNotExistError)}var B=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(B)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(A){this.element.setStyle({left:(this.options.x*A+this.originalLeft).round()+"px",top:(this.options.y*A+this.originalTop).round()+"px"})}});Effect.MoveBy=function(B,D,A){return new Effect.Move(B,Object.extend({x:A,y:D},arguments[3]||{}))};Effect.Scale=Class.create(Effect.Base,{initialize:function(B,A){this.element=$(B);if(!this.element){throw (Effect._elementDoesNotExistError)}var D=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:A},arguments[2]||{});this.start(D)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(B){this.originalStyle[B]=this.element.style[B]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var A=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(B){if(A.indexOf(B)>0){this.fontSize=parseFloat(A);this.fontSizeType=B}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(A){var B=(this.options.scaleFrom/100)+(this.factor*A);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*B+this.fontSizeType})}this.setDimensions(this.dims[0]*B,this.dims[1]*B)},finish:function(A){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(E,D){var F={};if(this.options.scaleX){F.width=D.round()+"px"}if(this.options.scaleY){F.height=E.round()+"px"}if(this.options.scaleFromCenter){var B=(E-this.dims[0])/2;var A=(D-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){F.top=this.originalTop-B+"px"}if(this.options.scaleX){F.left=this.originalLeft-A+"px"}}else{if(this.options.scaleY){F.top=-B+"px"}if(this.options.scaleX){F.left=-A+"px"}}}this.element.setStyle(F)}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(A){this.element=$(A);if(!this.element){throw (Effect._elementDoesNotExistError)}var B=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(B)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(A){return parseInt(this.options.startcolor.slice(A*2+1,A*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(A){return parseInt(this.options.endcolor.slice(A*2+1,A*2+3),16)-this._base[A]}.bind(this))},update:function(A){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(B,D,E){return B+((this._base[E]+(this._delta[E]*A)).round().toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(A){var B=arguments[1]||{},E=document.viewport.getScrollOffsets(),D=$(A).cumulativeOffset();if(B.offset){D[1]+=B.offset}return new Effect.Tween(null,E.top,D[1],B,function(F){scrollTo(E.left,F.round())})};Effect.Fade=function(B){B=$(B);var A=B.getInlineOpacity();var D=Object.extend({from:B.getOpacity()||1,to:0,afterFinishInternal:function(E){if(E.options.to!=0){return}E.element.hide().setStyle({opacity:A})}},arguments[1]||{});return new Effect.Opacity(B,D)};Effect.Appear=function(A){A=$(A);var B=Object.extend({from:(A.getStyle("display")=="none"?0:A.getOpacity()||0),to:1,afterFinishInternal:function(D){D.element.forceRerendering()},beforeSetup:function(D){D.element.setOpacity(D.options.from).show()}},arguments[1]||{});return new Effect.Opacity(A,B)};Effect.Puff=function(B){B=$(B);var A={opacity:B.getInlineOpacity(),position:B.getStyle("position"),top:B.style.top,left:B.style.left,width:B.style.width,height:B.style.height};return new Effect.Parallel([new Effect.Scale(B,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(B,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(D){Position.absolutize(D.effects[0].element)},afterFinishInternal:function(D){D.effects[0].element.hide().setStyle(A)}},arguments[1]||{}))};Effect.BlindUp=function(A){A=$(A);A.makeClipping();return new Effect.Scale(A,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(B){B.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(B){B=$(B);var A=B.getDimensions();return new Effect.Scale(B,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:A.height,originalWidth:A.width},restoreAfterFinish:true,afterSetup:function(D){D.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(D){D.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(B){B=$(B);var A=B.getInlineOpacity();return new Effect.Appear(B,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(D){new Effect.Scale(D.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(E){E.element.makePositioned().makeClipping()},afterFinishInternal:function(E){E.element.hide().undoClipping().undoPositioned().setStyle({opacity:A})}})}},arguments[1]||{}))};Effect.DropOut=function(B){B=$(B);var A={top:B.getStyle("top"),left:B.getStyle("left"),opacity:B.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(B,{x:0,y:100,sync:true}),new Effect.Opacity(B,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(D){D.effects[0].element.makePositioned()},afterFinishInternal:function(D){D.effects[0].element.hide().undoPositioned().setStyle(A)}},arguments[1]||{}))};Effect.Shake=function(B){B=$(B);var E=Object.extend({distance:20,duration:0.5},arguments[1]||{});var F=parseFloat(E.distance);var D=parseFloat(E.duration)/10;var A={top:B.getStyle("top"),left:B.getStyle("left")};return new Effect.Move(B,{x:F,y:0,duration:D,afterFinishInternal:function(G){new Effect.Move(G.element,{x:-F*2,y:0,duration:D*2,afterFinishInternal:function(H){new Effect.Move(H.element,{x:F*2,y:0,duration:D*2,afterFinishInternal:function(I){new Effect.Move(I.element,{x:-F*2,y:0,duration:D*2,afterFinishInternal:function(J){new Effect.Move(J.element,{x:F*2,y:0,duration:D*2,afterFinishInternal:function(K){new Effect.Move(K.element,{x:-F,y:0,duration:D,afterFinishInternal:function(L){L.element.undoPositioned().setStyle(A)}})}})}})}})}})}})};Effect.SlideDown=function(B){B=$(B).cleanWhitespace();var D=B.down().getStyle("bottom");var A=B.getDimensions();return new Effect.Scale(B,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:A.height,originalWidth:A.width},restoreAfterFinish:true,afterSetup:function(E){E.element.makePositioned();E.element.down().makePositioned();if(window.opera){E.element.setStyle({top:""})}E.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(E){E.element.down().setStyle({bottom:(E.dims[0]-E.element.clientHeight)+"px"})},afterFinishInternal:function(E){E.element.undoClipping().undoPositioned();E.element.down().undoPositioned().setStyle({bottom:D})}},arguments[1]||{}))};Effect.SlideUp=function(B){B=$(B).cleanWhitespace();var D=B.down().getStyle("bottom");var A=B.getDimensions();return new Effect.Scale(B,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:A.height,originalWidth:A.width},restoreAfterFinish:true,afterSetup:function(E){E.element.makePositioned();E.element.down().makePositioned();if(window.opera){E.element.setStyle({top:""})}E.element.makeClipping().show()},afterUpdateInternal:function(E){E.element.down().setStyle({bottom:(E.dims[0]-E.element.clientHeight)+"px"})},afterFinishInternal:function(E){E.element.hide().undoClipping().undoPositioned();E.element.down().undoPositioned().setStyle({bottom:D})}},arguments[1]||{}))};Effect.Squish=function(A){return new Effect.Scale(A,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(B){B.element.makeClipping()},afterFinishInternal:function(B){B.element.hide().undoClipping()}})};Effect.Grow=function(B){B=$(B);var D=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var A={top:B.style.top,left:B.style.left,height:B.style.height,width:B.style.width,opacity:B.getInlineOpacity()};var I=B.getDimensions();var G,H;var F,E;switch(D.direction){case"top-left":G=H=F=E=0;break;case"top-right":G=I.width;H=E=0;F=-I.width;break;case"bottom-left":G=F=0;H=I.height;E=-I.height;break;case"bottom-right":G=I.width;H=I.height;F=-I.width;E=-I.height;break;case"center":G=I.width/2;H=I.height/2;F=-I.width/2;E=-I.height/2;break}return new Effect.Move(B,{x:G,y:H,duration:0.01,beforeSetup:function(J){J.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(J){new Effect.Parallel([new Effect.Opacity(J.element,{sync:true,to:1,from:0,transition:D.opacityTransition}),new Effect.Move(J.element,{x:F,y:E,sync:true,transition:D.moveTransition}),new Effect.Scale(J.element,100,{scaleMode:{originalHeight:I.height,originalWidth:I.width},sync:true,scaleFrom:window.opera?1:0,transition:D.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(K){K.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(K){K.effects[0].element.undoClipping().undoPositioned().setStyle(A)}},D))}})};Effect.Shrink=function(B){B=$(B);var D=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var A={top:B.style.top,left:B.style.left,height:B.style.height,width:B.style.width,opacity:B.getInlineOpacity()};var G=B.getDimensions();var F,E;switch(D.direction){case"top-left":F=E=0;break;case"top-right":F=G.width;E=0;break;case"bottom-left":F=0;E=G.height;break;case"bottom-right":F=G.width;E=G.height;break;case"center":F=G.width/2;E=G.height/2;break}return new Effect.Parallel([new Effect.Opacity(B,{sync:true,to:0,from:1,transition:D.opacityTransition}),new Effect.Scale(B,window.opera?1:0,{sync:true,transition:D.scaleTransition,restoreAfterFinish:true}),new Effect.Move(B,{x:F,y:E,sync:true,transition:D.moveTransition})],Object.extend({beforeStartInternal:function(H){H.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(H){H.effects[0].element.hide().undoClipping().undoPositioned().setStyle(A)}},D))};Effect.Pulsate=function(D){D=$(D);var E=arguments[1]||{},B=D.getInlineOpacity(),F=E.transition||Effect.Transitions.linear,A=function(G){return 1-F((-Math.cos((G*(E.pulses||5)*2)*Math.PI)/2)+0.5)};return new Effect.Opacity(D,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(G){G.element.setStyle({opacity:B})}},E),{transition:A}))};Effect.Fold=function(B){B=$(B);var A={top:B.style.top,left:B.style.left,width:B.style.width,height:B.style.height};B.makeClipping();return new Effect.Scale(B,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(D){new Effect.Scale(B,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(E){E.element.hide().undoClipping().setStyle(A)}})}},arguments[1]||{}))};Effect.Morph=Class.create(Effect.Base,{initialize:function(A){this.element=$(A);if(!this.element){throw (Effect._elementDoesNotExistError)}var D=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(D.style)){this.style=$H(D.style)}else{if(D.style.include(":")){this.style=D.style.parseStyle()}else{this.element.addClassName(D.style);this.style=$H(this.element.getStyles());this.element.removeClassName(D.style);var B=this.element.getStyles();this.style=this.style.reject(function(E){return E.value==B[E.key]});D.afterFinishInternal=function(E){E.element.addClassName(E.options.style);E.transforms.each(function(F){E.element.style[F.style]=""})}}}this.start(D)},setup:function(){function A(B){if(!B||["rgba(0, 0, 0, 0)","transparent"].include(B)){B="#ffffff"}B=B.parseColor();return $R(0,2).map(function(D){return parseInt(B.slice(D*2+1,D*2+3),16)})}this.transforms=this.style.map(function(H){var B=H[0],G=H[1],F=null;if(G.parseColor("#zzzzzz")!="#zzzzzz"){G=G.parseColor();F="color"}else{if(B=="opacity"){G=parseFloat(G);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(G)){var E=G.match(/^([\+\-]?[0-9\.]+)(.*)$/);G=parseFloat(E[1]);F=(E.length==3)?E[2]:null}}}var D=this.element.getStyle(B);return{style:B.camelize(),originalValue:F=="color"?A(D):parseFloat(D||0),targetValue:F=="color"?A(G):G,unit:F}}.bind(this)).reject(function(B){return((B.originalValue==B.targetValue)||(B.unit!="color"&&(isNaN(B.originalValue)||isNaN(B.targetValue))))})},update:function(A){var E={},B,D=this.transforms.length;while(D--){E[(B=this.transforms[D]).style]=B.unit=="color"?"#"+(Math.round(B.originalValue[0]+(B.targetValue[0]-B.originalValue[0])*A)).toColorPart()+(Math.round(B.originalValue[1]+(B.targetValue[1]-B.originalValue[1])*A)).toColorPart()+(Math.round(B.originalValue[2]+(B.targetValue[2]-B.originalValue[2])*A)).toColorPart():(B.originalValue+(B.targetValue-B.originalValue)*A).toFixed(3)+(B.unit===null?"":B.unit)}this.element.setStyle(E,true)}});Effect.Transform=Class.create({initialize:function(A){this.tracks=[];this.options=arguments[1]||{};this.addTracks(A)},addTracks:function(A){A.each(function(B){B=$H(B);var D=B.values().first();this.tracks.push($H({ids:B.keys().first(),effect:Effect.Morph,options:{style:D}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(B){var F=B.get("ids"),D=B.get("effect"),E=B.get("options");var A=[$(F)||$$(F)].flatten();return A.map(function(G){return new D(G,Object.extend({sync:true},E))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");String.prototype.parseStyle=function(){var B,A=$H();if(Prototype.Browser.WebKit){B=new Element("div",{style:this}).style}else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';B=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(D){if(B[D]){A.set(D,B[D])}});if(Prototype.Browser.IE&&this.include("opacity")){A.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])}return A};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(A){var B=document.defaultView.getComputedStyle($(A),null);return Element.CSS_PROPERTIES.inject({},function(E,D){E[D]=B[D];return E})}}else{Element.getStyles=function(B){B=$(B);var D=B.currentStyle,A;A=Element.CSS_PROPERTIES.inject({},function(F,E){F[E]=D[E];return F});if(!A.opacity){A.opacity=B.getOpacity()}return A}}Effect.Methods={morph:function(A,B){A=$(A);new Effect.Morph(A,Object.extend({style:B},arguments[2]||{}));return A},visualEffect:function(D,B,E){D=$(D);var F=B.dasherize().camelize(),A=F.charAt(0).toUpperCase()+F.substring(1);new Effect[A](D,E);return D},highlight:function(A,B){A=$(A);new Effect.Highlight(A,B);return A}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(A){Effect.Methods[A]=function(B,D){B=$(B);Effect[A.charAt(0).toUpperCase()+A.substring(1)](B,D);return B}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(A){Effect.Methods[A]=Element[A]});Element.addMethods(Effect.Methods);if(typeof Effect=="undefined"){throw ("controls.js requires including script.aculo.us' effects.js library")}var Autocompleter={};Autocompleter.Base=Class.create({baseInitialize:function(A,D,B){A=$(A);this.element=A;this.update=$(D);this.hasFocus=false;this.changed=false;this.active=false;this.index=0;this.entryCount=0;this.oldElementValue=this.element.value;if(this.setOptions){this.setOptions(B)}else{this.options=B||{}}this.options.paramName=this.options.paramName||this.element.name;this.options.tokens=this.options.tokens||[];this.options.frequency=this.options.frequency||0.4;this.options.minChars=this.options.minChars||1;this.options.onShow=this.options.onShow||function(E,F){if(!F.style.position||F.style.position=="absolute"){F.style.position="absolute";Position.clone(E,F,{setHeight:false,offsetTop:E.offsetHeight})}Effect.Appear(F,{duration:0.15})};this.options.onHide=this.options.onHide||function(E,F){new Effect.Fade(F,{duration:0.15})};if(typeof(this.options.tokens)=="string"){this.options.tokens=new Array(this.options.tokens)}if(!this.options.tokens.include("\n")){this.options.tokens.push("\n")}this.observer=null;this.element.setAttribute("autocomplete","off");Element.hide(this.update);Event.observe(this.element,"blur",this.onBlur.bindAsEventListener(this));Event.observe(this.element,"keydown",this.onKeyPress.bindAsEventListener(this))},show:function(){if(Element.getStyle(this.update,"display")=="none"){this.options.onShow(this.element,this.update)}if(!this.iefix&&(Prototype.Browser.IE)&&(Element.getStyle(this.update,"position")=="absolute")){new Insertion.After(this.update,'<iframe id="'+this.update.id+'_iefix" style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" src="javascript:false;" frameborder="0" scrolling="no"></iframe>');this.iefix=$(this.update.id+"_iefix")}if(this.iefix){setTimeout(this.fixIEOverlapping.bind(this),50)}},fixIEOverlapping:function(){Position.clone(this.update,this.iefix,{setTop:(!this.update.style.height)});this.iefix.style.zIndex=1;this.update.style.zIndex=2;Element.show(this.iefix)},hide:function(){this.stopIndicator();if(Element.getStyle(this.update,"display")!="none"){this.options.onHide(this.element,this.update)}if(this.iefix){Element.hide(this.iefix)}},startIndicator:function(){if(this.options.indicator){Element.show(this.options.indicator)}},stopIndicator:function(){if(this.options.indicator){Element.hide(this.options.indicator)}},onKeyPress:function(A){if(this.active){switch(A.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:this.selectEntry();Event.stop(A);case Event.KEY_ESC:this.hide();this.active=false;Event.stop(A);return;case Event.KEY_LEFT:case Event.KEY_RIGHT:return;case Event.KEY_UP:this.markPrevious();this.render();Event.stop(A);return;case Event.KEY_DOWN:this.markNext();this.render();Event.stop(A);return}}else{if(A.keyCode==Event.KEY_TAB||A.keyCode==Event.KEY_RETURN||(Prototype.Browser.WebKit>0&&A.keyCode==0)){return}}this.changed=true;this.hasFocus=true;if(this.observer){clearTimeout(this.observer)}this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000)},activate:function(){this.changed=false;this.hasFocus=true;this.getUpdatedChoices()},onHover:function(B){var A=Event.findElement(B,"LI");if(this.index!=A.autocompleteIndex){this.index=A.autocompleteIndex;this.render()}Event.stop(B)},onClick:function(B){var A=Event.findElement(B,"LI");this.index=A.autocompleteIndex;this.selectEntry();this.hide()},onBlur:function(A){setTimeout(this.hide.bind(this),250);this.hasFocus=false;this.active=false},render:function(){if(this.entryCount>0){for(var A=0;A<this.entryCount;A++){this.index==A?Element.addClassName(this.getEntry(A),"selected"):Element.removeClassName(this.getEntry(A),"selected")}if(this.hasFocus){this.show();this.active=true}}else{this.active=false;this.hide()}},markPrevious:function(){if(this.index>0){this.index--}else{this.index=this.entryCount-1}this.getEntry(this.index).scrollIntoView(true)},markNext:function(){if(this.index<this.entryCount-1){this.index++}else{this.index=0}this.getEntry(this.index).scrollIntoView(false)},getEntry:function(A){return this.update.firstChild.childNodes[A]},getCurrentEntry:function(){return this.getEntry(this.index)},selectEntry:function(){this.active=false;this.updateElement(this.getCurrentEntry())},updateElement:function(G){if(this.options.updateElement){this.options.updateElement(G);return}var E="";if(this.options.select){var B=$(G).select("."+this.options.select)||[];if(B.length>0){E=Element.collectTextNodes(B[0],this.options.select)}}else{E=Element.collectTextNodesIgnoreClass(G,"informal")}var A=this.getTokenBounds();if(A[0]!=-1){var F=this.element.value.substr(0,A[0]);var D=this.element.value.substr(A[0]).match(/^\s+/);if(D){F+=D[0]}this.element.value=F+E+this.element.value.substr(A[1])}else{this.element.value=E}this.oldElementValue=this.element.value;this.element.focus();if(this.options.afterUpdateElement){this.options.afterUpdateElement(this.element,G)}},updateChoices:function(D){if(!this.changed&&this.hasFocus){this.update.innerHTML=D;Element.cleanWhitespace(this.update);Element.cleanWhitespace(this.update.down());if(this.update.firstChild&&this.update.down().childNodes){this.entryCount=this.update.down().childNodes.length;for(var A=0;A<this.entryCount;A++){var B=this.getEntry(A);B.autocompleteIndex=A;this.addObservers(B)}}else{this.entryCount=0}this.stopIndicator();this.index=0;if(this.entryCount==1&&this.options.autoSelect){this.selectEntry();this.hide()}else{this.render()}}},addObservers:function(A){Event.observe(A,"mouseover",this.onHover.bindAsEventListener(this));Event.observe(A,"click",this.onClick.bindAsEventListener(this))},onObserverEvent:function(){this.changed=false;this.tokenBounds=null;if(this.getToken().length>=this.options.minChars){this.getUpdatedChoices()}else{this.active=false;this.hide()}this.oldElementValue=this.element.value},getToken:function(){var A=this.getTokenBounds();return this.element.value.substring(A[0],A[1]).strip()},getTokenBounds:function(){if(null!=this.tokenBounds){return this.tokenBounds}var F=this.element.value;if(F.strip().empty()){return[-1,0]}var G=arguments.callee.getFirstDifferencePos(F,this.oldElementValue);var I=(G==this.oldElementValue.length?1:0);var E=-1,D=F.length;var H;for(var B=0,A=this.options.tokens.length;B<A;++B){H=F.lastIndexOf(this.options.tokens[B],G+I-1);if(H>E){E=H}H=F.indexOf(this.options.tokens[B],G+I);if(-1!=H&&H<D){D=H}}return(this.tokenBounds=[E+1,D])}});Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos=function(D,A){var E=Math.min(D.length,A.length);for(var B=0;B<E;++B){if(D[B]!=A[B]){return B}}return E};Ajax.Autocompleter=Class.create(Autocompleter.Base,{initialize:function(B,E,A,D){this.baseInitialize(B,E,D);this.options.asynchronous=true;this.options.onComplete=this.onComplete.bind(this);this.options.defaultParams=this.options.parameters||null;this.url=A},getUpdatedChoices:function(){this.startIndicator();var A=encodeURIComponent(this.options.paramName)+"="+encodeURIComponent(this.getToken());this.options.parameters=this.options.callback?this.options.callback(this.element,A):A;if(this.options.defaultParams){this.options.parameters+="&"+this.options.defaultParams}new Ajax.Request(this.url,this.options)},onComplete:function(A){this.updateChoices(A.responseText)}});Autocompleter.Local=Class.create(Autocompleter.Base,{initialize:function(A,D,E,B){this.baseInitialize(A,D,B);this.options.array=E},getUpdatedChoices:function(){this.updateChoices(this.options.selector(this))},setOptions:function(A){this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(B){var D=[];var F=[];var I=B.getToken();var H=0;for(var E=0;E<B.options.array.length&&D.length<B.options.choices;E++){var G=B.options.array[E];var J=B.options.ignoreCase?G.toLowerCase().indexOf(I.toLowerCase()):G.indexOf(I);while(J!=-1){if(J==0&&G.length!=I.length){D.push("<li><strong>"+G.substr(0,I.length)+"</strong>"+G.substr(I.length)+"</li>");break}else{if(I.length>=B.options.partialChars&&B.options.partialSearch&&J!=-1){if(B.options.fullSearch||/\s/.test(G.substr(J-1,1))){F.push("<li>"+G.substr(0,J)+"<strong>"+G.substr(J,I.length)+"</strong>"+G.substr(J+I.length)+"</li>");break}}}J=B.options.ignoreCase?G.toLowerCase().indexOf(I.toLowerCase(),J+1):G.indexOf(I,J+1)}}if(F.length){D=D.concat(F.slice(0,B.options.choices-D.length))}return"<ul>"+D.join("")+"</ul>"}},A||{})}});Field.scrollFreeActivate=function(A){setTimeout(function(){Field.activate(A)},1)};Ajax.InPlaceEditor=Class.create({initialize:function(B,A,D){this.url=A;this.element=B=$(B);this.prepareOptions();this._controls={};arguments.callee.dealWithDeprecatedOptions(D);Object.extend(this.options,D||{});if(!this.options.formId&&this.element.id){this.options.formId=this.element.id+"-inplaceeditor";if($(this.options.formId)){this.options.formId=""}}if(this.options.externalControl){this.options.externalControl=$(this.options.externalControl)}if(!this.options.externalControl){this.options.externalControlOnly=false}this._originalBackground=this.element.getStyle("background-color")||"transparent";this.element.title=this.options.clickToEditText;this._boundCancelHandler=this.handleFormCancellation.bind(this);this._boundComplete=(this.options.onComplete||Prototype.emptyFunction).bind(this);this._boundFailureHandler=this.handleAJAXFailure.bind(this);this._boundSubmitHandler=this.handleFormSubmission.bind(this);this._boundWrapperHandler=this.wrapUp.bind(this);this.registerListeners()},checkForEscapeOrReturn:function(A){if(!this._editing||A.ctrlKey||A.altKey||A.shiftKey){return}if(Event.KEY_ESC==A.keyCode){this.handleFormCancellation(A)}else{if(Event.KEY_RETURN==A.keyCode){this.handleFormSubmission(A)}}},createControl:function(H,D,B){var F=this.options[H+"Control"];var G=this.options[H+"Text"];if("button"==F){var A=document.createElement("input");A.type="submit";A.value=G;A.className="editor_"+H+"_button";if("cancel"==H){A.onclick=this._boundCancelHandler}this._form.appendChild(A);this._controls[H]=A}else{if("link"==F){var E=document.createElement("a");E.href="#";E.appendChild(document.createTextNode(G));E.onclick="cancel"==H?this._boundCancelHandler:this._boundSubmitHandler;E.className="editor_"+H+"_link";if(B){E.className+=" "+B}this._form.appendChild(E);this._controls[H]=E}}},createEditField:function(){var D=(this.options.loadTextURL?this.options.loadingText:this.getText());var B;if(1>=this.options.rows&&!/\r|\n/.test(this.getText())){B=document.createElement("input");B.type="text";var A=this.options.size||this.options.cols||0;if(0<A){B.size=A}}else{B=document.createElement("textarea");B.rows=(1>=this.options.rows?this.options.autoRows:this.options.rows);B.cols=this.options.cols||40}B.name=this.options.paramName;B.value=D;B.className="editor_field";if(this.options.submitOnBlur){B.onblur=this._boundSubmitHandler}this._controls.editor=B;if(this.options.loadTextURL){this.loadExternalText()}this._form.appendChild(this._controls.editor)},createForm:function(){var B=this;function A(F,D){var E=B.options["text"+F+"Controls"];if(!E||D===false){return}B._form.appendChild(document.createTextNode(E))}this._form=$(document.createElement("form"));this._form.id=this.options.formId;this._form.addClassName(this.options.formClassName);this._form.onsubmit=this._boundSubmitHandler;this.createEditField();if("textarea"==this._controls.editor.tagName.toLowerCase()){this._form.appendChild(document.createElement("br"))}if(this.options.onFormCustomization){this.options.onFormCustomization(this,this._form)}A("Before",this.options.okControl||this.options.cancelControl);this.createControl("ok",this._boundSubmitHandler);A("Between",this.options.okControl&&this.options.cancelControl);this.createControl("cancel",this._boundCancelHandler,"editor_cancel");A("After",this.options.okControl||this.options.cancelControl)},destroy:function(){if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML}this.leaveEditMode();this.unregisterListeners()},enterEditMode:function(A){if(this._saving||this._editing){return}this._editing=true;this.triggerCallback("onEnterEditMode");if(this.options.externalControl){this.options.externalControl.hide()}this.element.hide();this.createForm();this.element.parentNode.insertBefore(this._form,this.element);if(!this.options.loadTextURL){this.postProcessEditField()}if(A){Event.stop(A)}},enterHover:function(A){if(this.options.hoverClassName){this.element.addClassName(this.options.hoverClassName)}if(this._saving){return}this.triggerCallback("onEnterHover")},getText:function(){return this.element.innerHTML.unescapeHTML()},handleAJAXFailure:function(A){this.triggerCallback("onFailure",A);if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML;this._oldInnerHTML=null}},handleFormCancellation:function(A){this.wrapUp();if(A){Event.stop(A)}},handleFormSubmission:function(E){var B=this._form;var D=$F(this._controls.editor);this.prepareSubmission();var F=this.options.callback(B,D)||"";if(Object.isString(F)){F=F.toQueryParams()}F.editorId=this.element.id;if(this.options.htmlResponse){var A=Object.extend({evalScripts:true},this.options.ajaxOptions);Object.extend(A,{parameters:F,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Updater({success:this.element},this.url,A)}else{var A=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(A,{parameters:F,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Request(this.url,A)}if(E){Event.stop(E)}},leaveEditMode:function(){this.element.removeClassName(this.options.savingClassName);this.removeForm();this.leaveHover();this.element.style.backgroundColor=this._originalBackground;this.element.show();if(this.options.externalControl){this.options.externalControl.show()}this._saving=false;this._editing=false;this._oldInnerHTML=null;this.triggerCallback("onLeaveEditMode")},leaveHover:function(A){if(this.options.hoverClassName){this.element.removeClassName(this.options.hoverClassName)}if(this._saving){return}this.triggerCallback("onLeaveHover")},loadExternalText:function(){this._form.addClassName(this.options.loadingClassName);this._controls.editor.disabled=true;var A=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(A,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(D){this._form.removeClassName(this.options.loadingClassName);var B=D.responseText;if(this.options.stripLoadedTextTags){B=B.stripTags()}this._controls.editor.value=B;this._controls.editor.disabled=false;this.postProcessEditField()}.bind(this),onFailure:this._boundFailureHandler});new Ajax.Request(this.options.loadTextURL,A)},postProcessEditField:function(){var A=this.options.fieldPostCreation;if(A){$(this._controls.editor)["focus"==A?"focus":"activate"]()}},prepareOptions:function(){this.options=Object.clone(Ajax.InPlaceEditor.DefaultOptions);Object.extend(this.options,Ajax.InPlaceEditor.DefaultCallbacks);[this._extraDefaultOptions].flatten().compact().each(function(A){Object.extend(this.options,A)}.bind(this))},prepareSubmission:function(){this._saving=true;this.removeForm();this.leaveHover();this.showSaving()},registerListeners:function(){this._listeners={};var A;$H(Ajax.InPlaceEditor.Listeners).each(function(B){A=this[B.value].bind(this);this._listeners[B.key]=A;if(!this.options.externalControlOnly){this.element.observe(B.key,A)}if(this.options.externalControl){this.options.externalControl.observe(B.key,A)}}.bind(this))},removeForm:function(){if(!this._form){return}this._form.remove();this._form=null;this._controls={}},showSaving:function(){this._oldInnerHTML=this.element.innerHTML;this.element.innerHTML=this.options.savingText;this.element.addClassName(this.options.savingClassName);this.element.style.backgroundColor=this._originalBackground;this.element.show()},triggerCallback:function(B,A){if("function"==typeof this.options[B]){this.options[B](this,A)}},unregisterListeners:function(){$H(this._listeners).each(function(A){if(!this.options.externalControlOnly){this.element.stopObserving(A.key,A.value)}if(this.options.externalControl){this.options.externalControl.stopObserving(A.key,A.value)}}.bind(this))},wrapUp:function(A){this.leaveEditMode();this._boundComplete(A,this.element)}});Object.extend(Ajax.InPlaceEditor.prototype,{dispose:Ajax.InPlaceEditor.prototype.destroy});Ajax.InPlaceCollectionEditor=Class.create(Ajax.InPlaceEditor,{initialize:function($super,B,A,D){this._extraDefaultOptions=Ajax.InPlaceCollectionEditor.DefaultOptions;$super(B,A,D)},createEditField:function(){var A=document.createElement("select");A.name=this.options.paramName;A.size=1;this._controls.editor=A;this._collection=this.options.collection||[];if(this.options.loadCollectionURL){this.loadCollection()}else{this.checkForExternalText()}this._form.appendChild(this._controls.editor)},loadCollection:function(){this._form.addClassName(this.options.loadingClassName);this.showLoadingText(this.options.loadingCollectionText);var options=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(options,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(transport){var js=transport.responseText.strip();if(!/^\[.*\]$/.test(js)){throw ("Server returned an invalid collection representation.")}this._collection=eval(js);this.checkForExternalText()}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadCollectionURL,options)},showLoadingText:function(B){this._controls.editor.disabled=true;var A=this._controls.editor.firstChild;if(!A){A=document.createElement("option");A.value="";this._controls.editor.appendChild(A);A.selected=true}A.update((B||"").stripScripts().stripTags())},checkForExternalText:function(){this._text=this.getText();if(this.options.loadTextURL){this.loadExternalText()}else{this.buildOptionList()}},loadExternalText:function(){this.showLoadingText(this.options.loadingText);var A=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(A,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(B){this._text=B.responseText.strip();this.buildOptionList()}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadTextURL,A)},buildOptionList:function(){this._form.removeClassName(this.options.loadingClassName);this._collection=this._collection.map(function(E){return 2===E.length?E:[E,E].flatten()});var B=("value" in this.options)?this.options.value:this._text;var D=this._collection.any(function(E){return E[0]==B}.bind(this));this._controls.editor.update("");var A;this._collection.each(function(F,E){A=document.createElement("option");A.value=F[0];A.selected=D?F[0]==B:0==E;A.appendChild(document.createTextNode(F[1]));this._controls.editor.appendChild(A)}.bind(this));this._controls.editor.disabled=false;Field.scrollFreeActivate(this._controls.editor)}});Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions=function(A){if(!A){return}function B(D,E){if(D in A||E===undefined){return}A[D]=E}B("cancelControl",(A.cancelLink?"link":(A.cancelButton?"button":A.cancelLink==A.cancelButton==false?false:undefined)));B("okControl",(A.okLink?"link":(A.okButton?"button":A.okLink==A.okButton==false?false:undefined)));B("highlightColor",A.highlightcolor);B("highlightEndColor",A.highlightendcolor)};Object.extend(Ajax.InPlaceEditor,{DefaultOptions:{ajaxOptions:{},autoRows:3,cancelControl:"link",cancelText:"cancel",clickToEditText:"Click to edit",externalControl:null,externalControlOnly:false,fieldPostCreation:"activate",formClassName:"inplaceeditor-form",formId:null,highlightColor:"#ffff99",highlightEndColor:"#ffffff",hoverClassName:"",htmlResponse:true,loadingClassName:"inplaceeditor-loading",loadingText:"Loading...",okControl:"button",okText:"ok",paramName:"value",rows:1,savingClassName:"inplaceeditor-saving",savingText:"Saving...",size:0,stripLoadedTextTags:false,submitOnBlur:false,textAfterControls:"",textBeforeControls:"",textBetweenControls:""},DefaultCallbacks:{callback:function(A){return Form.serialize(A)},onComplete:function(B,A){new Effect.Highlight(A,{startcolor:this.options.highlightColor,keepBackgroundImage:true})},onEnterEditMode:null,onEnterHover:function(A){A.element.style.backgroundColor=A.options.highlightColor;if(A._effect){A._effect.cancel()}},onFailure:function(B,A){alert("Error communication with the server: "+B.responseText.stripTags())},onFormCustomization:null,onLeaveEditMode:null,onLeaveHover:function(A){A._effect=new Effect.Highlight(A.element,{startcolor:A.options.highlightColor,endcolor:A.options.highlightEndColor,restorecolor:A._originalBackground,keepBackgroundImage:true})}},Listeners:{click:"enterEditMode",keydown:"checkForEscapeOrReturn",mouseover:"enterHover",mouseout:"leaveHover"}});Ajax.InPlaceCollectionEditor.DefaultOptions={loadingCollectionText:"Loading options..."};Form.Element.DelayedObserver=Class.create({initialize:function(B,A,D){this.delay=A||0.5;this.element=$(B);this.callback=D;this.timer=null;this.lastValue=$F(this.element);Event.observe(this.element,"keyup",this.delayedListener.bindAsEventListener(this))},delayedListener:function(A){if(this.lastValue==$F(this.element)){return}if(this.timer){clearTimeout(this.timer)}this.timer=setTimeout(this.onTimerEvent.bind(this),this.delay*1000);this.lastValue=$F(this.element)},onTimerEvent:function(){this.timer=null;this.callback(this.element,$F(this.element))}});Object.extend(Autocompleter.Base.prototype,{markPrevious:function(){if(this.index>0){this.index--}else{this.index=this.entryCount-1}},markNext:function(){if(this.index<this.entryCount-1){this.index++}else{this.index=0}}});Object.extend(Ajax.Autocompleter.prototype,{initialize:function(B,E,A,D){this.baseInitialize(B,E,D);this.options.asynchronous=true;this.options.onShow=this.onShow.bind(this);this.options.onSuccess=this.onSuccess.bind(this);this.options.onFailure=this.onFailure.bind(this);this.options.defaultParams=this.options.parameters||null;this.url=A},onShow:function(A,D){if(!D.style.position||D.style.position=="absolute"){D.style.position="absolute";if(Prototype.Browser.IE&&/MSIE\s8\.0/.test(navigator.userAgent)){D.show()}var B=(this.options.cloneWidth==false)?false:true;Position.clone(A,D,{setHeight:false,setWidth:B,offsetTop:A.offsetHeight});D.hide()}Effect.Appear(D,{duration:0.15})},onSuccess:function(A){this.updateChoices(A.responseText)},onFailure:function(A){log.error("Ajax.Autocompleter: request failed")}});Ajax.AutocompleterJSON=Class.create(Ajax.Autocompleter,{onSuccess:function(F){try{var B=F.responseText.evalJSON(true);if(B.length>0){this.results=B}}catch(H){log.error("Ajax.Autocompleter: invalid response")}var D=new Element("div");var G=new Element("ul");D.appendChild(G);for(var A=0;A<B.length;A++){var E=new Element("li").update(B[A].suggestion);if(A%2==0){E.setAttribute("class","odd")}else{E.setAttribute("class","even")}G.appendChild(E)}if(this.options.transformResponse){G=this.options.transformResponse(G)}this.updateChoices(D.innerHTML)}});Effect.Transitions.easeFrom=function(A){return Math.pow(A,0.5)};Effect.Transitions.easeTo=function(A){return Math.pow(A,0.2)};if(typeof deconcept=="undefined"){var deconcept=new Object()}if(typeof deconcept.util=="undefined"){deconcept.util=new Object()}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()}deconcept.SWFObject=function(E,D,L,G,I,K,M,F,A,H){if(!document.getElementById){return}this.DETECT_KEY=H?H:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(E){this.setAttribute("swf",E)}if(D){this.setAttribute("id",D)}if(L){this.setAttribute("width",L)}if(G){this.setAttribute("height",G)}if(I){this.setAttribute("version",new deconcept.PlayerVersion(I.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(K){this.addParam("bgcolor",K)}var B=M?M:"high";this.addParam("quality",B);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var J=(F)?F:window.location;this.setAttribute("xiRedirectUrl",J);this.setAttribute("redirectUrl","");if(A){this.setAttribute("redirectUrl",A)}};deconcept.SWFObject.prototype={useExpressInstall:function(A){this.xiSWFPath=!A?"expressinstall.swf":A;this.setAttribute("useExpressInstall",true)},setAttribute:function(A,B){this.attributes[A]=B},getAttribute:function(A){return this.attributes[A]},addParam:function(A,B){this.params[A]=B},getParams:function(){return this.params},addVariable:function(A,B){this.variables[A]=B},getVariable:function(A){return this.variables[A]},getVariables:function(){return this.variables},getVariablePairs:function(){var A=new Array();var B;var D=this.getVariables();for(B in D){A.push(B+"="+D[B])}return A},getSWFHTML:function(){var D="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}D='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'"';D+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var E=this.getParams();for(var A in E){D+=[A]+'="'+E[A]+'" '}var B=this.getVariablePairs().join("&");if(B.length>0){D+='flashvars="'+B+'"'}D+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}D='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'">';D+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var E=this.getParams();for(var A in E){D+='<param name="'+A+'" value="'+E[A]+'" />'}var B=this.getVariablePairs().join("&");if(B.length>0){D+='<param name="flashvars" value="'+B+'" />'}D+="</object>"}return D},write:function(A){if(this.getAttribute("useExpressInstall")){var B=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(B)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var D=(typeof A=="string")?document.getElementById(A):A;D.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var D=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var A=navigator.plugins["Shockwave Flash"];if(A&&A.description){D=new deconcept.PlayerVersion(A.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{try{var B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(E){try{var B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");D=new deconcept.PlayerVersion([6,0,21]);B.AllowScriptAccess="always"}catch(E){if(D.major==6){return D}}try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(E){}}if(B!=null){D=new deconcept.PlayerVersion(B.GetVariable("$version").split(" ")[1].split(","))}}return D};deconcept.PlayerVersion=function(A){this.major=A[0]!=null?parseInt(A[0]):0;this.minor=A[1]!=null?parseInt(A[1]):0;this.rev=A[2]!=null?parseInt(A[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(A){if(this.major<A.major){return false}if(this.major>A.major){return true}if(this.minor<A.minor){return false}if(this.minor>A.minor){return true}if(this.rev<A.rev){return false}return true};deconcept.util={getRequestParameter:function(E){var D=document.location.search||document.location.hash;if(D){var B=D.substring(1).split("&");for(var A=0;A<B.length;A++){if(B[A].substring(0,B[A].indexOf("="))==E){return B[A].substring((B[A].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var B=document.getElementsByTagName("OBJECT");for(var D=0;D<B.length;D++){B[D].style.display="none";for(var A in B[D]){if(typeof B[D][A]=="function"){B[D][A]=function(){}}}}};if(deconcept.SWFObject.doPrepUnload){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload)}if(Array.prototype.push==null){Array.prototype.push=function(A){this[this.length]=A;return this.length}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;(function(){if(window.google&&google.gears){return}var A=null;if(typeof GearsFactory!="undefined"){A=new GearsFactory()}else{try{A=new ActiveXObject("Gears.Factory");if(A.getBuildInfo().indexOf("ie_mobile")!=-1){A.privateSetGlobalObject(this)}}catch(B){if((typeof navigator.mimeTypes!="undefined")&&navigator.mimeTypes["application/x-googlegears"]){A=document.createElement("object");A.style.display="none";A.width=0;A.height=0;A.type="application/x-googlegears";document.documentElement.appendChild(A)}}}if(!A){return}if(!window.google){google={}}if(!google.gears){google.gears={factory:A}}})();Persist=(function(){var H="0.2.0",G,J,A,I,F,D;D=(function(){var U="Thu, 01-Jan-1970 00:00:01 GMT",K=1000*60*60*24,T=["expires","path","domain"],M=escape,L=unescape,S=document,O;var P=function(){var V=new Date();V.setTime(V.getTime());return V};var B=function(Y,b){var X,W,a,Z=[],V=(arguments.length>2)?arguments[2]:{};Z.push(M(Y)+"="+M(b));for(X=0;X<T.length;X++){W=T[X];if(a=V[W]){Z.push(W+"="+a)}}if(V.secure){Z.push("secure")}return Z.join("; ")};var Q=function(){var W="__EC_TEST__",V=new Date();V=V.toGMTString();this.set(W,V);this.enabled=(this.remove(W)==V);return this.enabled};O={set:function(c,Y){var X=(arguments.length>2)?arguments[2]:{},W=P(),b,Z={};if(X.expires){var a=X.expires*K;Z.expires=new Date(W.getTime()+a);Z.expires=Z.expires.toGMTString()}var d=["path","domain","secure"];for(i=0;i<d.length;i++){if(X[d[i]]){Z[d[i]]=X[d[i]]}}var V=B(c,Y,Z);S.cookie=V;return Y},has:function(W){W=M(W);var Z=S.cookie,Y=Z.indexOf(W+"="),V=Y+W.length+1,X=Z.substring(0,W.length);return((!Y&&W!=X)||Y<0)?false:true},get:function(X){X=M(X);var a=S.cookie,Z=a.indexOf(X+"="),V=Z+X.length+1,Y=a.substring(0,X.length),W;if((!Z&&X!=Y)||Z<0){return null}W=a.indexOf(";",V);if(W<0){W=a.length}return L(a.substring(V,W))},remove:function(V){var X=O.get(V),W={expires:U};S.cookie=B(V,"",W);return X},keys:function(){var Z=S.cookie,Y=Z.split("; "),V,X,W=[];for(V=0;V<Y.length;V++){X=Y[V].split("=");W.push(L(X[0]))}return W},all:function(){var Z=S.cookie,Y=Z.split("; "),V,X,W=[];for(V=0;V<Y.length;V++){X=Y[V].split("=");W.push([L(X[0]),L(X[1])])}return W},version:"0.2.1",enabled:false};O.enabled=Q.call(O);return O}());var E=(function(){if(Array.prototype.indexOf){return function(B,K){return Array.prototype.indexOf.call(B,K)}}else{return function(L,M){var K,B;for(K=0,B=L.length;K<B;K++){if(L[K]==M){return K}}return -1}}})();F=function(){};A=function(B){return"PS"+B.replace(/_/g,"__").replace(/ /g,"_s")};C={search_order:["localstorage","globalstorage","whatwg_db","ie","flash"],name_re:/^[a-z][a-z0-9_ -]+$/i,methods:["init","get","set","remove","load","save"],sql:{version:"1",create:"CREATE TABLE IF NOT EXISTS persist_data (k TEXT UNIQUE NOT NULL PRIMARY KEY, v TEXT NOT NULL)",get:"SELECT v FROM persist_data WHERE k = ?",set:"INSERT INTO persist_data(k, v) VALUES (?, ?)",remove:"DELETE FROM persist_data WHERE k = ?"},flash:{div_id:"_persist_flash_wrap",id:"_persist_flash",path:"/script/lib/vendor/persistjs/persist.swf",size:{w:1,h:1},args:{autostart:true}}};J={gears:{size:-1,test:function(){return(window.google&&window.google.gears)?true:false},methods:{transaction:function(K){var B=this.db;B.execute("BEGIN").close();K.call(this,B);B.execute("COMMIT").close()},init:function(){var B;B=this.db=google.gears.factory.create("beta.database");B.open(A(this.name));B.execute(C.sql.create).close()},get:function(B,L,K){var M,O=C.sql.get;if(!L){return}this.transaction(function(Q){var P,S;M=Q.execute(O,[B]);P=M.isValidRow();S=P?M.field(0):null;M.close();L.call(K||this,P,S)})},set:function(B,Q,M,L){var K=C.sql.remove,P=C.sql.set,O;this.transaction(function(S){S.execute(K,[B]).close();S.execute(P,[B,Q]).close();if(M){M.call(L||this,true,Q)}})},remove:function(K,M,L){var B=C.sql.get;sql=C.sql.remove,r,val=null,is_valid=false;this.transaction(function(O){if(M){r=O.execute(B,[K]);is_valid=r.isValidRow();val=is_valid?r.field(0):null;r.close()}if(!M||is_valid){O.execute(sql,[K]).close()}if(M){M.call(L||this,is_valid,val)}})}}},whatwg_db:{size:200*1024,test:function(){var B="PersistJS Test",K="Persistent database test.";if(!window.openDatabase){return false}if(!window.openDatabase(B,C.sql.version,K,J.whatwg_db.size)){return false}return true},methods:{transaction:function(B){if(!this.db_created){this.db.transaction(function(K){K.executeSql(C.sql.create,[],function(){this.db_created=true})},F)}this.db.transaction(B)},init:function(){this.db=openDatabase(this.name,C.sql.version,this.o.about||("Persistent storage for "+this.name),this.o.size||J.whatwg_db.size)},get:function(B,L,K){var M=C.sql.get;if(!L){return}K=K||this;this.transaction(function(O){O.executeSql(M,[B],function(P,Q){if(Q.rows.length>0){L.call(K,true,Q.rows.item(0)["v"])}else{L.call(K,false,null)}})})},set:function(B,P,M,L){var K=C.sql.remove,O=C.sql.set;this.transaction(function(Q){Q.executeSql(K,[B],function(){Q.executeSql(O,[B,P],function(S,T){if(M){M.call(L||this,true,P)}})})});return P},remove:function(K,M,L){var B=C.sql.get;sql=C.sql.remove;this.transaction(function(O){if(M){O.executeSql(B,[K],function(P,Q){if(Q.rows.length>0){var S=Q.rows.item(0)["v"];P.executeSql(sql,[K],function(T,U){M.call(L||this,true,S)})}else{M.call(L||this,false,null)}})}else{O.executeSql(sql,[K])}})}}},globalstorage:{size:5*1024*1024,test:function(){return window.globalStorage?true:false},methods:{key:function(B){return A(this.name)+A(B)},init:function(){this.store=globalStorage[this.o.domain]},get:function(B,L,K){B=this.key(B);if(L){L.call(K||this,true,this.store.getItem(B))}},set:function(B,M,L,K){B=this.key(B);this.store.setItem(B,M);if(L){L.call(K||this,true,M)}},remove:function(B,L,K){var M;B=this.key(B);M=this.store[B];this.store.removeItem(B);if(L){L.call(K||this,(M!==null),M)}}}},localstorage:{size:-1,test:function(){return window.localStorage?true:false},methods:{key:function(B){return A(this.name)+A(B)},init:function(){this.store=localStorage},get:function(B,L,K){B=this.key(B);if(L){L.call(K||this,true,this.store.getItem(B))}},set:function(B,M,L,K){B=this.key(B);this.store.setItem(B,M);if(L){L.call(K||this,true,M)}},remove:function(B,L,K){var M;B=this.key(B);M=this.getItem(B);this.store.removeItem(B);if(L){L.call(K||this,(M!==null),M)}}}},ie:{prefix:"_persist_data-",size:64*1024,test:function(){return window.ActiveXObject?true:false},make_userdata:function(K){var B=document.createElement("div");B.id=K;B.style.display="none";B.addBehavior("#default#userdata");document.body.appendChild(B);return B},methods:{init:function(){var B=J.ie.prefix+A(this.name);this.el=J.ie.make_userdata(B);if(this.o.defer){this.load()}},get:function(B,L,K){var M;B=A(B);if(!this.o.defer){this.load()}M=this.el.getAttribute(B);if(L){L.call(K||this,M?true:false,M)}},set:function(B,M,L,K){B=A(B);this.el.setAttribute(B,M);if(!this.o.defer){this.save()}if(L){L.call(K||this,true,M)}},remove:function(B,L,K){var M;B=A(B);if(!this.o.defer){this.load()}M=this.el.getAttribute(B);this.el.removeAttribute(B);if(!this.o.defer){this.save()}if(L){L.call(K||this,M?true:false,M)}},load:function(){this.el.load(A(this.name))},save:function(){this.el.save(A(this.name))}}},cookie:{delim:":",size:4000,test:function(){return G.Cookie.enabled?true:false},methods:{key:function(B){return this.name+J.cookie.delim+B},get:function(B,L,K){var M;B=this.key(B);M=D.get(B);if(L){L.call(K||this,M!=null,M)}},set:function(B,M,L,K){B=this.key(B);D.set(B,M,this.o);if(L){L.call(K||this,true,M)}},remove:function(B,M,L,K){var M;B=this.key(B);M=D.remove(B);if(L){L.call(K||this,M!=null,M)}}}},flash:{test:function(){if(!deconcept||!deconcept.SWFObjectUtil){return false}var B=deconcept.SWFObjectUtil.getPlayerVersion().major;return(B>=8)?true:false},methods:{init:function(){if(!J.flash.el){var M,K,L,B=C.flash;L=document.createElement("div");L.id=B.div_id;document.body.appendChild(L);M=new deconcept.SWFObject(this.o.swf_path||B.path,B.id,B.size.w,B.size.h,"8");for(K in B.args){M.addVariable(K,B.args[K])}M.write(L);J.flash.el=document.getElementById(B.id)}this.el=J.flash.el},get:function(B,L,K){var M;B=A(B);M=this.el.get(this.name,B);if(L){L.call(K||this,M!==null,M)}},set:function(K,O,M,L){var B;K=A(K);B=this.el.set(this.name,K,O);if(M){M.call(L||this,true,O)}},remove:function(B,L,K){var M;B=A(B);M=this.el.remove(this.name,B);if(L){L.call(K||this,true,M)}}}}};var I=function(){var O,K,B,M,L=C.methods,P=C.search_order;for(O=0,K=L.length;O<K;O++){G.Store.prototype[L[O]]=F}G.type=null;G.size=-1;for(O=0,K=P.length;!G.type&&O<K;O++){B=J[P[O]];if(B.test()){G.type=P[O];G.size=B.size;for(M in B.methods){G.Store.prototype[M]=B.methods[M]}}}G._init=true};G={VERSION:H,type:null,size:0,add:function(B){J[B.id]=B;C.search_order=[B.id].concat(C.search_order);I()},remove:function(K){var B=E(C.search_order,K);if(B<0){return}C.search_order.splice(B,1);delete J[K];I()},Cookie:D,Store:function(B,K){if(!C.name_re.exec(B)){throw new Error("Invalid name")}if(!G.type){throw new Error("No suitable storage found")}K=K||{};this.name=B;K.domain=K.domain||location.host||"localhost";K.domain=K.domain.replace(/:\d+$/,"");K.domain=(K.domain=="localhost")?"":K.domain;this.o=K;K.expires=K.expires||365*2;K.path=K.path||"/";this.init()}};I();return G})();var OnlineOpinion=new Object();OnlineOpinion.util={SafeAddOnLoadEvent:function(B){if(!document.getElementById|!document.getElementsByTagName){return}var A=window.onload;if(typeof window.onload!="function"){window.onload=B}else{window.onload=function(){A();B()}}},SafeAddOnUnLoadEvent:function(A){if(!document.getElementById|!document.getElementsByTagName){return}var B=window.onunload;if(typeof window.onunload!="function"){window.onunload=A}else{window.onunload=function(){A();B()}}},popup:function(F,A,B){var E=window.open(F,A,B);if(typeof E=="undefined"){if(document.all){document.getElementById("test").href=F;document.getElementById("test").click()}else{var D=window.open(F,"_blank");D.focus()}}return false},walkAnchors:function(H,F,I,B){var G=1000;var E=0;while(H&&F>0){E++;if(E>=G){var A=function(){OnlineOpinion.util.walkAnchors(H,F,I,B)};setTimeout(A,50);return}if(H.tagName=="A"){if(I.test(H.href)){H.onmousedown=function(){B.Preferences.Plugins.Events.poX=0}}}if(H.tagName=="INPUT"){if(H.type=="submit"||H.type=="image"){H.onmousedown=function(){B.Preferences.Plugins.Events.poX=0}}}if(H.tagName=="FORM"){if(typeof H.onsubmit!="function"){H.onsubmit=function(){B.Preferences.Plugins.Events.poX=0}}else{var J=H.onsubmit;H.onsubmit=function(){B.Preferences.Plugins.Events.poX=0;J()}}}if(H.nodeType==1){var D=/^(script|style|textarea)/i;if(!D.test(H.tagName)&&H.childNodes.length>0){H=H.childNodes[0];F++;continue}}if(H.nextSibling){H=H.nextSibling}else{while(F>0){H=H.parentNode;F--;if(H==null){break}if(H.nextSibling){H=H.nextSibling;break}}}}}};OnlineOpinion.cookie=function(){this.cookie_name="oo_r";this.expiration=24*60*60*1000;this.rhex=function(num){var hex_chr="0123456789abcdef",_s="";for(var j=0;j<=3;j++){_s+=hex_chr.charAt((num>>(j*8+4))&15)+hex_chr.charAt((num>>(j*8))&15)}return _s};this.str2blks_MD5=function(_s){var nblk=((_s.length+8)>>6)+1,blks=new Array(nblk*16);var i=0;for(;i<nblk*16;i++){blks[i]=0}for(i=0;i<_s.length;i++){blks[i>>2]|=_s.charCodeAt(i)<<((i%4)*8)}blks[i>>2]|=128<<((i%4)*8);blks[nblk*16-2]=_s.length*8;return blks};this._fSa=function(x,y){var lsw=(x&65535)+(y&65535),msw=(x>>16)+(y>>16)+(lsw>>16);return(msw<<16)|(lsw&65535)};this.rol=function(num,cnt){return(num<<cnt)|(num>>>(32-cnt))};this.cmn=function(q,a,b,x,s,t){return this._fSa(this.rol(this._fSa(this._fSa(a,q),this._fSa(x,t)),s),b)};this._fF=function(a,b,c,d,x,s){return this.cmn((b&c)|((~b)&d),a,0,x,s,0)};this._fG=function(a,b,c,d,x,s){return this.cmn((b&c)|(b&d)|(c&d),a,0,x,s,1518500249)};this._fH=function(a,b,c,d,x,s){return this.cmn(b^c^d,a,0,x,s,1859775393)};this._MD4=function(_s){var x=this.str2blks_MD5(_s),a=1732584193,b=-271733879,c=-1732584194,d=271733878;for(var i=0;i<x.length;i+=16){var olda=a,oldb=b,oldc=c,oldd=d;a=this._fF(a,b,c,d,x[i+0],3);d=this._fF(d,a,b,c,x[i+1],7);c=this._fF(c,d,a,b,x[i+2],11);b=this._fF(b,c,d,a,x[i+3],19);a=this._fF(a,b,c,d,x[i+4],3);d=this._fF(d,a,b,c,x[i+5],7);c=this._fF(c,d,a,b,x[i+6],11);b=this._fF(b,c,d,a,x[i+7],19);a=this._fF(a,b,c,d,x[i+8],3);d=this._fF(d,a,b,c,x[i+9],7);c=this._fF(c,d,a,b,x[i+10],11);b=this._fF(b,c,d,a,x[i+11],19);a=this._fF(a,b,c,d,x[i+12],3);d=this._fF(d,a,b,c,x[i+13],7);c=this._fF(c,d,a,b,x[i+14],11);b=this._fF(b,c,d,a,x[i+15],19);a=this._fG(a,b,c,d,x[i+0],3);d=this._fG(d,a,b,c,x[i+4],5);c=this._fG(c,d,a,b,x[i+8],9);b=this._fG(b,c,d,a,x[i+12],13);a=this._fG(a,b,c,d,x[i+1],3);d=this._fG(d,a,b,c,x[i+5],5);c=this._fG(c,d,a,b,x[i+9],9);b=this._fG(b,c,d,a,x[i+13],13);a=this._fG(a,b,c,d,x[i+2],3);d=this._fG(d,a,b,c,x[i+6],5);c=this._fG(c,d,a,b,x[i+10],9);b=this._fG(b,c,d,a,x[i+14],13);a=this._fG(a,b,c,d,x[i+3],3);d=this._fG(d,a,b,c,x[i+7],5);c=this._fG(c,d,a,b,x[i+11],9);b=this._fG(b,c,d,a,x[i+15],13);a=this._fH(a,b,c,d,x[i+0],3);d=this._fH(d,a,b,c,x[i+8],9);c=this._fH(c,d,a,b,x[i+4],11);b=this._fH(b,c,d,a,x[i+12],15);a=this._fH(a,b,c,d,x[i+2],3);d=this._fH(d,a,b,c,x[i+10],9);c=this._fH(c,d,a,b,x[i+6],11);b=this._fH(b,c,d,a,x[i+14],15);a=this._fH(a,b,c,d,x[i+1],3);d=this._fH(d,a,b,c,x[i+9],9);c=this._fH(c,d,a,b,x[i+5],11);b=this._fH(b,c,d,a,x[i+13],15);a=this._fH(a,b,c,d,x[i+3],3);d=this._fH(d,a,b,c,x[i+11],9);c=this._fH(c,d,a,b,x[i+7],11);b=this._fH(b,c,d,a,x[i+15],15);a=this._fSa(a,olda);b=this._fSa(b,oldb);c=this._fSa(c,oldc);d=this._fSa(d,oldd)}return this.rhex(a)+this.rhex(b)+this.rhex(c)+this.rhex(d)};this.read=function(n){var neq=n+"=";var ca=document.cookie.split(";");for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==" "){c=c.substring(1,c.length)}if(c.indexOf(neq)==0){return unescape(c.substring(neq.length,c.length))}}return null};this.write=function(n,v){document.cookie=n+"="+v+";path=/;expires="+(new Date((new Date()).getTime()+this.expiration)).toGMTString()};this.matchurl=function(u,type){var i=0,c=this.read(this.cookie_name);if(type=="domain"){u=/(:\/\/)[\w\d\:\.]+/g.exec(u)[0].replace("://","")}n=this._MD4(u);if(c==null){return false}while(i<c.length){j=i+n.length;if(c.substring(i,j)==n){return(unescape(c.substring(j+1,j+2))==1)}i++}return false};this.tagurl=function(u,type){if(type=="domain"){u=/(:\/\/)[\w\d\:\.]+/g.exec(u)[0].replace("://","")}var prev_val="";if(this.read(this.cookie_name)!=null){prev_val=this.read(this.cookie_name).replace(eval("/"+escape(this._MD4(u))+"~1:/g"),"")}this.write(this.cookie_name,prev_val+(prev_val!=""?":":"")+escape(this._MD4(u))+"~1")}};OnlineOpinion.ocode=function(name){this.name=name;function rematch(val,restr){var re=new RegExp(restr);var m=re.exec(val);if(m==null||m==""){return""}else{var s="";for(i=0;i<m.length;i++){s=s+m[i]}return s}}this._fC=function(_u){_aT=this._sp+",\\/,\\.,-,_,"+this._rp+",%2F,%2E,%2D,%5F";_aA=_aT.split(",");for(i=0;i<5;i++){eval("_u=_u.replace(/"+_aA[i]+"/g,_aA[i+5])")}return _u};this._browser=function(){this.engine=null;this.version=null;var useragent=navigator.userAgent.toLowerCase();if(window.ActiveXObject){this.engine="ie";this.version=rematch(useragent,"msie\\s[0-9].[0-9]+").replace("msie ","")}else{if(window.opera){this.engine="opera";this.version=rematch(useragent,"opera.[0-9].[0-9]+").replace("opera","").replace("/","")}else{if(document.childNodes&&!document.all&&!navigator.taintEnabled){if(rematch(useragent,"applewebkit/[0-9]+")!=null){this.engine="webkit";this.version=rematch(useragent,"applewebkit/[0-9]+").replace("applewebkit/","")}else{this.engine="khtml";this.version=rematch(useragent,"khtml/[0-9].[0-9].[0-9]+").replace("khtml/","")}}else{if(navigator.userAgent.match(/gecko/i)){this.engine="gecko";this.version=rematch(useragent,"gecko/[0-9]+").replace("gecko/","")}}}}};this.serialize=function(obj,option){var str_out="",inc=0;for(var i in obj){if(typeof obj[i]!="function"&&typeof obj[i]!="undefined"&&obj[i]!=null&&obj[i]!=""){if(option==0){str_out+=(inc==0?"":"&")+i+"="+escape(obj[i])}else{if(option==1){str_out+=(inc==0?"":"|")+escape(obj[i])}}inc++}}return str_out};this.Preferences=new Object();this.Preferences.Persistence={enabled:true,cookie_type:"page",cookie_name:"oo_r",expiration:24*60*60*1000};this.Preferences.Render={type:"floating",main_div_id:"oo_feedback_float",up_div_id:"olUp",over_div_id:"olOver",img_path:"onlineopinion/oo_black.gif",feedback_span_id:"fbText",feedback_html:"FEEDBACK",click_html:"Click here to<br>rate this page",ty_html:"",float_style:"fixed"};this.Metrics=new Object();this.Metrics.core={width:screen.width,height:screen.height,referer:window.location.href,prev:document.referrer,time1:(new Date()).getTime(),time2:null};this.Metrics.custom=new Object();this.Preferences.Plugins=new Object();this.Preferences.Plugins.Events={poE:0,poX:0,poC:{id:"",value:0},poWC:0};this.onEntry=function(){if(Math.random()>=1-this.Preferences.Plugins.Events.poE){this.show();this.Preferences.Plugins.Events.poX=0}};this.onExit=function(){if(Math.random()>=1-this.Preferences.Plugins.Events.poX){this.show()}};this.OnClick=function(){if(Math.random()>=1-this.Preferences.Plugins.Events.poC){this.show();this.Preferences.Plugins.Events.poX=0;this.Preferences.Plugins.Events.poC=0}};this.Preferences.Plugins.URLRewrite={active:false,regex_search_pattern:"",regex_replace_pattern:""};this.Preferences.Plugins.CardOnPage={enabled:false,div_id:"onlineopinion_cc_window",iframe_id:"onlineopinion_cc_frame"};this.init=function(){this.resetReferer();if(typeof OnlineOpinion.cookie!="undefined"&&this.Preferences.Persistence.cookie_type!=null){this.Cookie=new OnlineOpinion.cookie();if(typeof this.Preferences.Persistence.cookie_name!="undefined"){this.Cookie.cookie_name=this.Preferences.Persistence.cookie_name}this.Cookie.expiration=1000*this.Preferences.Persistence.expiration;if(this.Cookie.matchurl(this.Metrics.core.referer,this.Preferences.Persistence.cookie_type)==1){this.Preferences.Plugins.Events.poX=0;this.Preferences.Plugins.Events.poE=0;return false}}else{this.Cookie=null}return true};this.render=function(onclick_func){this.init();var b=new this._browser();var d=document;var de=d.documentElement;var db=d.body;var w=window;var divID=this.Preferences.Render.main_div_id;var bVersion=parseFloat(b.version);var compliant=d.compatMode=="CSS1Compat";var sObj=compliant?de:db;if(b.engine=="webkit"){sObj=db}if(b.engine==null||b.version==null||isNaN(parseInt(b.version,10))||(b.engine=="ie"&&parseFloat(b.version)<6)||(b.engine=="opera"&&parseInt(b.version,10)<8)||(b.engine=="gecko"&&parseInt(b.version,10)<20041107)){return false}var mainDivObj=d.getElementById(divID);if(mainDivObj==null){if(this.Preferences.Render.type=="floating"){mainDivObj=db.appendChild(d.createElement("div"));mainDivObj.id=divID}}if(mainDivObj.innerHTML==""){if(this.Preferences.Render.type=="floating"){if(this.Preferences.Persistence.enabled&&this.Preferences.Persistence.cookie_type!=null){if(this.Cookie.matchurl(this.Metrics.core.referer,this.Preferences.Persistence.cookie_type)==1){return false}}var olUpObj=mainDivObj.appendChild(d.createElement("div"));olUpObj.id=this.Preferences.Render.up_div_id;var olOverObj=mainDivObj.appendChild(d.createElement("div"));olOverObj.id=this.Preferences.Render.over_div_id;olOverObj.style.display="none";olUpObj.onmouseover=function(){d.getElementById(olOverObj.id).style.display="block";document.getElementById(olUpObj.id).style.display="none"};olOverObj.onmouseout=function(){d.getElementById(olOverObj.id).style.display="none";document.getElementById(olUpObj.id).style.display="block"};var ooImg=olUpObj.appendChild(d.createElement("img"));ooImg.src=this.Preferences.Render.img_path;var fbText=olUpObj.appendChild(d.createElement("span"));fbText.id=this.Preferences.Render.feedback_span_id;fbText.innerHTML=this.Preferences.Render.feedback_html;var feedback_text=null;if(this.Preferences.Render.div_alt_text){feedback_text=this.Preferences.Render.div_alt_text}else{if(document.all){feedback_text=fbText.innerText}else{feedback_text=fbText.textContent}}mainDivObj.alt=feedback_text;mainDivObj.title=feedback_text;olOverObj.innerHTML=this.Preferences.Render.click_html}if(this.Preferences.Render.type=="static"){mainDivObj.innerHTML=this.Preferences.Render.main_html}}if(this.Preferences.Render.type=="floating"){if(!this.Preferences.Render.float_style){this.Preferences.Render.float_style="fixed"}var mdoStyle=mainDivObj.style;var _this=this;if(this.Preferences.Render.float_style=="rightOfContent"){function getRightOfContent(){return contentDiv.offsetWidth+contentDiv.offsetLeft+1}var contentDiv=d.getElementById(_this.Preferences.Render.main_content_id||"content");if(contentDiv==null){contentDiv=db.firstChild;while(contentDiv&&contentDiv.nodeType!=Node.ELEMENT_NODE){contentDiv=contentDiv.nextSibling}}function fixBackground(){if(_this.Preferences.Render.fix_background){db.style.backgroundAttachment="scroll";var margin=null;if(document.defaultView&&document.defaultView.getComputedStyle){margin=parseInt(document.defaultView.getComputedStyle(contentDiv,null).getPropertyValue("margin-left"),10)}else{margin=parseInt(contentDiv.currentStyle.marginLeft,10)}if(isNaN(margin)||margin==0){margin=contentDiv.offsetLeft||0}db.style.backgroundPosition=(Math.floor(contentDiv.scrollWidth*-0.5)-2+margin)+"px 0"}}}var ieSix=function(e){if(_this.Preferences.Render.float_style=="fixed"){mdoStyle.left=sObj.scrollLeft+sObj.clientWidth-mainDivObj.clientWidth}else{if(_this.Preferences.Render.float_style=="rightOfContent"){mdoStyle.left=getRightOfContent()+"px"}}mdoStyle.top=sObj.scrollTop+sObj.clientHeight-mainDivObj.clientHeight;if(e==null||e.type=="load"){mdoStyle.visibility="visible"}if(e==null||e.type=="load"||e.type=="resize"){fixBackground()}};if(b.engine=="ie"&&(bVersion<7||!compliant)){mdoStyle.position="absolute";function mapEvents(target,events){for(var idx=0;idx<events.length;idx++){var curevent=events[idx];target.attachEvent("on"+curevent,ieSix)}}mapEvents(mainDivObj,["mouseover","mouseout"]);mapEvents(w,["resize","scroll","mousewheel","load"]);ieSix()}else{mdoStyle.position="fixed";if(this.Preferences.Render.float_style=="fixed"){mdoStyle.right="0px";mdoStyle.bottom="0px"}else{if(this.Preferences.Render.float_style=="rightOfContent"){var rightOfContent=getRightOfContent()-sObj.scrollLeft+"px";mdoStyle.bottom="0px";mdoStyle.left=rightOfContent;var gutter=d.createElement("div");db.replaceChild(gutter,mainDivObj);gutter.appendChild(mainDivObj);gutter.style.position="absolute";gutter.style.width=mainDivObj.offsetWidth+"px";gutter.style.left=rightOfContent;gutter.style.top="0px";gutter.style.height=sObj.scrollHeight+"px";fixBackground();var resizeMove=function(e){var right=getRightOfContent();mdoStyle.left=right-sObj.scrollLeft+"px";if(e.type=="resize"){gutter.style.left=right+"px";fixBackground()}};if(b.engine=="ie"){w.attachEvent("onresize",resizeMove);w.attachEvent("onscroll",resizeMove)}else{w.addEventListener("resize",resizeMove,false);w.addEventListener("scroll",resizeMove,false)}}}mainDivObj.style.visibility="visible"}}mainDivObj.onclick=onclick_func;try{if(this.Preferences.Plugins.CardOnPage.enabled==true){var onPageCCdiv=db.appendChild(d.createElement("div"));onPageCCdiv.id=this.Preferences.Plugins.CardOnPage.div_id;var onPageCCiframe=onPageCCdiv.appendChild(d.createElement("iframe"));onPageCCiframe.id=this.Preferences.Plugins.CardOnPage.iframe_id;var W=(b.engine=="webkit")?w.innerWidth:(b.engine=="opera"?db.clientWidth:de.clientWidth);var H=(b.engine=="webkit")?w.innerHeight:(b.engine=="opera"?db.clientHeight:de.clientHeight);var wx=585,hy=400;onPageCCdiv.style.left=parseInt((W-wx)/2,10)+"px";onPageCCdiv.style.top=parseInt((H-hy)/2,10)+"px";if(b.engine=="ie"&&bVersion<7){onPageCCdiv.style.position="absolute"}}}catch(e){}return true};this.launchCC=function(){try{if(this.Cookie.matchurl(this.Metrics.core.referer,this.Preferences.Persistence.cookie_type)!=1){if(this.Preferences.Plugins.CardOnPage.enabled==true){document.getElementById(this.Preferences.Plugins.CardOnPage.iframe_id).src="https://secure.opinionlab.com/ccc01/comment_card.asp?"+(this.Preferences.Render.type=="asm"?"asm=1&":"")+"static=1&"+this.serialize(this.Metrics.core,0)+"&custom_var="+this.serialize(this.Metrics.custom,1);document.getElementById(this.Preferences.Plugins.CardOnPage.div_id).style.display="block"}else{OnlineOpinion.util.popup("https://secure.opinionlab.com/ccc01/comment_card.asp?"+(this.Preferences.Render.type=="asm"?"asm=1&":"")+this.serialize(this.Metrics.core,0)+"&custom_var="+this.serialize(this.Metrics.custom,1),"OnlineOpinion","resizable=yes,copyhistory=yes,scrollbars="+(this.Preferences.Render.type=="asm"?"yes":"no")+",location=no,status=no,fullscreen=no,width=545,height=200,top="+parseInt((this.Metrics.core.height-200)/2,10)+",left="+parseInt((this.Metrics.core.width-545)/2,10))}}}catch(e){OnlineOpinion.util.popup("https://secure.opinionlab.com/ccc01/comment_card.asp?"+(this.Preferences.Render.type=="asm"?"asm=1&":"")+this.serialize(this.Metrics.core,0)+"&custom_var="+this.serialize(this.Metrics.custom,1),"OnlineOpinion","resizable=yes,copyhistory=yes,scrollbars="+(this.Preferences.Render.type=="asm"?"yes":"no")+",location=no,status=no,fullscreen=no,width=545,height=200,top="+parseInt((this.Metrics.core.height-200)/2,10)+",left="+parseInt((this.Metrics.core.width-545)/2,10))}};this.show=function(){this.Metrics.core.time2=(new Date()).getTime();this.launchCC();if(this.Preferences.Persistence.enabled){document.getElementById(this.Preferences.Render.main_div_id).style.display="none"}if(this.Cookie!=null&&this.Preferences.Persistence.cookie_type!=null){this.Cookie.tagurl(this.Metrics.core.referer,this.Preferences.Persistence.cookie_type)}this.resetReferer()};this.resetReferer=function(alt_referer){var location=window.location.href;if(alt_referer){location=alt_referer}var rewriter=this.Preferences.Plugins.URLRewrite;if(rewriter&&rewriter.active==true){this.Metrics.core.referer=location.replace(rewriter.regex_search_pattern,rewriter.regex_replace_pattern)}else{this.Metrics.core.referer=location}};this.post=function(){this.Metrics.core.time2=(new Date()).getTime();var mainDivObj=document.getElementById(this.Preferences.Render.main_div_id);var JSONP=mainDivObj.appendChild(document.createElement("script"));var odata=this.serialize(this.Metrics.core,0)+"&custom_var="+this.serialize(this.Metrics.custom,1);var elements=document.forms[this.Preferences.Render.main_div_id+"_form"].elements;var formdata=[];for(idx=0;idx<elements.length;idx++){var curElement=elements[idx];try{var name=curElement.name;if(name!=undefined&&curElement.value!=undefined){switch(curElement.type){case"radio":if(curElement.checked){formdata.push(curElement.name+"="+encodeURIComponent(curElement.value))}break;case"checkbox":if(curElement.checked){formdata.push(curElement.name+"="+encodeURIComponent(curElement.value))}break;default:formdata.push(curElement.name+"="+encodeURIComponent(curElement.value))}}}catch(e){}}var cdata=formdata.join("&");var osignature=this.Cookie!=null?this.Cookie._MD4(odata):"";JSONP.src="https://secure.opinionlab.com/rate36s.asp?"+odata+"&"+cdata+"&signature="+osignature;if(this.Preferences.Persistence.enabled){var mainFormDiv=document.getElementById(this.Preferences.Render.main_div_id+"_form");mainFormDiv.style.display="none"}if(this.Preferences.Render.ty_html!=""){var TYDivObj=document.getElementById(this.Preferences.Render.ty_div_id);TYDivObj.innerHTML=this.Preferences.Render.ty_html;TYDivObj.style.display="block"}if(this.Cookie!=null&&this.Preferences.Persistence.cookie_type!=null){this.Cookie.tagurl(this.Metrics.core.referer,this.Preferences.Persistence.cookie_type)}this.resetReferer()}};var mboxCopyright="Copyright 1996-2009. Adobe Systems Incorporated. All rights reserved";mboxUrlBuilder=function(B,A){this.a=B;this.b=A;this.c=new Array();this.d=function(D){return D};this.f=null};mboxUrlBuilder.prototype.addParameter=function(G,F){var E=new RegExp("('|\")");if(E.exec(G)){throw"Parameter '"+G+"' contains invalid characters"}for(var D=0;D<this.c.length;D++){var B=this.c[D];if(B.name==G){B.value=F;return this}}var A=new Object();A.name=G;A.value=F;this.c[this.c.length]=A;return this};mboxUrlBuilder.prototype.addParameters=function(D){if(!D){return this}for(var B=0;B<D.length;B++){var A=D[B].indexOf("=");if(A==-1||A==0){continue}this.addParameter(D[B].substring(0,A),D[B].substring(A+1,D[B].length))}return this};mboxUrlBuilder.prototype.setServerType=function(A){this.o=A};mboxUrlBuilder.prototype.setBasePath=function(A){this.f=A};mboxUrlBuilder.prototype.setUrlProcessAction=function(A){this.d=A};mboxUrlBuilder.prototype.buildUrl=function(){var F=this.f?this.f:"/m2/"+this.b+"/mbox/"+this.o;var E=document.location.protocol=="file:"?"http:":document.location.protocol;var G=E+"//"+this.a+F;var D=G.indexOf("?")!=-1?"&":"?";for(var B=0;B<this.c.length;B++){var A=this.c[B];G+=D+encodeURIComponent(A.name)+"="+encodeURIComponent(A.value);D="&"}return this.t(this.d(G))};mboxUrlBuilder.prototype.getParameters=function(){return this.c};mboxUrlBuilder.prototype.setParameters=function(A){this.c=A};mboxUrlBuilder.prototype.clone=function(){var B=new mboxUrlBuilder(this.a,this.b);B.setServerType(this.o);B.setBasePath(this.f);B.setUrlProcessAction(this.d);for(var A=0;A<this.c.length;A++){B.addParameter(this.c[A].name,this.c[A].value)}return B};mboxUrlBuilder.prototype.t=function(A){return A.replace(/\"/g,"&quot;").replace(/>/g,"&gt;")};mboxStandardFetcher=function(){};mboxStandardFetcher.prototype.getType=function(){return"standard"};mboxStandardFetcher.prototype.fetch=function(A){A.setServerType(this.getType());document.write('<script src="'+A.buildUrl()+'" language="JavaScript"><\/script>')};mboxStandardFetcher.prototype.cancel=function(){};mboxAjaxFetcher=function(){};mboxAjaxFetcher.prototype.getType=function(){return"ajax"};mboxAjaxFetcher.prototype.fetch=function(A){A.setServerType(this.getType());var B=A.buildUrl();this.x=document.createElement("script");this.x.src=B;document.body.appendChild(this.x)};mboxAjaxFetcher.prototype.cancel=function(){};mboxMap=function(){this.y=new Object();this.z=new Array()};mboxMap.prototype.put=function(B,D){if(!this.y[B]){this.z[this.z.length]=B}this.y[B]=D};mboxMap.prototype.get=function(B){return this.y[B]};mboxMap.prototype.remove=function(B){this.y[B]=undefined};mboxMap.prototype.each=function(F){for(var D=0;D<this.z.length;D++){var B=this.z[D];var E=this.y[B];if(E){F(B,E)}}};mboxFactory=function(G,A,F){this.D=false;this.B=G;this.C=F;this.E=new mboxList();mboxFactories.put(F,this);this.F=typeof document.createElement("div").replaceChild!="undefined"&&(function(){return true})()&&typeof document.getElementById!="undefined"&&typeof(window.attachEvent||document.addEventListener||window.addEventListener)!="undefined"&&typeof encodeURIComponent!="undefined";this.G=this.F&&mboxGetPageParameter("mboxDisable")==null;var E=F=="default";this.I=new mboxCookieManager("mbox"+(E?"":("-"+F)),(function(){return mboxCookiePageDomain()})());this.G=this.G&&this.I.isEnabled()&&(this.I.getCookie("disable")==null);if(this.isAdmin()){this.enable()}this.J=mboxGenerateId();this.K=mboxScreenHeight();this.L=mboxScreenWidth();this.M=mboxBrowserWidth();this.N=mboxBrowserHeight();this.O=mboxScreenColorDepth();this.P=mboxBrowserTimeOffset();this.Q=new mboxSession(this.J,"mboxSession","session",31*60,this.I);this.R=new mboxPC("PC",2592000,this.I);this.w=new mboxUrlBuilder(G,A);this.S(this.w,E);this.T=new Date().getTime();this.U=this.T;var D=this;this.addOnLoad(function(){D.U=new Date().getTime()});if(this.F){this.addOnLoad(function(){D.D=true;D.getMboxes().each(function(B){B.setFetcher(new mboxAjaxFetcher());B.finalize()})});this.limitTraffic(100,10368000);if(this.G){this.X();this.Y=new mboxSignaler(function(B,H){return D.create(B,H)},this.I)}}};mboxFactory.prototype.isEnabled=function(){return this.G};mboxFactory.prototype.getDisableReason=function(){return this.I.getCookie("disable")};mboxFactory.prototype.isSupported=function(){return this.F};mboxFactory.prototype.disable=function(A,B){if(typeof A=="undefined"){A=60*60}if(typeof B=="undefined"){B="unspecified"}if(!this.isAdmin()){this.G=false;this.I.setCookie("disable",B,A)}};mboxFactory.prototype.enable=function(){this.G=true;this.I.deleteCookie("disable")};mboxFactory.prototype.isAdmin=function(){return document.location.href.indexOf("mboxEnv")!=-1};mboxFactory.prototype.limitTraffic=function(B,A){};mboxFactory.prototype.addOnLoad=function(A){if(window.addEventListener){window.addEventListener("load",A,false)}else{if(document.addEventListener){document.addEventListener("load",A,false)}else{if(document.attachEvent){window.attachEvent("onload",A)}}}};mboxFactory.prototype.getEllapsedTime=function(){return this.U-this.T};mboxFactory.prototype.getEllapsedTimeUntil=function(A){return A-this.T};mboxFactory.prototype.getMboxes=function(){return this.E};mboxFactory.prototype.get=function(B,A){return this.E.get(B).getById(A||0)};mboxFactory.prototype.update=function(A,B){if(!this.isEnabled()){return}if(this.E.get(A).length()==0){throw"Mbox "+A+" is not defined"}this.E.get(A).each(function(D){D.getUrlBuilder().addParameter("mboxPage",mboxGenerateId());D.load(B)})};mboxFactory.prototype.create=function(A,J,H){if(!this.isSupported()){return null}var I=this.w.clone();I.addParameter("mboxCount",this.E.length()+1);I.addParameters(J);var M=this.E.get(A).length();var E=this.C+"-"+A+"-"+M;var L;if(H){L=new mboxLocatorNode(H)}else{if(this.D){throw"The page has already been loaded, can't write marker"}L=new mboxLocatorDefault(E)}try{var D=this;var G="mboxImported-"+E;var B=new mbox(A,M,I,L,G);if(this.G){B.setFetcher(this.D?new mboxAjaxFetcher():new mboxStandardFetcher())}B.setOnError(function(O,P){B.setMessage(O);B.activate();if(!B.isActivated()){D.disable(60*60,O);window.location.reload(false)}});this.E.add(B)}catch(K){this.disable();throw'Failed creating mbox "'+A+'", the error was: '+K}var F=new Date();I.addParameter("mboxTime",F.getTime()-(F.getTimezoneOffset()*60000));return B};mboxFactory.prototype.getCookieManager=function(){return this.I};mboxFactory.prototype.getPageId=function(){return this.J};mboxFactory.prototype.getPCId=function(){return this.R};mboxFactory.prototype.getSessionId=function(){return this.Q};mboxFactory.prototype.getSignaler=function(){return this.Y};mboxFactory.prototype.getUrlBuilder=function(){return this.w};mboxFactory.prototype.S=function(B,A){B.addParameter("mboxHost",document.location.host).addParameter("mboxSession",this.Q.getId());if(!A){B.addParameter("mboxFactoryId",this.C)}if(this.R.getId()!=null){B.addParameter("mboxPC",this.R.getId())}B.addParameter("mboxPage",this.J);B.addParameter("screenHeight",this.K);B.addParameter("screenWidth",this.L);B.addParameter("browserWidth",this.M);B.addParameter("browserHeight",this.N);B.addParameter("browserTimeOffset",this.P);B.addParameter("colorDepth",this.O);B.setUrlProcessAction(function(E){E+="&mboxURL="+encodeURIComponent(document.location);var D=encodeURIComponent(document.referrer);if(E.length+D.length<2000){E+="&mboxReferrer="+D}E+="&mboxVersion="+mboxVersion;return E})};mboxFactory.prototype.mb=function(){return""};mboxFactory.prototype.X=function(){document.write("<style>.mboxDefault { visibility:hidden; }</style>")};mboxFactory.prototype.isDomLoaded=function(){return this.D};mboxSignaler=function(B,F){this.I=F;var D=F.getCookieNames("signal-");for(var E=0;E<D.length;E++){var G=D[E];var H=F.getCookie(G).split("&");var A=B(H[0],H);A.load();F.deleteCookie(G)}};mboxSignaler.prototype.signal=function(B,A){this.I.setCookie("signal-"+B,mboxShiftArray(arguments).join("&"),45*60)};mboxList=function(){this.E=new Array()};mboxList.prototype.add=function(A){if(A!=null){this.E[this.E.length]=A}};mboxList.prototype.get=function(D){var E=new mboxList();for(var B=0;B<this.E.length;B++){var A=this.E[B];if(A.getName()==D){E.add(A)}}return E};mboxList.prototype.getById=function(A){return this.E[A]};mboxList.prototype.length=function(){return this.E.length};mboxList.prototype.each=function(B){if(typeof B!="function"){throw"Action must be a function, was: "+typeof(B)}for(var A=0;A<this.E.length;A++){B(this.E[A])}};mboxLocatorDefault=function(A){this.g="mboxMarker-"+A;document.write('<div id="'+this.g+'" style="visibility:hidden;display:none">&nbsp;</div>')};mboxLocatorDefault.prototype.locate=function(){var A=document.getElementById(this.g);while(A!=null){if(A.nodeType==1){if(A.className=="mboxDefault"){return A}}A=A.previousSibling}return null};mboxLocatorDefault.prototype.force=function(){var A=document.createElement("div");A.className="mboxDefault";var B=document.getElementById(this.g);B.parentNode.insertBefore(A,B);return A};mboxLocatorNode=function(A){this.ub=A};mboxLocatorNode.prototype.locate=function(){return typeof this.ub=="string"?document.getElementById(this.ub):this.ub};mboxLocatorNode.prototype.force=function(){return null};mboxCreate=function(B){var A=mboxFactoryDefault.create(B,mboxShiftArray(arguments));if(A){A.load()}return A};mboxDefine=function(B,D){var A=mboxFactoryDefault.create(D,mboxShiftArray(mboxShiftArray(arguments)),B);return A};mboxUpdate=function(A){mboxFactoryDefault.update(A,mboxShiftArray(arguments))};mbox=function(E,A,B,D,F){this.Ab=null;this.Bb=0;this.gb=D;this.hb=F;this.Cb=null;this.Db=new mboxOfferContent();this.vb=null;this.w=B;this.message="";this.Eb=new Object();this.Fb=0;this.yb=A;this.g=E;this.Gb();B.addParameter("mbox",E).addParameter("mboxId",A);this.Hb=function(){};this.Ib=function(){};this.Jb=null};mbox.prototype.getId=function(){return this.yb};mbox.prototype.Gb=function(){if(this.g.length>250){throw"Mbox Name "+this.g+" exceeds max length of 250 characters."}else{if(this.g.match(/^\s+|\s+$/g)){throw"Mbox Name "+this.g+" has leading/trailing whitespace(s)."}}};mbox.prototype.getName=function(){return this.g};mbox.prototype.getParameters=function(){var D=this.w.getParameters();var B=new Array();for(var A=0;A<D.length;A++){if(D[A].name.indexOf("mbox")!=0){B[B.length]=D[A].name+"="+D[A].value}}return B};mbox.prototype.setOnLoad=function(A){this.Ib=A;return this};mbox.prototype.setMessage=function(A){this.message=A;return this};mbox.prototype.setOnError=function(A){this.Hb=A;return this};mbox.prototype.setFetcher=function(A){if(this.Cb){this.Cb.cancel()}this.Cb=A;return this};mbox.prototype.getFetcher=function(){return this.Cb};mbox.prototype.load=function(D){if(this.Cb==null){return this}this.setEventTime("load.start");this.cancelTimeout();this.Bb=0;var B=(D&&D.length>0)?this.w.clone().addParameters(D):this.w;this.Cb.fetch(B);var A=this;this.Lb=setTimeout(function(){A.Hb("browser timeout",A.Cb.getType())},15000);this.setEventTime("load.end");return this};mbox.prototype.loaded=function(){this.cancelTimeout();if(!this.activate()){var A=this;setTimeout(function(){A.loaded()},100)}};mbox.prototype.activate=function(){if(this.Bb){return this.Bb}this.setEventTime("activate"+(++this.Fb)+".start");if(this.show()){this.cancelTimeout();this.Bb=1}this.setEventTime("activate"+this.Fb+".end");return this.Bb};mbox.prototype.isActivated=function(){return this.Bb};mbox.prototype.setOffer=function(A){if(A&&A.show&&A.setOnLoad){this.Db=A}else{throw"Invalid offer"}return this};mbox.prototype.getOffer=function(){return this.Db};mbox.prototype.show=function(){this.setEventTime("show.start");var A=this.Db.show(this);this.setEventTime(A==1?"show.end.ok":"show.end");return A};mbox.prototype.showContent=function(A){if(A==null){return 0}if(this.vb==null||!this.vb.parentNode){this.vb=this.getDefaultDiv();if(this.vb==null){return 0}}if(this.vb!=A){this.Nb(this.vb);this.vb.parentNode.replaceChild(A,this.vb);this.vb=A}this.Ob(A);this.Ib();return 1};mbox.prototype.hide=function(){this.setEventTime("hide.start");var A=this.showContent(this.getDefaultDiv());this.setEventTime(A==1?"hide.end.ok":"hide.end.fail");return A};mbox.prototype.finalize=function(){this.setEventTime("finalize.start");this.cancelTimeout();if(this.getDefaultDiv()==null){if(this.gb.force()!=null){this.setMessage("No default content, an empty one has been added")}else{this.setMessage("Unable to locate mbox")}}if(!this.activate()){this.hide();this.setEventTime("finalize.end.hide")}this.setEventTime("finalize.end.ok")};mbox.prototype.cancelTimeout=function(){if(this.Lb){clearTimeout(this.Lb)}if(this.Cb!=null){this.Cb.cancel()}};mbox.prototype.getDiv=function(){return this.vb};mbox.prototype.getDefaultDiv=function(){if(this.Jb==null){this.Jb=this.gb.locate()}return this.Jb};mbox.prototype.setEventTime=function(A){this.Eb[A]=(new Date()).getTime()};mbox.prototype.getEventTimes=function(){return this.Eb};mbox.prototype.getImportName=function(){return this.hb};mbox.prototype.getURL=function(){return this.w.buildUrl()};mbox.prototype.getUrlBuilder=function(){return this.w};mbox.prototype.Qb=function(A){return A.style.display!="none"};mbox.prototype.Ob=function(A){this.Rb(A,true)};mbox.prototype.Nb=function(A){this.Rb(A,false)};mbox.prototype.Rb=function(B,A){B.style.visibility=A?"visible":"hidden";B.style.display=A?"block":"none"};mboxOfferContent=function(){this.Ib=function(){}};mboxOfferContent.prototype.show=function(A){var B=A.showContent(document.getElementById(A.getImportName()));if(B==1){this.Ib()}return B};mboxOfferContent.prototype.setOnLoad=function(A){this.Ib=A};mboxOfferAjax=function(A){this.Mb=A;this.Ib=function(){}};mboxOfferAjax.prototype.setOnLoad=function(A){this.Ib=A};mboxOfferAjax.prototype.show=function(A){var B=document.createElement("div");B.id=A.getImportName();B.innerHTML=this.Mb;var D=A.showContent(B);if(D==1){this.Ib()}return D};mboxOfferDefault=function(){this.Ib=function(){}};mboxOfferDefault.prototype.setOnLoad=function(A){this.Ib=A};mboxOfferDefault.prototype.show=function(A){var B=A.hide();if(B==1){this.Ib()}return B};mboxCookieManager=function mboxCookieManager(B,A){this.g=B;this.Ub=A==""||A.indexOf(".")==-1?"":"; domain="+A;this.Vb=new mboxMap();this.loadCookies()};mboxCookieManager.prototype.isEnabled=function(){this.setCookie("check","true",60);this.loadCookies();return this.getCookie("check")=="true"};mboxCookieManager.prototype.setCookie=function(D,B,A){if(typeof D!="undefined"&&typeof B!="undefined"&&typeof A!="undefined"){var E=new Object();E.name=D;E.value=escape(B);E.expireOn=Math.ceil(A+new Date().getTime()/1000);this.Vb.put(D,E);this.saveCookies()}};mboxCookieManager.prototype.getCookie=function(A){var B=this.Vb.get(A);return B?unescape(B.value):null};mboxCookieManager.prototype.deleteCookie=function(A){this.Vb.remove(A);this.saveCookies()};mboxCookieManager.prototype.getCookieNames=function(A){var B=new Array();this.Vb.each(function(D,E){if(D.indexOf(A)==0){B[B.length]=D}});return B};mboxCookieManager.prototype.saveCookies=function(){var B=new Array();var A=0;this.Vb.each(function(E,F){B[B.length]=E+"#"+F.value+"#"+F.expireOn;if(A<F.expireOn){A=F.expireOn}});var D=new Date(A*1000);document.cookie=this.g+"="+B.join("|")+"; expires="+D.toGMTString()+"; path=/"+this.Ub};mboxCookieManager.prototype.loadCookies=function(){this.Vb=new mboxMap();var F=document.cookie.indexOf(this.g+"=");if(F!=-1){var H=document.cookie.indexOf(";",F);if(H==-1){H=document.cookie.indexOf(",",F);if(H==-1){H=document.cookie.length}}var A=document.cookie.substring(F+this.g.length+1,H).split("|");var D=Math.ceil(new Date().getTime()/1000);for(var B=0;B<A.length;B++){var G=A[B].split("#");if(D<=G[2]){var E=new Object();E.name=G[0];E.value=G[1];E.expireOn=G[2];this.Vb.put(E.name,E)}}}};mboxSession=function(E,F,D,A,B){this.hc=F;this.pb=D;this.ic=A;this.I=B;this.jc=false;this.yb=typeof mboxForceSessionId!="undefined"?mboxForceSessionId:mboxGetPageParameter(this.hc);if(this.yb==null||this.yb.length==0){this.yb=B.getCookie(D);if(this.yb==null||this.yb.length==0){this.yb=E;this.jc=true}}B.setCookie(D,this.yb,A)};mboxSession.prototype.getId=function(){return this.yb};mboxSession.prototype.forceId=function(A){this.yb=A;this.I.setCookie(this.pb,this.yb,this.ic)};mboxPC=function(D,A,B){this.pb=D;this.ic=A;this.I=B;this.yb=typeof mboxForcePCId!="undefined"?mboxForcePCId:B.getCookie(D);if(this.yb!=null){B.setCookie(D,this.yb,A)}};mboxPC.prototype.getId=function(){return this.yb};mboxPC.prototype.forceId=function(A){if(this.yb!=A){this.yb=A;this.I.setCookie(this.pb,this.yb,this.ic);return true}return false};mboxGetPageParameter=function(B){var E=null;var A=new RegExp(B+"=([^&]*)");var D=A.exec(document.location);if(D!=null&&D.length>=2){E=D[1]}return E};mboxSetCookie=function(D,B,A){return mboxFactoryDefault.getCookieManager().setCookie(D,B,A)};mboxGetCookie=function(A){return mboxFactoryDefault.getCookieManager().getCookie(A)};mboxCookiePageDomain=function(){var B=(/([^:]*)(:[0-9]{0,5})?/).exec(document.location.host)[1];var D=/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/;if(!D.exec(B)){var A=(/([^\.]+\.[^\.]{3}|[^\.]+\.[^\.]+\.[^\.]{2})$/).exec(B);if(A){B=A[0]}}return B?B:""};mboxShiftArray=function(B){var D=new Array();for(var A=1;A<B.length;A++){D[D.length]=B[A]}return D};mboxGenerateId=function(){return(new Date()).getTime()+"-"+Math.floor(Math.random()*999999)};mboxScreenHeight=function(){return screen.height};mboxScreenWidth=function(){return screen.width};mboxBrowserWidth=function(){return(window.innerWidth)?window.innerWidth:document.documentElement?document.documentElement.clientWidth:document.body.clientWidth};mboxBrowserHeight=function(){return(window.innerHeight)?window.innerHeight:document.documentElement?document.documentElement.clientHeight:document.body.clientHeight};mboxBrowserTimeOffset=function(){return -new Date().getTimezoneOffset()};mboxScreenColorDepth=function(){return screen.pixelDepth};if(typeof mboxVersion=="undefined"){var mboxVersion=39;var mboxFactories=new mboxMap();var mboxFactoryDefault=new mboxFactory("orbitz.tt.omtrdc.net","orbitz","default")}if(mboxGetPageParameter("mboxDebug")!=null||mboxFactoryDefault.getCookieManager().getCookie("debug")!=null){setTimeout(function(){if(typeof mboxDebugLoaded=="undefined"){alert("Could not load the remote debug.\nPlease check your connection to Test&amp;Target servers")}},60*60);document.write('<script language="Javascript1.2" src="http://admin16.testandtarget.omniture.com/admin/mbox/mbox_debug.jsp?mboxServerHost=orbitz.tt.omtrdc.net&clientCode=orbitz"><\/script>')}var mboxUtils={cookieName:"myTests",getCookie:function(){var A=document.cookie.match("(^|;) ?"+this.cookieName+"=([^;]*)(;|$)");if(A){return decodeURIComponent(A[2]).split("|")}return null},checkMyTests:function(){var E=/:[1-9]+[0-9]*$/;var B=this.getCookie();for(var D=0,A=B.length;D<A;D++){if(B[D].search(E)!=-1){return true}}return false},updateMyTests:function(F,A){var J=28;var D=new Date();D.setTime(D.getTime()+(J*86400000));var E="expires="+D.toGMTString();var H=this.getCookie();var G=F+":";var B=A;for(var I=0,K=H.length;I<K;I++){if(H[I].indexOf(G)==0){H[I]=G+B;break}}document.cookie=this.cookieName+"="+H.join("|")+"; "+E+"; path=/"}};Abstract.Agent=Class.create();Abstract.Agent.prototype={initialize:function(B,D){if(typeof(B)=="object"){try{Profiler.start(D.type);log.debug(D.type+".initialize() *");if(!D.params){D.params={}}Object.extend(this,D);this.element=Element.extend(B);this.initExtend();Profiler.stop(D.type)}catch(A){Errors.capture(A,"Initialization failure : "+D.type,"Source element : "+B)}}},initializeChildren:function(){var self=this;this.childAgents=[];Page.childAgents[self.type].each(function(child,index){eval("new "+child.agent.type+"(child.element,self)");Page.childAgents[self.type][index]=null});Page.childAgents[self.type]=Page.childAgents[self.type].compact()},initExtend:function(){}};Abstract.ChildAgent=Class.create();Abstract.ChildAgent.prototype={initialize:function(D,A){if(typeof(D)=="object"){try{this.parent=A;this.element=Element.extend(D);this.agent=this.element.getAgents()[0];Object.extend(this,this.agent);Profiler.start(this.type);log.debug("child agent: "+this.agent.type+".initialize() *");this.initExtend.apply(this,arguments);A.childAgents.push(this);Profiler.stop(this.type)}catch(B){Errors.capture(B,"Initialization failure : "+this.agent.type,"Source element : "+D)}}},initExtend:function(){}};var Page={debug:false,prevNumTags:0,isDOMReady:false,onLoadFired:false,initializationComplete:false,initInterval:100,agents:[],childAgents:[],hideRevealRadios:[],deferredAdverts:{ads:[],newAd:function(A){this.ads.push(A)},uiAgentInitCompleteTrigger:function(){this.populate()},busy:false,populate:function(){if(Page.onLoadFired&&Page.initializationComplete){if(!this.busy){this.busy=true;var A=function(){var B=new Date();log.info("populating: "+this.ads.length+" deferred Adverts");while(this.ads.length>0){this.ads.pop().populate(B)}this.busy=false}.bind(this);window.setTimeout(A,0)}}}},init:function(){if(window.clientPerf){window.clientPerf.timestamp("jsRecd")}Profiler.start("Combined: Loading DOM + init");this.deferredAgents=[];this.domReadyAgents=[];var D=function(){if(!this.isDOMReady){try{this.initPage()}catch(E){var F="beforeDOMReady init: "+E.name+": "+E.message;if(E.lineNumber){F+="; line "+E.lineNumber}log.error(F)}window.setTimeout(D.bind(this),this.initInterval)}};var A=function(){try{this.initPage(true)}catch(E){var F="onDOMReady init: "+E.name+": "+E.message;if(E.lineNumber){F+="; line "+E.lineNumber}log.error(F)}Profiler.stop("Combined: Loading DOM + init")};var B=function(){if(window.clientPerf){window.clientPerf.timestamp("domReady")}this.isDOMReady=true;log.info("DOM Ready");setTimeout(A.bind(this),0)};Event.onDOMReady(B.bind(this));D.call(this)},initAgent:function(A,D){try{var B=new (this.locateAgentClass(D.type))(A,D);if(!this.agents[D.type]){this.agents[D.type]=[]}this.agents[D.type].push(B)}catch(E){log.error("Error trying to instantiate agent of type "+D.type+". Error: \n\n"+E)}},initializeAjaxResponse:function(A){var B=$(document.createElement("DIV"));B.innerHTML=A;Page.initializeDOMFragment(B)},locateAgentClass:function(F){try{var B=F.split(".");var D=window;for(var A=0;A<B.length;A++){D=D[B[A]]}}catch(E){return}return D},initedBeforeDOMReady:0,lastProcessed:null,initPage:function(E){Profiler.start("Page.init");if(!this.pageInitNum){this.pageInitNum=1}else{this.pageInitNum++}var A=0;var K=0;var D=0;var I=$A();var O=$A();if(!this.prevNotReady){this.prevNotReady=$A()}var P=document.getElementsByTagName("*");var H=P.length;if(H>this.prevNumTags||E){for(var S=0;S<H;S++){var X=P[S];if(X.getAttribute("agent")){X=$(X);if(X.isDOMReady()){O.push(X)}else{I.push(X)}}}var F=$A();var L=false;for(var S=0;S<O.length;S++){var X=O[S];var W=X.tagName;if(this.prevNotReady.include(X)){F.push(X)}else{if(this.lastProcessed){if(L){F.push(X)}else{if(X===this.lastProcessed){L=true}K++}}else{F.push(X)}}if(S+1==O.length){this.lastProcessed=X}}var J=F.length;for(var S=0;S<J;S++){var M=F[S];var G=M.getAgents();if(G){if(window.clientPerf&&window.clientPerf.agentsNotStarted){window.clientPerf.timestamp("agentsStart")}var T=G.length;for(var Q=0;Q<T;Q++){var B=G[Q];var V=this.locateAgentClass(B.type);if(!Object.isString(B.type)){log.error("Agent type is not a string for "+M.inspect().escapeHTML()+". Missing quotes in SystemText popup?")}else{if(!V){log.error("Agent '"+B.type+"' does not exist. Element: "+M.inspect().escapeHTML())}else{var U=V.prototype.beforeDOMReady;if(B.deferred=="true"){D++;this.deferredAgents.push({element:M,agent:B})}else{if(B.childOf){D++;if(!this.childAgents[B.childOf]){this.childAgents[B.childOf]=[]}this.childAgents[B.childOf].push({element:M,agent:B})}else{if(!U&&B.lazy!="true"){D++;this.domReadyAgents.push({element:M,agent:B})}else{if(B.lazy!="true"){A++;this.initAgent(M,B)}}}}}}}}else{log.error("Could not retrieve agents for "+M.inspect().escapeHTML())}}this.initedBeforeDOMReady=this.initedBeforeDOMReady+A;if(E){this.pageInitNum=this.pageInitNum.toString()+" [final DOMReady initPage]"}log.info("Page.initPage() run: "+this.pageInitNum);if(E){if(window.clientPerf&&window.clientPerf.agentsNotStarted){window.clientPerf.timestamp("agentsStart")}for(var S=0;S<this.domReadyAgents.length;S++){this.initAgent(this.domReadyAgents[S].element,this.domReadyAgents[S].agent)}for(var S=0;S<this.deferredAgents.length;S++){this.initAgent(this.deferredAgents[S].element,this.deferredAgents[S].agent)}this.initializationComplete=true;if(window.clientPerf){window.clientPerf.timestamp("agentsFinish")}this.deferredAdverts.uiAgentInitCompleteTrigger();delete this.deferredAgents;delete this.domReadyAgents}this.prevNumTags=H;this.prevNotReady=I}else{log.info("Page.initPage() run: "+this.pageInitNum+" [no new elements]")}Profiler.stop("Page.init")},initializeDOMFragment:function(E,L){Profiler.start("DOMFragment.init");E=Element.extend(E);var B=E.getElementsByAttribute("agent");if(L&&E.getAttribute("agent")){B.unshift(E)}var D=[];var K=$A();for(var I=0;B[I];I++){var M=B[I];var J=M.getAgents();for(var H=0;J[H];H++){var G=J[H];var A=this.locateAgentClass(G.type);if(!Object.isString(G.type)){log.error("Agent type is not a string for "+M.inspect().escapeHTML()+". Missing quotes in SystemText popup?")}else{if(!A){log.error("Agent '"+G.type+"' does not exist. Element: "+M.inspect().escapeHTML())}else{if(G.deferred=="true"){D.push({element:M,agent:G})}else{if(G.childOf!=""&&G.childOf!=undefined){if(this.childAgents[G.childOf]==null){this.childAgents[G.childOf]=[]}this.childAgents[G.childOf].push({element:M,agent:G})}else{if(G.lazy!="true"){this.initAgent(M,G)}}}}}}}for(var F=0;D[F];F++){this.initAgent(D[F].element,D[F].agent)}Page.deferredAdverts.populate();Profiler.stop("DOMFragment.init")}};Event.observe(window,"load",function(){Page.onLoadFired=true;Page.deferredAdverts.populate()});function dcsCookie(){if(typeof(dcsOther)=="function"){dcsOther()}else{if(typeof(dcsPlugin)=="function"){dcsPlugin()}else{if(typeof(dcsFPC)=="function"){dcsFPC(gTimeZone)}}}}function dcsGetCookie(B){var E=document.cookie.indexOf(B+"=");if(E!=-1){var D=E+B.length+1;var A=document.cookie.indexOf(";",D);if(A==-1){A=document.cookie.length}return unescape(document.cookie.substring(D,A))}return null}function dcsGetCrumb(B,A){var E=dcsGetCookie(B).split(":");for(var D=0;D<E.length;D++){var F=E[D].split("=");if(A==F[0]){return F[1]}}return null}function dcsGetIdCrumb(D,A){var B=dcsGetCookie(D);var G=B.substring(0,B.indexOf(":lv="));var F=G.split("=");for(var E=0;E<F.length;E++){if(A==F[0]){return F[1]}}return null}function dcsFPC(F){if(typeof(F)=="undefined"){return}if(document.cookie.indexOf("WTLOPTOUT=")!=-1){return}var A=gFpc;var K=new Date();var J=(K.getTimezoneOffset()*60000)+(F*3600000);K.setTime(K.getTime()+J);var E=new Date(K.getTime()+315360000000);var L=new Date(K.getTime());if(document.cookie.indexOf(A+"=")==-1){if((typeof(gWtId)!="undefined")&&(gWtId!="")){WT.co_f=gWtId}else{if((typeof(gTempWtId)!="undefined")&&(gTempWtId!="")){WT.co_f=gTempWtId;WT.vt_f="1"}else{WT.co_f="2";var M=K.getTime().toString();for(var H=2;H<=(32-M.length);H++){WT.co_f+=Math.floor(Math.random()*16).toString(16)}WT.co_f+=M;WT.vt_f="1"}}if(typeof(gWtAccountRollup)=="undefined"){WT.vt_f_a="1"}WT.vt_f_s="1";WT.vt_f_d="1";WT.vt_f_tlh=WT.vt_f_tlv="0"}else{var B=dcsGetIdCrumb(A,"id");var D=parseInt(dcsGetCrumb(A,"lv"));var O=parseInt(dcsGetCrumb(A,"ss"));if((B==null)||(B=="null")||isNaN(D)||isNaN(O)){return}WT.co_f=B;var G=new Date(D);WT.vt_f_tlh=Math.floor((G.getTime()-J)/1000);L.setTime(O);if((K.getTime()>(G.getTime()+1800000))||(K.getTime()>(L.getTime()+28800000))){WT.vt_f_tlv=Math.floor((L.getTime()-J)/1000);L.setTime(K.getTime());WT.vt_f_s="1"}if((K.getDay()!=G.getDay())||(K.getMonth()!=G.getMonth())||(K.getYear()!=G.getYear())){WT.vt_f_d="1"}}WT.co_f=escape(WT.co_f);WT.vt_sid=WT.co_f+"."+(L.getTime()-J);DCSext.wsid=getSessionID("logging")||getSessionID("JSESSIONID");if(document.cookie.indexOf("anon")!=-1){DCSext.avid=dcsGetCookie("anon")}var I="; expires="+E.toGMTString();document.cookie=A+"=id="+WT.co_f+":lv="+K.getTime().toString()+":ss="+L.getTime().toString()+I+"; path=/"+(((typeof(gFpcDom)!="undefined")&&(gFpcDom!=""))?("; domain="+gFpcDom):(""));if(document.cookie.indexOf(A+"=")==-1){WT.co_f=WT.vt_sid=WT.vt_f_s=WT.vt_f_d=WT.vt_f_tlh=WT.vt_f_tlv="";WT.vt_f=WT.vt_f_a="2"}}function dcsEvt(B,A){var D=B.target||B.srcElement;while(D.tagName&&(D.tagName!=A)){D=D.parentElement||D.parentNode}return D}function dcsBind(B,A){if((typeof(window[A])=="function")&&document.body){if(document.body.addEventListener){document.body.addEventListener(B,window[A],true)}else{if(document.body.attachEvent){document.body.attachEvent("on"+B,window[A])}}}}function dcsET(){var A=(navigator.appVersion.indexOf("MSIE")!=-1)?"click":"mousedown";dcsBind(A,"dcsDownload");dcsBind(A,"dcsFormButton");dcsBind("keypress","dcsFormButton");dcsBind(A,"dcsImageMap")}function dcsMultiTrack(){if(arguments.length%2==0){for(var B=0;B<arguments.length;B+=2){if(arguments[B].indexOf("WT.")==0){WT[arguments[B].substring(3)]=arguments[B+1]}else{if(arguments[B].indexOf("DCS.")==0){DCS[arguments[B].substring(4)]=arguments[B+1]}else{if(arguments[B].indexOf("DCSext.")==0){DCSext[arguments[B].substring(7)]=arguments[B+1]}}}}var A=new Date();DCS.dcsdat=A.getTime();dcsFunc("dcsCookie");dcsTag()}}function dcsSetVar(){if((arguments.length%2==0)&&(navigator.appVersion.indexOf("MSIE")!=-1)){for(var A=0;A<arguments.length;A+=2){if(arguments[A].indexOf("WT.")==0){WT[arguments[A].substring(3)]=arguments[A+1]}else{if(arguments[A].indexOf("DCS.")==0){DCS[arguments[A].substring(4)]=arguments[A+1]}else{if(arguments[A].indexOf("DCSext.")==0){DCSext[arguments[A].substring(7)]=arguments[A+1]}}}}}}function dcsSetVarCap(E){var G=E.onclick.toString();var B=G.substring(G.indexOf("dcsSetVar(")+10,G.length);var D=B.substring(0,B.indexOf(");")).replace(/\s"/gi,"").replace(/"/gi,"");var F=D.split(",");if(F.length!=-1){for(var A=0;A<F.length;A+=2){if(F[A].indexOf("WT.")==0){WT[F[A].substring(3)]=F[A+1]}else{if(F[A].indexOf("DCS.")==0){DCS[F[A].substring(4)]=F[A+1]}else{if(F[A].indexOf("DCSext.")==0){DCSext[F[A].substring(7)]=F[A+1]}}}}}}function dcsNavigation(D){try{var B=0;while(B!=1){if(D.parentNode.tagName!="DIV"){D=D.parentNode}if(D.parentNode.tagName=="DIV"){if((D.parentNode.getAttribute("id"))||(D.parentNode.className)){DCSext.wtNav=D.parentNode.getAttribute("id")||D.parentNode.className;B=1}else{D=D.parentNode}}}}catch(A){}}function dcsDownload(A){A=A||(window.event||"");if(A){var E=dcsEvt(A,"A");if(E){if(E.href&&E.hostname&&E.protocol&&(E.protocol.indexOf("http")!=-1)){if(E.getAttribute("delegatedtracking")=="true"){}else{dcsNavigation(E);if((navigator.appVersion.indexOf("MSIE")==-1)&&(E.onclick)){dcsSetVarCap(E)}var D=E.pathname?((E.pathname.indexOf("/")!=0)?"/"+E.pathname:E.pathname):"/";if(document.all){var B=E.innerText||E.innerHTML||""}else{var B=E.textContent||E.innerHTML||""}dcsMultiTrack("DCS.dcssip",E.hostname,"DCS.dcsuri",D,"DCS.dcsqry",E.search||"","WT.ti","Link:"+B,"WT.dl","1","WT.ad","","WT.mc_id","","WT.sp","");DCS.dcssip=DCS.dcsuri=DCS.dcsqry=WT.ti=WT.dl=B=D=""}}}}}function dcsImageMap(A){A=A||(window.event||"");if(A){var B=dcsEvt(A,"AREA");if(B){if(B.href&&B.hostname&&B.protocol&&(B.protocol.indexOf("http")!=-1)){dcsNavigation(B);var D=B.pathname?((B.pathname.indexOf("/")!=0)?"/"+B.pathname:B.pathname):"/";dcsMultiTrack("DCS.dcssip",B.hostname,"DCS.dcsuri",D,"DCS.dcsqry",B.search||"","WT.ti","Link:Image Map","WT.dl","1","WT.ad","","WT.mc_id","","WT.sp","");DCS.dcssip=DCS.dcsuri=DCS.dcsqry=WT.ti=WT.dl=""}}}}function dcsFormButton(I){I=I||(window.event||"");if(I){var J="INPUT,BUTTON,SPAN";var H=J.toUpperCase().split(",");for(var B=0;B<H.length;B++){var E=dcsEvt(I,H[B]);var G=E.type||"";if(G&&((G=="submit")||(G=="image")||(G=="button")||(G=="reset"))||((G=="text")&&((I.which||I.keyCode)==13))){var A=gTitle=gMethod=qry="";dcsNavigation(E);if(E.form){A=E.form.action||window.location.pathname;gTitle=E.form.id||E.form.className||E.form.name||"Unknown";gMethod=E.form.method||"Unknown"}else{A=window.location.pathname;gTitle=E.name||E.id||E.className||"Unknown";gMethod="Input"}if((A!="")&&(gTitle!="")&&(gMethod!="")&&(I.keyCode!=9)){if(A.indexOf("?")!=-1){var D=A.split("?");A=D[0];qry=D[1]}if(A.indexOf("http://")!=-1||A.indexOf("https://")!=-1){var F=A.substr(7).split("/");A="";for(var B=1;B<F.length;B++){A+="/"+F[B]}}dcsMultiTrack("DCS.dcssip",E.hostname||window.location.host||"","DCS.dcsuri",A,"DCS.dcsqry",qry,"WT.ti","FormButton:"+gTitle,"WT.dl","2","WT.fm",gMethod,"WT.ad","","WT.mc_id","","WT.sp","")}DCS.dcsuri=DCS.dcsqry=qry=WT.ti=WT.dl=WT.fm=""}}}}function dcsAdSearch(){if(document.links){for(var D=0;D<document.links.length;D++){var A=document.links[D].href+"";var G=A.toUpperCase().indexOf("WT.AC=");if(G!=-1){var F=G+6;var B=A.indexOf("&",F);var E=A.substring(F,(B!=-1)?B:A.length);WT.ad=WT.ad?(WT.ad+";"+E):E}}}}function dcsCleanUp(){_DCS=new Object();_WT=new Object();_DCSext=new Object();_WT.co_f=WT.co_f;_WT.vt_sid=WT.vt_sid;_WT.Site=WT.Site;_DCSext.hostname=DCSext.hostname;_DCSext.pos=DCSext.pos;_DCSext.b=DCSext.b;_DCSext.wtEvtSrc=DCSext.wtEvtSrc;_DCSext.owwPage=DCSext.owwPage;if(arguments.length%2==0){for(var A=0;A<arguments.length;A+=2){if(arguments[A].indexOf("WT.")==0){_WT[arguments[A].substring(3)]=arguments[A+1]}else{if(arguments[A].indexOf("DCS.")==0){_DCS[arguments[A].substring(4)]=arguments[A+1]}else{if(arguments[A].indexOf("DCSext.")==0){_DCSext[arguments[A].substring(7)]=arguments[A+1]}}}}}DCS=_DCS;WT=_WT;DCSext=_DCSext}function dcsAdv(){if((typeof(gTrackEvents)!="undefined")&&gTrackEvents){WT.wtsv=1;if(typeof(WT.sp)!="undefined"){WT.sv_sp=WT.sp}}dcsFunc("dcsCookie");dcsFunc("dcsAdSearch");var B=document.getElementsByName("WT.ti");for(var A=0;A<B.length;A++){if(B[A].tagName==="META"){DCSext.wtEvtSrc=B[A].content;break}}}function dcsVar(){var B=new Date();DCSext.hostname=window.location.hostname;WT.Site=DCSext.hostname;WT.tz=B.getTimezoneOffset()/60*-1;if(WT.tz==0){WT.tz="0"}WT.bh=B.getHours();WT.ul=navigator.appName=="Netscape"?navigator.language:navigator.userLanguage;if(typeof(screen)=="object"){WT.cd=navigator.appName=="Netscape"?screen.pixelDepth:screen.colorDepth;WT.sr=screen.width+"x"+screen.height}if(typeof(navigator.javaEnabled())=="boolean"){WT.jo=navigator.javaEnabled()?"Yes":"No"}if(document.title){WT.ti=gI18n?dcsEscape(dcsEncode(document.title),I18NRE):document.title}WT.js="Yes";WT.jv=dcsJV();if(document.body&&document.body.addBehavior){document.body.addBehavior("#default#clientCaps");if(document.body.connectionType){WT.ct=document.body.connectionType}document.body.addBehavior("#default#homePage");WT.hp=document.body.isHomePage(location.href)?"1":"0"}if(parseInt(navigator.appVersion)>3){if((navigator.appName=="Microsoft Internet Explorer")&&document.body){WT.bs=document.body.offsetWidth+"x"+document.body.offsetHeight}else{if(navigator.appName=="Netscape"){WT.bs=window.innerWidth+"x"+window.innerHeight}}}WT.fi="No";if(window.ActiveXObject){for(var F=10;F>0;F--){try{var E=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+F);WT.fi="Yes";WT.fv=F+".0";break}catch(H){}}}else{if(navigator.plugins&&navigator.plugins.length){for(var F=0;F<navigator.plugins.length;F++){if(navigator.plugins[F].name.indexOf("Shockwave Flash")!=-1){WT.fi="Yes";WT.fv=navigator.plugins[F].description.split(" ")[2];break}}}}if(gI18n){WT.em=(typeof(encodeURIComponent)=="function")?"uri":"esc";if(typeof(document.defaultCharset)=="string"){WT.le=document.defaultCharset}else{if(typeof(document.characterSet)=="string"){WT.le=document.characterSet}}}WT.dl="0";DCS.dcsdat=B.getTime();DCS.dcssip=window.location.hostname;DCS.dcsuri=window.location.pathname;DCSext.owwPage=window.location.pathname;if(window.location.search){DCS.dcsqry=window.location.search;if(gQP.length>0){for(var F=0;F<gQP.length;F++){var I=DCS.dcsqry.indexOf(gQP[F]);if(I!=-1){var G=DCS.dcsqry.substring(0,I);var A=DCS.dcsqry.substring(I+gQP[F].length,DCS.dcsqry.length);DCS.dcsqry=G+A}}}}if((window.document.referrer!="")&&(window.document.referrer!="-")){var D=window.document.referrer;if(D.split("?")[0].indexOf(window.location.hostname)!=-1){D=D.split("?")[0]}if(!(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)<4)){DCS.dcsref=gI18n?dcsEscape(D,I18NRE):D}}}function dcsA(B,A){return"&"+B+"="+dcsEscape(A,RE)}function dcsEscape(A,B){if(typeof(B)!="undefined"){var D=new String(A);for(R in B){D=D.replace(B[R],R)}return D}else{return escape(A)}}function dcsEncode(A){return(typeof(encodeURIComponent)=="function")?encodeURIComponent(A):escape(A)}function dcsCreateImage(A){if(document.images){gImages[gIndex]=new Image;gImages[gIndex].src=A;gIndex++}else{document.write('<IMG ALT="" BORDER="0" NAME="DCSIMG" WIDTH="1" HEIGHT="1" SRC="'+A+'">')}}function dcsMeta(){var A;if(document.all){A=document.all.tags("meta")}else{if(document.documentElement){A=document.getElementsByTagName("meta")}}if(typeof(A)!="undefined"){for(var B=1;B<=A.length;B++){var D=A.item(B-1);if(D.name){if(D.name.indexOf("WT.")==0){WT[D.name.substring(3)]=(gI18n&&(D.name.indexOf("WT.ti")==0))?dcsEscape(dcsEncode(D.content),I18NRE):D.content}else{if(D.name.indexOf("DCSext.")==0){DCSext[D.name.substring(7)]=D.content}else{if(D.name.indexOf("DCS.")==0){DCS[D.name.substring(4)]=(gI18n&&(D.name.indexOf("DCS.dcsref")==0))?dcsEscape(D.content,I18NRE):D.content}}}}}}}function dcsTag(){if(document.cookie.indexOf("WTLOPTOUT=")!=-1){return}var A="http"+(window.location.protocol.indexOf("https:")==0?"s":"")+"://"+gDomain+(gDcsId==""?"":"/"+gDcsId)+"/dcs.gif?";for(N in WT){if(WT[N]){A+=dcsA("WT."+N,WT[N])}}for(N in DCSext){if(DCSext[N]){A+=dcsA(N,DCSext[N])}}for(N in DCS){if(DCS[N]){A+=dcsA(N,DCS[N])}}if(A.length>2048&&navigator.userAgent.indexOf("MSIE")>=0){A=A.substring(0,2040)+"&WT.tu=1"}dcsCreateImage(A)}function dcsJV(){var B=navigator.userAgent.toLowerCase();var J=parseInt(navigator.appVersion);var I=(B.indexOf("mac")!=-1);var O=((B.indexOf("mozilla")!=-1)&&(B.indexOf("compatible")==-1));var D=(O&&(J==4));var M=(O&&(J>=5));var A=((B.indexOf("msie")!=-1)&&(B.indexOf("opera")==-1));var E=(A&&(J==4)&&(B.indexOf("msie 4")!=-1));var F=(A&&!E);var H=(B.indexOf("opera")!=-1);var L=(B.indexOf("opera 5")!=-1||B.indexOf("opera/5")!=-1);var K=(B.indexOf("opera 6")!=-1||B.indexOf("opera/6")!=-1);var G=(H&&!L&&!K);var P="1.1";if(M||G){P="1.5"}else{if((I&&F)||K){P="1.4"}else{if(F||D||L){P="1.3"}else{if(E){P="1.2"}}}}return P}function dcsFunc(A){if(typeof(window[A])=="function"){window[A]()}}function wtInit(){gService=true;gTimeZone=-6;hostName=window.location.hostname;indexOfDot=hostName.indexOf(".");lengthOfHostName=hostName.length;if(indexOfDot==-1){gFpcDom=hostName}else{gFpcDom=hostName.slice(indexOfDot,lengthOfHostName)}gImages=new Array;gIndex=0;DCS=new Object();WT=new Object();DCSext=new Object();gQP=new Array();gI18n=false;if(window.RegExp){RE={"%09":/\t/g,"%20":/ /g,"%23":/\#/g,"%26":/\&/g,"%2B":/\+/g,"%3F":/\?/g,"%5C":/\\/g};I18NRE={"%25":/\%/g}}dcsVar();dcsMeta();if((typeof(gTrackEvents)!="undefined")&&gTrackEvents){dcsET()}dcsFunc("dcsAdv");dcsTag();dcsCleanUp()}function getSessionID(F){var D=document.cookie;var B=D.lastIndexOf(F+"=");if(B==-1){return null}var E=D.substring(B+F.length+1);var A=E.indexOf(";");if(A==-1){A=E.length}E=E.substring(0,A);E=E.split("|")[0];return E}var AirResultsCard=Class.create();AirResultsCard.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:false,initExtend:function(){if(!this.params.swapLink){log.error("AirResultsCard: Missing required param");return}this.element.observe("click",this.swap.bindAsEventListener(this))},swap:function(B){if(this.swapped===undefined){this.link=$(this.element.getElementsByTagName("A")[0]);this.swapLink=(new Element("div")).update(this.params.swapLink).down();this.swapLink.addClassName("hideLink hidden");this.link.insert({after:this.swapLink});this.link.addClassName("visible");this.content=$(this.element.up(".resultsCardPanelAir").getElementsByClassName("airItinerary")[0].getElementsByClassName("summary")[0]);this.url=this.swapLink.href;var A=new Ajax.Request(this.url,{method:"get",onSuccess:function(F){var G=$((new Element("div")).update(F.responseText).getElementsByClassName("details")[0]);if(G){this.swapContent.replace(G);this.pi.stop();this.pi=null;this.swapContent=G;new Effect.Morph(this.itinerary,{style:"height: "+this.swapContent.getHeight()+"px",duration:0.3,afterFinish:function(){this.itinerary.setStyle({height:"",overflow:""})}.bind(this)})}else{var I=$A((new Element("div")).update(F.responseText).getElementsByClassName("error"));if(I.length!=0){var H=this.swapContent.up(".resultsCardPanelAir");H.setStyle({position:"relative"});var D=new Element("div",{"class":"resultMask"});D.setOpacity(0.8);D.setStyle({width:H.getWidth()+"px",height:H.getHeight()+"px",top:"0px"});var E=$(new Element("div"));E.addClassName("airResultsError");I.each(function(J){E.insert({bottom:J})});H.insert({bottom:D});H.insert({bottom:E});E.setStyle({width:H.getWidth()+"px",marginTop:(((H.getHeight()-E.getHeight())/2))+"px",top:"0px"})}else{log.error("No flight details content and no errors were found. Returning summary.");this.swapLink.hideByClass();this.link.showByClass();this.element.stopObserving("click")}this.swapContent.replace(this.content);this.pi.stop();this.pi=null}}.bind(this)});this.itinerary=this.content.up(".airItinerary");this.itinerary.setStyle({height:this.itinerary.getHeight()+"px",overflow:"hidden"});this.pi=(new ProgressIndicatorAgent(this.itinerary,{type:"ProgressIndicatorAgent"})).pi;this.swapContent=this.pi.container}if(this.swapped){this.swapLink.hideByClass();this.link.showByClass();if(this.swapContent){this.swapContent.replace(this.content)}}else{this.link.hideByClass();this.swapLink.showByClass();if(this.swapContent){this.content.replace(this.swapContent)}}this.swapped=!this.swapped;B.preventDefault()}});var DatePickerWidget=Class.create();DatePickerWidget.prototype={initialize:function(A,E,D,B){log.info("initializing DatePickerWidget for input "+D);this.initialized=false;this.dateInputObj=A;this.selectedDate=B;this.today=this.dateInputObj.today;this.minDate=this.cloneDateObject(this.today);this.maxDate=this.dateInputObj.maxDate;this.isFirstDate=D===0;this.dateInputIndex=D;this.params=this.dateInputObj.params;this.daysPerMonth=[31,28,31,30,31,30,31,31,30,31,30,31];this.target=$(E);this.container=$(E.parentNode);this.buildMarkup();document.observe("datePicker:updated",this.updateSelects.bindAsEventListener(this));document.observe("calendar:selectDate",this.updateSelectsFromCalendar.bindAsEventListener(this));document.observe("calendar:hidden",function(){$("content").show();$$("div.pageHeader")[0].show()})},buildMarkup:function(){var A=new Element("div");this.monthSelect=new Element("select").addClassName("datePicker");this.updateMonths();this.dateSelect=new Element("select").addClassName("datePicker");this.updateDays();Event.observe(this.monthSelect,"change",this.updateDays.bindAsEventListener(this));Event.observe(this.monthSelect,"change",this.setDate.bindAsEventListener(this));Event.observe(this.dateSelect,"change",this.setDate.bindAsEventListener(this));var B=new Element("a").addClassName("calIcon").update(this.params.calendarImage);Event.observe(B,"click",this.showCalendar.bindAsEventListener(this));this.target.hide();A.appendChild(this.monthSelect);A.appendChild(this.dateSelect);A.appendChild(B);this.container.appendChild(A);this.setDate()},showCalendar:function(A){if(!window.calendarWidget){window.calendarWidget=new CalendarWidget(this.today,this.params)}$("content").hide();$$("div.pageHeader")[0].hide();document.fire("calendar:showAndPosition",{rootEvent:A,dateInputObj:this.dateInputObj,minDate:this.minDate,maxDate:this.maxDate,targetInput:this.target})},updateMonths:function(){var E,B=this.isFirstDate?this.cloneDateObject(this.today):this.cloneDateObject(this.dateInputObj.validateDate(this.dateInputObj.dateInputArray[this.dateInputIndex-1].value));if(this.selectedDate!=null){E=this.selectedDate.getMonth()}this.minDate=this.cloneDateObject(B);this.monthSelect.innerHTML="";B.setDate(1);while(B<=this.maxDate){var F=B.getMonth();var D=B.getFullYear();var A=new Element("option").update(this.params.abbrMonths[F]+" "+D);A.setAttribute("value","["+F+","+D+"]");if(F==E){A.setAttribute("selected","selected")}this.monthSelect.appendChild(A);B.setMonth((F+1))}},updateDays:function(){var monthSelectValue=eval(this.monthSelect.options[this.monthSelect.selectedIndex].value);var month=monthSelectValue[0],year=monthSelectValue[1],selectedDay,startDate=this.minDate,day=startDate.getMonth()===month?startDate.getDate():1;this.dateSelect.innerHTML="";if(this.selectedDate!=null){selectedDay=this.selectedDate.getDate()}var operatingDate=new Date(year,month,day,0,0,0);for(var i=day;i<=this.daysPerMonth[month];i++){var option=new Element("option");option.setAttribute("value",i);operatingDate.setDate(i);var dayOfWeek=operatingDate.getDay();option.update(i+" "+this.params.abbrDays[dayOfWeek]);if(i===selectedDay||(!this.isFirstDate&&!this.initialized&&i===day+1)){option.setAttribute("selected","selected");this.initialized=true}this.dateSelect.appendChild(option)}},setDate:function(){var monthSelectValue=eval(this.monthSelect.options[this.monthSelect.selectedIndex].value);var daySelectValue=this.dateSelect.options[this.dateSelect.selectedIndex].value;var date=(monthSelectValue[0])+"_"+daySelectValue+"_"+monthSelectValue[1];document.fire("calendar:selectDate",{eventElement:this.target,selectedDate:date});document.fire("datePicker:updated",{updatedIndex:this.dateInputIndex})},updateSelects:function(A){if(A.memo.updatedIndex<this.dateInputIndex){this.updateMonths();this.updateDays();this.setDate()}},updateSelectsFromCalendar:function(B){$("content").show();if(B.memo.eventElement==this.target){var A=this.dateInputObj.validateDate(this.dateInputObj.formatDateString(B.memo.selectedDate));this.selectedDate=A;this.updateMonths();this.updateDays();document.fire("datePicker:updated",{updatedIndex:this.dateInputIndex})}},cloneDateObject:function(A){return new Date(A.getFullYear(),A.getMonth(),A.getDate())}};var CalendarWidget=Class.create();CalendarWidget.prototype={initialize:function(A,B){log.info("initializing CalendarWidget");this.today=A;this.NUM_WEEKS=6;this.daysPerMonth=[31,28,31,30,31,30,31,31,30,31,30,31];this.X_OFFSET=60;this.Y_OFFSET=-82;this.params=B;this.days=this.buildMarkupWithObservers();this.repositionAndShim();document.observe("calendar:showAndPosition",this.showAndPosition.bindAsEventListener(this));document.observe("calendar:hide",this.hideCalendar.bindAsEventListener(this))},buildMarkupWithObservers:function(){if(this.element=$("calendarWidget")){return}this.element=new Element("div").addClassName("calendar noneBlock");this.element.setAttribute("data-context","calendar");this.element.setAttribute("id","calendarWidget");this.calBody=new Element("div").addClassName("calendarBody");this.element.appendChild(this.calBody);Event.observe(this.calBody,("ontouchstart" in document)?"click":"mousedown",this.setCalendarFocus.bindAsEventListener(this));var Q=$A();var G=document.createDocumentFragment();var S=new Element("table",{cellpadding:0,cellspacing:0,border:0});var A=document.createDocumentFragment();this.previousArrow=new Element("span").addClassName("arrow arrowPrev visible").update(this.params.previous);this.nextArrow=new Element("span").addClassName("arrow arrowNext visible").update(this.params.next);A.appendChild(this.previousArrow);A.appendChild(new Element("span")).addClassName("monthName");A.appendChild(this.nextArrow);S.appendChild(new Element("thead")).appendChild(new Element("tr")).appendChild(new Element("th",{colspan:this.params.days.length})).appendChild(A);var T=document.createDocumentFragment();for(var J=0;this.params.days[J];J++){var L=(J+Number(this.params.firstDayOfWeekIndex))%this.params.days.length;T.appendChild(new Element("th").update(this.params.days[L]))}var I=new Element("tbody");I.appendChild(new Element("tr")).appendChild(T);var O=document.createDocumentFragment();var B=document.createDocumentFragment();for(var J=0;this.params.days[J];J++){var F=new Element("td");B.appendChild(F)}var P=new Element("tr").addClassName("week");P.appendChild(B);O.appendChild(P);for(var E=1;E<this.NUM_WEEKS;E++){var M=P.cloneNode(true);if(E===this.NUM_WEEKS-1){M.addClassName("last")}O.appendChild(M)}I.appendChild(O);if("ontouchstart" in document){Event.observe(I,"click",this.dateTouch.bindAsEventListener(this))}else{Event.observe(I,"mousedown",this.selectDate.bindAsEventListener(this))}Event.observe(I,"mouseover",this.highlight.bindAsEventListener(this));Event.observe(I,"mouseout",this.clearHighlight.bindAsEventListener(this));S.appendChild(I);var H=I.getElementsByTagName("td");for(var J=0;H[J];J++){var F=H[J];Q.push(F)}var K=new Element("span").update(this.params.close);var D=new Element("div").addClassName("closeBar");D.appendChild(K);G.appendChild(S);G.appendChild(D);Event.observe(this.nextArrow,"click",function(U){this.changeMonth(U,true)}.bindAsEventListener(this));Event.observe(this.previousArrow,"click",function(U){this.changeMonth(U,false)}.bindAsEventListener(this));Event.observe(K,"click",this.hideCalendar.bindAsEventListener(this));this.element.addClassName("active");this.calBody.appendChild(G);document.body.appendChild(this.element);return Q},repositionAndShim:function(){var A=new Element("iframe");A.src="/cacheable/empty.html";this.element.insertBefore(A,this.element.childNodes[0])},showAndPosition:function(A){var H=A.memo.dateInputObj;this.calendarFocused=false;var I=this.eventElement;log.info("previous event element="+I);this.eventElement=A.memo.targetInput?A.memo.targetInput:Event.element(A.memo.rootEvent);this.maxDate=A.memo.maxDate;this.minDate=A.memo.minDate;if(I!=this.eventElement||!this.element.visibleByClass()){if(this.element.visibleByClass()){this.element.hideByClass()}var G=Position.cumulativeOffset(this.eventElement);var K=Position.cumulativeOffset(this.element.getOffsetParent());var D=(G[0]-K[0]+this.X_OFFSET)/12;var B=(G[1]-K[1]+this.Y_OFFSET)/12;if(D<1){D=1}if(B<1){B=1}this.element.style.left=D+"em";this.element.style.top=B+"em";var E=true;var J=H.validateDate(this.eventElement.value);if(J===null){J=this.today;E=false}var F=this.minDate;this.calDate=this.minDate>J?this.minDate:J;this.dateInInput=this.cloneDateObject(J);this.update(this.minDate,E);if(!this.element.visibleByClass()){this.element.showByClass()}}if(!A.memo.targetInput){this.eventElement.select()}},update:function(K,J){log.info("calling calendar.update()");var A=false;if(K==null){K=this.today;A=true}var O=this.calDate.getMonth()==K.getMonth()&&this.calDate.getFullYear()==K.getFullYear();var I=this.calDate.getMonth()==this.maxDate.getMonth()&&this.calDate.getFullYear()==this.maxDate.getFullYear();var F=(this.calDate.getFullYear()<K.getFullYear())||(this.calDate.getMonth()<K.getMonth()&&this.calDate.getFullYear()==K.getFullYear());var M=(this.calDate.getFullYear()>this.maxDate.getFullYear())||(this.calDate.getMonth()>this.maxDate.getMonth()&&this.calDate.getFullYear()==this.maxDate.getFullYear());var Q=this.getDaysInMonth(this.calDate.getMonth(),this.calDate.getFullYear());if(O){this.previousArrow.hide()}else{this.previousArrow.show()}if(I){this.nextArrow.hide()}else{this.nextArrow.show()}var G=this.element.getFirstElementByClassName("monthName");G.innerHTML=this.params.months[this.calDate.getMonth()]+" "+this.calDate.getFullYear();var L=this.cloneDateObject(this.calDate);L.setDate(1);var D=L.getDay()-Number(this.params.firstDayOfWeekIndex);var B=(D<0?D+7:D);var E=false;var P=1;for(var H=0;this.days[H];H++){this.days[H].className="";this.days[H].setAttribute("date","");if(E==false){this.days[H].innerHTML="&nbsp;";if(H==B){E=true}}if(E){this.days[H].innerHTML=P;if((F||(P<K.getDate()&&O))||(M||(P>this.maxDate.getDate()&&I))){this.days[H].addClassName("inactive")}else{if(P==K.getDate()&&O&&A){this.days[H].addClassName("today")}if(P==this.calDate.getDate()&&J){this.days[H].addClassName("selected")}this.days[H].setAttribute("date",this.calDate.getMonth()+"_"+P+"_"+this.calDate.getFullYear())}if(P>=Q){E=false}P++}}},changeMonth:function(A,J){var D=A.element();var B=this.cloneDateObject(this.calDate);var K=B.getMonth();var I=B.getFullYear();if(J===false){var E=K-1;if(E<0){E=11;I=I-1}var L=this.getDaysInMonth(E,I);if(B.getDate()>L){B.setDate(L)}B.setMonth(B.getMonth()-1);B.setYear(I);if(B.getMonth()<this.today.getMonth()&&B.getFullYear()==this.today.getFullYear()){B=this.today}}else{if(J===true){var H=K+1;if(H>11){H=0;I=I+1}var L=this.getDaysInMonth(H,I);if(B.getDate()>L){B.setDate(L)}B.setMonth(B.getMonth()+1);B.setYear(I);if(B.getMonth()>this.maxDate.getMonth()&&B.getFullYear()==this.maxDate.getFullYear()){B=this.maxDate}}}this.calDate=B;var F=(this.calDate.getMonth()==this.dateInInput.getMonth()&&this.calDate.getFullYear()==this.dateInInput.getFullYear());var G=this.minDate||this.cloneDateObject(this.today);this.update(G,F)},dateTouch:function(B){this.highlight(B);var A=B;window.setTimeout(function(){this.selectDate(A)}.bind(this),150)},selectDate:function(D){var B=Event.element(D);var A=B.getAttribute("date");if(A){document.fire("calendar:selectDate",{eventElement:this.eventElement,selectedDate:A})}Event.stop(D)},getDaysInMonth:function(E,B){var D=((B%4==0&&B%100!=0)||B%400==0);var A=this.daysPerMonth[E];return(E==1&&D?A+1:A)},compareDates:function(dateA,compareString,dateB){var returnVal;try{var evalString=String(Date.parse(dateA)+compareString+Date.parse(dateB));log.info("method compareDates evaulation string = "+evalString);returnVal=eval(evalString)}catch(e){log.warning("method compareDates failed to execute properly. error message: "+e);returnVal=-1}return returnVal},hideCalendar:function(){document.fire("calendar:hidden");this.element.hideByClass();this.calendarFocused=false},setCalendarFocus:function(){this.calendarFocused=true},highlight:function(B){if(Event.element){var A=Event.element(B);if(A.getAttribute("date")){A.addClassName("highlight")}}},clearHighlight:function(B){if(Event.element){var A=Event.element(B);if(A!=this.selectionElement&&A.getAttribute("date")){A.removeClassName("highlight")}}},cloneDateObject:function(A){return new Date(A.getFullYear(),A.getMonth(),A.getDate())}};var DateInputManager=Class.create(Abstract.Agent,{initExtend:function(){var B=new Date(this.params.today);this.today=new Date(B.getFullYear(),B.getMonth(),B.getDate(),0,0,0);this.maxDate=new Date(this.params.maxDate);this.pattern={string:this.params.pattern.toLowerCase(),localisedString:this.params.localisedPattern};this.daysPerMonth=[31,28,31,30,31,30,31,31,30,31,30,31];if(this.pattern.string.length!=0){this.pattern.patternArray=$A();this.pattern.string.gsub(/[^a-z0-9]+|[a-z0-9]+/,function(H){this.pattern.patternArray.push(H[0])}.bind(this));for(var E=0,A=this.pattern.patternArray.length;E<A;E++){if(this.pattern.patternArray[E].indexOf("y")!=-1){this.pattern.yearStringLength=this.pattern.patternArray[E].length;this.pattern.yearPosition=E}if(this.pattern.patternArray[E].indexOf("m")!=-1){this.pattern.monthPosition=E}if(this.pattern.patternArray[E].indexOf("d")!=-1){this.pattern.dayPosition=E}}var G=this.pattern.patternArray.clone();G[this.pattern.dayPosition]="\\d{1,2}";G[this.pattern.monthPosition]="\\d{1,2}";G[this.pattern.yearPosition]="\\d{1,"+this.pattern.yearStringLength+"}";var D=G.join("");this.pattern.regExpPattern=new RegExp(D)}var F=true;if(!this.pattern.string){F=false;log.warning("Calendar: unsupported date format or date separator pattern supplied.")}if(this.params.months.length!==12){F=false;log.warning("Calendar: twelve (12) month names not defined")}if(this.params.days.length!==7){F=false;log.warning("Calendar: seven (7) day names not defined")}if(this.pattern.string.length===0){F=false;log.warning("Calendar: invalid date format pattern")}if(F){this.isFirstDate=null;document.observe("calendar:selectDate",this.selectDate.bindAsEventListener(this));if(this.params.parentClass){this.ancestor=this.element.getParentByClassName(this.params.parentClass)}else{if(this.params.parentTag){this.ancestor=this.element.getParentByTagName(this.params.parentTag)}else{this.ancestor=$$("body")}}this.addInputObservers()}else{log.error("Calendar: initialization failed due to calendarRules model")}},formatDateString:function(B){var A=B.split("_");var D=parseInt(A[0])+1+"";if(D.length!=2){D="0"+D}var G=A[1]+"";if(G.length!=2){G="0"+G}var F=A[2]+"";if(F.length!=this.pattern.yearStringLength){while(F.length>this.pattern.yearStringLength){F=F.substr(1)}}var E=this.pattern.patternArray.clone();E[this.pattern.dayPosition]=G;E[this.pattern.monthPosition]=D;E[this.pattern.yearPosition]=F;E=E.join("");return E},addInputObservers:function(){this.dateInputArray=$A();if(this.params.selectors){this.selectors=this.params.selectors.split(",");for(var I=0;this.selectors[I];I++){var H=this.ancestor.getElementsBySelector(this.selectors[I]);for(var F=0;H[F];F++){var B=H[F];var D=H[F].getElementsByTagName("input");for(var E=0;D[E];E++){var A=D[E];A.datePairParent=B;this.dateInputArray.push(A);var J=null;if(A.value.length==0){A.value=this.pattern.localisedString}else{J=this.validateDate(A.value)}if(this.params.enableDatePicker){A.datePickerWidget=new DatePickerWidget(this,A,(this.dateInputArray.length-1),J)}}if(this.dateInputArray.length==2){this.computeDuration(B)}}}for(var I=0;this.dateInputArray[I];I++){Event.observe(this.dateInputArray[I],"focus",this.showWidget.bindAsEventListener(this));Event.observe(this.dateInputArray[I],"blur",this.setInputBlur.bindAsEventListener(this));if(this.dateInputArray[I].form){var G=this.dateInputArray[I].form.getInputs("submit");for(var F=0;G[F];F++){Event.observe(G[F],"click",this.clearField.bindAsEventListener(this,this.dateInputArray[I]));document.observe("dateInput:clearField",this.clearField.bindAsEventListener(this,this.dateInputArray[I]))}}}}},createWidget:function(){if(!window.calendarWidget){window.calendarWidget=new CalendarWidget(this.today,this.params)}},showWidget:function(F){this.createWidget();this.eventElement=Event.element(F);this.inputHasFocus=true;this.isFirstDate=true;var B=null;for(var E=1,D=this.dateInputArray.length;E<D;E++){if(this.dateInputArray[E]==this.eventElement){var A=null;var G=E-1;while(A==null&&G>=0){A=this.validateDate(this.dateInputArray[G].value);G--}B=A;this.isFirstDate=false;break}}document.fire("calendar:showAndPosition",{rootEvent:F,dateInputObj:this,minDate:B,maxDate:this.maxDate,isFirstDate:this.isFirstDate})},validateDate:function(J){var B=null;var A=true;var E=(J==undefined?$F(this.eventElement):J);if(this.pattern.regExpPattern.test(E)){var H=$A();E.gsub(/[^a-z0-9]+|[a-z0-9]+/,function(K){H.push(K[0])});var F=H[this.pattern.dayPosition];var D=H[this.pattern.monthPosition];var G=H[this.pattern.yearPosition];if(G.length==2){G="20"+G}if(F<1||F>this.getDaysInMonth((D-1),G)){A=false}if(A&&(D<1||D>12)){A=false}if(A){var I=new Date(G,D-1,F,0,0,0);if(I<=this.maxDate&&I>=this.today){B=I}}}return B},selectDate:function(A){this.eventElement=A.memo.eventElement;this.eventElement.value=this.formatDateString(A.memo.selectedDate);this.computeDuration(this.eventElement.datePairParent);document.fire("calendar:hide");this.eventElement.blur()},getDaysInMonth:function(E,B){var D=((B%4==0&&B%100!=0)||B%400==0);var A=this.daysPerMonth[E];return(E==1&&D?A+1:A)},computeDuration:function(B){if(this.dateInputArray.length==2){var A=this.validateDate(this.dateInputArray[0].value);var D=this.validateDate(this.dateInputArray[1].value);if(A!=null&&D!=null){B.tripDuration=Math.round((D-A)/86400000);DateDuration.prototype.updateDuration(B)}}},setInputBlur:function(A){this.inputHasFocus=false;window.setTimeout(this.getFocus.bind(this),100)},getFocus:function(){if(this.inputHasFocus==false&&window.calendarWidget.calendarFocused==false&&window.calendarWidget.element.visibleByClass()){document.fire("calendar:hide")}},clearField:function(B,A){if(A.value==this.pattern.localisedString){A.value=""}}});var DateDuration=Class.create();DateDuration.prototype=Object.extend(new Abstract.Agent(),{initialized:false,initExtend:function(){var B=this.element;var A=document.createElement("label");A.className="control textInput durationLabel";A.innerHTML=this.params.labelContent;B.appendChild(A);if(B.tripDuration){this.updateDuration(B)}},updateDuration:function(B){if(B.tripDuration||B.tripDuration===0){var A=B.getFirstElementByClassName("durationLabel","label");if(A){var D=A.getFirstElementByClassName("readOnlyValue","span");D.innerHTML=B.tripDuration}}}});var RadioAsLink=Class.create();RadioAsLink.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:true,initExtend:function(){this.radio=null;var B=this.element.parentNode;var G=this.element.getElementsByTagName("a")[0];var E=document.createElement("label");var D=G.href;this.element.removeClassName("radioAsLink");var F=this.element.className;var H=(G.getAttribute("checked"))?" checked":"";E.className="radio "+F+H;var A='<input type="radio" name="'+G.getAttribute("name")+'" value="'+G.getAttribute("value")+'" ';if(F){A+='class="'+F+'" '}if(G.getAttribute("checked")){A+='checked="checked" '}A+="/>";E.innerHTML=A+G.innerHTML;B.replaceChild(E,this.element);E.childNodes[0].setAttribute("linkURL",D)}});var Matrix=Class.create();Matrix.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.table=this.element;var A=this.table.tBodies[0].rows[0].getElementsByTagName("TH").length;$A(this.table.tHead.rows).each(function(B){$A(B.cells).each(function(D,E){if(E<A){return}if(D.title!=""){D.title=D.title.strip()}$(D);if(D.innerHTML==""||D.hasClassName("noHighlight")){return}Event.observe(D,"mouseover",this.colHeaderMouseEvent.bind(this,E));Event.observe(D,"mouseout",this.colHeaderMouseEvent.bind(this,E));Event.observe(D,"click",this.cellClickEvent.bind(this,"TH"))}.bind(this))}.bind(this));$A(this.table.tBodies[0].rows).each(function(B){$A(B.cells).each(function(D,E){if(D.title!=""){D.title=D.title.strip()}$(D);if(D.innerHTML==""||D.hasClassName("noHighlight")){return}if(D.tagName=="TH"){Event.observe(D,"mouseover",this.rowHeaderMouseEvent.bind(this));Event.observe(D,"mouseout",this.rowHeaderMouseEvent.bind(this));Event.observe(D,"click",this.cellClickEvent.bind(this,"TH"))}else{Event.observe(D,"mouseover",this.cellMouseEvent.bind(this,E));Event.observe(D,"mouseout",this.cellMouseEvent.bind(this,E));Event.observe(D,"click",this.cellClickEvent.bind(this,"TD"))}}.bind(this))}.bind(this));document.observe("agent:updatingResults",this.handleResultsUpdated.bind(this))},cellMouseEvent:function(A,D){var B=Event.findElementByTagName(D,"TD");var E=(D.type=="mouseover");this.highlightCell(B,E);this.highlightRowHeader(B,E);this.highlightColumnHeader(A,E)},rowHeaderMouseEvent:function(B){var A=Event.findElementByTagName(B,"TH");this.highlightRow(A,(B.type=="mouseover"))},colHeaderMouseEvent:function(A,B){this.highlightColumn(A,(B.type=="mouseover"))},cellClickEvent:function(D,B){var A=Event.findElementByTagName(B,D);if(A.getElementsByTagName("a")[0]){window.location=A.getElementsByTagName("a")[0].href}},highlightRowHeader:function(A,B){$A(A.parentNode.cells).each(function(D){if(D.tagName!="TH"){throw $break}this.highlightCell(D,B)}.bind(this))},highlightColumnHeader:function(A,B){$A(this.table.tHead.rows).each(function(D){this.highlightCell(D.cells[A],B)}.bind(this))},highlightRow:function(A,D,B){$A(A.parentNode.cells).each(function(E){this.highlightCell(E,D)}.bind(this))},highlightColumn:function(B,D,A){$A(this.table.rows).each(function(E){this.highlightCell(E.cells[B],D)}.bind(this))},highlightCell:function(A,B){if(A.hasClassName("noHighlight")){return}if(B){A.addClassName("hover")}else{A.removeClassName("hover")}},handleResultsUpdated:function(){$A(this.table.tHead.rows).each(function(A){$A(A.cells).each(function(B){$(B).removeClassName("selected")})});$A(this.table.tBodies[0].rows).each(function(A){$A(A.cells).each(function(B){$(B).removeClassName("selected")})})}});var HideReveal=Class.create();HideReveal.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){log.info(this.selectors);this.targets=$A();this.swapContent=(this.swapContent)?this.swapContent:this.content;if(this.selectors){this.selectors=this.selectors.split(",")}if(this.swapSelectors){this.swapSelectors=this.swapSelectors.split(",")}switch(this.element.tagName){case"SPAN":this.hrType="link";if(!this.element.hasClassName("progressive")){this.bindObserver();this.updateContent()}break;case"DL":this.hrType="link";this.bindObserver();this.updateContent();break;case"A":this.hrType="link";this.bindObserver();this.updateContent();break;case"LABEL":this.inputs=this.element.getElementsByTagName("INPUT");if(this.inputs){var A=0;while(this.inputs[A]&&this.inputs[A].type=="hidden"){A++}this.input=this.inputs[A];this.hrType=this.input.type;switch(this.input.type){case"radio":new HideRevealRadio(this);break;case"checkbox":Event.observe(this.input,this.eventType,this.toggle.bindAsEventListener(this));if(this.input.checked){this.toggle()}break;default:log.warning('&lt;input type="'+this.input.type+'"&gt; not supported in HideReveal agent.');log.info("Please edit HideReveal.initExtend if you wish to implement hide/reveal functionality for this input type.")}}else{log.warning("&lt;label&gt; tag does not contain an input.")}break;case"DIV":this.bindObserver();break;default:log.warning("&lt;"+this.element.tagName+"&gt; tag not supported in HideReveal agent.");log.info("Please edit HideReveal.initExtend if you wish to implement hide/reveal functionality for this tag type.");break}},bindObserver:function(D,B){var A=D?D:this.toggle;var E=B?B:this;Event.observe(this.element,this.eventType,A.bindAsEventListener(E));if(this.radioValue){Event.observe(this.element,this.eventType,this.changeRadio.bind(this))}if(this.checkboxValue){Event.observe(this.element,this.eventType,this.toggleCheckbox.bind(this));Event.observe(this.input,this.eventType,this.toggleCheckbox.bind(this))}},toggleCheckbox:function(){this.input.checked=!(this.input.checked)},updateContent:function(A){var B=A?A:this.content;if(B){this.element.update(B);log.info("HideReveal is updating content to "+B)}else{B=this.element.innerHTML}this.content=this.swapContent;this.swapContent=B},findTargets:function(){this.targets=this._findTargets(this.selectors);if(this.swapSelectors){this.swapTargets=this._findTargets(this.swapSelectors)}var A=this.targets.length;log.info(A+" "+(A!=1?"targets":"target")+" found for HideReveal")},_findTargets:function(A){var B=[];A.each(function(E){if(this.parentClass){var F=this.element.getParentByClassName(this.parentClass);var D=F.getElementsBySelector(E);for(var G=0;D[G];G++){B.push(D[G])}}else{if(this.parentTag){var F=this.element.getParentByTagName(this.parentTag);var D=F.getElementsBySelector(E);for(var G=0;D[G];G++){B.push(D[G])}}else{var D=$$(E);for(var G=0;D[G];G++){B.push(D[G])}}}}.bind(this));return B},changeRadio:function(){var B=this.radioValue;var A,D;if(this.parentClass){ancestor=this.element.getParentByClassName(this.parentClass)}else{if(this.parentTag){ancestor=this.element.getParentByTagName(this.parentTag)}}if(ancestor){A=$A(ancestor.getElementsByClassName("radio"));A.each(function(F){var E=F.getElementsByTagName("input")[0];if(E.value==B){E.click()}})}},hide:function(B){for(var A=0;B[A];A++){B[A].hideByClass()}},show:function(B){for(var A=0;B[A];A++){B[A].showByClass()}},toggle:function(D){if(this.targets.length==0&&this.selectors.length>0){this.findTargets()}if(D){var A=Element.extend(Event.element(D));if(A.hasClassName("selected")){A.removeClassName("selected")}else{A.addClassName("selected")}if(this.hrType=="link"){Event.stop(D);this.updateContent()}if(this.removeOnEvent){this.element.remove()}}if(this.exclusive){if(this.currentState=="show"){this.hide(this.targets);if(this.swapTargets){this.show(this.swapTargets)}this.currentState="hide"}else{this.show(this.targets);if(this.swapTargets){this.hide(this.swapTargets)}this.currentState="show"}}else{for(var B=0;this.targets[B];B++){this.targets[B].toggleByClass()}}}});var HideRevealRadio=Class.create();HideRevealRadio.prototype={initialize:function(A){this.hrRadio=A;this.groupName=this.hrRadio.input.name;if(!Page.hideRevealRadios[this.groupName]){Page.hideRevealRadios[this.groupName]=[]}Event.observe(this.hrRadio.input,this.hrRadio.eventType,this.groupEvent.bindAsEventListener(this));Page.hideRevealRadios[this.groupName].push(this);if(this.hrRadio.input.checked){if(!this.hrRadio.input.defaultChecked){var D=Page.hideRevealRadios[this.groupName];for(var B=0;D[B];B++){if(D[B].hrRadio.input.defaultChecked){D[B].hrRadio.toggle()}D[B].checked=false}this.hrRadio.toggle()}this.checked=true}},groupEvent:function(D){var A=Event.element(D);if(this.checked){return}var E=Page.hideRevealRadios[this.groupName];for(var B=0;E[B];B++){if(E[B].checked){E[B].hrRadio.toggle(D)}E[B].checked=false}this.hrRadio.toggle(D);this.checked=true}};HideReveal.Progressive=Class.create();HideReveal.Progressive.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(A){if(!this.params.validIndices||!this.params.validIndices.length||this.params.currentIndex!=0&&this.params.currentIndex!=1||!this.params.expandSelectors||!this.params.expandLinks||!this.params.scopeClass||!this.params.linkClass){log.warning("HideReveal.Progressive.initExtend: exiting because required params missing or invalid");return}this.setIndex(this.params.currentIndex);this.createHideReveal(true);log.info("HideReveal.Progressive.initExtend has successfully completed")},setIndex:function(A){this.currentIndex=!isNaN(A)?A:this.getNextIndex();log.info("HideReveal.Progressive.currentIndex="+this.currentIndex)},getNextIndex:function(){var A=-1;for(var D=0;D<this.params.validIndices.length;D++){var B=parseInt(this.params.validIndices[D]);if(B>this.currentIndex){A=B;break}}return A},createLinkNode:function(){if(!this.linkNode){this.linkNode=this.element.appendChild(document.createElement("div"));this.linkNodeLink=this.linkNode.appendChild(document.createElement("span"));this.linkNodeLink.className="link "+this.params.linkClass;log.info("HideReveal.Progressive has created its link node")}},destroyLinkNode:function(){this.element.removeChild(this.linkNode);log.info("HideReveal.Progressive has destroyed its link node")},createHideReveal:function(A){if(A){this.createLinkNode()}if(this.getNextIndex()>=0){this.hideRevealLink=new HideReveal(this.linkNodeLink,{type:"HideReveal [inside HideReveal.Progressive]",eventType:"click",parentClass:this.params.scopeClass,selectors:"."+this.params.expandSelectors[this.getNextIndex()]});log.info("HideReveal.Progressive.hideRevealLink="+this.hideRevealLink);if(A){this.hideRevealLink.bindObserver(this.updateLink,this)}this.hideRevealLink.updateContent(this.params.expandLinks[this.currentIndex])}else{this.destroyLinkNode();log.info("HideReveal.Progressive has no hideRevealLink because index is out of bounds.")}},updateLink:function(){log.info("HideReveal.Progressive.updateLink called");log.info("type="+this.type);this.hideRevealLink.toggle();this.setIndex();this.createHideReveal()}});var PanelCollapse=Class.create();PanelCollapse.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.titleBar=this.element.getFirstElementByClassName("titleBar","div");this.titleBar.addClassName("collapsible");this.opened=(this.params.collapseState==="opened");this.panelContent=this.element.getFirstElementByClassName("panelContent","div");this.instructionLink=this.titleBar.getFirstElementByClassName("panelCollapse");this.title=this.titleBar.getFirstElementByClassName("title");this.titleText=this.title.getElementsByTagName("span")[0];this.expandCollapseLink=new Element("a");this.expandCollapseLink.href="#";this.title.insertBefore(this.expandCollapseLink,this.titleText);this.expandCollapseLink.innerHTML=this.params.collapseIcon+this.params.expandIcon;this.collapseIcon=this.expandCollapseLink.childElements()[0];this.expandIcon=this.expandCollapseLink.childElements()[1];if(this.opened){this.expandIcon.hide()}else{this.collapseIcon.hide();this.panelContent.hideByClass()}this.panelMessageElement=this.element.getFirstElementByClassName("panelMessage","div");this.panelMessage="";if(this.panelMessageElement!=null){this.panelMessage=this.panelMessageElement.innerHTML}this.dirtyFieldsMessage="";this.fieldsDirty=false;if(this.panelMessageElement!=null){var F=this.panelMessageElement.getParams();if((F!=null)&&(F.dirtyFieldsMessage!=null)){this.dirtyFieldsMessage=F.dirtyFieldsMessage}}this.fieldsToObserve=[];if(this.dirtyFieldsMessage!=""){var D=$A(this.element.getElementsByTagName("input"));var A=$A(this.element.getElementsByTagName("select"));var E=$A(this.element.getElementsByTagName("textArea"));this.fieldsToObserve=D.concat(A,E)}log.info(this.type+".fieldsToObserve: "+this.fieldsToObserve.length);for(var B=0;B<this.fieldsToObserve.length;B++){Event.observe(this.fieldsToObserve[B],"change",this.setFieldsDirty.bindAsEventListener(this))}Event.observe(this.expandCollapseLink,"click",this.toggleCollapse.bindAsEventListener(this));Event.observe(this.titleText,"click",this.toggleCollapse.bindAsEventListener(this));if(this.instructionLink){Event.observe(this.instructionLink,"click",this.toggleCollapse.bindAsEventListener(this))}},setFieldsDirty:function(){this.fieldsDirty=true;log.info("fields dirtied")},toggleCollapse:function(A){this.titleBar.toggleClasses("open","closed");this.opened=!(this.opened);if(this.opened){this.expandIcon.hide();this.collapseIcon.show();this.panelContent.showByClass()}else{this.collapseIcon.hide();this.expandIcon.show();this.panelContent.hideByClass()}if(this.fieldsDirty){if(this.opened){this.panelMessageElement.innerHTML=this.panelMessage}else{this.panelMessageElement.innerHTML=this.dirtyFieldsMessage}}A.preventDefault()}});var CollapseRemoteControl=Class.create();CollapseRemoteControl.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.collapseAgent;this.hideRevealAgent;this.anchor;if(this.params.anchorName!=null||this.params.anchorName!=""){this.anchor=document.anchors.namedItem(this.params.anchorName);if(this.anchor!=null){var B=this.anchor;var D=Page.agents.Collapse;while(B.parentNode!=document&&this.collapseAgent==null){B=B.parentNode;for(i=0;i<D.length;i++){if(D[i].element==B){this.collapseAgent=D[i];break}}}var A=Page.agents.HideReveal;while(this.hideRevealAgent==null){for(i=0;i<A.length;i++){if(A[i].element==this.collapseAgent.titleBar){this.hideRevealAgent=A[i];break}}}Event.observe(this.element,"click",this.expandTargetPanel.bindAsEventListener(this))}else{log.error("CollapseRemoteControl: could not find anchor named '"+this.params.anchorName+"', unable to initialize")}}else{log.error("CollapseRemoteControl: missing required param 'anchorName', unable to initialize")}},expandTargetPanel:function(){if(this.collapseAgent.opened==false){this.collapseAgent.collapse();this.hideRevealAgent.toggle()}}});var Interstitial=Class.create(Abstract.Agent,{interstitialResponseTimeout:2000,interstitialAssetsTimeout:2000,url:"/helper/interstitial",initExtend:function(){var A=this.element.tagName;this.bodyWrapper=this.params.targetParent?Element.extend(window.parent.document.getElementById("bodyWrapper")):Element.extend(document.getElementById("bodyWrapper"));if(A==="INPUT"){Event.observe(this.element,"click",function(){Event.observe(this.element.form,"submit",this.requestFormInterstitial.bind(this))}.bind(this))}else{if(A==="A"){Event.observe(this.element,"click",this.requestLinkInterstitial.bindAsEventListener(this))}else{if(A==="TABLE"||A==="TBODY"){Event.observe(this.element,"click",this.requestTableInterstitial.bindAsEventListener(this))}else{log.warning("Interstitial tried to initialize, but failed on element.tagName")}}}},requestFormInterstitial:function(B){log.debug("form interstitial");B.preventDefault();Form.HiddenField.add(this.element.form,this.element.name,this.element.value);var A=Form.serialize(this.element.form);this.action=function(){log.debug("interstitial: submitting form");this.element.form.submit()}.bind(this);this.getInterstitial(A.deleteQueryStringParam("execution"))},requestLinkInterstitial:function(A){log.debug("link interstitial");A.preventDefault();var B=this.element.href.split("?")[1]||"";this.action=function(){log.debug("interstitial: following link");window.location=this.element.href}.bind(this);this.getInterstitial(B.deleteQueryStringParam("execution"))},requestTableInterstitial:function(B){B.preventDefault();var A=Event.element(B);if(A.tagName!=="A"){A=Event.findElement(B,"TD");if(A!==document){A=A.getElementsByTagName("A")[0]}}if(A&&A.tagName==="A"){this.element=A;this.requestLinkInterstitial(B)}else{return false}},getInterstitial:function(E){var A=setTimeout(this.action,this.interstitialResponseTimeout);Event.observe(window,"pageshow",this.hideInterstitial.bindAsEventListener(this));var D=new Ajax.Request(this.url,{parameters:E,onSuccess:this.showInterstitial.bind(this,A)});this.bodyWrapper.addClassName("hideFromBrowser");var B=this.params.targetParent?Element.extend(window.parent.document.body):Element.extend(document.body);B.addClassName("interstitial")},showInterstitial:function(B,G){clearTimeout(B);if(G.responseText.indexOf('status:"failed"')>-1){return}else{var F=$(document.createElement("DIV"));F.innerHTML=G.responseText;Page.initializeDOMFragment(F);this.bodyWrapper.insert({before:F})}var D=F.getElementsByTagName("IFRAME");if(D.length>0){var E=D[0];var A=function(){if(!E.contentWindow.adLoaded||!E.contentWindow.resized){window.setTimeout(A.bind(this),50)}else{log.debug("interstitial advert loaded and resized");window.clearTimeout(this.advertTimeout);this.action()}};this.advertTimeout=setTimeout(this.action,this.interstitialAssetsTimeout);A.call(this)}else{this.action()}},hideInterstitial:function(){var A=$("interBody");if(A){A.remove()}if(this.bodyWrapper){this.bodyWrapper.removeClassName("hideFromBrowser")}if(Page.agents.ChangeSearchLightboxAgent){$(Page.agents.ChangeSearchLightboxAgent).each(function(B){B.dialogObject.close()})}}});var PopupWindow=Class.create();PopupWindow.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:true,windowProps:"width=620,height=400,left=20,top=20,resizable=yes,scrollbars=yes,status=yes",windowName:"popWin",initExtend:function(){this.element.target=this.windowName;Event.observe(this.element,"click",this.popWindow.bindAsEventListener(this))},popWindow:function(B){var A=window.open("",this.windowName,this.windowProps);A.focus();if(B){B.stopPropagation()}}});PopupWindow.FullSize=Class.create();PopupWindow.FullSize.prototype=Object.extend(new PopupWindow(),{windowProps:"width=720,height=500,left=0,top=0,resizable=yes,toolbar=yes,location=yes,scrollbars=yes,status=yes",windowName:"popWinFullSize"});PopupWindow.FullSizeNoToolBar=Class.create();PopupWindow.FullSizeNoToolBar.prototype=Object.extend(new PopupWindow(),{windowProps:"width=720,height=500,left=0,top=0,resizable=yes,toolbar=no,location=yes,scrollbars=yes,status=yes",windowName:"popWinFullSizeNoToolBar"});PopupWindow.FullWindow=Class.create();PopupWindow.FullWindow.prototype=Object.extend(new PopupWindow(),{windowProps:"width="+screen.availWidth+",height="+screen.availHeight+",left=0,top=0,resizable=yes,toolbar=no,location=yes,scrollbars=yes,directories=no,status=no",windowName:"popWinFullScreen"});var RedirectOpenerOnClose=Class.create();RedirectOpenerOnClose.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.popupWindow=self;this.popupOpener=self.opener;if(this.popupOpener!=null&&this.params!=null&&this.params.sendOpenerTo!=null&&this.params.sendOpenerTo!=""){this.redirectOpenerURL=this.params.sendOpenerTo;Event.observe(self,"unload",this.redirectOpener.bindAsEventListener(this))}else{log.error(this.popupWindow+" missing sendOpenerTo param, or window is not a popup")}},redirectOpener:function(){if(this.redirectOpenerURL!=null){this.popupOpener.location.href=this.redirectOpenerURL}}});var ExitApp=Class.create();ExitApp.prototype=Object.extend(new Abstract.Agent(),{windowProps:"width=620,height=400,left=20,top=20,resizable=yes,scrollbars=yes,status=yes",windowName:"exitApp",popupEnabled:true,initExtend:function(){this.url="/info/bookingPathExitApp";var A=this.element.getElementsByTagName("input")[0];Event.observe(A,"click",this.disablePopup.bindAsEventListener(this));Event.observe(window,"unload",this.popExitApp.bindAsEventListener(this))},popExitApp:function(B){if(this.popupEnabled){var A=window.open(this.url,this.windowName,this.windowProps);A.blur();window.focus()}},disablePopup:function(A){ExitApp.prototype.popupEnabled=false}});var cancelExitApp=Class.create();cancelExitApp.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){Event.observe(this.element,"click",this.disableExitApp.bindAsEventListener(this))},disableExitApp:function(A){ExitApp.prototype.disablePopup()}});var ScriptContent=Class.create();ScriptContent.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){if(!this.params.multiContent&&!this.params.content){log.warning("ScriptContent.initExtend: exiting because required params missing or invalid");return}this.insertionsToProcess=(this.params.multiContent?this.params.multiContent:[this.params]);this.insertionsToProcess.each(function(J){var D=J.targetClass?this.element.getFirstElementByClassName(J.targetClass):this.element;if(!D){log.warning("ScriptContent.initExtend: exiting because target node [class: "+J.targetClass+"] was not valid")}else{var H=new Element(J.containerType||"div");H.innerHTML=J.content;if(J.containerClass){H.className=J.containerClass}var B;if(!J.containerType){var A=document.createDocumentFragment();B=H.childElements();while(H.firstChild){A.appendChild(H.firstChild)}H=A}var G=J.insertAtTop?D.insertBefore(H,D.firstChild):D.appendChild(H);if(J.containerType){B=[G]}if(J.clickHandler){var I=J.clickHandler.bindAsEventListener(this);for(var E=0,F=B.length;E<F;E++){Event.observe(B[E],"click",I)}}for(var E=0,F=B.length;E<F;E++){Page.initializeDOMFragment(B[E],true)}}}.bind(this))}});ProductNav=Class.create();ProductNav.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.manager=new DialogManager(this.element.parentNode);this.radios=$A(this.element.getElementsByTagName("input"));this.radios.each(function(A){if(A.type=="radio"){Event.observe(A,"click",this.onClick.bindAsEventListener(this));if(A.checked){this.currentType=A.value}}}.bind(this))},onClick:function(E){var B=E.element().value;if(B!=this.currentType){dcsMultiTrack.apply(undefined,["DCSext.rbck",B]);dcsCleanUp();if(!this.element.hasClassName("quickSearchNav")){location.href=E.element().getAttribute("linkURL")}else{this.manager.close();var A=B.substring(0,10)=="thirdParty";var F=A?"/helper/searchFormThirdParty":"/shop/searchForm";var D=new Ajax.Request(F,{parameters:"quickSearch=true&pathId=home&type="+B,onSuccess:this.success.bind(this),onFailure:this.failure});this.element.fire("agent:showIntrastitial");this.currentType=B}}},success:function(A){log.info("Response received from /shop/searchForm");this.element.fire("agent:hideIntrastitial",{newMarkup:A.responseText})},failure:function(){log.error("No response from /shop/searchForm")}});var QuickSearch=Class.create();QuickSearch.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){if(!this.params.instructions){log.error("QuickSearch: No instruction content found")}this.instructions=this.params.instructions;this.element.insert({before:this.instructions});this.instructions=this.element.previous();this.link=$(this.instructions.getElementsByTagName("A")[0]);if(!this.link){log.error("QuickSearch: No link found in instruction content")}this.link.observe("click",this.showContent.bindAsEventListener(this))},showContent:function(A){this.instructions.remove();this.element.showByClass();A.preventDefault()}});var SearchForm=Class.create(Abstract.Agent,{initExtend:function(){this.form=this.element.getFirstElementByClassName("searchFormForm","form");this.initializeChildren();this.listenElement=this.element.up(".searchFormPanel");if(!this.listenElement){this.listenElement=this.element}this.showListener=this.showIntrastitial.bind(this);this.listenElement.observe("agent:showIntrastitial",this.showListener);this.hideListener=this.hideIntrastitial.bind(this);this.listenElement.observe("agent:hideIntrastitial",this.hideListener)},showIntrastitial:function(A){this.element.addClassName("hidden");if(this.pi){if(this.pi.container.hasClassName("hidden")){this.pi.container.removeClassName("hidden")}this.pi.start()}else{this.pi=new ProgressIndicator();this.element.insert({top:this.pi.container})}this.pi.container.addClassName("visible");if(A){A.stopPropagation()}},hideIntrastitial:function(D){if(this.pi){this.pi.stop();if(this.pi.container.hasClassName("visible")){this.pi.container.removeClassName("visible")}this.pi.container.addClassName("hidden")}this.element.removeClassName("hidden");if(D&&D.memo&&D.memo.newMarkup){this.destroy();D.stopPropagation();var A=this.element.parentNode;this.element=null;A.update(D.memo.newMarkup.stripNoScripts());try{Page.initializeDOMFragment(A)}catch(B){Errors.capture(B,"SearchForm Ajax initialization failed")}}},destroy:function(){this.listenElement.stopObserving("agent:showIntrastitial",this.showListener);this.listenElement.stopObserving("agent:hideIntrastitial",this.hideListener);this.listenElement=null}});SearchForm.SearchTypes=Class.create(Abstract.ChildAgent,{initExtend:function(B,A){this.searchForm=A;this.radios=$A(this.element.getElementsByTagName("input"));this.radios.each(function(D){Element.extend(D.parentNode);Event.observe(D,"click",this.onClick.bind(this));if(D.checked){this.currentType=D.value}}.bind(this))},onClick:function(){var A;var D;this.radios.each(function(E){if(E.checked){A=E.value;D=$(E).readAttribute("linkurl").split("?")[1]}});if(A!=this.currentType){var B=new Ajax.Request("/shop/searchForm",{parameters:D,onSuccess:this.success.bind(this),onFailure:this.failure});this.currentType=A;this.element.fire("agent:showIntrastitial")}},success:function(A){log.info("Successful response from /shop/searchForm");this.element.fire("agent:hideIntrastitial",{newMarkup:A.responseText})},failure:function(){log.error("No response from /shop/searchForm")}});SearchForm.HotelTravelers=Class.create(Abstract.ChildAgent,{initExtend:function(B,A){this.searchForm=A;this.element=B;["addRoom","removeRoom"].each(function(E){var D=new Element("a",{"class":"link "+E,href:"#"}).update(this.params[E+"Text"]);D.observe("click",this[E].bind(this));this[E+"Item"]=new Element("li").update(D)}.bind(this));this.addRemove=B.down("ul.addRemove").remove();this.updateLinks()},updateLinks:function(){var B=this.addRemove;while(B.firstChild){B.removeChild(B.firstChild)}var D=this.element.getElementsByTagName("fieldset");var A=D.length;if(A<this.params.maxRooms){B.appendChild(this.addRoomItem)}if(A>1){B.appendChild(this.removeRoomItem)}$(D[A-1]).down(".guests").appendChild(B)},addRoom:function(B){B.preventDefault();if(this.busy){return}this.busy=true;var D=this.searchForm.form.serialize()+"&hotel.addRoom=true";var A=new Ajax.Request("/helper/hotelRoom",{method:"get",parameters:D,onSuccess:this.insertNewRoom.bind(this),onFailure:this.failure.bind(this)})},insertNewRoom:function(E){var D=this.searchForm.form.down(".travelers");var F=new Element("div").update(E.responseText);var G=F.down("ul.addRemove");if(G){G.remove()}var A=F.childElements();for(var B=0;B<A.length;B++){D.appendChild(A[B]);Page.initializeDOMFragment(A[B],true)}this.updateLinks();this.busy=false},failure:function(){log.error("No response from /helper/hotelRoom");this.busy=false},removeRoom:function(A){A.preventDefault();var B=this.element.getElementsByTagName("fieldset");$(B[B.length-1]).remove();this.updateLinks()}});SearchForm.MultiroomGuests=Class.create(Abstract.ChildAgent,{initExtend:function(D,A){this.guestLabels=this.element.select("label");this.guestDropdowns=this.element.select("label select");this.guestDropdowns.each(function(E,F){if(F!=0){E.removeChild(E.down("option"))}});this.dialogManager=new DialogManager(this.element);this.multipleRoomsOptionText=this.params.multipleRoomsText;this.visibilityClass=this.params.visibilityClass;var B=$(A.form).down("div.rooms select");this.showGuestCounts(B);this.element.showByClass();Event.observe(B,"change",this.onChange.bindAsEventListener(this))},onChange:function(B){var A=Event.element(B);this.showGuestCounts(A);if(A.value<=1){this.dialogManager.close()}},showGuestCounts:function(B){var E=(B)?parseInt(B.value):1;var A=(E<=this.guestLabels.length)?E:1;var D=this.visibilityClass;var F=this.multipleRoomsOptionText;this.guestLabels.each(function(I,H){var G=I.down("span");if(A==1&&G){G.addClassName(D);this.element.removeClassName("extraRoomSelectsShown")}else{G.removeClassName(D);this.element.addClassName("extraRoomSelectsShown")}if((A==F)||(H<A)){I.removeClassName("noneBlock")}else{I.addClassName("noneBlock")}}.bind(this))}});SearchForm.APHButton=Class.create(Abstract.ChildAgent,{initExtend:function(B,A){var D=this.element;var E=function(G){if(G&&D.disabled){return}D.disabled=G;D[(G)?"addClassName":"removeClassName"]("disabled")};var F=A.form.select(this.params.selectors);F.each(function(G){if(G.checked){E(true)}G.observe("click",function(){var H=false;if(this.checked){E(true)}else{F.each(function(I){if(I.checked){H=true;throw $break}});E(H)}})})}});SearchForm.CarLocationTypes=Class.create(Abstract.ChildAgent,{initExtend:function(B,A){this.searchForm=A;this.parentForm=$(this.searchForm.form);if(this.params&&this.params.pickupType){this.pickup=B.getElementsBySelector('[name="'+this.params.pickupType+'"]')[0]}else{this.pickup=B.getElementsBySelector('[name="car.pickupType"]')[0]}Event.observe(this.pickup,"change",this.requestForm.bindAsEventListener(this));if(this.params&&this.params.dropoffType){this.dropoff=B.getElementsBySelector('[name="'+this.params.dropoffType+'"]')[0]}else{this.dropoff=B.getElementsBySelector('[name="car.dropoffType"]')[0]}Event.observe(this.dropoff,"change",this.requestForm.bindAsEventListener(this))},requestForm:function(F){var B="";if(/\/home/.test(location.pathname)){B="&quickSearch=true"}var E="/shop/searchForm";if(/\/book/.test(location.pathname)){E="/book/bookingpath";var A=this.searchForm.form.elements.execution.value;B="&quickSearch=true&changeSearch=true&_eventId=changeSearchXSellCar&execution="+A}if(this.params){document.fire("dateInput:clearField");var G=Form.serialize(this.searchForm.form).deleteQueryStringParam("search",false)+B}else{var G="type=car"+B+"&car.pickupType="+this.pickup.value+"&car.dropoffType="+this.dropoff.value}var D=new Ajax.Request(E,{parameters:G,onSuccess:this.success.bind(this),onFailure:this.failure});this.element.fire("agent:showIntrastitial")},success:function(A){log.info("Response received from /shop/searchForm");this.element.fire("agent:hideIntrastitial",{newMarkup:A.responseText})},failure:function(){log.error("No response from /shop/searchForm")}});SearchForm.CarDriverAgeNote=Class.create(Abstract.ChildAgent,{initExtend:function(D,B){var A=D.getElementsByTagName("select")[0];this.ageNote=D.getNthElementByClassName("alert",[1],"p");if(A.value=="21"){this.toggleNoteDisplay()}Event.observe(A,"change",this.toggleNoteDisplay.bindAsEventListener(this))},toggleNoteDisplay:function(){this.ageNote.toggleByClass()}});SearchForm.FauxRoomsDropdown=Class.create(Abstract.ChildAgent,{initExtend:function(D,B){this.formSubmits=$A();$A(B.element.getElementsByClassName("submit")).each(function(I){this.formSubmits.push(I.getElementsByTagName("input")[0])}.bind(this));this.multiBookingAlert=D.getFirstElementByClassName("alert","p");this.multipleRoomsOptionText=this.params.multipleRoomsText;if(this.multipleRoomsOptionText!=null&&this.formSubmits.length>0){if(D.getFirstElementByClassName("readOnlyValue","span")){var H=D.getFirstElementByClassName("readOnlyValue","span");var G=H.innerHTML;var A=Element.extend(D.getElementsByTagName("input")[0]);if(A){var E=A.name;var F=A.value;A.remove()}else{E="fakeRoomsSelect";F=G}optionText=G;this.fauxSelect=Element.extend(document.createElement("select"));this.fauxSelect.name=E;this.addOptionToSelect(this.fauxSelect,F,optionText);H.parentNode.appendChild(this.fauxSelect);H.remove()}else{if(D.getElementsByTagName("select")[0]){this.fauxSelect=D.getElementsByTagName("select")[0]}else{log.error("fauxRoomsDropdown: nothing to convert to a select");return false}}this.addOptionToSelect(this.fauxSelect,this.multipleRoomsOptionText,this.multipleRoomsOptionText);this.checkForFauxSelection();Event.observe(this.fauxSelect,"change",this.checkForFauxSelection.bindAsEventListener(this))}},addOptionToSelect:function(B,D,E){var A=Element.extend(document.createElement("option"));A.value=D;A.update(E);B.appendChild(A)},checkForFauxSelection:function(){if(this.fauxSelect.options[this.fauxSelect.selectedIndex].value==this.multipleRoomsOptionText){this.formSubmits.each(function(A){if(!A.disabled){this.toggleSubmitEnabled(A)}}.bind(this));this.multiBookingAlert.showByClass();this.element.addClassName("hasAlertShown")}else{this.formSubmits.each(function(A){if(A.disabled){this.toggleSubmitEnabled(A)}}.bind(this));this.multiBookingAlert.hideByClass();this.element.removeClassName("hasAlertShown")}},toggleSubmitEnabled:function(A){A=$(A);A.disabled=!A.disabled;A.toggleClassName("disabled")}});SearchForm.RailFlyCheckbox=Class.create(Abstract.ChildAgent,{initExtend:function(D,B){var A=D.getParentByTagName("form");this.checkbox=D.down('input[type="checkbox"]');this.textField=A.down('.location input[type="text"]');if(this.params.naCheckBoxName){this.naCheckbox=A.down('input[name="'+this.params.naCheckBoxName+'"]');if(!this.naCheckbox){log.error("SearchForm.RailFlyCheckbox: nearby airports checkbox not found");return}}if(!this.checkbox){log.error("SearchForm.RailFlyCheckbox: checkbox not found");return}else{if(!this.textField){log.error("SearchForm.RailFlyCheckbox: text field not found");return}}if(this.checkbox.checked){this.checkbox.value="";this.disableTextField()}Event.observe(this.checkbox,"click",this.toggleTextField.bindAsEventListener(this))},toggleTextField:function(){this.checkbox.checked?this.disableTextField():this.enableTextField()},disableTextField:function(){this.oldTextFieldValue=this.textField.value;this.textField.value=this.params.railAndFlyText?this.params.railAndFlyText:"";this.textField.disabled=true;if(this.naCheckbox){this.naCheckbox.checked=false;this.naCheckbox.disabled=true}log.info("RailFlyCheckbox: disabled departure text")},enableTextField:function(){this.textField.value=this.oldTextFieldValue?this.oldTextFieldValue:"";this.textField.disabled=false;if(this.naCheckbox){this.naCheckbox.disabled=false}log.info("RailFlyCheckbox: enabled departure text")}});SearchForm.OandDValidator=Class.create(Abstract.ChildAgent,{initExtend:function(B,A){var D=B.select('.location input[type="text"]');this.element=B;this.errorCode=this.params.errorCode.replace(".","-");this.errorMsg=this.element.down("."+this.errorCode);if(D.length<2){log.error("SearchForm.OandDValidator: could not find origin and destination fields");return}this.originField=D[0];this.destinationField=D[1];this.originField.observe("blur",this.validateLocations.bindAsEventListener(this));this.destinationField.observe("blur",this.validateLocations.bindAsEventListener(this))},validateLocations:function(B){var D=this.originField.value.strip().toLowerCase();var A=this.destinationField.value.strip().toLowerCase();if(D&&D===A){if(!this.errorMsg){this.element.insert({top:this.params.errorMsgMarkup});this.errorMsg=this.element.down("."+this.errorCode)}else{this.errorMsg.show()}}else{if(this.errorMsg){this.errorMsg.hide()}}}});SearchForm.XSliceMatchValidator=Class.create(Abstract.ChildAgent,{initExtend:function(B,A){this.element=B;this.errorCode=this.params.errorCode.replace(".","-");this.errorMsg=this.element.down("."+this.errorCode);this.locations=this.element.select('.location input[type="text"]');if(this.locations.length<4){log.error("SearchForm.XSliceMatchValidator: could not find origin and destination fields");return}var E=this.validateLocations.bindAsEventListener(this);for(var D=0;this.locations.length;D++){this.locations[D].observe("blur",E)}},validateLocations:function(E){var F=$A();var G=this.locations.length;for(var D=0;D<G;D++){F[D]=this.locations[D].value.strip().toLowerCase()}for(var B=0;B<(G-2);B+=2){if(F[B]&&F[B+1]){for(var A=B+2;A<G;A+=2){if(F[B]===F[A]&&F[B+1]===F[A+1]){if(!this.errorMsg){this.element.insert({top:this.params.errorMsgMarkup});this.errorMsg=this.element.down("."+this.errorCode)}else{this.errorMsg.show()}return}}}}if(this.errorMsg){this.errorMsg.hide()}}});SearchFormChildTravelers=Class.create(Abstract.Agent,{beforeDOMReady:false,initExtend:function(){this.dropdown=this.element.down("select");this.childTravelers=this.element.getParentByTagName("fieldset").down(".childTravelers");this.childAgeDropdowns=this.childTravelers.select(".select");this.dropdown.observe("change",this.showChildAges.bind(this));this.showChildAges()},showChildAges:function(){var B=this.dropdown.value;for(var A=0;A<this.childAgeDropdowns.length;A++){if(A<B){this.childAgeDropdowns[A].showByClass()}else{this.childAgeDropdowns[A].hideByClass()}}if(B>0){this.childTravelers.showByClass()}else{this.childTravelers.hideByClass()}}});var ChangeSearch=Class.create();ChangeSearch.prototype=Object.extend(new Abstract.Agent("ChangeSearch"),{initExtend:function(){this.visible=false;Event.observe(this.element,"click",this.requestForm.bindAsEventListener(this))},showSelectBoxes:function(){var A=$A(document.getElementsByTagName("select"));A.each(function(B){B.style.visibility="visible"})},hideSelectBoxes:function(){var A=$A(document.getElementsByTagName("select"));A.each(function(B){B.style.visibility="hidden"})},requestForm:function(B){Event.stop(B);this.getPageDimensionsAndScroll();this.hideSelectBoxes();this.visible=true;this.modalDiv=document.createElement("div");this.modalDiv.className="modal";this.bodyWrapper=$("bodyWrapper");this.bodyWrapper.appendChild(this.modalDiv);this.modalDiv.style.height=this.pageHeight+"px";this.modalDiv.style.width=this.pageWidth+"px";this.modalDiv.style.filter="alpha(opacity=50)";this.modalDiv.style.opacity=0.5;this.modalDiv.style.MozOpacity=0.5;this.agentDiv=Element.extend(document.createElement("div"));this.bodyWrapper.appendChild(this.agentDiv);this.agentDiv.update(this.params.markup);this.closeWindowLink=this.agentDiv.getFirstElementByClassName("closeWindowLink");Event.observe(this.closeWindowLink,"click",this.close.bindAsEventListener(this));this.changeSearchDiv=this.agentDiv.getFirstElementByClassName("changeSearch");this.changeSearchDivHeight=this.changeSearchDiv.getHeight();this.changeSearchDivWidth=this.changeSearchDiv.getWidth();this.changeSearchDivTopMargin=0;if(this.changeSearchDivHeight<this.windowHeight){this.changeSearchDivTopMargin=(this.windowHeight-this.changeSearchDivHeight)*0.5}this.changeSearchDiv.style.marginTop=this.yScroll+this.changeSearchDivTopMargin+"px";this.changeSearchDivLeftMargin=0;if(this.changeSearchDivWidth<this.windowWidth){this.changeSearchDivLeftMargin=(this.windowWidth-this.changeSearchDivWidth)*0.5}this.changeSearchDiv.style.marginLeft=this.xScroll+this.changeSearchDivLeftMargin+"px";var D="";if(this.params.url){D=this.params.url;D="&"+D.substr(D.indexOf("?")+1)}else{D="&"+location.search.substring(1)}if(this.params.url&&this.params.url.indexOf("book")!=-1){D=D.replace("&amp%3B","&");D=D.replace("&amp;","&");var A=new Ajax.Request("/book/bookingpath",{parameters:"changeSearch=true"+D,onSuccess:this.success.bind(this),onFailure:this.failure})}else{var A=new Ajax.Request("/shop/searchForm",{parameters:"changeSearch=true"+D,onSuccess:this.success.bind(this),onFailure:this.failure})}},getPageDimensionsAndScroll:function(){if(window.innerHeight&&window.scrollMaxY){this.yScroll=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){this.yScroll=document.body.scrollHeight}else{this.yScroll=document.body.offsetHeight}}if(self.innerHeight){this.windowHeight=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){this.windowHeight=document.documentElement.clientHeight}else{if(document.body){this.windowHeight=document.body.clientHeight}}}if(this.yScroll<this.windowHeight){this.pageHeight=this.windowHeight}else{this.pageHeight=this.yScroll}if(self.pageYOffset){this.yScroll=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){this.yScroll=document.documentElement.scrollTop}else{if(document.body){this.yScroll=document.body.scrollTop}}}if(window.innerWidth&&window.scrollMaxX){this.xScroll=window.innerWidth+window.scrollMaxX}else{if(document.body.scrollWidth>document.body.offsetWidth){this.xScroll=document.body.scrollWidth}else{this.xScroll=document.body.offsetWidth}}if(self.innerWidth){this.windowWidth=self.innerWidth}else{if(document.documentElement&&document.documentElement.clientWidth){this.windowWidth=document.documentElement.clientWidth}else{if(document.body){this.windowWidth=document.body.clientWidth}}}if(this.xScroll<this.windowWidth){this.pageWidth=this.windowWidth}else{this.pageWidth=this.xScroll}if(self.pageXOffset){this.xScroll=self.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollLeft){this.xScroll=document.documentElement.scrollLeft}else{if(document.body){this.xScroll=document.body.scrollLeft}}}},close:function(A){Event.stop(A);this.visible=false;this.bodyWrapper.removeChild(this.modalDiv);this.bodyWrapper.removeChild(this.agentDiv);this.showSelectBoxes()},success:function(B){log.info("Response received from /shop/searchForm");if(this.visible){var A=this.agentDiv.getFirstElementByClassName("intrastitial");A.removeClassName("intrastitial");A.update(B.responseText);Page.initializeDOMFragment(A.parentNode.parentNode)}},failure:function(){log.error("No response from /shop/searchForm")}});var miniHotelForm=Class.create();miniHotelForm.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.triggerElement=this.element;this.triggerElement.pos=this.triggerElement.getPosition();this.paramsHash=$H(this.params);Event.observe(this.triggerElement,"click",this.showForm.bindAsEventListener(this));this.makeMiniForm()},makeMiniForm:function(){if($("miniHotelFormContainer")==null&&this.params.formMarkup){var B=Element.extend(document.createElement("div"));B.id="miniHotelFormContainer";B.className="noneBlock";var D=this.params.formMarkup.stripNoScripts();B.innerHTML=D;$("main").appendChild(B);var E=B.getFirstElementByClassName("closeFlyOut","span");Event.observe(E,"click",this.hideForm.bindAsEventListener(this));try{Page.initializeDOMFragment(B)}catch(A){Errors.capture(A,"initializeDOMFragment() failed for miniHotelForm();")}}},showForm:function(D){var A=$("miniHotelFormContainer");this.fixIE7Positioning();var B=A.getElementsByTagName("form")[0];Position.putInViewport(this.triggerElement,A);A.showByClass();this.paramsHash.each(function(F){if(F.key!="formMarkup"){var E=B.getInputs("hidden",F.key)[0];if(E==null){E=new Element("input",{type:"hidden",name:F.key})}E.value=F.value;B.appendChild(E)}}.bind(this));Event.stop(D)},fixIE7Positioning:function(B){var A=this.triggerElement.getParentByClassName("column1");if(A){A.style.position="relative"}},hideForm:function(A){$("miniHotelFormContainer").hideByClass();Event.stop(A)}});var GroupedMiniHotelForm=Class.create(Object.extend(new miniHotelForm(),{initExtend:function(){this.makeMiniForm();Event.observe(this.element,"click",function(A){try{var D=Event.element(A);var B="";if(D.tagName.toLowerCase()=="a"&&(B=D.getAgents()[0])&&B.type=="MiniHotelFormData"){Event.stop(A);this.paramsHash=$H(B.params);this.triggerElement=D;this.triggerElement.pos=this.triggerElement.getPosition();this.showForm()}}catch(E){Errors.capture(E,"in capture click for miniHotelForm")}}.bind(this))}}));var SelectFromPopup=Class.create();SelectFromPopup.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){var A=this.element;Event.observe(A,"click",this.loadLinkInOpener.bindAsEventListener(this))},loadLinkInOpener:function(A){self.opener.location.href=this.element.href;Event.stop(A);self.close()}});var PhotoGallery=Class.create();PhotoGallery.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){var D=this.element.parentNode;this.images=$A();this.imageIndex=0;$A(D.getElementsByTagName("A")).each(function(E){this.images.push(E)}.bind(this));D.removeChild(this.element);this.image=document.createElement("IMG");this.header=document.createElement("P");this.image.src=this.images[this.imageIndex].href;this.image.alt="";this.header.appendChild(document.createTextNode("1"));this.header.appendChild(document.createTextNode(" "+this.params.numText.strip()+" "+this.images.length));if(this.images.length>1){this.header.appendChild(document.createTextNode(" : "));var A=document.createElement("A");var B=document.createElement("A");A.appendChild(document.createTextNode(this.params.nextLink.strip()));B.appendChild(document.createTextNode(this.params.previousLink.strip()));A.href="#";B.href="#";this.header.appendChild(B);this.header.appendChild(document.createTextNode(" | "));this.header.appendChild(A);Event.observe(A,"click",this.nextClick.bind(this));Event.observe(B,"click",this.previousClick.bind(this));D.appendChild(this.header)}D.appendChild(this.image)},nextClick:function(A){this.imageIndex=(this.imageIndex+1>=this.images.length)?0:this.imageIndex+1;this.image.src=this.images[this.imageIndex].href;this.image.alt=this.images[this.imageIndex].title;this.header.firstChild.nodeValue=this.imageIndex+1;Event.stop(A)},previousClick:function(A){this.imageIndex=(this.imageIndex-1<0)?this.images.length-1:this.imageIndex-1;this.image.src=this.images[this.imageIndex].href;this.image.alt=this.images[this.imageIndex].title;this.header.firstChild.nodeValue=this.imageIndex+1;Event.stop(A)}});var PhotoViewer=Class.create(Abstract.Agent,{beforeDOMReady:true,bgOpacity:0.5,initExtend:function(){this.thCon=this.element.getFirstElementByClassName("thumbnails");this.img=this.element.getFirstElementByClassName("photo");this.thLst=this.thCon.getFirstElementByClassName("thumbnailLists");this.thOpn=false;this.cGrp=0;this.tGrps=$A();this.eff=false;this.numImagesLoaded=0;this.neverOpened=true;this.initializeThumbnailGroups();this.createToggleImages();this.createControlBackground();if(this.params.imageList.length>this.params.groupSize){this.createNextThumbnailsImage();this.createPreviousThumbnailsImage()}if(!Page.onLoadFired){Event.observe(window,"load",this.firstRun.bind(this))}else{if(this.params.isAjax){setTimeout(function(){this.firstRun()}.bind(this),2000)}else{this.firstRun()}}},initializeThumbnailGroups:function(){var H=this.params.imageList.eachSlice(this.params.groupSize);var F;for(var G=0;G<H.length;G++){var E=$A();this.tGrps[G]={};if(G==0){this.tGrps[G].wrapper=this.thCon.down("ul");var A=this.tGrps[G].wrapper.getElementsByTagName("img");var D=function(I){Event.observe(I,"load",function(){Event.stopObserving(I,"load");this.numImagesLoaded++;if(this.numImagesLoaded==A.length){this.firstRun()}}.bind(this))}.bind(this);for(var B=0;B<A.length;B++){D(A[B])}this.tGrps[G].initialized=true;this.offset=parseInt(window.getComputedStyle?window.getComputedStyle(this.thLst,null).left:this.thLst.currentStyle.left);F=this.tGrps[G].wrapper.getWidth()}else{this.tGrps[G].wrapper=$(new Element("ul",{"class":"hidden"}));this.tGrps[G].initialized=false}this.tGrps[G].wrapper.setStyle({left:(G*F)+"px"});for(var B=0;B<H[G].length;B++){E.push({imageURL:H[G][B].imgURL,thumbURL:H[G][B].thumbURL})}this.tGrps[G].images=E;this.tGrps[G].wrapper.observe("click",this.changeDisplayImage.bindAsEventListener(this))}},createToggleImages:function(){this.opn=new Element("a",{"class":"thumbnailsToggle block",href:"#"}).update(this.params.openButtonMarkup);this.opn.observe("click",this.toggleThumbnailList.bindAsEventListener(this));this.thCon.insert({bottom:this.opn});this.cls=new Element("a",{"class":"thumbnailsToggle noneBlock",href:"#"}).update(this.params.closeButtonMarkup);this.cls.observe("click",this.toggleThumbnailList.bindAsEventListener(this));this.thCon.insert({bottom:this.cls})},createNextThumbnailsImage:function(){this.nxt=new Element("a",{"class":"noneBlock nextThumbsIcon",href:"#"}).update(this.params.nextButtonMarkup);this.nxt.observe("click",this.scrollThumbnailList.bindAsEventListener(this,"next"));this.thCon.insert({bottom:this.nxt})},createPreviousThumbnailsImage:function(){this.prv=new Element("a",{"class":"noneBlock previousThumbsIcon",href:"#"}).update(this.params.previousButtonMarkup);this.prv.observe("click",this.scrollThumbnailList.bindAsEventListener(this,"previous"));this.thCon.insert({top:this.prv})},createControlBackground:function(){this.bck=new Element("div",{"class":"noneBlock controlBar"});this.bck.setOpacity(this.bgOpacity);this.thCon.insert({before:this.bck})},createNewThumbnailGroup:function(E){var F=this.tGrps[E];if(!F||F.initialized){return}for(var D=0;D<F.images.length;D++){var B=(new Element("li")).update(new Element("a",{href:F.images[D].imageURL}));var A=new Element("img");if(F.images[D].thumbURL){A.src=F.images[D].thumbURL}else{A.src=F.images[D].imageURL}B.down("a").update(A);F.wrapper.insert({bottom:B})}F.initialized=true;this.thLst.insert({bottom:F.wrapper})},firstRun:function(){if(!this.neverOpened){return}this.neverOpened=false;this.toggleThumbnailList()},toggleThumbnailList:function(G){if(G){G.preventDefault()}if(this.eff){return}this.eff=true;var A=this.tGrps[this.cGrp].wrapper.childElements();if(this.thOpn){this.bck.hideByClass();if(this.nxt){this.nxt.hideByClass()}if(this.prv){this.prv.hideByClass()}var H=this.tGrps[this.cGrp].wrapper.getPositionOffset(this.cls).x;var E=0;A.each(function(I){I.setStyle({position:"absolute",left:E+"px"});E=E+I.getWidth()});this.unsetSelectedImage();for(var D=0;D<A.length;D++){var B={style:"left: "+H+"px",duration:0.35-0.3*D/(this.params.groupSize-1),transition:Effect.Transitions.easeFrom};if(D==0){B.afterFinish=function(){this.tGrps[this.cGrp].wrapper.hideByClass();this.cls.hideByClass();this.opn.showByClass();this.thOpn=false;this.eff=false}.bind(this)}new Effect.Morph(A[D],B)}}else{var H=this.tGrps[this.cGrp].wrapper.getPositionOffset(this.opn).x;A.each(function(I){I.setStyle({position:"absolute",left:H+"px"})});this.tGrps[this.cGrp].wrapper.showByClass();var F=A[0].getWidth();var E=F*(A.length-1);for(var D=A.length-1;D>-1;D--){var B={style:"left: "+E+"px",duration:0.35-0.3*D/(this.params.groupSize-1),transition:Effect.Transitions.easeTo};if(D==0){B.afterFinish=function(){A.each(function(J){J.setStyle({position:"",left:""});var K=this.currentImageLink;if(K){this.setSelectedImage(K)}else{this.setSelectedImage(A[0].down("a"))}}.bind(this));var I=$A([{el:this.bck,op:this.bgOpacity}]);if(this.cGrp!=0){I.push({el:this.prv,op:1})}if(this.cGrp<this.tGrps.length-1){I.push({el:this.nxt,op:1})}I.each(function(J){J.el.setStyle({opacity:0});J.el.showByClass();new Effect.Morph(J.el,{style:"opacity: "+J.op,duration:0.25})});this.cls.showByClass();this.opn.hideByClass();this.eff=false;this.thOpn=true;this.createNewThumbnailGroup(this.cGrp+1)}.bind(this)}new Effect.Morph(A[D],B);E-=F}}},scrollThumbnailList:function(D,F){D.preventDefault();if(this.eff){return}this.eff=true;var B,E,A;if(F=="next"){B=this.cGrp+1}else{B=this.cGrp-1}E=this.tGrps[B].wrapper;A=this.tGrps[this.cGrp].wrapper;if(B==this.tGrps.length-1){this.nxt.hideByClass()}if(B==0){this.prv.hideByClass()}E.showByClass();new Effect.Morph(this.thLst,{style:"left: "+(-1*parseFloat(E.getStyle("left"))+this.offset)+"px",duration:0.35,transition:Effect.Transitions.sinoidal,afterFinish:function(){A.hideByClass();if(B<this.tGrps.length-1){this.nxt.showByClass()}if(B>0){this.prv.showByClass()}this.eff=false}.bind(this)});if(B<this.tGrps.length-1){this.createNewThumbnailGroup(B+1)}this.cGrp=B},changeDisplayImage:function(B){var A=Element.extend(B.findElement("a"));B.preventDefault();if(A==this.currentImageLink){return}if(A){var E=new Element("img",{src:A.href});this.unsetSelectedImage();this.setSelectedImage(A);var D=this.img;new Effect.Morph(D,{style:"opacity: 0",duration:0.25,afterFinish:function(){D.update(E);new Effect.Morph(D,{style:"opacity: 1",duration:0.25})}})}},setSelectedImage:function(A){this.currentImageLink=A;A.up("li").addClassName("current")},unsetSelectedImage:function(){var A=this.currentImageLink;if(A){A.up("li").removeClassName("current")}}});var UserReviewGraph=Class.create();UserReviewGraph.prototype=Object.extend(new Abstract.Agent(),{pxPerUnit:27,initExtend:function(){$A(this.element.getElementsByClassName("score")).each(function(D){var F=D.innerHTML.replace(/,/g,".");var E=Math.floor(F*this.pxPerUnit);D.style.width=(E/11)+"em"}.bind(this));var A='<dt class="noneBlock graphHeading">&nbsp;</dt><dd class="graphHeading"><span>1</span><span>2</span><span>3</span><span>4</span><span>5</span></dd>';var B=this.element.getElementsByTagName("dl")[0].innerHTML;this.element.getElementsByTagName("dl")[0].innerHTML=A+B;this.element.addClassName("userReviewGraph")}});var SubmitControlOnChange=Class.create();SubmitControlOnChange.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.control=this.element.getElementsByTagName("select")[0]||this.element.getElementsByTagName("input")[0];if(this.params.submitButtonName){this.submitButton=document.getElementsByName(this.params.submitButtonName)[0]}if(!this.control){log.error(this.type+": Required element undefined");return}if($(this.control).tagName=="SELECT"){this.control.observe("change",this.onChange.bindAsEventListener(this))}else{this.control.observe("click",this.onChange.bindAsEventListener(this))}},onChange:function(A){if(this.control.value){if(this.submitButton){this.submitButton.click()}else{this.control.form.submit()}}}});var CCVImage=Class.create();CCVImage.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.creditCardList=this.params.cardsInList;this.image=Element.extend(this.element.parentNode).getFirstElementByClassName("ccvImg");this.textBlock=Element.extend(this.element.parentNode).getFirstElementByClassName("ccvText");this.displayBlock=Element.extend(this.element.parentNode).getFirstElementByClassName("ccvDisplay");this.content3DSBlock=$A(this.element.parentNode.getElementsByClassName("cc3DSContent"));this.display3DSBlock=Element.extend(this.element.parentNode).getFirstElementByClassName("cc3DSDisplay");$A(this.element.getElementsByTagName("input")).each(function(A){if(A.type=="radio"){if(this.image!=null){Event.observe(A,"click",this.swapCCVImage.bindAsEventListener(this))}if(this.content3DSBlock!=null&&this.content3DSBlock.length>=3){Event.observe(A,"click",this.swap3DSContent.bindAsEventListener(this))}}}.bind(this));this.swapCCVImage();this.swap3DSContent()},swapCCVImage:function(A){for(i=0;i<this.creditCardList.length;i++){if(this.creditCardList[i].code==Event.element(A).value){this.image.innerHTML=this.creditCardList[i].img;if(this.creditCardList[i].img==""){this.displayBlock.hideByClass()}else{this.displayBlock.showByClass()}this.textBlock.innerHTML=this.creditCardList[i].text;break}}},swap3DSContent:function(F){for(i=0;i<this.creditCardList.length;i++){if(this.creditCardList[i].code==Event.element(F).value){var A=Element.extend(this.content3DSBlock[1]).getElementsBySelector(".cc3DSContentItem");var D=this.creditCardList[i].secureLogoCode;var E="cc3DSContentItem"+D;for(var B=0;B<A.length;B++){if(E.match(A[B].id)){A[B].showByClass()}else{A[B].hideByClass()}}this.content3DSBlock[0].hideByClass();this.content3DSBlock[2].innerHTML="<p>"+this.creditCardList[i].securetext+"</p>";this.content3DSBlock[2].showByClass();if(this.creditCardList[i].securetext){this.display3DSBlock.showByClass()}else{this.display3DSBlock.hideByClass()}break}}}});var SelectHideReveal=Class.create();SelectHideReveal.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.dropDown=$(this.element.getElementsByTagName("select")[0]);this.parentNode=this.dropDown.getParentByClassName(this.params.parentClass);Event.observe(this.dropDown,"change",this.toggleElements.bindAsEventListener(this))},toggleElements:function(){var A=(this.dropDown[this.dropDown.selectedIndex].value!=="")?this.dropDown[this.dropDown.selectedIndex].value:this.params.blankOptionName;for(var D=0;D<this.params.paymentOptions[A].showClasses.length;D++){$A(this.parentNode.getElementsByClassName(this.params.paymentOptions[A].showClasses[D])).each(function(E){E.showByClass()})}for(var B=0;B<this.params.paymentOptions[A].hideClasses.length;B++){$A(this.parentNode.getElementsByClassName(this.params.paymentOptions[A].hideClasses[B])).each(function(E){E.hideByClass()})}}});var AutoSubmitter=Class.create();AutoSubmitter.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){setTimeout(function(){this.element.click()}.bind(this),500)}});var CCSpecialFields=Class.create();CCSpecialFields.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.container=this.element.getParentByClassName("editBillingProfileInclude");this.targetFields=$A(this.container.getElementsByClassName(this.params.targetClassname));this.cardIDsRequiringFields=[];this.params.cardIDs.each(function(A){log.info("Adding "+A.code+" to special card array for "+this.params.targetClassname+" classed objects.");this.cardIDsRequiringFields[A.code]=true}.bind(this));$A(this.element.getElementsByTagName("input")).each(function(A){if(A.type=="radio"){Event.observe(A,"click",this.showHideFields.bindAsEventListener(this))}}.bind(this))},showHideFields:function(B){var A=Event.element(B).value;if(this.cardIDsRequiringFields[A]){this.targetFields.each(function(D){D.showByClass()}.bind(this))}else{this.targetFields.each(function(D){D.hideByClass()}.bind(this))}}});var CustomerAddressForm=Class.create();CustomerAddressForm.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:false,initExtend:function(){this.countryInput=null;this.countrySelect=null;this.countryWrapper=this.element.getFirstElementByClassName("addressCountryField");this.cityWrapper=this.element.getFirstElementByClassName("addressCityField");if(this.countryWrapper.getElementsByTagName("input").length>0){this.countryInput=this.element.getElementsByTagName("input")[0]}if(this.countryWrapper.getElementsByTagName("select").length>0){this.countrySelect=this.element.getElementsByTagName("select")[0]}this.stateProvince=this.element.getFirstElementByClassName("stateProvince");this.initialHTML=this.stateProvince.innerHTML;this.initialValue="";this.stateProvince.hasError=Element.extend(this.stateProvince.getElementsByTagName("label")[0]).hasClassName("error");if(this.stateProvince.getElementsByTagName("input").length>0){this.initialValue=this.stateProvince.getElementsByTagName("input")[0].value}if(this.stateProvince.getElementsByTagName("select").length>0){this.initialValue=this.stateProvince.getElementsByTagName("select")[0][this.stateProvince.getElementsByTagName("select")[0].selectedIndex].value}this.postalCodeWrapper=this.element.getFirstElementByClassName("postalCode");this.countriesWithoutPostalCode=$A(this.params.countriesWithoutPostalCode.split(","));this.getListAjax();this.setPostalCode();if(this.countrySelect!=null){Event.observe(this.countrySelect,"change",this.getListAjax.bindAsEventListener(this));Event.observe(this.countrySelect,"change",this.setPostalCode.bindAsEventListener(this))}},setPostalCode:function(){var A=null;if(this.countryInput!=null){A=this.countryInput.value}if(this.countrySelect!=null){A=this.countrySelect[this.countrySelect.selectedIndex].value}var B=false;for(i=0;i<this.countriesWithoutPostalCode.length;i++){if(this.countriesWithoutPostalCode[i]==A){B=true;break}}if(B){this.postalCodeWrapper.hideByClass()}else{this.postalCodeWrapper.showByClass()}},getListAjax:function(){this.stateProvince.addClassName("intrastitial");var A=null;if(this.countryInput!=null){A=this.countryInput.value}if(this.countrySelect!=null){A=this.countrySelect[this.countrySelect.selectedIndex].value}var B=new Ajax.Request("/helper/populateStateList",{parameters:"models[countryCode].countryCode="+A,onSuccess:this.success.bind(this),onFailure:this.failure.bind(this),onException:this.failure.bind(this)})},success:function(A){log.info("Response recieved from stateProvince AJAX");this.fillDiv(A.responseText);this.stateProvince.removeClassName("intrastitial")},failure:function(A){log.error("No response from stateProvince AJAX");this.initialFill(this.initialHTML);this.stateProvince.removeClassName("intrastitial")},fillDiv:function(E){var G="";var F=new RegExp('name="[^"]*"');G=E.replace(F,'name="'+this.params.stateProvinceBindNode+'"');var A=new RegExp('value="[^"]*"');G=G.replace(A,'value="'+this.initialValue+'"');this.stateProvince.update(G);if(this.stateProvince.hasError){this.stateProvince.getElementsByTagName("label")[0].addClassName("error")}if(this.stateProvince.getElementsByTagName("select").length>0){var B=this.stateProvince.getElementsByTagName("select")[0];for(var D=0;B.options[D];D++){if(B.options[D].value==this.initialValue){B.selectedIndex=D}}}},initialFill:function(A){this.stateProvince.innerHTML=A}});var ChangeShippingAddress=Class.create();ChangeShippingAddress.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){var A=$A(this.element.getElementsByTagName("input"));this.radios=$A();A.each(function(B){if(B.type=="radio"){this.radios.push(B)}}.bind(this));this.newAddressForm=this.element.getElementsBySelector(".profileAddressNew .editShipping");this.useBillingAddressSelected=true;this.useNewAddressSelected=false;this.radios.each(function(B){if(Element.extend(B.parentNode.parentNode).hasClassName("useBillingAddress")){if(!B.checked){this.useBillingAddressSelected=false}Event.observe(B,"click",this.useBillingAddress.bindAsEventListener(this))}}.bind(this));this.radios.each(function(B){if(Element.extend(B.parentNode.parentNode).hasClassName("profileAddressNew")){if(this.useBillingAddressSelected){B.checked=false}if(B.checked){this.useNewAddressSelected=true}Event.observe(B,"click",this.useNewAddress.bindAsEventListener(this))}else{if(Element.extend(B.parentNode.parentNode).hasClassName("profileAddress")){if(this.useBillingAddressSelected){B.checked=false}Event.observe(B,"click",this.useOtherAddress.bindAsEventListener(this))}}}.bind(this));this.existingAddressAlert=this.element.getElementsByClassName("existingAddressAlert")[0];if(this.useNewAddressSelected){this.useNewAddress()}},useNewAddress:function(){this.showNewAddress();this.radios.each(function(A){if(Element.extend(A.parentNode.parentNode).hasClassName("useOtherAddress")){A.checked=true;throw $break}})},useOtherAddress:function(){this.hideNewAddress();this.radios.each(function(A){if(Element.extend(A.parentNode.parentNode).hasClassName("useOtherAddress")){A.checked=true;throw $break}})},useBillingAddress:function(){this.hideNewAddress();this.radios.each(function(A){if(Element.extend(A.parentNode.parentNode).hasClassName("profileAddress")){A.checked=false}})},showNewAddress:function(){this.newAddressForm.each(function(A){A.showByClass()}.bind(this));if(this.existingAddressAlert){this.existingAddressAlert.hideByClass()}},hideNewAddress:function(){this.newAddressForm.each(function(A){A.hideByClass()}.bind(this));if(this.existingAddressAlert){this.existingAddressAlert.showByClass()}}});var LoyaltyProgram=Class.create();LoyaltyProgram.prototype={initialize:function(A){this.containerElement=A;this.isVisible=A.visibleByClass();if(this.isVisible){this.completeInitialization()}},completeInitialization:function(){var B=this.containerElement.getElementsByTagName("label");this.clearableFields=$A();for(var A=0;A<B.length;A++){var D=B[A].getElementsByTagName("input")[0];if(D==null){D=B[A].getElementsByTagName("select")[0]}if(D){this.clearableFields.push(D)}}this.deleteLink=this.containerElement.getLastElementByClassName("deleteProgram","span");Event.observe(this.deleteLink,"click",this.deleteProgram.bindAsEventListener(this))},addProgram:function(){this.containerElement.showByClass();this.completeInitialization()},deleteProgram:function(){this.clearableFields.each(function(B){B.value="";if(document.fireEvent){B.fireEvent("onchange")}else{var A=document.createEvent("HTMLEvents");A.initEvent("change",true,true);B.dispatchEvent(A)}});this.containerElement.hideByClass()}};var LoyaltyPrograms=Class.create();LoyaltyPrograms.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.loyaltyPrograms=$A();this.nextAvailableLoyaltyProgram=0;var A=this.element.getElementsByTagAndClass("div","loyaltyProgram");for(var B=0;B<A.length;B++){var D=new LoyaltyProgram(A[B]);if(D.isVisible){this.nextAvailableLoyaltyProgram++}this.loyaltyPrograms.push(D)}this.numLoyaltyPrograms=this.loyaltyPrograms.length;this.addProgramLink=this.element.getLastElementByClassName("addProgramLink","p");Event.observe(this.addProgramLink,"click",this.addAnotherProgram.bindAsEventListener(this))},addAnotherProgram:function(){if(this.nextAvailableLoyaltyProgram<this.loyaltyPrograms.length){this.loyaltyPrograms[this.nextAvailableLoyaltyProgram].addProgram();this.nextAvailableLoyaltyProgram++;if(this.nextAvailableLoyaltyProgram>=this.loyaltyPrograms.length){this.addProgramLink.remove()}}else{log.error("no more to show")}}});var WebTrends=Class.create();WebTrends.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){if(this.enabled){this.webTrendsCallback=(function(){var A=["DCS.dcsuri",location.pathname,"WT.ti",this.title];for(i in this.nameValuePairs){A.push(this.webTrendsPrefix+i);A.push(this.nameValuePairs[i])}dcsSetVar.apply(undefined,A);if(!this.persistent){Event.stopObserving(this.element,this.eventType,this.webTrendsCallback)}}).bind(this);Event.observe(this.element,this.eventType,this.webTrendsCallback)}}});var WebTrendsMultiTrackListener=Class.create();WebTrendsMultiTrackListener.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:false,initExtend:function(){this.defaultTags=$H({"DCS.dcsuri":"","DCS.dcsqry":"","WT.ti":"","WT.ad":"","WT.mc_id":"","WT.sp":""});document.observe("webtrends:multiTrackEvent",function(E){var G=E;var F=G.pathname?((G.pathname.indexOf("/")!=0)?"/"+G.pathname:G.pathname):"/";var D=G.textContent||G.innerText||G.innerHTML||"";var B=this.defaultTags.clone();B.set("DCS.dcsuri",F);B.set("DCS.dcsqry",G.search||"");B.update($H(E.memo));var A=[];B.each(function(H){A.push(H.key);A.push(H.value)});log.debug("WebTrends, sending: dcsMultiTrack() with parameters: "+A);dcsMultiTrack.apply(undefined,A);dcsCleanUp()}.bind(this))}});var WebTrendsTrackElement=Class.create();WebTrendsTrackElement.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){var A=this.element.tagName.toLowerCase();if(A!="a"){this.tags=this.params.tags;Event.observe(this.element,this.params.event,function(B){this.element.fire("webtrends:multiTrackEvent",this.params.tags)}.bind(this))}}});var WebTrendsTrackSliderChange=Class.create();WebTrendsTrackSliderChange.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.tags=this.params.tags;this.element.observe("agent:sliderChange",function(A){this.element.fire("webtrends:multiTrackEvent",this.tags)}.bind(this))}});var WebTrendsTrackCheckboxList=Class.create();WebTrendsTrackCheckboxList.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.tags=this.params.tags;this.checkboxes=this.element.select("input[type=checkbox]");this.tagPrefixes=$H();this.params.dynamicallyAddValue.each(function(A){this.tagPrefixes.set(A,this.tags[A])}.bind(this));this.checkboxes.each(function(A){A.observe("click",function(B){elem=B.element();if(elem.checked){if(this.params.dynamicallyAddValue!=null){this.params.dynamicallyAddValue.each(function(D){this.tags[D]=this.tagPrefixes.get(D)+elem.value}.bind(this))}this.element.fire("webtrends:multiTrackEvent",this.tags)}}.bind(this))}.bind(this))}});var WebTrendsTrackSelectBox=Class.create();WebTrendsTrackSelectBox.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.tags=this.params.tags;var A=this.element.select("select");for(i=0;i<A.length;i++){Event.observe(A[i],"change",function(B){elem=B.element();if(this.params.dynamicallyAddValue!=null){this.params.dynamicallyAddValue.each(function(D){this.tags[D]+=elem.value}.bind(this))}elem.fire("webtrends:multiTrackEvent",this.tags)}.bind(this))}}});var RemoveLinks=Class.create();RemoveLinks.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){$A(this.element.getElementsByTagName("a")).each(function(B){var D=document.createElement("span");D.innerHTML=B.innerHTML;var A=B.parentNode;A.replaceChild(D,B)})}});var LightboxAgent=Class.create();LightboxAgent.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:false,initialize:function(A,B){Object.extend(this,B);this.element=Element.extend(A);this.dialogObject=new Lightbox([this.element],B.params.content,B.params.options)}});var DialogPositioningContextAgent=Class.create();DialogPositioningContextAgent.prototype=Object.extend(new Abstract.Agent(),{initialize:function(A,B){Object.extend(this,B);this.element=Element.extend(A);this.dialogPositioningContextObject=new DialogPositioningContext(this.element)}});var ChangeSearchLightboxAgent=Class.create(Abstract.Agent,{beforeDOMReady:false,initialize:function(A,B){Object.extend(this,B);this.element=Element.extend(A);this.dialogObject=new ChangeSearchLightbox([this.element],B.params.content,B.params.options)}});var ContainedLightboxAgent=Class.create(Abstract.Agent,{beforeDOMReady:false,initialize:function(A,B){Object.extend(this,B);this.element=Element.extend(A);this.dialogObject=new ContainedLightbox([this.element],B.params.content,B.params.options)}});var ElementUpdater=Class.create();ElementUpdater.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){document.observe("content:update",this.updateContent.bindAsEventListener(this))},updateContent:function(A){if(this.params.sourceKey in A.memo){this.hideContent(this.element,function(){try{this.element.update(A.memo[this.params.sourceKey]);Page.initializeDOMFragment(this.element);document.fire("contentUpdate:succeeded")}catch(B){Errors.capture(B)}this.showContent(this.element)}.bind(this))}},hideContent:function(A,B){document.body.style.cursor="wait";new Effect.Fade(A,{duration:0.2,to:0.2,afterFinish:B})},showContent:function(A){new Effect.Appear(A,{duration:0.2,from:0.2,to:1});document.body.style.cursor="default"}});var ElementUpdateTrigger=Class.create();ElementUpdateTrigger.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){var A=this.params.event?this.params.event:"click";this.control=this.element.getElementsByTagName("input")[0]||this.element.getElementsByTagName("select")[0];Event.observe(this.control,A,this.updateSummary.bindAsEventListener(this))},updateSummary:function(B){document.fire("contentUpdate:started");var D=this.control.form;var E=Form.serialize(D).deleteQueryStringParam("_eventId",true)+"&"+this.params.eventId+"=true";var A=new Ajax.Request(D.action,{method:"post",parameters:E,onSuccess:function(F){document.fire("content:update",F.responseText.unescapeJSON().evalJSON())},onFailure:function(){log.error("No response from application for Element Updates")}})}});var AjaxStatusFlagManager=Class.create();AjaxStatusFlagManager.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){document.observe("contentUpdate:started",this.ajaxStarted.bindAsEventListener(this));document.observe("contentUpdate:succeeded",this.ajaxSucceeded.bindAsEventListener(this));this.element.value="true"},ajaxStarted:function(A){log.debug("setting ajax response status to false");this.element.value="false"},ajaxSucceeded:function(A){log.debug("setting ajax response status to true");this.element.value="true"}});var NonLocalizedContentManager=Class.create();NonLocalizedContentManager.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){Event.observe(this.element.down("a"),"click",function(A){this.element.replace(this.params.content);A.preventDefault()}.bindAsEventListener(this))}});var Autocomplete=Class.create();Autocomplete.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){if(!this.params.url){log.error("Autocomplete: No 'url' parameter was passed to agent");return}this.input=this.element.getElementsByTagName("input")[0];if(!this.input){log.error("Autocomplete: No input found inside element");return}$(this.input).writeAttribute("autocomplete","off");this.suggestions=new Element("div",{className:"smartFill"});this.element.parentNode.insertBefore(this.suggestions,this.element.nextSibling);this.params.parameters=Object.toQueryString(this.params.parameters);if(this.params.highlightMatches){this.params.transformResponse=this.highlightMatches.bind(this)}this.autocompleter=new Ajax.AutocompleterJSON(this.input,this.suggestions,this.params.url,this.params);if(this.params.additionalInfoInputName){this.additionalInfo=new Element("input",{type:"hidden",name:this.params.additionalInfoInputName,value:this.params.additionalInfoInputValue||""});this.element.parentNode.insertBefore(this.additionalInfo,this.element.nextSibling);new ClearValueOnChange(this.element,{type:"ClearValueOnChange",params:{inputToClearName:this.params.additionalInfoInputName,inputToClearValue:this.params.additionalInfoInputValue||null}});Event.observe(this.element.form,"submit",this.matchResults.bindAsEventListener(this))}},highlightMatches:function(D){var B=this.input.value.strip();B=B.escapeRegex();B=new RegExp("("+B+")","im");var A=$(D).select("li");A.each(function(E){E.cleanWhitespace();$A(E.childNodes).each(function(G){if(G.nodeName=="#text"){var F=new Element("span").update(G.nodeValue.replace(B,'<span class="match">$1</span>'));E.replaceChild(F,G)}})});return D},matchResults:function(){if(this.autocompleter.results){var A=this.input.value.strip().toLowerCase();var D=this.autocompleter.results;for(var B=0;B<D.length;B++){if(A==D[B].suggestion.toLowerCase()){this.additionalInfo.value=D[B].additionalInfo;break}}}}});var Intrastitial=Class.create();Intrastitial.prototype={initialize:function(D,A,B){if(arguments.length>=2){this.targetElement=A;this.mask=new Element("div",{"class":"resultsIntrastitial"});this.messageDiv=new Element("div",{"class":"resultsIntrastitialMessage"});this.messageDiv.innerHTML="<span>"+D+"</span>";this.disableCenterInViewport=B;this.mask.setOpacity(0.8);this.messageDiv.setOpacity(0.8);this.hide();this.targetElement.appendChild(this.mask);this.targetElement.appendChild(this.messageDiv)}else{log.error("Intrastitial.initialize: too few arguments!")}},show:function(){if(this.mask){if(!this.disableCenterInViewport){this.positionMessageInViewport()}var A=this.targetElement.getDimensions();this.mask.setStyle({width:A.width+"px",height:A.height+"px"});this.mask.show()}if(this.messageDiv){this.messageDiv.show()}},hide:function(){if(this.mask){this.mask.hide()}if(this.messageDiv){this.messageDiv.hide()}},positionMessageInViewport:function(){if(this.messageDiv){this.messageDiv.style.top=((document.viewport.getHeight()/2)-(this.messageDiv.getDimensions().height/2))-this.targetElement.viewportOffset().top+"px"}},destroy:function(){if(this.mask){this.mask.remove()}if(this.messageDiv){this.messageDiv.remove()}}};var MultiNodeUpdaterTarget=Class.create(Abstract.Agent,{beforeDOMReady:false,initExtend:function(){Page.multiNodeTargets=Page.multiNodeTargets||{};this.dialogManager=new DialogManager(this.element);if(Page.multiNodeTargets[this.params.targetId]){try{var B=Page.multiNodeTargets[this.params.targetId];B.dialogManager.destroy();B.element.parentNode.replaceChild(this.element,B.element);delete B}catch(A){Errors.capture(A)}}Page.multiNodeTargets[this.params.targetId]=this}});var GoogleCSESearchBox=Class.create(Abstract.Agent,{initExtend:function(){var A=new Template('<form id="searchbox_#{cx}" action="/App/PrepareSearchResult"><input type="hidden" name="cx" value="#{cx}" /><input type="hidden" name="safe" value="active" /><input type="hidden" name="cof" value="FORID:9;NB:1" /><input type="hidden" class="searchValue" name="ve_kw" value="" /><input class="searchBox" name="q" size="36" value="" type="search" autosave="#{autosave}" results="10" /><span class="control submit"><input class="button" type="submit" value="#{buttonText}" /></span></form>');this.element.update(A.evaluate({cx:this.params.cx,buttonText:this.params.buttonText,autosave:this.params.autosave}));Event.observe(this.element.down("form"),"submit",this.handleSubmit.bind(this))},handleSubmit:function(D){var B=this.element.down("input.searchBox");var E=this.element.down("input.searchValue");var A=(B)?B.value:"";A=A.replace(/^\s+/,"");A=A.replace(/\s+$/,"");if(E){E.value=A}if(A==""){if(D){Event.stop(D)}return false}}});var RevealReadMore=Class.create(new Abstract.Agent(),{beforeDOMReady:false,initExtend:function(){this.expandText=this.params.expandText;this.collapseText=this.params.collapseText;this.expandClass=this.params.expandClass;this.collapseClass=this.params.collapseClass;this.eventSource=this.params.eventSource;if(!this.expandText&&!this.collapseText&&!this.expandClass&&!this.collapseClass){log.error(this.type+": Required param undefined");return}var A=this.params.ancestorNode,B=this.params.nodesToCheck,D=this.params.eventToObserve;if(A&&B){this.elemsToCheck=this.element.up(A).select(B)}else{this.elemsToCheck=[this.element]}if(D){this.element.observe(D,this.processEvent.bind(this))}else{this.checkHeight()}},processEvent:function(A){if(!this.eventSource||(this.eventSource&&A.findElement(this.eventSource)!==document)){this.checkHeight()}},checkHeight:function(D){var A,B;if(this.elemsToCheck){this.elemsToCheck.each(function(E){E.addClassName(this.collapseClass);E.addClassName(this.expandClass);A=E.getHeight();E.removeClassName(this.expandClass);if(A>E.getHeight()&&!E.next(".toggle")){B=$(new Element("span",{"class":"toggle"})).update(this.expandText);E.insert({after:B});B.observe("click",this.toggleExpand.bind(this))}},this)}},toggleExpand:function(D){var B=D.findElement(),A=B.up().previousSiblings()[0];if(A.hasClassName(this.collapseClass)){A.removeClassName(this.collapseClass);A.addClassName(this.expandClass);B.up().update(this.collapseText)}else{A.removeClassName(this.expandClass);A.addClassName(this.collapseClass);B.up().update(this.expandText)}D.preventDefault()}});var DropDownMenu=Class.create(new Abstract.Agent(),{beforeDOMReady:false,initExtend:function(){this.showClass=this.params.showClass;this.menuLinkClass=this.params.menuLinkClass;if(!this.showClass||!this.menuLinkClass){log.error(this.type+": Required param undefined");return}this.element.observe("click",this.toggleMenu.bind(this));document.observe("click",this.closeMenu.bind(this))},toggleMenu:function(D){var B=D.element();if(B.hasClassName(this.menuLinkClass)){D.stop();var A=B.up();this.activeMenu==A?this.closeMenu():this.openMenu(A)}},openMenu:function(A){this.closeMenu();this.activeMenu=A.addClassName(this.showClass)},closeMenu:function(){this.activeMenu&&this.activeMenu.removeClassName(this.showClass);this.activeMenu=null}});var FixedHeightReveal=Class.create(Abstract.Agent,{initExtend:function(){this.element.style.overflow="hidden";var D=Element.extend(this.element.getElementsByTagName("a")[0]).getStyle("line-height");D=D.substring(0,D.length-2);var A=D*this.params.numberOfLines+2;var F=this.element.down();var E=F.getDimensions().height;if(D==E){this.element.style.height="auto";return}var B=new Element("div").addClassName("moreLink");var G=new Element("a").addClassName("link").update(this.params.moreLinkText);var H=function(){F.style.overflow="visible";F.style.height="auto";this.element.removeChild(B);this.element.style.height="auto"};Event.observe(G,"click",H);B.appendChild(G);if(E>=A){F.style.overflow="hidden";F.style.height=D+"em";this.element.appendChild(B)}}});var CopyDateOfBirth=Class.create();CopyDateOfBirth.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.infantdobInput=this.element.up(".traveler").down(".dateOfBirth input");this.tsaDateOfBirth=this.element.down("label.tsaDateOfBirth input");if(!this.infantdobInput||!this.tsaDateOfBirth){log.error("CopyDateOfBirth: couldn't find input");return}this.infantdobInput.observe("blur",this.checkInputAndCopyDateOfBirth.bindAsEventListener(this));this.tsaDateOfBirth.writeAttribute("readonly","readonly")},checkInputAndCopyDateOfBirth:function(A){this.tsaDateOfBirth.value=this.infantdobInput.value}});var Print=Class.create();Print.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){window.print()}});var LazyLoader=Class.create();LazyLoader.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:true,initExtend:function(){var B=(this.params.url)?this.params.url:null;if(!B){log.error("LazyLoader: No 'url' parameter was passed to agent");return}var A=(this.params.filetype)?this.params.filetype.toUpperCase():null;if(!A){log.error("LazyLoader: No 'filetype' parameter was passed to agent");return}var D=function(){switch(A){case"JS":var E=document.createElement("script");E.type="text/javascript";E.src=document.location.protocol+"//"+B;document.getElementsByTagName("head")[0].appendChild(E);break;case"CSS":var E=document.createElement("link");E.type="text/css";E.rel="stylesheet";E.media=(this.params.media)?this.params.media.toLowerCase():"all";E.href=document.location.protocol+"//"+B;document.getElementsByTagName("head")[0].appendChild(E);break;default:log.warning("&lt;"+A+"&gt; file not supported in LazyLoader agent.");log.info("Please edit LazyLoader.initExtend if you wish to implement lazy loading functionality for this file type.");break}};if(Page.onLoadFired){D()}else{Event.observe(window,"load",D.bind(this))}}});var RateCalendar=Class.create(Abstract.Agent,{initExtend:function(){this.isPartial=false;this.calendarContainerReference=this.element;this.params.mcOptions.tearDown=this.addDialogContentToRecentlyViewedBox.bind(this);this.dialogObject=new Microcontent(this.element.select(".miniAirFormTrigger a"),{jsTemplate:{id:this.params.templateId,dataAttributeName:"data-miniAirForm"}},this.params.mcOptions);this.attachEventHandlers(false);if(this.params.intrastitialMessage){this.intrastitial=new Intrastitial(this.params.intrastitialMessage,$(this.element.parentNode),true)}},addDialogContentToRecentlyViewedBox:function(D){var F;var A;if(D){F=this.recentlyViewedList;A=this.recentlyViewedHeader}else{var B=$(this.dialogObject.markup.mainInfo).getFirstElementByClassName("airFareDatesContainer");F=B&&B.innerHTML;A=B&&this.dialogObject.markup.mainInfo.getFirstElementByClassName("dateSelectionHeading").innerHTML}if(F){if(!this.recentlyViewedList||D){this.element.down(".rateCalendar").insert({after:this.params.recentlyViewedMarkup})}try{this.recentlyViewedList=F;this.recentlyViewedHeader=A;Page.initializeDOMFragment($(this.element).getFirstElementByClassName("airFareDatesContainer").update(F));$(this.element).getFirstElementByClassName("recentlyViewedHeader").update(A)}catch(E){log.error("Could not update recently viewed box with elements from microcontent.")}}},fetch:function(A){A.preventDefault();this.dialogObject.close();this.intrastitial.show();new Ajax.PartialRequest(encodeURI($(Event.findElement(A,"a")).readAttribute("href")),{onComplete:function(B){this.initPartial(B)}.bind(this),method:"get"})},ajaxSubmit:function(B){this.dialogObject.close();this.intrastitial.show();var A=B.element();new Ajax.PartialRequest(A.form.action,{parameters:$(A.form).serialize(),onComplete:function(D){this.initPartial(D)}.bind(this),method:"get"})},attachEventHandlers:function(A){if(A){this.dialogObject.attachTriggers($(this.calendarContainerReference).select(".miniAirFormTrigger a"))}$A(this.calendarContainerReference.getElementsByClassName("monthLink")).each(function(B){$(B).observe("click",this.fetch.bindAsEventListener(this))}.bind(this));$A(this.calendarContainerReference.getElementsByTagName("select")).each(function(B){$(B).observe("change",this.ajaxSubmit.bindAsEventListener(this))}.bind(this))},initPartial:function(A){this.dialogObject.close();this.calendarContainerReference.update(A.responseText);this.addDialogContentToRecentlyViewedBox(true);this.attachEventHandlers(true);this.intrastitial.hide()}});var ProgressIndicator=Class.create();ProgressIndicator.prototype={initialize:function(D,J){log.debug("ProgressIndicator.initialize");var G=J?J:"&#8226;";var A=D?D*0.75:0.75;this.container=new Element("div").addClassName("progressIndicator").setStyle({position:"relative"});this.spinners=$A();for(var H=0;H<12;H++){var B=1-((H*83333)/1000000);var K=new Element("span").update(G).setOpacity(B);var F=(Math.PI*H)/6;var E=(Math.sin(F)*A).toFixed(3);var I=(Math.cos(F)*A).toFixed(3);K.setStyle({position:"absolute",top:E?E+"em":"0",left:I?I+"em":"0"});this.spinners.push(K);this.container.appendChild(K)}this.start()},start:function(){this.interval=setInterval(this.fadeStep.bind(this),83)},stop:function(){clearInterval(this.interval)},fadeStep:function(){this.spinners.each(function(D){var B=D.getOpacity();var A=B+0.083;if(A>=0.99){A=0}D.setOpacity(A)}.bind(this))},destroy:function(){log.debug("ProgressIndicator.destroy()");this.stop();this.container.remove();delete this.spinners;delete this.container;return null}};var ProgressIndicatorAgent=Class.create(Abstract.Agent,{initExtend:function(){var B,A;if(this.params){B=this.params.radius;A=this.params.symbol}this.pi=new ProgressIndicator(B,A);this.element.appendChild(this.pi.container)}});var AnyCheckbox=Class.create();AnyCheckbox.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:true,initExtend:function(){var A=new Template('<label class="control checkbox anyCheckbox">			<input name="" value="ANY" type="checkbox" />			<span>#{label}</span>		</label>');A=A.evaluate({label:this.params.label});this.checkboxes=this.element.select("input[type=checkbox]");if(!this.checkboxes||this.checkboxes.length<2){log.error("AnyCheckbox: Could not find checkboxes");return}this.checkboxes[0].up("label").insert({before:A});this.anyCheckbox=this.element.select("input[type=checkbox]")[0];if(this.shouldCheckAny()){this.checkAny()}this.element.observe("click",this.checkStatus.bindAsEventListener(this))},checkStatus:function(B){var A=B.element();if(A==this.anyCheckbox){if(A.checked){this.checkAny()}else{this.uncheckOthers()}}else{if(this.shouldCheckAny()){this.checkAny()}else{this.uncheckAny()}}},shouldCheckAny:function(){var A=this.checkboxes.length;var D=this.checkboxes[0].checked;for(var B=1;B<A;B++){if(this.checkboxes[B].checked!=D){return false}}return true},checkAny:function(){this.anyCheckbox.checked="checked";this.anyCheckbox.disabled="disabled";this.uncheckOthers()},uncheckAny:function(){this.anyCheckbox.disabled="";this.anyCheckbox.checked=""},uncheckOthers:function(){this.checkboxes.each(function(A){A.checked=""})}});var ClearValueOnChange=Class.create();ClearValueOnChange.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.inputToWatch=$(this.element.getElementsByTagName("input")[0]);if(!this.params.inputToClearName){log.error("ClearValueOnChange: No 'inputToClearName' parameter was passed to agent");return}this.inputToClearElement=this.inputToWatch.form[this.params.inputToClearName];if(this.inputToClearElement){this.inputToClearElement.value=this.params.inputToClearValue||this.inputToClearElement.value}else{log.error("ClearValueOnChange: No input with name '"+this.params.inputToClearName+"' was found in base element's parent form.");return}this.attachChangeListener()},attachChangeListener:function(){this.changeListener=function(A){this.inputToClearElement.value="";this.inputToWatch.stopObserving("change",this.changeListener);this.changeListener=null}.bindAsEventListener(this);this.inputToWatch.observe("change",this.changeListener)}});var Filter=Class.create(Object.extend(new Abstract.Agent(),{beforeDOMReady:false,initExtend:function(){this.mainLayoutElement=$("main");this.intrastitialMessage=this.params.intrastitialMessage||"";if(this.intrastitial==null){this.intrastitial=new Intrastitial(this.intrastitialMessage,this.mainLayoutElement)}this.mostRecentRequest=null;this.element.observe("click",this.processEvent.bindAsEventListener(this,"click"));this.element.observe("agent:filter",this.processEvent.bindAsEventListener(this,"agent:filter"));var B=(this.element.tagName.toLowerCase()=="form")?this.element:this.element.up("form");B.observe("submit",this.processEvent.bindAsEventListener(this,"submit"));this.lastQuery=unescape(B.serialize());var A=this.element.select("select");for(i=0;i<A.length;i++){Event.observe(A[i],"change",function(F){var E=(typeof this.form!="undefined")?this.form:$(Event.findElement(F,"form"));var G=unescape(E.serialize())+"&rep=partial";var D=E.action;this.fetch(D,G)}.bind(this))}},processEvent:function(E,A){var D=Event.element(E);if((A=="agent:filter"&&!E.memo.url)||(A=="submit")||(D.tagName.toLowerCase()=="input"&&D.getAttribute("type")=="checkbox")){if(D.tagName.toLowerCase()=="input"&&!D.readAttribute("name")){return}var B=$(Event.findElement(E,"form"));if(!B){return}var F=unescape(B.serialize());this.fetch(B.action,F)}else{if(A=="agent:filter"&&E.memo.url){this.fetch(E.memo.url)}}if(A=="submit"){E.preventDefault()}},fetch:function(A,B){if(B&&B==this.lastQuery){return}this.lastQuery=B;document.fire("agent:updatingResults");B=B||"";new Ajax.Request(A,{method:"get",parameters:B+"&rep=partial",onCreate:(function(D){if(!this.mostRecentRequest){this.intrastitial.show()}this.mostRecentRequest=D.transport}).bind(this),onSuccess:(function(D){if(D.transport==this.mostRecentRequest){Page.initializeAjaxResponse(D.responseText);this.intrastitial.hide();this.mostRecentRequest=null;document.fire("agent:resultsUpdated")}}).bind(this),onFailure:(function(D){if(D.transport==this.mostRecentRequest){this.intrastitial.hide();this.mostRecentRequest=null;window.location.reload()}}).bind(this)})}}));var FilterOnLinkClick=Class.create(Object.extend(new Abstract.Agent(),{beforeDOMReady:true,initExtend:function(){this.element.observe("click",this.callFilter.bindAsEventListener(this));if(this.params.hiddenInput){this.hiddenInput=(new Element("div")).update(this.params.hiddenInput).childElements()[0];this.element.insert({bottom:this.hiddenInput})}if(this.params.updateCheckboxes){this.checkboxes=this.element.select(".checkbox input")}},callFilter:function(D){var B=D.findElement("a");if(B){if(this.hiddenInput){this.hiddenInput.value=B.href.toQueryParams()[this.hiddenInput.name]||"";this.element.fire("agent:filter")}if(this.checkboxes){var A=B.readAttribute("href").toQueryParams();this.checkboxes.each(function(E){if(!E.readAttribute("disabled")){var F=A[E.readAttribute("name")];if(F==="ALL"){E.checked=true}else{if(F==="NONE"){E.checked=false}else{E.checked=(F==E.readAttribute("value"))}}}});this.element.fire("agent:filter")}else{this.element.fire("agent:filter",{url:B.href})}D.preventDefault()}}}));var FilterLinksToggleState=Class.create(Object.extend(new Abstract.Agent(),{beforeDOMReady:false,initExtend:function(){this.className="selected";if(this.params.className){this.className=this.params.className}this.element.observe("click",this.toggleState.bindAsEventListener(this))},toggleState:function(D){var B=D.findElement("a");if(B){var A=B.up("li");if(A){var E=B.down("img");if(E){A.removeClassName(this.className);B.addClassName("offscreen")}else{A.addClassName(this.className);A.siblings().each(function(F){if(F.hasClassName(this.className)){F.removeClassName(this.className);if(F.down("a img")){F.down("a").remove()}}}.bind(this))}}else{log.error("FilterLinksToggleState : listItem undefined")}}}}));var Fixed=Class.create();Fixed.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:false,TEST_INTERVAL:100,initExtend:function(){var A=this.createFixedElement();if(!A){return}if(this.params.hideLinkMarkup&&PersistUtil.ready()){this.persistStore=new Persist.Store("FixedAgent");this.persistStore.get("expiration",function(B,D){if(!(B&&D)||!(new Date().getTime()-D<0)){this.show()}}.bind(this))}else{this.show()}},createFixedElement:function(){this.fixedElement=new Element("div",{"class":"fixedAgentLocked"});this.fixedElement.hide();document.body.appendChild(this.fixedElement);if(this.fixedElement.getStyle("position")=="static"){this.fixedElement.remove();return false}this.fixedElement.remove();this.fixedElement.show();return true},show:function(){this.fixedElement.setStyle({height:this.element.getHeight()+"px",width:this.element.getWidth()+"px"});this.fixedElement.appendChild(new Element("div",{"class":"fixedShadow"}));if(this.params.hideLinkMarkup){var B=new Element("div",{"class":"hideTab"}).insert(this.params.hideLinkMarkup);this.fixedElement.appendChild(B);B.down("a").observe("click",function(D){D.preventDefault();this.disable();if(this.persistStore){this.persistStore.set("expiration",new Date().getTime()+604800000)}}.bind(this))}this.placeHolder=$(this.element.cloneNode(false));if(this.placeHolder.hasAttribute("id")){this.placeHolder.removeAttribute("id")}if(this.placeHolder.hasAttribute("agent")){this.placeHolder.removeAttribute("agent")}this.placeHolder.setStyle({borderWidth:0,padding:0});var A=this.element.cumulativeOffset();this.initialYPos=A.top;this.initialXPos=A.left;this.fixedState=false;this.scrollingState=false;this.observer=this.setScrolling.bind(this);if(!this.params.startDisabled){if(this.params.adjustScrollForAnchoredPageLoads){this.adjustScroll=true}this.enable();this.adjustScroll=false}if(this.params.enableMVT){this.mvtListener=(function(D){document.stopObserving("mvt:HOTEL200_stalkbar",this.mvtListener);if(D.memo=="disable"){this.disable()}else{if(D.memo=="toggle"){if(this.enabled){this.disable()}else{this.enable()}}}this.mvtListener=null}).bindAsEventListener(this);document.observe("mvt:HOTEL200_stalkbar",this.mvtListener);this.element.fire("mvt:HOTEL200_stalkbar-ready")}},enable:function(){if(this.enabled){return}this.testModeChange();Event.observe(window,"scroll",this.observer);document.observe("mouseup",this.observer);this.enabled=true},disable:function(){if(!this.enabled){return}Event.stopObserving(window,"scroll",this.observer);document.stopObserving("mouseup",this.observer);this.unlock();this.enabled=false},testModeChange:function(){if(!this.fixedState){var A=this.element.cumulativeOffset()[1];if((A!=this.initialYPos)&&(A>=0)){this.initialYPos=A;log.info("Fixed Agent: Change initialYPos to "+A)}}if(!this.fixedState&&this.getVerticalScrolledDistance()>this.initialYPos){this.lock()}else{if(this.fixedState&&this.getVerticalScrolledDistance()<this.initialYPos){this.unlock()}else{this.fixPosition()}}},fixPosition:function(){if(this.fixedState){this.horizontalDistance=this.initialXPos-this.getHorizontalScrolledDistance();this.fixedElement.style.left=this.horizontalDistance+"px"}else{this.fixedElement.style.left=0}},lock:function(){if(this.fixedState){return}this.fixedState=true;this.fixPosition();var A=this.element.getDimensions();this.placeHolder.setStyle({height:A.height+"px",width:A.width+"px"});if(this.adjustScroll&&this.getVerticalScrolledDistance()>this.initialYPos+A.height){this.adjustScroll=false;if(document.body&&document.body.scrollTop){document.body.scrollTop=document.body.scrollTop+A.height}else{if(document.documentElement&&document.documentElement.scrollTop){document.documentElement.scrollTop=document.documentElement.scrollTop-A.height}}}this.element.insert({before:this.fixedElement});this.fixedElement.insert({top:this.element});this.fixedElement.insert({after:this.placeHolder});this.fixedElement.insert({before:this.iframe})},unlock:function(){if(!this.fixedState){return}this.placeHolder.remove();this.fixedElement.insert({after:this.element});this.fixedElement.remove();this.fixedState=false;this.fixPosition()},getVerticalScrolledDistance:function(){var A=0;if(document.body&&document.body.scrollTop){A=document.body.scrollTop}else{if(document.documentElement&&document.documentElement.scrollTop){A=document.documentElement.scrollTop}}return A},getHorizontalScrolledDistance:function(){var A=0;if(document.body&&document.body.scrollLeft){A=document.body.scrollLeft}else{if(document.documentElement&&document.documentElement.scrollLeft){A=document.documentElement.scrollLeft}}return A},setScrolling:function(){if(!this.scrollingState){this.scrollingState=true;setTimeout(function(){this.scrollingState=false}.bind(this),this.TEST_INTERVAL);setTimeout(function(){if(!this.scrollingState&&this.enabled){this.testModeChange()}}.bind(this),(this.TEST_INTERVAL*1.5))}}});var flexWidth=Class.create(Abstract.Agent,{initExtend:function(){this.resizeElement();Event.observe(window,"resize",this.resizeElement.bindAsEventListener(this))},resizeElement:function(){var A=$(this.element.parentNode);var B=document.documentElement.clientWidth;if(B<A.getWidth()&&B>0){this.element.style.width=(B-this.params.offSet)+"px"}else{this.element.style.width=""}}});var FacebookXFBMLParse=Class.create();FacebookXFBMLParse.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:false,initExtend:function(){var A=function(){FB.XFBML.parse(this.element)}.bind(this);if(!window.isIE6){FacebookSDK.load(A,this)}}});var FaceBookLoader=Class.create();FaceBookLoader.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){if(!this.params.url){log.error("FaceBookLoader: A required parameter was not passed to agent");return}var B=this.params.locale||"en_US";var A=function(){var E="http://www.facebook.com/plugins/like.php?href="+encodeURIComponent(this.params.url)+"&locale="+B+"&layout=button_count&show_faces=true&width=90&action=like&colorscheme=light&height=21";var D=new Element("iframe",{src:E});D.frameBorder=0;D.scrolling="no";this.element.insert({bottom:D})};if(Page.onLoadFired){A.call(this)}else{Event.observe(window,"load",A.bind(this))}}});var HideRevealCheckbox=Class.create();HideRevealCheckbox.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:true,initExtend:function(){if(!this.params.label){log.error('HideReveal: Required parameter "label" missing');return}if(!this.params.selector){log.error('HideReveal: Required parameter "selector" missing');return}this.checkErrors=this.element.select("p.error");if(this.checkErrors.length){return}this.hiddenElements=this.element.select(this.params.selector);for(var A=0;this.hiddenElements[A];A++){this.hiddenElements[A].remove()}var B=new Template('<label class="control checkbox hideRevealCheckbox">				<input name="" value="" type="checkbox" />				<span>#{label}</span>			</label>');B=B.evaluate({label:this.params.label});this.element.insert({top:B});this.hideRevealCheckbox=this.element.down("input");this.hideRevealCheckbox.observe("click",this.checkStatus.bindAsEventListener(this));this.checkStatus()},checkStatus:function(A){if(this.hideRevealCheckbox.checked){this.addRevealContent()}else{this.removeHideContent()}},addRevealContent:function(B){for(var A=0;this.hiddenElements[A];A++){this.element.insert({bottom:this.hiddenElements[A]})}},removeHideContent:function(B){for(var A=0;this.hiddenElements[A];A++){this.hiddenElements[A].remove()}}});var GoogleMap=Class.create();GoogleMap.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){if(!this.params.location||isNaN(this.params.location.latitude)||isNaN(this.params.location.longitude)){log.error("GoogleMap: Location missing or invalid");return}if(isNaN(this.params.zoom)){log.error("GoogleMap: Zoom missing or invalid");return}if(this.params.map===undefined||(!this.params.map&&!this.params.streetview)){this.params.map=true}this.element.update();this.element.removeClassName("staticMap");this.element.addClassName("dynamicMap");this.element.addClassName("intrastitial");if(!this.pi){this.pi=new ProgressIndicator();this.element.appendChild(this.pi.container)}GoogleMapAPILoader.load(this.initMap.bind(this),this.params.locale)},initMap:function(){this.element.removeClassName("intrastitial");if(this.pi){this.pi.stop();this.pi.container.remove();this.pi=null}this.location=new google.maps.LatLng(this.params.location.latitude,this.params.location.longitude);if(this.params.map){this.showMap()}if(this.params.streetview){this.enableStreetview()}},enableStreetview:function(){var A=this.params.location;GoogleMapUtil.getStreetView(new google.maps.LatLng(A.latitude,A.longitude),function(B){if(B){this.panoData=B}if(this.params.map){this.toggleLink=new Element("a",{"class":"link toggleLink"});this.element.insertBefore(this.toggleLink,this.mapElement);this.toggleLink.update(this.params.switchToStreetviewText);Event.observe(this.toggleLink,"click",this.toggleMaps.bindAsEventListener(this))}else{this.showStreetview()}}.bind(this))},toggleMaps:function(){if(this.currentMap==this.mapElement){this.showStreetview()}else{this.showMap()}},showMap:function(){if(!this.mapElement){this.mapElement=new Element("div",{"class":"standardMap"});this.element.appendChild(this.mapElement);var A={center:this.location,mapTypeControl:true,mapTypeId:google.maps.MapTypeId.ROADMAP,panControl:true,zoomControlOptions:{style:google.maps.ZoomControlStyle.DEFAULT},scaleControl:true,scrollwheel:false,streetViewControl:false,zoom:this.params.zoom};this.map=new google.maps.Map(this.mapElement,A);this.marker=new google.maps.Marker({clickable:false,map:this.map,position:this.location})}if(this.currentMap){this.currentMap.hide()}this.mapElement.show();google.maps.event.trigger(this.map,"resize");this.currentMap=this.mapElement;if(this.toggleLink){this.toggleLink.update(this.params.switchToStreetviewText)}},showStreetview:function(){if(!this.streetviewElement){this.streetviewElement=new Element("div",{"class":"streetview"});this.element.appendChild(this.streetviewElement);this.streetviewElement.show();this.streetview=new google.maps.StreetViewPanorama(this.streetviewElement,{position:this.panoData.location.latLng,pov:{heading:GoogleMapUtil.calculateBearing(this.panoData.location.latLng,this.location),pitch:3,zoom:1},scrollwheel:false})}if(this.currentMap){this.currentMap.hide()}this.streetviewElement.show();google.maps.event.trigger(this.streetview,"resize");this.currentMap=this.streetviewElement;if(this.toggleLink){this.toggleLink.update(this.params.switchToMapText)}}});var merchMiniAirForm=Class.create();merchMiniAirForm.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.dialogObject=new Microcontent(this.element.select(".miniAirFormTrigger a"),{jsTemplate:{id:this.params.templateId,dataAttributeName:"data-miniAirForm"}},this.params.mcOptions)}});var MicrocontentAgent=Class.create();MicrocontentAgent.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:false,initialize:function(A,D){Object.extend(this,D);this.element=Element.extend(A);var B=$A();if(!D.params.useAdditionalTriggersOnly){B.push(this.element)}if(D.params.additionalTriggers){D.params.additionalTriggers.each(function(E){$$(E).each(function(F){B.push(F)})})}this.dialogObject=new Microcontent(B,D.params.content,D.params.options)}});var TotalPriceMicrocontent=Class.create();TotalPriceMicrocontent.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.markup=this.params.dynamicMarkup;this.options={dialogGroup:"totalPrice"};this.options.setUp=function(){if(!this.domNodes){this.domNodes=new Element("div").insert(this.markup).childElements()}this.mainElement=this.microcontent.markup.mainInfo.down(".totalPriceMicrocontent");for(var A=0;A<this.domNodes.length;A++){this.mainElement.appendChild(this.domNodes[A])}}.bind(this);this.options.tearDown=function(){for(var A=0;A<this.domNodes.length;A++){this.mainElement.removeChild(this.domNodes[A])}}.bind(this);this.options=Object.extend(this.params.options,this.options);this.microcontent=new Microcontent([this.element],this.params.content,this.options);document.observe("dialog:dialogOpen",this.close.bindAsEventListener(this))},close:function(A){if(A&&A.memo&&A.memo.dialog!=this.microcontent&&A.memo.dialog.options.dialogGroup==this.options.dialogGroup){this.microcontent.close()}}});var RevealOtherActivitesControl=Class.create(Abstract.Agent,{initExtend:function(){var A=function(D){if(D.target.tagName.toLowerCase()=="a"){document.fire("otherActivities:reveal");B(D)}};var B=function(D){this.element.stopObserving("click",A)}.bindAsEventListener(this);Event.observe(this.element,"click",A);document.observe("otherActivitiesControl:remove",B)}});var RevealOtherActivities=Class.create(Abstract.Agent,{initExtend:function(){var D=new Element("div").addClassName("otherCategoriesReveal");var A=new Element("a").addClassName("link").update(this.params.linkText);D.appendChild(A);var E=function(F){this.element.showByClass();this.element.getElementsByTagName("input")[0].value=true;B(F);F.preventDefault()}.bindAsEventListener(this);var B=function(F){A.stopObserving("click",E);D.removeChild(A);this.element.parentNode.removeChild(D);document.fire("otherActivitiesControl:remove")}.bindAsEventListener(this);Event.observe(A,"click",E);document.observe("otherActivities:reveal",E);this.element.parentNode.appendChild(D)}});var OasOptionsToggle=Class.create(Abstract.Agent,{initExtend:function(){this.oasOptions=null;Event.observe(this.element,"click",function(A){if(!this.oasOptions){this.oasOptions=this.element.up("div.oasProductOptions")}if(this.oasOptions.hasClassName("collapsedView")){this.element.update(this.params.hideDetailsText);this.oasOptions.removeClassName("collapsedView")}else{this.element.update(this.params.showDetailsText);this.oasOptions.addClassName("collapsedView")}A.preventDefault()}.bindAsEventListener(this))}});var OasSubOptionEventManager=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){var B=$A();$A(this.element.getElementsByTagName("input")).each(function(D){if(D.type.toLowerCase()==="checkbox"){B.push(D)}});var A=function(){var D=[];B.each(function(F){if(F.checked){var E=F.name.substring(F.name.lastIndexOf("['")+2,F.name.lastIndexOf("']"));D[D.length]=E}});return D};Event.observe(this.element,"click",function(F){var E=F.target;if(E.tagName.toLowerCase()==="input"&&E.type.toLowerCase()==="checkbox"){var D=A();document.fire("oasSubOptions"+this.params.activityKey+":changed",D)}}.bindAsEventListener(this));document.observe("oasSubOptions"+this.params.activityKey+":getKey",function(E){var D=A().toString();if(D!=E.memo.displayedKey){var F={memo:D};E.memo.callback(F)}}.bindAsEventListener(this))}});var OasOptionsTableManager=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){var B=function(I){if(I.target.tagName.toLowerCase()=="input"){var H=Element.extend(I.target).getParentByTagName("tbody").getElementsByClassName("displayedRow")[0];if(H){H.removeClassName("displayedRow")}var G=Element.extend(I.target).getParentByTagName("tr");G.addClassName("displayedRow");document.fire("oasOption"+this.params.activityKey+":changed",this.element)}}.bindAsEventListener(this);Event.observe(this.element,"click",B);if(this.params.subOptions){var F=function(){var I=$A();var J=this.element.getElementsByTagName("input");for(var H=0;H<J.length;H++){var G=J[H];if(G.type=="radio"){I.push(G)}}return I}.bindAsEventListener(this);var E=function(){var I=false;var J=F();for(var H=0;H<J.length;H++){var G=J[H];if(G.checked){I=G.value}}return I};var A=function(K){var J=F();var G=false;for(var I=0;I<J.length;I++){var H=J[I];if(H.value==K){H.click();G=true;return}}if(!G){log.debug("defaulting selected option to first radio since lists did not match");J[0].click()}};var D=function(G){if(this.params.subOptions[G.memo]){var I=E();var H=this.params.subOptions[G.memo];this.element.update(H);A(I)}}.bindAsEventListener(this);document.observe("oasSubOptions"+this.params.activityKey+":changed",D);document.fire("oasSubOptions"+this.params.activityKey+":getKey",{displayedKey:this.params.displayedKey,callback:D})}}});var OpinionLabsInitializer=Class.create(Abstract.Agent,{beforeROMReady:false,initExtend:function(){this.OOobj=new OnlineOpinion.ocode();this.OOobj.Preferences.Persistence={enabled:true,cookie_name:"oo_r",cookie_type:"page",expiration:3600};this.OOobj.Preferences.Render={type:"floating",main_div_id:"oo_feedback_float",up_div_id:"olUp",over_div_id:"olOver",img_path:this.params.imagePath,feedback_span_id:"fbText",feedback_html:this.params.feedbackText,click_html:this.params.clickText};this.OOobj.Preferences.Plugins.URLRewrite={active:true,regex_search_pattern:"://",regex_replace_pattern:"://"+this.params.locale+"."};this.OOobj.Metrics.custom.sessionId=this.params.sessionId;OnlineOpinion.util.SafeAddOnUnLoadEvent(function(){this.OOobj.onExit()}.bindAsEventListener(this));this.OOobj.render(function(){this.OOobj.show();this.removeHeaderListItem()}.bindAsEventListener(this));if(!this.OOobj.Cookie.matchurl(this.OOobj.Metrics.core.referer,this.OOobj.Preferences.Persistence.cookie_type)){if(this.params.displayLink){this.attachHeaderLink()}else{this.removeHeaderListItem()}}else{this.removeHeaderListItem()}},attachHeaderLink:function(){var A=new Element("a",{"class":"link",href:"#"}).update(this.params.feedbackText);var D=function(E){this.OOobj.show();Event.stopObserving(A,"click",B);this.removeHeaderListItem();E.preventDefault()};var B=D.bindAsEventListener(this);Event.observe(A,"click",B);this.element.appendChild(A)},removeHeaderListItem:function(){var A=this.element.next(0);if(typeof A=="undefined"&&this.element.tagName.toLowerCase()=="li"){this.element.previous(0).addClassName("last")}this.element.parentNode.removeChild(this.element)}});var GoogleResultSetMap=Class.create();GoogleResultSetMap.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:true,initExtend:function(){this.mapState="collapsed";this.expandedSelector="#preMain";this.toggleMapState=function(){var A=["collapsed","expanded"];return function(){this.mapState=A.reverse()[0]}}();this.container={collapsed:this.element.parentNode,expanded:Element.extend(document.body).down(this.expandedSelector)};if(!this.container.expanded){document.observe("map:containerReady",function(){this.container.expanded=Element.extend(document.body).down(this.expandedSelector);this.checkPersist()}.bind(this))}else{this.checkPersist()}},checkPersist:function(){if(PersistUtil.ready()){this.persistStore=new Persist.Store("GoogleResultSetMap");try{this.persistStore.get("mapData",function(B,E){if(B&&E){var D=("("+E+")").evalJSON();if(D.searchKey==this.params.searchKey){if(D.state==="expanded"){this.persistMapDetails=function(){return/selectHotelDetails=true/.test(document.referrer)}();if(this.persistMapDetails){this.persistStore.mapData=D}this.toggleMapState();this.container[this.mapState].insertBefore(this.element,this.container[this.mapState].firstChild)}}}this.createNodes();this.load()}.bind(this))}catch(A){}}else{this.createNodes();this.load()}},load:function(){Event.observe(window,"load",function(){this.loadMap()}.bind(this));if(Page.onLoadFired){this.loadMap()}},createNodes:function(){this.element.addClassName(this.mapState+"ResultsMap");this.headerWrapper=this.element.appendChild(new Element("DIV",{className:"mapHeader"}));this.headerWrapper.appendChild(new Element("H3",{className:"mapLabel"})).appendChild(document.createTextNode(this.params.mapHeader));this.toggleElement=this.headerWrapper.appendChild(new Element("A",{className:"mapLink",href:"javascript:void(0);",delegatedtracking:"true"}));this.toggleElement.appendChild(document.createTextNode(this.params.linkText[this.mapState]));this.mapElement=new Element("DIV",{className:"mapContainer block"});this.element.appendChild(this.mapElement);if(!this.pi){this.pi=new ProgressIndicator();this.mapElement.appendChild(this.pi.container)}},loadMap:function(){if(!this.loaded){this.loaded=true;GoogleMapAPILoader.load(this.mapLoadCallback.bind(this),this.params.locale)}},mapLoadCallback:function(){google.maps.event.addDomListener(window,"unload",this.onUnload.bind(this));var A=this;this.infoWindowVisible=false;this.streetViewVisible=false;if(this.pi){this.pi.destroy()}var E=new google.maps.Map(this.mapElement,{panControl:true,scaleControl:true,zoomControlOptions:{style:google.maps.ZoomControlStyle.LARGE},streetViewControl:false});google.maps.event.addDomListener(this.toggleElement,"click",this.resizeMap.bind(this));document.observe("agent:resultsUpdated",function(){this.resetMap();this.setMapMarkers();this.handleCloseZoom();this.map.fitBounds(this.bounds)}.bind(this));this.infoWindowData=this.params.infoWindowData;this.datedSearch=this.params.datedSearch;this.map=E;this.setMapState[this.mapState].call(this);this.setMapMarkers();if(this.persistMapDetails){var D=this.persistStore.mapData;E.setMapTypeId(D.mapType);E.setCenter(new google.maps.LatLng(D.position.lat,D.position.lng));E.setZoom(D.zoom);if(D.activeId){var B=this.getMapMarker(D.activeId);if(B){google.maps.event.addListener(B,"domready",this.markerClick.bind(this,B,false))}}}else{E.setMapTypeId(google.maps.MapTypeId.ROADMAP);this.handleCloseZoom();this.map.fitBounds(this.bounds)}},getMapMarker:function(D){for(var B=0,A=this.data.length;B<A;B++){if(this.data[B].id==D){return this.markers[B]}}},setMapState:{collapsed:function(){this.resetMap();if(!this.mapListener){this.mapListener=google.maps.event.addListener(this.map,"click",this.resizeMap.bind(this))}this.element.removeClassName("expandedResultsMap").addClassName("collapsedResultsMap");this.map.setOptions({disableDefaultUI:true,disableDoubleClickZoom:true,draggable:false,keyboardShortcuts:false,mapTypeControl:false,panControl:false,zoomControl:false,scaleControl:false,scrollwheel:false,mapTypeId:google.maps.MapTypeId.ROADMAP})},expanded:function(){if(this.mapListener){google.maps.event.removeListener(this.mapListener);delete this.mapListener}this.element.removeClassName("collapsedResultsMap").addClassName("expandedResultsMap");this.map.setOptions({disableDefaultUI:false,disableDoubleClickZoom:false,draggable:true,keyboardShortcuts:true,mapTypeControl:true,panControl:true,zoomControl:true,scaleControl:true,scrollwheel:true})}},setMapMarkers:function(){if(this.markers){this.clearMapMarkers()}var bounds=new google.maps.LatLngBounds();var markers=[];var data=[];var resultCards=$("main").select("div[data-mapInfo]");for(var i=resultCards.length;i--;){var datum=resultCards[i].getAttribute("data-mapInfo").evalJSON();datum.resultCardElement=(datum.elementSelector)?$("main").down(datum.elementSelector):resultCards[i];datum.tooltip=eval(datum.type+"MarkerToolTip");datum.infoWindow=eval(datum.type+"MapInfoWindow");datum.datedSearch=this.datedSearch;var marker=new MapMarker(new google.maps.LatLng(datum.lat,datum.lng),datum.type,this.map,datum.label,datum.isFeatured&&"featured");marker.id=i;bounds.extend(marker.getPosition());google.maps.event.addListener(marker,"mouseover",this.markerMouseover.bind(this,marker));google.maps.event.addListener(marker,"mouseout",this.markerMouseout.bind(this,marker));google.maps.event.addListener(marker,"click",this.markerClick.bind(this,marker,true));markers[i]=marker;data[i]=datum}this.bounds=bounds;this.markers=markers;this.data=data},clearMapMarkers:function(){var A=this.markers;while(A.length){A.shift().destroy()}this.bounds=null;this.markers=null;this.data=null},resetMap:function(){if(this.infoWindowVisible){this.getInfoWindow().close()}if(this.streetViewVisible){this.hideStreetView()}},handleCloseZoom:function(){var A=this.map;google.maps.event.addListenerOnce(A,"bounds_changed",function(){if(A.getZoom()>17){A.setZoom(17)}})},resizeMap:function(){this.toggleMapState();this.handleCloseZoom();this.fireWebTrendsEvent(this.mapState+" map");this.setMapState[this.mapState].call(this);this.container[this.mapState].insertBefore(this.element,this.container[this.mapState].firstChild);google.maps.event.trigger(this.map,"resize");this.toggleElement.replaceChild(document.createTextNode(this.params.linkText[this.mapState]),this.toggleElement.firstChild);this.map.fitBounds(this.bounds)},onUnload:function(){var A=this.map.getCenter();var E;if(this.infoWindowVisible){E=this.data[this.getInfoWindow().marker.id].id}if(Persist.type){var D={searchKey:this.params.searchKey,state:this.mapState,zoom:this.map.getZoom(),position:{lat:A.lat(),lng:A.lng()},mapType:this.map.getMapTypeId(),activeId:E};try{this.persistStore.set("mapData",Object.toJSON(D))}catch(B){}}if(this.infoWindow){this.infoWindow.destroy()}if(this.tooltip){this.tooltip.destroy()}this.clearMapMarkers()},getInfoWindow:function(){return this.infoWindow||(this.infoWindow=function(){var A=new MapInfoWindow(this.map,this.params.infoWindowData);google.maps.event.addListener(A,"showStreetView",this.showStreetView.bind(this));google.maps.event.addListener(A,"visible_changed",function(){this.infoWindowVisible=A.getVisible()}.bind(this));google.maps.event.addListener(A,"close",function(){this.marker.overlay.removeClassName("mapMarkerCurrent")});google.maps.event.addListener(A,"marker_changed",function(B){B.overlay.removeClassName("mapMarkerCurrent")});google.maps.event.addListener(A,"webtrends",function(B){this.fireWebTrendsEvent(B)}.bind(this));return A}.call(this))},getMarkerTooltip:function(){return this.tooltip||(this.tooltip=new MarkerToolTip(this.map))},getStreetView:function(){return this.streetview||(this.streetview=function(){var A={panorama:this.map.getStreetView(),backToMapLink:new Element("A",{"class":"link backToMapLink",href:"javascript:void(0)"}).update(this.infoWindowData.switchToMapText).observe("click",function(){this.hideStreetView();this.fireWebTrendsEvent("Back to map")}.bind(this))};A.panorama.setOptions({enableCloseButton:false});google.maps.event.addListener(A.panorama,"visible_changed",function(){this.streetViewVisible=A.panorama.getVisible()}.bind(this));return A}.call(this))},hideStreetView:function(){var A=this.getStreetView();A.backToMapLink.remove();A.panorama.setVisible(false);A.panorama.setPosition(null);A.panorama.setPov(null)},showStreetView:function(D){var B=this.getStreetView();var A=B.panorama;this.headerWrapper.appendChild(B.backToMapLink);A.setPosition(D.location.latLng);A.setPov({heading:GoogleMapUtil.calculateBearing(D.location.latLng,this.getInfoWindow().getPosition()),pitch:3,zoom:1});A.setVisible(true)},markerMouseover:function(B){if(this.mapState=="collapsed"){return false}var A=this.data[B.id];B.overlay.addClassName("mapMarkerHover");this.getMarkerTooltip().open(B,A)},markerMouseout:function(A){if(this.mapState=="collapsed"){return false}A.overlay.removeClassName("mapMarkerHover");this.getMarkerTooltip().close()},markerClick:function(D,A){if(this.mapState=="collapsed"){return false}var B=this.data[D.id];this.getInfoWindow().open(D,B);D.overlay.addClassName("mapMarkerCurrent");this.getMarkerTooltip().close();if(A){this.fireWebTrendsEvent(B.type+" pin")}},fireWebTrendsEvent:function(A){this.element.fire("webtrends:multiTrackEvent",{"DCSext.wtNav":"srmap","DCSext.srmap":1,"WT.dl":1,"WT.ti":A})}});var BaseOverlay=function(){BaseOverlay=function(){};BaseOverlay.prototype=Object.extend(new google.maps.OverlayView(),{getSize:function(){return new google.maps.Size(this.overlay.offsetWidth,this.overlay.offsetHeight)},getPixelBounds:function(){var D=this.getProjection();if(D){var A=D.fromLatLngToDivPixel(this.getPosition());var B=this.getSize();return{getNorthEast:function(){return this.getNorthEast(A,B)}.bind(this),getSouthWest:function(){return this.getSouthWest(A,B)}.bind(this),getCenter:function(){return this.getCenter(A,B)}.bind(this)}}},getBounds:function(){var A=this.getProjection();if(A){var B=this.getPixelBounds();return new google.maps.LatLngBounds(A.fromDivPixelToLatLng(B.getSouthWest()),A.fromDivPixelToLatLng(B.getNorthEast()))}},getNorthEast:function(A,B){return new google.maps.Point(A.x+(B.width/2),A.y-(B.height))},getSouthWest:function(A,B){return new google.maps.Point(A.x-(B.width/2),A.y)},getCenter:function(A,B){return new google.maps.Point(A.x,A.y-(B.height/2))},onAdd:function(){this.getPane().appendChild(this.overlay);google.maps.event.trigger(this,"domready");return this},onRemove:function(){this.overlay.parentNode.removeChild(this.overlay);return this},draw:function(){if(!this.getPosition()){return}var A=this.getPixelBounds();if(A){this.overlay.style.left=A.getSouthWest().x+"px";this.overlay.style.top=A.getNorthEast().y+"px"}return this},getDomListeners:function(){return this.domListeners||(this.domListeners=[])},addDomListener:function(D,A,B){this.getDomListeners().push(google.maps.event.addDomListener(D,A,B))},clearListeners:function(){google.maps.event.clearInstanceListeners(this)},clearDomListeners:function(){var A=this.getDomListeners();while(A.length){google.maps.event.removeListener(A.shift())}},setPosition:function(A){this.set("position",A);return this},getPosition:function(){return this.get("position")},getVisible:function(){return this.get("visible")},setVisible:function(A){this.overlay.style.visibility=A?"visible":"hidden";this.set("visible",A);return this},addWebTrendsEventListener:function(B,A){B.writeAttribute("delegatedtracking","true");this.addDomListener(B,"click",function(D){google.maps.event.trigger(this,"webtrends",D)}.bind(this,A));return B},destroy:function(){this.clearListeners();this.clearDomListeners();this.setMap(null)}});return new BaseOverlay()};var MapMarker=function(A,G,I,B,D){var F=new Element("DIV");var H=F.appendChild(new Element("SPAN"));var E=H.appendChild(new Element("SPAN"));F.appendChild(new Element("DIV")).className="beakBorder";F.appendChild(new Element("DIV")).className="beak";F.className="mapMarker";H.className="content";E.className="label";F.style.position="absolute";MapMarker=function(J,M,O,K,L){this.overlay=F.cloneNode(true);this.overlay.addClassName(M+"MapMarker");if(L){this.overlay.addClassName(L)}this.label=this.overlay.down("SPAN.label");if(K){this.setLabel(K)}else{this.label.addClassName("icon")}this.setPosition(J);this.setMap(O);this.addDomListener(this.label,"mouseover",function(){google.maps.event.trigger(this,"mouseover")}.bind(this));this.addDomListener(this.label,"mouseout",function(){google.maps.event.trigger(this,"mouseout")}.bind(this));this.addDomListener(this.label,"click",function(){google.maps.event.trigger(this,"click")}.bind(this))};MapMarker.prototype=Object.extend(new BaseOverlay(),{setLabel:function(J){this.label.innerHTML=J},getPane:function(){return this.getPanes().overlayImage},getPosition:function(){return this.get("position")},getNorthEast:function(J,K){return new google.maps.Point(J.x+(K.width)-5,J.y-(K.height))},getSouthWest:function(J,K){return new google.maps.Point(J.x-5,J.y)},getCenter:function(J,K){return new google.maps.Point((J.x-5)+(K.width/2),J.y-(K.height/2))}});return new MapMarker(A,G,I,B,D)};var MarkerToolTip=function(B){var A=new Element("DIV");A.style.position="absolute";A.className="markerToolTip";MarkerToolTip=function(D){this.overlay=A;this.setVisible(false);this.setMap(D)};MarkerToolTip.prototype=Object.extend(new BaseOverlay(),{open:function(D,E){this.marker=D;this.populateToolTip(E);this.setPosition(D.getPosition());this.draw();this.setVisible(true)},close:function(){this.marker=null;this.setVisible(false)},populateToolTip:function(D){D.tooltip.populateToolTip.call(this,D)},getPane:function(){return this.getPanes().overlayImage},getNorthEast:function(E,F){if(this.marker){var D=this.marker.getPixelBounds();return new google.maps.Point(D.getNorthEast().x+F.width-5,D.getNorthEast().y-5)}return new google.maps.Point(0,0)},getSouthWest:function(E,F){if(this.marker){var D=this.marker.getPixelBounds();return new google.maps.Point(D.getNorthEast().x-5,D.getNorthEast().y+F.height-5)}return new google.maps.Point(0,0)}});return new MarkerToolTip(B)};var MapInfoWindow=function(D,B){function A(E){Event.extend(E);E.stopPropagation()}MapInfoWindow=function(F,E){this.setProperties("MapInfoWindow",{},{closeLabel:E.closeLabel,heading:true});this.createDialogDivs();this.overlay=this.markup.dialogWrapper;this.overlay.appendChild(new Element("div",{"class":"microcontentBeakBottom"}));this.attachCloseListeners(this.close.bind(this));google.maps.event.addDomListener(this.overlay,"mousedown",A);google.maps.event.addDomListener(this.overlay,"mouseover",A);google.maps.event.addDomListener(this.overlay,"mouseout",A);this.content=E;this.setVisible(false);this.setMap(F);this.onAdd()};MapInfoWindow.prototype=Object.extend(new BaseOverlay(),Object.extend(Dialog.Base,{open:function(E,F){if(this.marker!==E){if(this.marker){google.maps.event.trigger(this,"marker_changed",this.marker)}this.setPosition(E.getPosition());this.marker=E;this.clearDomListeners();this.setHeader(F);this.populateInfoWindow(F);this.draw()}this.setVisible(true);this.getMap().panToBounds(this.getBounds())},close:function(){google.maps.event.trigger(this,"close");this.marker=null;this.setVisible(false)},setHeader:function(E){E.infoWindow.setHeader.call(this,E)},populateInfoWindow:function(E){E.infoWindow.populateInfoWindow.call(this,E)},enableStreetview:function(E){var F=new Element("li");var G=new Element("a",{"class":"link streetviewLink",href:"javascript:void(0);"}).update(this.content.streetviewLabel);this.addWebTrendsEventListener(G,"Streetview");this.markup.mainInfo.down(".infoWindowContent ul.pipedList").insert({bottom:F});F.insert({bottom:G});this.addDomListener(G,"click",function(){google.maps.event.trigger(this,"showStreetView",E)}.bind(this))},getPane:function(){return this.getPanes().floatPane},getNorthEast:function(F,G){if(this.marker){var E=this.marker.getPixelBounds();return new google.maps.Point(E.getCenter().x+(G.width/2),E.getNorthEast().y-(G.height))}return new google.maps.Point(0,0)},getSouthWest:function(F,G){if(this.marker){var E=this.marker.getPixelBounds();return new google.maps.Point(E.getCenter().x-(G.width/2),E.getNorthEast().y)}return new google.maps.Point(0,0)},destroy:function(){google.maps.event.clearInstanceListeners(this.overlay);this.closeEventObservers.clear();BaseOverlay.prototype.destroy.call(this)}}));return new MapInfoWindow(D,B)};var HotelMarkerToolTip={populateToolTip:function(A){if(!A.name){A.name=A.resultCardElement.down("a.hotelNameLink").innerHTML}var B='<strong class="name">'+A.name+"</strong>"+((A.stars)?'<img class="stars" src="/style/global/img/star'+A.stars+'.png" alt="'+A.stars+' stars" height="13" width="70" />':"")+((A.rating)?'<span class="rating"><strong><span>'+A.rating+"</span></strong></span>":"");this.overlay.update(B)}};var HotelMapInfoWindow={setHeader:function(E){var B=E.resultCardElement;this.markup.dialogTitle.innerHTML="";var A=new Element("h3");var F=B.down("a.hotelNameLink");if(F){this.addWebTrendsEventListener(A.appendChild(F.cloneNode(true)),"Hotel name");this.markup.dialogTitle.appendChild(A)}var D=B.down("img.stars");if(D){this.markup.dialogTitle.appendChild(D.cloneNode(true))}},populateInfoWindow:function(H){var E=H.resultCardElement;var D=new Element("div",{className:"infoWindowContent"});var G=new Element("div",{className:"price"});this.markup.mainInfo.innerHTML="";var J=E.down("a.thumbnail");if(J){this.addWebTrendsEventListener(this.markup.mainInfo.appendChild(J.cloneNode(true)),"Hotel photo")}var Q=E.down("div.hotelPriceInfo");if(Q){var B=$(Q.cloneNode(true));var I=B.down(".totalPriceMicrocontentLink");if(I){I.replace(I.innerHTML)}G.appendChild(B)}var P=E.down("ul.hotelPriceDisclaimers");if(P){G.appendChild(P.cloneNode(true))}D.appendChild(G);var A=E.down(".hotelUserRatingsSummary");if(A){D.appendChild(A.cloneNode(true))}var L=new Element("UL",{"class":"pipedList"});var F=E.down("a.detailsLink");if(F){this.addWebTrendsEventListener(L.appendChild(new Element("LI").update(F.cloneNode(true))),"More hotel details")}D.appendChild(L);this.markup.mainInfo.appendChild(D);var K=E.down(".priceButtonLink");if(K){if(H.datedSearch){K=this.addWebTrendsEventListener(this.markup.mainInfo.appendChild(K.cloneNode(true)),(H.rate)?"Select":"Check rates")}else{K=this.addWebTrendsEventListener(this.markup.mainInfo.appendChild(K.cloneNode(true)),"Check availability")}var M=K.down("a[agent]");if(M){var O=M.getAgents()[0];if(O&&O.type=="MicrocontentAgent"){O.type="ContainedLightboxAgent";O.params.options.container=".resultsMap";O.params.options.closeEvents=["agent:updatingResults"];K.down("a[agent]").stopObserving();K.down("a[agent]").setAttribute("agent",Object.toJSON(O))}}}this.markup.mainInfo.descendants().each(function(S){S.removeAttribute("id")});Page.initializeDOMFragment(this.markup.mainInfo);GoogleMapUtil.getStreetView(this.getPosition(),this.enableStreetview.bind(this))}};var HpcHotelMarkerToolTip={populateToolTip:function(A){HotelMarkerToolTip.populateToolTip.call(this,A)}};var HpcHotelMapInfoWindow={setHeader:function(E){var B=E.resultCardElement;this.markup.dialogTitle.innerHTML="";var A=new Element("h3");var F=B.down("a.hotelNameLink");if(F){this.addWebTrendsEventListener(A.appendChild(F.cloneNode(true)),"Hotel name");A.insert({bottom:E.productPlusText});this.markup.dialogTitle.appendChild(A)}var D=B.down("img.stars");if(D){this.markup.dialogTitle.appendChild(D.cloneNode(true))}Page.initializeDOMFragment(this.markup.dialogTitle)},populateInfoWindow:function(H){var E=H.resultCardElement;var D=new Element("div",{className:"infoWindowContent"});var G=new Element("div",{className:"price"});this.markup.mainInfo.innerHTML="";var I=E.down("a.thumbnail");if(I){this.addWebTrendsEventListener(this.markup.mainInfo.appendChild(I.cloneNode(true)),"Hotel photo")}var B=E.down("div.priceAndDisclaimers");var L=$(B.cloneNode(true));G.appendChild(L);D.appendChild(G);var A=E.down(".hotelUserRatingsSummary");if(A){D.appendChild(A.cloneNode(true))}var K=new Element("UL",{"class":"pipedList"});var F=E.down("a.detailsLink");if(F){this.addWebTrendsEventListener(K.appendChild(new Element("LI").update(F.cloneNode(true))),"More hotel details")}D.appendChild(K);this.markup.mainInfo.appendChild(D);var J=E.down(".priceButtonLink");J=this.addWebTrendsEventListener(this.markup.mainInfo.appendChild(J.cloneNode(true)),(H.rate)?"Select":"Check rates");this.markup.mainInfo.descendants().each(function(M){M.removeAttribute("id")});Page.initializeDOMFragment(this.markup.mainInfo);GoogleMapUtil.getStreetView(this.getPosition(),this.enableStreetview.bind(this))}};var HpcCarMarkerToolTip={populateToolTip:function(A){var B=((A.vendorName)?'<strong class="name">'+A.vendorName+"</strong>":"")+"<span>"+A.carLocation+"</span>";this.overlay.update(B)}};var HpcCarMapInfoWindow={setHeader:function(D){this.markup.dialogTitle.innerHTML="";var E=D.resultCardElement;var B=E.down("div.summary").down("div.data");var F=B.down("div.brand");var A=new Element("div",{className:"carLocation"});A.innerHTML=D.carLocation;this.markup.dialogTitle.appendChild(F.cloneNode(true));this.markup.dialogTitle.appendChild(A)},populateInfoWindow:function(E){var F=E.resultCardElement;var D=new Element("div",{className:"infoWindowContent"});this.markup.mainInfo.innerHTML="";var B=F.down("div.imageColumn");var A=F.down("div.summary").down("div.data");this.markup.mainInfo.appendChild(B.cloneNode(true));this.markup.mainInfo.appendChild(A.cloneNode(true));this.markup.mainInfo.down("div.brand").remove();this.markup.mainInfo.down("li.inclusionExclusion").remove()}};var GoogleResultSetMapContainer=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){document.fire("map:containerReady")}});var Reveal=Class.create();Reveal.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:true,initExtend:function(){if(!this.params.label){log.error('Reveal: Required parameter "label" missing');return}if(this.params.selector){this.hiddenElements=this.element.select(this.params.selector)}else{this.hiddenElements=this.element.getElementsByTagAndClass("*","noneBlock")}if(this.hiddenElements.length!=0){this.revealLink=new Element("a",{"class":"link revealLink",href:"#"});this.revealLink.update(this.params.label);this.element.insert({bottom:this.revealLink});this.revealLink.observe("click",this.reveal.bindAsEventListener(this))}},reveal:function(D){this.revealLink.remove();this.revealLink=null;for(var B=0,A=this.hiddenElements.length;B<A;B++){this.hiddenElements[B].showByClass()}D.preventDefault()}});var SavedHotelsTotal=Class.create(Abstract.Agent,{initExtend:function(){this.totalsContent=this.element.select("span.savedHotelsTotal")[0];Event.observe($(document.body),"savedHotel:saveRequestReturned",this.onSavedHotelUpdated.bindAsEventListener(this));Event.observe($(document.body),"savedHotel:removed",this.onSavedHotelUpdated.bindAsEventListener(this));Event.observe($(document.body),"savedHotel:listUpdated",this.onSavedHotelUpdated.bindAsEventListener(this))},onSavedHotelUpdated:function(A){if(navigator.cookieEnabled){this.totalsContent.innerHTML=A.memo.savedHotelsTotal.innerHTML}}});var SavedHotelsList=Class.create(Abstract.Agent,{initExtend:function(){if(this.params){this.noCookiesMessage=this.params.noCookiesMessage;this.updateListURL=this.params.updateListURL}else{this.noCookiesMessage="";this.updateListURL=null}this.removeLinks=new ManagedEventObservers();Event.observe(this.element,"savedHotel:removeAgentCreated",this.addRemoveLink.bindAsEventListener(this));Event.observe($(document.body),"savedHotel:saveRequestReturned",this.onSaveRequestOrRemove.bindAsEventListener(this));Event.observe($(document.body),"savedHotel:removed",this.onSaveRequestOrRemove.bindAsEventListener(this));if(this.updateListURL){var A=new Ajax.Request(this.updateListURL,{method:"get",parameters:{cacheBuster:new Date().getTime()},onSuccess:function(D){var B=parseSavedHotelsResponse(D);B.element=this.element;log.debug("saved hotels: "+B.savedHotelsData.savedHotels);this.update(B.savedHotelsContent);$(document.body).fire("savedHotel:listUpdated",B)}.bind(this)})}},addRemoveLink:function(D){if(D.memo.length>=3){var B=D.memo[0];var A=D.memo[1];var E=D.memo[2];this.removeLinks.add(B,A,E)}},onSaveRequestOrRemove:function(A){this.update(A.memo.savedHotelsContent)},update:function(A){this.destroy();if(!navigator.cookieEnabled&&this.noCookiesMessage!=""){this.element.innerHTML=this.noCookiesMessage}else{this.element.innerHTML=A.innerHTML;Page.initializeDOMFragment(this.element)}},destroy:function(){this.removeLinks.clear()}});var SavedHotelsStatus=Class.create(Abstract.Agent,{initExtend:function(){if(this.params){this.noCookiesMessage=this.params.noCookiesMessage}else{this.noCookiesMessage=""}this.statusMessage=this.element.select("div.savedHotelsStatus")[0];this.statusMessageTitle=this.statusMessage.select(".dialogTitle a")[0];this.statusMessageContent=this.statusMessage.select("div.savedHotelsStatusContent")[0];this.savedHotelsTotal=this.element.select("")[0];this.displayDuration=6000;this.displayTimer=null;Event.observe($(document.body),"savedHotel:saveRequestReturned",this.onSaveRequestReturned.bindAsEventListener(this))},onSaveRequestReturned:function(A){if(!navigator.cookieEnabled&&this.noCookiesMessage!=""){this.statusMessageContent.innerHTML=this.noCookiesMessage}else{this.statusMessageContent.innerHTML=A.memo.savedHotelsStatusContent.innerHTML}this.statusMessageTitle.innerHTML=A.memo.savedHotelsTotal.innerHTML;this.displayMessage()},displayMessage:function(){this.element.removeClassName("noneBlock");if(this.displayTimer!=null){window.clearTimeout(this.displayTimer)}this.displayTimer=window.setTimeout(this.hideMessage.bind(this),this.displayDuration)},hideMessage:function(){this.element.addClassName("noneBlock");this.statusMessageContent.innerHTML="";this.displayTimer=null}});var AddSavedHotel=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(A){if(this.params){this.hotelId=this.params.hotelId;this.url=this.params.url;this.notSavedLabel=this.params.notSavedLabel;this.savedLabel=this.params.savedLabel;this.saved=this.params.saved;delete this.params;Event.observe(this.element,"click",this.add.bindAsEventListener(this));Event.observe($(document.body),"savedHotel:removed_"+this.hotelId,this.displayAsNotSaved.bindAsEventListener(this));Event.observe($(document.body),"savedHotel:listUpdated",this.onSavedHotelListUpdated.bindAsEventListener(this))}else{log.error("AddSavedHotel.initExtend: too few parameters to initialize")}},add:function(A){A.preventDefault();this.request=new Ajax.Request(this.url,{method:"get",parameters:{cacheBuster:new Date().getTime()},onSuccess:function(D){var B=parseSavedHotelsResponse(D);B.addSavedHotelAgent=this;$(document.body).fire("savedHotel:saveRequestReturned",B);if(this.hotelId==B.savedHotelsData.hotelId&&B.savedHotelsData.status=="SAVED"&&navigator.cookieEnabled){this.displayAsSaved();$(document.body).fire("savedHotel:saved",B)}else{if(this.hotelId==B.savedHotelsData.hotelId&&B.savedHotelsData.status=="DUPLICATE"&&navigator.cookieEnabled){$(document.body).fire("savedHotel:alreadySaved",B)}}}.bind(this)})},onSavedHotelListUpdated:function(B){var A=$A(B.memo.savedHotelsData.savedHotels);if(A.include(this.hotelId)){this.displayAsSaved()}else{this.displayAsNotSaved()}},displayAsSaved:function(){this.element.innerHTML=this.savedLabel;this.element.removeClassName("saveHotel");this.element.addClassName("savedHotel");this.saved=true},displayAsNotSaved:function(){this.element.innerHTML=this.notSavedLabel;this.element.removeClassName("savedHotel");this.element.addClassName("saveHotel");this.saved=false}});var RemoveSavedHotel=Class.create(Abstract.Agent,{initExtend:function(A){if(this.params){this.hotelId=this.params.hotelId;this.url=this.params.url;delete this.params;this.element.fire("savedHotel:removeAgentCreated",[this.element,"click",this.remove.bindAsEventListener(this)])}else{log.error("RemoveSavedHotel.initExtend: too few parameters to initialize")}},remove:function(A){A.preventDefault();this.request=new Ajax.Request(this.url,{method:"get",parameters:{cacheBuster:new Date().getTime()},onSuccess:function(D){var B=parseSavedHotelsResponse(D);B.element=this.element;$(document.body).fire("savedHotel:removed",B);$(document.body).fire("savedHotel:removed_"+this.hotelId,B)}.bind(this)})}});var parseSavedHotelsResponse=function(G){if(G&&G.responseText){var D=new Element("div");D.innerHTML=G.responseText;var E=D.select("div.savedHotelsData")[0].innerHTML;var H=D.select("span.savedHotelsTotal")[0];var F=D.select("div.savedHotelsStatusContent")[0];var B=D.select("div.savedHotelsContent")[0];var A={savedHotelsData:E.evalJSON(),savedHotelsTotal:H,savedHotelsStatusContent:F,savedHotelsContent:B};return A}};var SavedHotelsWebtrendsEventSender=new function(){this.onHotelSaved=function(A){var B=A.memo.addSavedHotelAgent;A.memo.addSavedHotelAgent.element.fire("webtrends:multiTrackEvent",{"DCS.dcsuri":B.url,"WT.dl":"1","WT.ti":"Link:"+B.notSavedLabel,"DCSext.fhid":B.hotelId})};this.onHotelAlreadySaved=function(A){var B=A.memo.addSavedHotelAgent;A.memo.addSavedHotelAgent.element.fire("webtrends:multiTrackEvent",{"DCS.dcsuri":B.url,"WT.dl":"1","WT.ti":"Link:"+B.savedLabel})};this.onSavedHotelsListViewed=function(D,F,G){if(arguments.length==3){var A;if(F=="SEARCH"){A="HP"}else{if(F=="RESULTS"){A="SR"}}if(G){var B=Event.findElement(G,"A");var E=B.innerText||B.textContent;var H=new RegExp("\\s*\\d+\\s*","g");E=E.strip();E=E.replace(H,"");B.fire("webtrends:multiTrackEvent",{"DCS.dcsuri":D,"WT.dl":"0","WT.si_n":"FH","WT.ti":"Link:"+E,"DCSext.fhl":A})}}else{log.error("SavedHotelsWebtrendsEventSender.onSavedHotelsListViewed(): too few parameters to execute")}};document.observe("savedHotel:saved",this.onHotelSaved.bindAsEventListener(this));document.observe("savedHotel:alreadySaved",this.onHotelAlreadySaved.bindAsEventListener(this))};var Slider=Class.create(Abstract.Agent,{restricted:true,snapInterval:false,tickSubdivisions:false,tickInterval:false,sliderPosition:"bottom",trackType:"lessThan",hideTicks:false,initExtend:function(){Object.extend(this,this.params||{});this.container=this.getContainer();this.fields=this.getFields();if(this.min===undefined||this.max===undefined||!this.fields||this.fields.length<=0){log.error("Invalid slider params");return}this.initMarkup()},initMarkup:function(){this.disabled=this.disabled||(this.min==this.max)||(this.snapInterval&&(this.max-this.min==this.snapInterval));var H=new Element("div",{"class":"slider  slider"+this.fields.length+"Handled"});var G="sliderTrack";if(this.hideTicks==true){G=G+" noTicks"}if(this.fields.length===1){G=G+" "+this.trackType}this.track=new Element("div",{"class":G});this.track.setStyle({position:"relative"});var A=document.createDocumentFragment();this.ticks=[];if(this.tickInterval&&(this.min!=this.max)){this.tickInterval=this.tickInterval/this.tickSubdivisions;var I=(Math.floor(this.min/this.tickInterval)+1)*this.tickInterval;var D=(Math.ceil(this.max/this.tickInterval)-1)*this.tickInterval;var O=Math.ceil((D-I)/this.tickInterval)+3;var M=(Math.floor(this.min/this.tickSubdivisions/this.tickInterval)+1)*this.tickInterval*this.tickSubdivisions;var L=(Math.round((M-I)/this.tickInterval)+1)%this.tickSubdivisions}else{var O=2}for(var E=0;E<O;E++){var P;if(E==0){P="tick lowRange"}else{if(E==O-1){P="tick highRange"}else{if(E%this.tickSubdivisions==L){P="tick"}else{P="minorTick"}}}var F=new Element("div",{"class":P});this.ticks.push(F);A.appendChild(F)}this.trackLeft=new Element("div",{"class":"trackLeft"});A.appendChild(this.trackLeft);this.trackRight=new Element("div",{"class":"trackRight"});A.appendChild(this.trackRight);this.handles=[];for(var E=0;E<this.fields.length;E++){var B=new Element("div",{"class":"handle handle"+E});B.style.cursor="pointer";this.handles[E]={element:B,index:E,field:this.fields[E]};A.appendChild(B)}this.track.appendChild(A);var J=new Element("div",{"class":"sliderRange"});J.appendChild((new Element("span",{"class":"rangeLow"})).insert(this.rangeMinLabel||this.min));J.appendChild((new Element("span",{"class":"rangeHigh"})).insert(this.rangeMaxLabel||this.max));H.insert(this.track);if(this.sliderPosition==="top"){J.addClassName("aboveTrack");H.insert({top:J})}else{H.insert(J)}if(this.sliderPosition==="top"){this.container.insert({top:H})}else{this.container.insert(H)}for(var E=0;E<this.fields.length;E++){var K=this.fields[E];K.index=E;this.updateField(K);K.lastValue=K.value;if(this.min!=this.max){K.observe("blur",this.checkFieldAndUpdate.bindAsEventListener(this));K.observe("keypress",this.handleFieldKeyPress.bindAsEventListener(this))}}this.fieldTimestamp=new Date();this.update();if(this.disabled){this.disable()}else{this.container.observe("mousedown",this.startDrag.bindAsEventListener(this))}},getFields:function(){return this.fields||this.container.select(".textInput input")},getContainer:function(){var A=this.container;if(!A&&this.selector){A=this.element.down(this.selector)}A=A||this.element;return A},startDrag:function(F){var B=F.element();for(var D=0;D<this.handles.length;D++){if(this.handles[D].element==B){var A=this.handles[D];break}}if(!A||!Event.isLeftClick(F)){return}document.body.style.cursor="pointer";var G=0;if(this.restricted&&A.index>0){var E=this.handles[A.index-1].element;G=parseInt(E.getStyle("marginLeft"))}var H=this.width;if(this.restricted&&A.index<this.handles.length-1){var E=this.handles[A.index+1].element;H=parseInt(E.getStyle("marginLeft"))}this.drag={handle:A,mousePos:Event.pointerX(F),handlePos:parseInt(B.getStyle("marginLeft")),minimum:G,maximum:H};this.eventListeners={mousemove:this.continueDrag.bindAsEventListener(this),mouseup:this.stopDrag.bindAsEventListener(this),selectstart:this.preventTextSelection.bindAsEventListener(this)};for(var D in this.eventListeners){document.observe(D,this.eventListeners[D])}F.preventDefault()},continueDrag:function(A){if(!this.drag){return}var D=Event.pointerX(A)-this.drag.mousePos+this.drag.handlePos;if(D<this.drag.minimum){D=this.drag.minimum}else{if(D>this.drag.maximum){D=this.drag.maximum}}var B=this.pixelsToValue(D);if(this.snapInterval){var B=this.snapValue(B);D=this.valueToPixels(B)}this.moveHandle(this.drag.handle,D);if(new Date()-this.fieldTimestamp>=50){this.updateField(this.drag.handle.field,B);this.fireUpdateEvent(this.drag.handle,false)}A.preventDefault()},stopDrag:function(B){if(!this.drag){return}var E=parseInt(this.drag.handle.element.getStyle("marginLeft"));var D=this.pixelsToValue(E);if(this.snapInterval){D=this.snapValue(D)}this.updateField(this.drag.handle.field,D);this.fireUpdateEvent(this.drag.handle,true);this.drag=false;document.body.style.cursor="auto";for(var A in this.eventListeners){document.stopObserving(A,this.eventListeners[A])}this.eventListeners=null;B.preventDefault()},moveHandle:function(A,B){A.element.style.marginLeft=B+"px";if(A.index==0){this.trackLeft.style.width=B+"px"}if(A.index==this.handles.length-1){this.trackRight.style.width=this.width-B+"px"}},updateField:function(B){var A=arguments[1]||B.value;A=this.correctFieldValue(B,A);if(B.value!=A){B.value=A;this.fieldTimestamp=new Date()}},fireUpdateEvent:function(A,B){if(A.field.lastValue!=A.field.value){A.field.lastValue=A.field.value}this.handleSliderUpdated(B,A.index)},checkFieldAndUpdate:function(E){var B=E.element();for(var D=0;D<this.handles.length;D++){if(this.handles[D].field==B){var A=this.handles[D];break}}if(!A){return}this.updateField(A.field);var G=this.correctHandleValue(this.correctFieldValue(A.field));var F=this.min;if(this.restricted&&A.index>0){F=this.correctFieldValue(this.handles[A.index-1].field)}var H=this.max;if(this.restricted&&A.index<this.handles.length-1){H=this.correctFieldValue(this.handles[A.index+1].field)}if(G<F){G=F}else{if(G>H){G=H}}if(this.snapInterval){G=this.snapValue(G)}this.moveHandle(A,this.valueToPixels(G));this.fireUpdateEvent(A,true)},handleFieldKeyPress:function(A){if(Event.KEY_RETURN==A.keyCode){this.checkFieldAndUpdate(A)}},update:function(){this.width=this.track.getWidth();for(var A=0;A<this.handles.length;A++){var D=this.correctFieldValue(this.handles[A].field);this.moveHandle(this.handles[A],this.valueToPixels(D))}this.ticks[0].setStyle({marginLeft:this.valueToPixels(this.min)+"px"});var B=(Math.floor(this.min/this.tickInterval)+1)*this.tickInterval;for(var A=1;A<this.ticks.length-1;A++){this.ticks[A].setStyle({marginLeft:this.valueToPixels(B)+"px"});B+=this.tickInterval}this.ticks[this.ticks.length-1].setStyle({marginLeft:this.valueToPixels(this.max)+"px"})},disable:function(){for(var A=0;A<this.handles.length;A++){this.handles[A].element.hide()}for(var A=0;A<this.fields.length;A++){this.fields[A].disabled=true}var B=Math.round(this.width/2);this.trackLeft.addClassName("disabled");this.trackRight.addClassName("disabled");this.trackLeft.style.width=B+"px";this.trackRight.style.width=this.width-B+"px"},pixelsToValue:function(B){var A=((this.max-this.min)*B/this.width)+this.min;return this.correctHandleValue(A)},valueToPixels:function(A){A=this.correctHandleValue(A);return Math.round((A-this.min)/(this.max-this.min)*this.width)},correctHandleValue:function(A){if(A===""||A===undefined||A===null||isNaN(A)){if(this.trackType==="lessThan"){A=this.max}else{A=this.min}}if(A<this.min){A=this.min}else{if(A>this.max){A=this.max}}return A},correctFieldValue:function(B){var A=arguments[1]||B.value;return parseFloat(A).toFixed(0)},snapValue:function(A){var B=Math.round(A/this.snapInterval)*this.snapInterval;if(this.max-A<A-B){B=this.max}else{if(A-this.min<B-A){B=this.min}}return B},preventTextSelection:function(A){A.preventDefault()},handleSliderUpdated:function(A){if(A){this.container.fire("agent:filter")}}});var SlideShow=Class.create(Abstract.Agent,{initExtend:function(){this.container=Element.extend(this.element.parentNode);if(this.params.compactMode){this.container.addClassName("compactImageGallery")}var E=new ProgressIndicator();this.container.parentNode.appendChild(E.container);this.startSlideShowOnLoad=false;this.endlessLoop=false;this.imagesPerGroup=this.params.thumbnailCount?Number(this.params.thumbnailCount):4;this.slideShowController=false;this.slideShowWaitTime=2;this.images=$A();this.currentImageIndex=0;this.loadAdvanceImages=2;this.timeToWaitForLoad=1500;$A(this.container.getElementsByTagName("A")).each(function(H,G){var I=Element.extend(H);this.images.push({imageRef:I,initialized:false,parent:Element.extend(I.parentNode),imageIndex:G});if(G===0){this.images[G].parent.addClassName("current")}if(G>=this.imagesPerGroup){this.images[G].parent.hide()}}.bind(this));this.galleryExists=this.images.length>1;if(!this.galleryExists||this.params.compactMode){this.element.hide()}this.groups=this.images.inGroupsOf(this.imagesPerGroup);this.currentThumbGroup=0;this.initializeThumbGroup(this.currentThumbGroup);var F=new Element("div").addClassName("mainImage");this.image=new Element("img",{alt:""});F.appendChild(this.image);this.header=new Element("div").addClassName("galleryHeader");var D=new Element("div").addClassName("galleryControls");if(this.params.virtualTourLink){var B=new Element("div").addClassName("tourLink");B.update(this.params.virtualTourLink);this.header.appendChild(B);Page.initializeDOMFragment(B)}this.currentPosition=new Element("span").update(this.currentImageIndex+1);D.appendChild(this.currentPosition);D.appendChild(new Element("span").update("&nbsp;"+this.params.numText.strip()+"&nbsp;"+this.images.length));if(this.galleryExists){this.nextButtonMarkup=this.params.nextButtonMarkup;this.previousButtonMarkup=this.params.previousButtonMarkup;this.nextButtonDisabledMarkup=this.params.nextButtonDisabledMarkup;this.previousButtonDisabledMarkup=this.params.previousButtonDisabledMarkup;this.nextButton=new Element("a",{href:"#"}).update(this.nextButtonMarkup);this.previousButton=(new Element("a",{href:"#"}).update(this.previousButtonMarkup));this.startSlideshowButtonMarkup=this.params.startSlideshowButtonMarkup;this.stopSlideshowButtonMarkup=this.params.stopSlideshowButtonMarkup;this.showButton=new Element("a",{href:"#"}).addClassName("slideshowControl").update(this.startSlideshowButtonMarkup);var A=function(G){if(G.findElement("a")===this.previousButton){this.previousClick(true)}if(G.findElement("a")===this.nextButton){this.nextClick(true)}if(G.findElement("a")===this.showButton){if(this.slideShowController){this.stopSlideShow()}else{this.startSlideShow()}}G.stop()}.bindAsEventListener(this);Event.observe(this.header,"click",A);D.insert({top:this.previousButton,bottom:this.nextButton});this.header.appendChild(D);this.header.appendChild(this.showButton)}this.container.appendChild(this.header);this.container.appendChild(F);this.showImage(0,0);if(this.galleryExists&&!this.params.compactMode){this.container.appendChild(this.setupThumbnails());this.element.show()}setTimeout(function(){E.stop();this.container.parentNode.removeChild(E.container);this.container.showByClass();if(this.startSlideShowOnLoad){this.startSlideShow()}}.bindAsEventListener(this),this.timeToWaitForLoad)},setupThumbnails:function(){var B=new Element("div").addClassName("slideshowThumbnails");B.appendChild(this.element);if(this.groups.length>1){this.backControl=this.previousButton.cloneNode(true).addClassName("backControl");this.forwardControl=this.nextButton.cloneNode(true).addClassName("forwardControl");B.insert({top:this.backControl,bottom:this.forwardControl})}var A=function(D){var G=D.target;if(D.findElement("a")===this.backControl){this.previousThumbGroup()}if(D.findElement("a")===this.forwardControl){this.nextThumbGroup()}if(G.hasClassName("thumbnail")){var F=this.images.detect(function(H){if(G.src==H.imageRef){return H}});this.showImage(this.currentImageIndex,F.imageIndex);var E=this.currentImageIndex+this.loadAdvanceImages;if(E>=this.images.length){E=0}if(!this.images[E].initialized){this.initializeThumbGroup(this.currentThumbGroup+1)}this.currentPosition.update(this.currentImageIndex+1)}this.stopSlideShow();D.stop()}.bindAsEventListener(this);Event.observe(B,"click",A);return B},startSlideShow:function(){if(!this.endlessLoop&&(this.currentImageIndex)+1==this.images.length){this.swapGroupVisibility(this.currentThumbGroup,0);this.showImage(this.currentImageIndex,0)}this.slideShowController=new PeriodicalExecuter(function(A){this.nextClick(false)}.bind(this),this.slideShowWaitTime);this.showButton.update(this.stopSlideshowButtonMarkup)},stopSlideShow:function(){if(this.slideShowController){this.slideShowController.stop()}this.slideShowController=false;this.showButton.update(this.startSlideshowButtonMarkup)},initializeThumbnail:function(B,A){var D=new Element("img",{src:this.images[A].imageRef.href,"class":"thumbnail"});B.update(D);this.images[A].initialized=true},initializeThumbGroup:function(B){for(var A=0;A<this.imagesPerGroup;A++){if(this.groups[B][A]){this.groups[B][A].groupIndex=B;this.initializeThumbnail(this.groups[B][A].imageRef,this.groups[B][A].imageIndex)}}},showImage:function(B,A){this.images[B].parent.removeClassName("current");this.currentImageIndex=A;this.currentPosition.update(this.currentImageIndex+1);this.image.src=this.images[A].imageRef.href;this.images[A].parent.addClassName("current");if(this.galleryExists){if(!this.endlessLoop&&A===0){this.disableLink(this.previousButton,"back")}else{this.enableLink(this.previousButton,"back")}if(!this.endlessLoop&&A===this.images.length-1){this.disableLink(this.nextButton,"forward")}else{this.enableLink(this.nextButton,"forward")}}},enableLink:function(A,B){A.innerHTML=((B=="back")?this.previousButtonMarkup:this.nextButtonMarkup)},disableLink:function(A,B){A.innerHTML=((B=="forward")?this.nextButtonDisabledMarkup:this.previousButtonDisabledMarkup)},nextClick:function(B){var F=this.currentImageIndex+1;var D=F>=this.images.length;if(this.endlessLoop&&D){F=0;D=false}if(!D){this.showImage(this.currentImageIndex,F);var A=this.currentImageIndex+this.loadAdvanceImages;if(A>=this.images.length){A=0}if(!this.images[A].initialized){var E=this.currentThumbGroup+1;if(E>this.groups.length){E=0}this.initializeThumbGroup(E)}if(this.currentThumbGroup!==this.images[this.currentImageIndex].groupIndex){this.swapGroupVisibility(this.currentThumbGroup,this.images[this.currentImageIndex].groupIndex)}D=(!this.endlessLoop&&this.currentImageIndex===this.images.length-1)}if(B||D){this.stopSlideShow()}},previousClick:function(B){var F=this.currentImageIndex-1;var D=F<0;if(this.endlessLoop&&D){F=this.images.length-1;D=false}if(!D){this.showImage(this.currentImageIndex,F);var A=this.currentImageIndex-this.loadAdvanceImages;if(A<=0){A=this.images.length-1}if(!this.images[A].initialized){var E=this.currentThumbGroup-1;if(E<=0){E=this.groups.length-1}this.initializeThumbGroup(E)}if(this.currentThumbGroup!==this.images[this.currentImageIndex].groupIndex){this.swapGroupVisibility(this.currentThumbGroup,this.images[this.currentImageIndex].groupIndex)}D=(!this.endlessLoop&&this.currentImageIndex===0)}if(B||D){this.stopSlideShow()}},nextThumbGroup:function(){var B=this.currentThumbGroup;var D=this.currentThumbGroup+1;var A=D>=this.groups.length;if(this.endlessLoop&&A){D=0;A=false}if(!A){if(!this.groups[D][0].initialized){this.initializeThumbGroup(D)}this.swapGroupVisibility(B,D)}},previousThumbGroup:function(){var B=this.currentThumbGroup;var D=this.currentThumbGroup-1;var A=D<0;if(this.endlessLoop&&A){D=this.groups.length-1;A=false}if(!A){if(!this.groups[D][0].initialized){this.initializeThumbGroup(D)}this.swapGroupVisibility(B,D)}},swapGroupVisibility:function(B,D){this.currentThumbGroup=D;for(var A=0;A<this.imagesPerGroup;A++){if(this.groups[B][A]){this.groups[B][A].parent.hide()}if(this.groups[D][A]){this.groups[D][A].parent.show()}}if(!this.endlessLoop&&D===0){this.disableLink(this.backControl,"back")}else{this.enableLink(this.backControl,"back")}if(!this.endlessLoop&&D===this.groups.length-1){this.disableLink(this.forwardControl,"forward")}else{this.enableLink(this.forwardControl,"forward")}}});var TabMenu=Class.create();TabMenu.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.tabs=$A();this.id=this.params.id;this.parent=Element.extend(this.element.parentNode);this.container=Element.extend(this.parent.parentNode);this.parent.addClassName("tabBar");var B=this.element.getElementsByTagName("li");for(var D=0,A=B.length;D<A;D++){this.tabs.push(new Tab(B[D],this.container,this))}if(this.params.affectHistory){document.observe("hash:change",this.updateTabs.bindAsEventListener(this));document.fire("hash:check")}this.selectedTab.initTabAgents();this.busy=false;this.updateAllAjaxTabsOnFirstRequest=(this.params.ajaxURL)?true:false},loadContent:function(A){if(!this.busy){this.busy=true;ajaxUrl=(this.updateAllAjaxTabsOnFirstRequest)?this.params.ajaxURL:A.link.href;ajaxUrl=ajaxUrl.concat(((ajaxUrl.indexOf("?")<0)?"?ajax=true":"&ajax=true"));log.debug("loading content from: "+ajaxUrl);var B=ajaxUrl.split("?");new Ajax.Request(B[0],{parameters:B[1],onSuccess:function(E){var D=E.responseText.unescapeJSON();if(D.isJSON()){this.populateContent(D.evalJSON())}else{this.selectedTab.populateContentBlock(E.responseText)}this.busy=false}.bind(this),onFailure:function(){log.error("TabMenu.loadContent AJAX request failed.\n JSON formatted response:"+response.responseText.unescapeJSON().isJSON());this.verifyContentPopulated();this.busy=false}.bind(this),method:"get"})}else{log.warning("TabMenu busy, request to load content ignored")}},populateContent:function(D){for(tabId in D){for(var A=0;A<this.tabs.length;A++){var B=this.tabs[A];if(B.type==="ajax"&&B.tabId===tabId){B.populateContentBlock(D[tabId]);break}}}this.verifyContentPopulated()},verifyContentPopulated:function(){for(var A=0;A<this.tabs.length;A++){if(this.tabs[A].type==="ajax"){this.tabs[A].indicateError(this.tabs[A].tabId)}}},selectTabByKey:function(A){this.tabs.each(function(B){if(B.key==A){B.selectTab();throw $break}})},updateTabs:function(A){var G=A.memo.hash;if(G){for(var F=0;F<this.tabs.length;F++){if(this.tabs[F].key==G){var H=this.tabs[F];break}}if(H){if(!H.selected){H.click()}}else{var B,J,I=this.container.getElementsByTagName("A");for(var E=0;E<I.length;E++){var K=Element.extend(I[E]);if(K.name&&K.name==G){J=K.up("div.tabContent").getElementsByTagName("A")[0];break}}for(var D=0;D<this.tabs.length;D++){if(this.tabs[D].key==J.name&&!this.tabs[D].selected){B=this.tabs[D];break}}if(B){B.click();K.scrollTo()}}}else{if(!this.defaultTab.selected){this.defaultTab.click()}}}});var Tab=Class.create();Tab.prototype={initialize:function(B,A,D){this.agentsInitialized=false;this.link=B.getElementsByTagName("A")[0];this.element=$(B);this.tabMenu=D;this.contentWrapper=A;this.selected=false;this.contentBlock=null;this.type=this.link.rel==="ajax"?"ajax":"dom";this.tabId=this.type==="ajax"?this.element.getAttribute("data-tabId"):null;this.key=(this.tabId)?this.tabId+this.tabMenu.id:this.link.href.substring((this.link.href.indexOf("#")+1));this.contentPopulated=this.type==="ajax"?false:true;if(!this.tabMenu.params||!this.tabMenu.params.affectHistory){this.element.observe("click",this.click.bindAsEventListener(this))}if(this.element.hasClassName("currentTab")){this.selected=true;this.tabMenu.selectedTab=this;this.tabMenu.defaultTab=this}},click:function(A){if(A){A.preventDefault()}this.tabMenu.selectedTab.deselectTab();this.selectTab();if(this.type==="ajax"){this.tabMenu.loadContent(this)}else{if(!this.agentsInitialized){this.initTabAgents()}}},findContentBlock:function(){if(!this.contentBlock){var D=this.contentWrapper.getElementsByTagName("A");for(var E=0,A=D.length;E<A;E++){var B=Element.extend(D[E]);if(B.name&&B.name==this.key){this.contentBlock=B.getParentByClassName("tabContent");return}}}},populateContentBlock:function(A){this.type="dom";this.findContentBlock();this.contentBlock.removeClassName("loadingAJAXTabContent");this.contentBlock.removeClassName("unloadedAJAXTabContent");if(this.progressIndicator){this.progressIndicator.destroy();delete this.progressIndicator}this.contentBlock.innerHTML=A;Page.initializeDOMFragment(this.contentBlock);if(this.selected&&!this.agentsInitialized){this.initTabAgents()}},indicateError:function(A){log.error("Tab: "+A+" content expected but not found in response");if(this.progressIndicator){this.progressIndicator.destroy();delete this.progressIndicator}},selectTab:function(){this.findContentBlock();this.selected=true;this.element.addClassName("currentTab");if(this.type==="ajax"){this.contentBlock.removeClassName("unloadedAJAXTabContent");this.contentBlock.addClassName("loadingAJAXTabContent");if(this.progressIndicator===undefined){this.progressIndicator=new ProgressIndicator();this.contentBlock.appendChild(this.progressIndicator.container)}}if(this.contentBlock&&!this.contentBlock.visibleByClass()){this.contentBlock.showByClass()}this.tabMenu.selectedTab=this},deselectTab:function(){this.selected=false;this.element.removeClassName("currentTab");this.findContentBlock();if(this.contentBlock&&this.contentBlock.visibleByClass()){this.contentBlock.hideByClass()}this.tabMenu.selectedTab=null},initTabAgents:function(){this.findContentBlock();var E=this.contentBlock.getElementsByAttribute("agent");for(var F=0;E[F];F++){var A=E[F];var B=A.getAgents();if(B){for(var D=0;B[D];D++){if(B[D].lazy=="true"){Page.initAgent(A,B[D])}}}}this.agentsInitialized=true}};var BookerTraveling=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){$A(this.element.getElementsByTagName("input")).each(function(B){if(B.type=="checkbox"){this.bookerNotTravelingCheckbox=B;throw $break}}.bind(this));this.container=Element.extend(this.element.parentNode);this.bookerNameFields=Element.extend(this.container.getElementsByClassName("whosBookingName")[0]);var A=function(B){if(this.bookerNotTravelingCheckbox.checked){this.container.addClassName("highlight");this.bookerNameFields.showByClass()}else{this.container.removeClassName("highlight");this.bookerNameFields.hideByClass()}}.bindAsEventListener(this);Event.observe(this.bookerNotTravelingCheckbox,"click",A);A()}});var TravelerName=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){this.nameInputs=new Hash();function A(E){var D=this.getNameInfoHash();document.fire("traveler"+this.params.travelerIndex+"Name:changed",D)}$A(this.element.getElementsByTagName("select")).each(function(E){var D=this.getNameInputName(E);this.nameInputs.set(D,E);Event.observe(E,"change",A.bindAsEventListener(this))}.bind(this));$A(this.element.getElementsByTagName("input")).each(function(D){var E=this.getNameInputName(D);this.nameInputs.set(E,D);Event.observe(D,"change",A.bindAsEventListener(this))}.bind(this));function B(E){var D={memo:this.getNameInfoHash()};E.memo.callback(D)}document.observe("traveler"+this.params.travelerIndex+":getName",B.bindAsEventListener(this))},getNameInputName:function(A){return A.name.substring(A.name.indexOf("name.")+5)},getNameFromInputs:function(){var B=this.nameInputs.values();var A="";B.each(function(D){if(D.type=="select-one"){var E=D.options[D.selectedIndex];if(E.value!=""){A+=E.text+" "}}else{if(D.type!="radio"){A+=D.value+" "}}});return A},getNameInfoHash:function(){var A=new Hash();A.set("index",this.params.travelerIndex);A.set("name",this.getNameFromInputs());return A}});var ExistingTraveler=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){this.initialText=this.element.innerHTML;this.updateMember=true;document.observe("traveler"+this.params.travelerIndex+"Name:changed",this.travelerChanged.bindAsEventListener(this));document.fire("traveler"+this.params.travelerIndex+":getData",{callback:this.savedTravelerChanged.bind(this)});if(this.updateMember){document.fire("traveler"+this.params.travelerIndex+":getName",{callback:this.travelerChanged.bind(this)})}},travelerChanged:function(D){var B=this.initialText;var A=D.memo.get("name");if(A.strip()!=""){B=A+" ("+this.initialText.replace(":","")+")"}this.element.update(B)},savedTravelerChanged:function(B){var A=B.memo.get("useMemberName");if(A){this.updateMember=false;this.travelerChanged(B)}}});var SavedTraveler=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){this.params=$H(this.params);this.savedMemberSelect=Element.extend(this.element.getElementsByTagName("select")[0]);this.useSavedMemberRadio=Element.extend(this.element.getElementsByTagName("input")[0]);function A(F){var E=true;if(F.target.type=="radio"){if(!F.target.checked){E=false}}if(E){var D=this.getNameInfoHash(this.savedMemberSelect.selectedIndex);document.fire("traveler"+this.params.get("travelerIndex")+"Name:changed",D)}}Event.observe(this.savedMemberSelect,"change",A.bindAsEventListener(this));Event.observe(this.useSavedMemberRadio,"change",A.bindAsEventListener(this));function B(F){var D=this.getNameInfoHash(this.savedMemberSelect.selectedIndex);var E={memo:D};F.memo.callback(E)}document.observe("traveler"+this.params.get("travelerIndex")+":getData",B.bindAsEventListener(this))},getNameInfoHash:function(B){var A=new Hash();A.set("index",this.params.get("travelerIndex"));var D=this.savedMemberSelect.options[B];A.set("name",D.value==""?"":D.text);A.set("travelerInformation",this.params.get("traveler"+this.savedMemberSelect.options[B].value));A.set("useMemberName",this.useSavedMemberRadio.checked);return A}});var TravelerTSAInfo=Class.create(Abstract.Agent,{initExtend:function(){this.dateOfBirth=null;this.redressNumber=null;this.knownTravelerNumber=null;$A(this.element.getElementsByTagName("input")).each(function(E){if(E.name.indexOf("dateOfBirth")!=-1){this.dateOfBirth=E}else{if(E.name.indexOf("redressNumber")!=-1){this.redressNumber=E}else{if(E.name.indexOf("travelerNumber")!=-1){this.knownTravelerNumber=E}else{log.debug("Unknown Input field in TSA module")}}}}.bind(this));this.gender=Element.extend(this.element.getElementsByTagName("select")[0]);this.infantdobInput=this.element.up(".traveler").down(".dateOfBirth input");var D=function(G){log.debug("TravelerTSAInfo travelerChanged() has fired");var I=G.memo.get("travelerInformation");if(I){var H=I.tsaInfo;this.gender.value=H.gender;if(this.dateOfBirth){this.dateOfBirth.value=H.dateOfBirth}else{this.infantdobInput.value=H.dateOfBirth}this.redressNumber.value=H.redressNumber;this.knownTravelerNumber.value=H.knownTravelerNumber}else{this.gender.value="";this.dateOfBirth.value="";this.redressNumber.value="";this.knownTravelerNumber.value=""}if(this.hiddenElements2){for(var E=0;this.hiddenElements2[E];E++){this.locationElement2.insert({bottom:this.hiddenElements2[E]})}}if(this.hiddenElements){for(var E=0;this.hiddenElements[E];E++){this.locationElement.insert({bottom:this.hiddenElements[E]})}}this.removeCheckboxes=this.element.select("label[class=control checkbox hideRevealCheckbox]");for(var E=0;this.removeCheckboxes[E];E++){this.removeCheckboxes[E].remove()}this.checkErrors=this.element.select("p.error");if(this.checkErrors.length){return}if(!this.redressNumber.value&&!this.knownTravelerNumber.value){var F=new Template('<label class="control checkbox hideRevealCheckbox">					<input name="" value="" type="checkbox" />					<span>#{label}</span>				</label>');F=F.evaluate({label:this.params.label2});this.locationElement2=this.element.down("[class=optionalTSAInfo]");this.locationElement2.insert({top:F});this.hiddenElements2=this.locationElement2.select(".redressKnownTravelerInput");for(var E=0;this.hiddenElements2[E];E++){this.hiddenElements2[E].remove()}this.hideRevealCheckbox2=this.locationElement2.down("input");this.hideRevealCheckbox2.observe("click",this.checkStatus2.bindAsEventListener(this))}if(!this.gender.value&&!this.dateOfBirth.value&&!this.params.genderDateOfBirthRequired){var F=new Template('<label class="control checkbox hideRevealCheckbox">					<input name="" value="" type="checkbox" />					<span>#{label}</span>				</label>');F=F.evaluate({label:this.params.label1});this.locationElement=this.element.down("[class=optionalOrRequiredTSAInfo]");this.locationElement.insert({top:F});this.hiddenElements=this.locationElement.select(".allInput");for(var E=0;this.hiddenElements[E];E++){this.hiddenElements[E].remove()}this.hideRevealCheckbox=this.locationElement.down("input");this.hideRevealCheckbox.observe("click",this.checkStatus.bindAsEventListener(this));this.checkStatus()}};var B=D.bindAsEventListener(this);var A="traveler"+this.params.travelerIndex+"Name:changed";document.observe(A,B);log.debug("TravelerTSAInfo firing travelerX:getData function");document.fire("traveler"+this.params.travelerIndex+":getData",{callback:D.bind(this)})},checkStatus:function(A){if(this.hideRevealCheckbox.checked){this.addRevealContent()}else{this.removeHideContent()}},addRevealContent:function(B){for(var A=0;this.hiddenElements[A];A++){this.locationElement.insert({bottom:this.hiddenElements[A]})}},removeHideContent:function(B){for(var A=0;this.hiddenElements[A];A++){this.hiddenElements[A].remove()}},checkStatus2:function(A){if(this.hideRevealCheckbox2.checked){this.addRevealContent2()}else{this.removeHideContent2()}},addRevealContent2:function(B){for(var A=0;this.hiddenElements2[A];A++){this.locationElement2.insert({bottom:this.hiddenElements2[A]})}},removeHideContent2:function(B){for(var A=0;this.hiddenElements2[A];A++){this.hiddenElements2[A].remove()}}});var TravelerPhoneNumber=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){this.countryCode=Element.extend(this.element.getElementsByTagName("select")[0]);this.phoneNumber=Element.extend(this.element.getElementsByTagName("input")[0]);this.extension=Element.extend(this.element.getElementsByTagName("input")[1]);var D=function(F){var G=F.memo.get("travelerInformation");if(G){var E=G.phone;this.countryCode.value=E.countryCode;this.phoneNumber.value=E.phoneNumber;log.info("phoneValue"+this.phoneNumber.value);this.extension.value=E.extension}else{this.countryCode.value="";this.phoneNumber.value="";this.extension.value=""}};var B=D.bindAsEventListener(this);var A="traveler"+this.params.travelerIndex+"Name:changed";document.observe(A,B);Event.observe(this.countryCode,"change",function(E){document.stopObserving(A,B)});Event.observe(this.phoneNumber,"change",function(E){document.stopObserving(A,B)});Event.observe(this.extension,"change",function(E){document.stopObserving(A,B)});if(this.phoneNumber.value==""){log.debug("TravelerPhoneNumber firing travelerX:getData function");document.fire("traveler"+this.params.travelerIndex+":getData",{callback:D.bind(this)})}}});var TravelerEmailAddress=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){var B=Element.extend(this.element.getElementsByTagName("input")[0]);var E=function(G){log.debug("TravelerEmailAddress travelerChanged() has fired");var H=G.memo.get("travelerInformation");if(H){var F=H.email.strip();B.value=F}else{B.value=""}};var D=E.bindAsEventListener(this);var A="traveler"+this.params.travelerIndex+"Name:changed";document.observe(A,D);Event.observe(B,"change",function(F){document.stopObserving(A,D)})}});var TravelerLoyaltyPrograms=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){var B=Element.extend(this.element.getElementsByTagName("input")[0]);var E=function(F){log.debug("TravelerLoyaltyPrograms travelerChanged() has fired");var G=F.memo.get("travelerInformation");if(G){var H=$H(G.loyaltyPrograms);B.value=H.get(this.params.loyaltyProgramType+"LoyaltyProgram"+this.params.loyaltyProgramCode)}else{B.value=""}};var D=E.bindAsEventListener(this);var A="traveler"+this.params.travelerIndex+"Name:changed";document.observe(A,D);Event.observe(B,"change",function(F){document.stopObserving(A,D)});if(B.value==""){log.debug("firing travelerX:getData function");document.fire("traveler"+this.params.travelerIndex+":getData",{callback:E.bind(this)})}}});var TravelerSeatPreferences=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){var D=false;var B=this.element.getElementsByTagName("select")[0];var A=function(F){log.debug("TravelerSeatPreferences travelerChanged() executing for traveler"+this.params.travelerIndex);var G=F.memo.get("travelerInformation");if(G){var E=G.flightPreferences;if(E.seat){B.value=E.seat}else{B.value="N"}}else{B.value="N"}};this.observingFunction=A.bindAsEventListener(this);this.customEvent="traveler"+this.params.travelerIndex+"Name:changed";document.observe(this.customEvent,this.observingFunction);if(B.selectedIndex!=0){D=true}Event.observe(B,"change",this.stopObserving.bindAsEventListener(this));if(!D){log.debug("firing travelerX:getData function");document.fire("traveler"+this.params.travelerIndex+":getData",{callback:A.bind(this)})}},stopObserving:function(A){document.stopObserving(this.customEvent,this.observingFunction)}});var TravelerFlightSpecialRequests=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){var D=false;var A=new Hash({seat:"",meal:"",specialRequest:""});var B=function(F){log.debug("TravelerFlightSpecialRequests travelerChanged() executing for traveler"+this.params.travelerIndex);var G=F.memo.get("travelerInformation");if(G){var E=G.flightPreferences;A.get("meal").value=E.meal;A.get("specialRequest").value=E.specialRequest}else{A.get("meal").value="";A.get("specialRequest").value=""}};this.observingFunction=B.bindAsEventListener(this);this.customEvent="traveler"+this.params.travelerIndex+"Name:changed";document.observe(this.customEvent,this.observingFunction);$A(this.element.getElementsByTagName("select")).each(function(E){A.set(E.name.substr(E.name.lastIndexOf(".")+1),E);if(E.selectedIndex!=0){D=true}Event.observe(E,"change",this.stopObserving.bindAsEventListener(this))}.bind(this));if(!D){log.debug("firing travelerX:getData function");document.fire("traveler"+this.params.travelerIndex+":getData",{callback:B.bind(this)})}},stopObserving:function(A){document.stopObserving(this.customEvent,this.observingFunction)}});var PackageDefaultTraveler=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){var A=new Element("span").addClassName("heldByLabel");A.update(this.params.content);this.element.insertBefore(A,this.element.firstChild);Page.initializeDOMFragment(A)}});var NameFromListToggle=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){this.element.update(this.params.content);this.parentElement=Element.extend(this.element.parentNode);var A=Element.extend(this.parentElement.parentNode);this.radio=A.getElementsByTagName("input")[0];if(this.radio.checked){this.parentElement.showByClass()}else{this.parentElement.hideByClass()}Event.observe(this.element,"click",this.toggleEvent.bindAsEventListener(this));document.observe("savedTraveler"+this.params.travelerIndex+":toggle",this.toggleNameSelection.bindAsEventListener(this))},toggleEvent:function(A){document.fire("savedTraveler"+this.params.travelerIndex+":toggle",{action:this.params.action});A.preventDefault()},toggleNameSelection:function(A){if(A.memo.action==this.params.action){this.parentElement.hideByClass()}else{this.radio.click();this.parentElement.showByClass()}}});var DeferredImages={viewportScroll:0,documentHeight:0,create:function(){Event.observe(window,"resize",DeferredImages.viewportResize);Event.observe(window,"scroll",DeferredImages.scroll);DeferredImages.cache=$A();DeferredImages.calculateViewport()},destroy:function(){delete DeferredImages.cache;Event.stopObserving(window,"resize",DeferredImages.viewportResize);Event.stopObserving(window,"scroll",DeferredImages.scroll)},isInViewport:function(D){var B=700;var A=D.totalOffset-DeferredImages.viewportScroll;if(A<(DeferredImages.viewportHeight+B)&&A>-(D.height+B)){return true}return false},isInDocument:function(A){var D=A.parentNode,B=false;while(D){B=(D==document);D=D.parentNode}return B},calculateViewport:function(){DeferredImages.viewportHeight=document.viewport.getHeight();DeferredImages.viewportScroll=document.viewport.getScrollOffsets().top},calculateImages:function(){DeferredImages.cache.each(function(B){var A=B.el;A.totalOffset=Element.cumulativeOffset(A).top})},loadImages:function(){if(DeferredImages.documentHeight!==document.body.offsetHeight){DeferredImages.documentHeight=document.body.offsetHeight;DeferredImages.calculateImages()}DeferredImages.cache=DeferredImages.cache.reject(DeferredImages.loadImage);if(DeferredImages.cache.length===0){DeferredImages.destroy()}},loadImage:function(B){var A=B.el;if(A.totalOffset>0||DeferredImages.isInDocument(A)){if(DeferredImages.isInViewport(A)){var D=A.src;Event.observe(A,"error",function(){log.warning("Request for "+B.src+" timed out");A.src=D});A.removeAttribute("height");A.removeAttribute("width");A.src=B.src;return true}return false}else{return true}},scroll:function(){Event.stopObserving(window,"scroll",DeferredImages.scroll);var A=100;DeferredImages.viewportScroll=document.viewport.getScrollOffsets().top;DeferredImages.loadImages();if(DeferredImages.cache){setTimeout(function(){DeferredImages.loadImages();if(DeferredImages.viewportScroll===document.viewport.getScrollOffsets().top){if(DeferredImages.cache){Event.observe(window,"scroll",DeferredImages.scroll)}}else{DeferredImages.viewportScroll=document.viewport.getScrollOffsets().top;if(DeferredImages.cache){setTimeout(arguments.callee,A)}}},A)}},viewportResize:function(){if(DeferredImages.viewportHeight!==document.viewport.getHeight()){DeferredImages.calculateViewport();DeferredImages.loadImages()}}};var DeferredImage=Class.create();DeferredImage.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:true,initExtend:function(){if(!DeferredImages.cache){DeferredImages.create()}this.element.totalOffset=Element.cumulativeOffset(this.element).top;var A={el:this.element,src:this.params.src};if(!DeferredImages.loadImage(A)){DeferredImages.cache.push(A)}}});var resizeIFrameToContents=function(A,B){if(arguments.length<1||!A||A.tagName!=="IFRAME"){log.error("Advert: resizeIFrameToContents() requires an IFRAME argument");return}new function(){this.debug=false;this.resizerTimeout=window.setTimeout(function(){window.clearInterval(this.resizerInterval);if(this.debug){log.debug("Advert: resizer timed-out after "+B+"ms")}this.resizerInterval=null;if(window.isIE6){var J=[];var H=this.iframe.contentWindow.document.body.all;for(var G=0;G<H.length;G++){if(H[G].tagName=="OBJECT"){J.push(H[G])}}var F=0;var E=0;for(var G=0;G<J.length;G++){var I=$(J[G]).getDimensions();I.width=J[G].width>I.width?J[G].width:I.width;I.height=J[G].height>I.height?J[G].height:I.height;F=I.width>F?I.width:F;E=I.height>E?I.height:E}this.iframe.width=F+"px";this.iframe.height=E+"px";this.repairBadUrlTargets();if(this.debug&&J.length>0){log.debug("Advert: IE6 OBJECT tag: "+F+"px x "+E+"px")}}}.bind(this),B);this.repairBadUrlTargets=function(){var E=$A(this.iframe.contentWindow.document.getElementsByTagName("A"));var G=$A(this.iframe.contentWindow.document.getElementsByTagName("AREA"));var F=E.concat(G);for(var H=0;H<F.length;H++){if(Element.hasAttribute(F[H],"href")){var I=F[H].target.toLowerCase();if(I===""||(I!=="_blank"&&I!=="_parent"&&I.indexOf("_")==0)){if(I===""){I="undeclared"}if(this.debug){log.debug("Advert: repairing link target: "+I+" -&gt; _parent")}F[H].target="_parent"}}}};this.fixIE6Glitch=function(){if(window.isIE6){var E=$(this.iframe.parentNode);E.hide();E.show()}};var D=function(){contentWindow=this.iframe.contentWindow;contentDocument=contentWindow.document;var H=contentDocument.body.scrollWidth;var G=contentDocument.body.scrollHeight;this.iframe.width="0px";this.iframe.height="0px";var F=contentDocument.body.scrollWidth;var E=contentDocument.body.scrollHeight;if(F>0&&E>0){window.clearInterval(this.resizerInterval);window.clearTimeout(this.resizerTimeout);this.resizerInterval=null;this.resizerTimeout=null;this.iframe.width=F+"px";this.iframe.height=E+"px";this.iframe.style.visibility="visible";contentWindow.resized=true;this.repairBadUrlTargets();if(this.debug){log.debug("Advert: resized: "+F+"px x "+E+"px")}}else{this.iframe.width=H+"px";this.iframe.height=G+"px"}}.bind(this);this.iframe=A;this.fixIE6Glitch();this.resizerInterval=window.setInterval(D,100)}};var Advert=Class.create(Abstract.Agent,{beforeDOMReady:true,TIMEOUT:10000,initExtend:function(){this.deferred=this.params.deferred;if(this.deferred){Page.deferredAdverts.newAd(this)}else{this.populate()}},populate:function(){this.element.oww_adURL=unescape(this.params.adURL);this.element.contentWindow.location.replace("/cacheable/ad.html");var A=function(){if(!this.element.contentWindow.adLoaded){window.setTimeout(A,100)}else{this.displayPopulatedAd()}}.bind(this);A()},displayPopulatedAd:function(){resizeIFrameToContents(this.element,this.TIMEOUT)}});var JumpList=Class.create();JumpList.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){if(window.msPerformance===undefined||!window.external.msIsSiteMode()){log.info("failed tests, window.msPerformance: "+window.msPerformance+" | window.external.msIsSiteMode(): "+window.external.msIsSiteMode());return}var B=this.params.listHeader||null;if(!B){log.error("JumpList: No 'listHeader' parameter was passed to agent");return}var A=this.params.jumpListItems||null;if(!A||typeof A!="object"){log.error("JumpList: No 'jumpListItems' parameter was passed to agent or jumpListItems is not an object");return}window.external.msSiteModeClearJumplist();window.external.msSiteModeCreateJumplist(B);for(var D=A.length-1;D>=0;D--){window.external.msSiteModeAddJumpListItem(A[D].text,A[D].link,A[D].icon);log.info("added a jump list item - "+A[D].text+" - "+A[D].link+" - "+A[D].icon)}window.external.msSiteModeShowJumplist()}});var ExpandCollapse=Class.create();ExpandCollapse.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.opened=(this.params.collapseState==="opened");this.target=this.element.down(this.params.targetSelector);this.expandCollapseLink=new Element("a");this.expandCollapseLink.addClassName("collapseLink");this.expandCollapseLink.href="#";this.element.insert({top:this.expandCollapseLink});this.element.addClassName("collapsible");this.expandLink=this.params.expandText;this.collapseLink=this.params.collapseText;this.updateContent();Event.observe(this.expandCollapseLink,"click",this.toggleCollapse.bindAsEventListener(this))},updateContent:function(){if(this.opened){this.target.showByClass();this.expandCollapseLink.innerHTML=this.collapseLink;this.expandCollapseLink.addClassName("expanded");this.element.removeClassName("collapsed")}else{this.target.hideByClass();this.expandCollapseLink.innerHTML=this.expandLink;this.expandCollapseLink.removeClassName("expanded");this.element.addClassName("collapsed")}},toggleCollapse:function(A){A.preventDefault();this.opened=!(this.opened);this.updateContent()}});var PriceFilter=Class.create(Slider,{beforeDOMReady:true,sliderPosition:"top",hideTicks:true,initExtend:function($super){$super();this.startColor=this.track.getStyle("color").parseColor("#ffffff");this.endColor=this.fields[0].getStyle("backgroundColor").parseColor("#ffffff");this.fields[0].observe("focus",this.handleFocus.bindAsEventListener(this));this.fields[0].observe("blur",this.handleBlur.bindAsEventListener(this));this.fields[0].observe("keypress",this.handleKeyPress.bindAsEventListener(this))},correctFieldValue:function(B){var A=arguments[1]||B.value;if(A){if(typeof A==="string"){A=A.strip();var E=1.1;var D=E.toLocaleString().substring(1,2);if(D!="."){A=A.replace(D,".")}else{A=A.replace(",","")}}A=parseFloat(A).toFixed(0);if(isNaN(A)||A<0){A=B.lastValue||""}}return A},handleFocus:function(A){this.addHighlight(A.element())},handleBlur:function(A){this.fadeHighlight(A.element())},handleKeyPress:function(B){if(Event.KEY_RETURN==B.keyCode){var A=B.element();A.blur()}},handleSliderUpdated:function(D,A){var B=this.fields[A];B.blur();this.addHighlight(B);if(D){this.fadeHighlight(B);this.element.fire("agent:filter")}},addHighlight:function(A){if(this.highlightEffect){this.highlightEffect.cancel();this.highlightEffect=null}A.setStyle({backgroundColor:this.startColor})},fadeHighlight:function(A){if(this.highlightEffect){this.highlightEffect.cancel()}this.highlightEffect=new Effect.Highlight(A,{startcolor:this.startColor,endcolor:this.endColor,restorecolor:this.endColor,duration:3})}});var ReviewerScoreFilter=Class.create(Slider,{beforeDOMReady:true,tickInterval:1,tickSubdivisions:2,correctFieldValue:function(E){var D=arguments[1]||E.value;D=this.correctHandleValue(D);D=parseFloat(D).toFixed(1);var A=parseFloat(this.max).toFixed(1);var B=parseFloat(this.min).toFixed(1);if(E.index>0){B=this.fields[E.index-1].value}if(E.index<this.fields.length-1){A=this.fields[E.index+1].value}if(D<B){D=B}else{if(D>A){D=A}}return D},handleSliderUpdated:function(A){if(A){this.element.fire("webtrends:multiTrackEvent",{"DCSext.fctkw":"Reviewer score","WT.dl":"6","WT.ti":"Slider: Reviewer score"});this.element.fire("agent:filter")}}});var FlightTimesFilter=Class.create(Slider,{beforeDOMReady:true,sliderPosition:"top",hideTicks:true,snapInterval:1,hidden:false,interacted:false,initExtend:function(){Object.extend(this,this.params||{});this.container=this.getContainer();this.fields=this.getFields();if(!this.fields||this.fields.length<2){log.error("Invalid slider params");return}this.labels=this.container.select("label.select");this.min=0;this.max=this.fields[1].options.length-1;if(this.fields[0].selectedIndex!=this.min||this.fields[1].selectedIndex!=this.max){this.interacted=true}if(this.interacted){this.hidden=false}this.initToggle();if(this.hidden){this.hide()}else{this.initSlider()}},initToggle:function(){var A=this.element.down(".subheading");if(!A){log.error("No toggle element found.");return}var E=A.down(".toggle");if(!E){E=new Element("div",{"class":"toggle"});A.insert(E)}var B=new Element("label");this.toggle=new Element("input",{type:"checkbox"});var D=new Element("span");B.insert(this.toggle);D.insert(this.toggleLabelText);B.insert(D);E.insert(B);if(!this.hidden){this.toggle.checked=true}B.observe("click",this.handleToggle.bindAsEventListener(this))},initSlider:function(){this.initMarkup();this.sliderLabel=new Element("span",{"class":"sliderLabel"});this.sliderLabelValue=new Element("span");this.sliderLabelValue.insert(this.getLabelValue());this.sliderLabel.insert(this.sliderLabelText);this.sliderLabel.insert(this.sliderLabelValue);this.container.insert(this.sliderLabel);this.startColor=this.track.getStyle("color").parseColor("#ffffff");this.endColor=this.container.getStyle("backgroundColor").parseColor("#ffffff")},getFields:function(){return this.fields||this.container.select("select")},updateField:function(B){var A=arguments[1];if(A===undefined||A===null){return}B.selectedIndex=A;this.fieldTimestamp=new Date()},updateLabel:function(){if(this.sliderLabelValue){this.sliderLabelValue.update(this.getLabelValue())}},correctFieldValue:function(E){var B=arguments[1]||E.selectedIndex;var A=E.options.length-1;var D=0;if(E.index>0){D=this.fields[E.index-1].selectedIndex}if(E.index<this.fields.length-1){A=this.fields[E.index+1].selectedIndex}if(B<D){B=D}else{if(B>A){B=A}}return B},handleSliderUpdated:function(D,A){var B=this.fields[A];this.updateLabel();this.interacted=true;this.sliderLabel.highlight({startcolor:this.startColor,endcolor:this.endColor,restorecolor:this.endColor,duration:4});if(D){this.container.fire("agent:filter")}},getLabelValue:function(){var A=this.fields[0].options[this.fields[0].selectedIndex].text;var B=this.fields[1].options[this.fields[1].selectedIndex].text;if(A!=B){return A+" - "+B}else{return A}},handleToggle:function(A){if(this.toggle.checked&&this.hidden){this.show()}else{if(!this.hidden){this.hide()}}},hide:function(){this.container.hide();for(var B=0;B<this.fields.length;B++){var D=this.fields[B];var A=(B==0)?0:D.options.length-1;D.selectedIndex=A;if(this.labels[B]){this.labels[B].remove()}}if(this.interacted){this.container.fire("agent:filter");this.interacted=false}this.updateLabel();this.hidden=true},show:function(){this.hidden=false;this.container.show();for(var A=0;A<this.labels.length;A++){if(this.sliderLabel){this.sliderLabel.insert({before:this.labels[A]})}else{this.container.insert(this.labels[A])}}if(!this.track){this.initSlider()}if(!this.disabled){this.update()}}});var PixelTracking=Class.create();PixelTracking.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:false,deferred:true,initExtend:function(){this.element.contentWindow.location.replace("/helper/pixelTracking")}});
