/*
 * Copyright � 1999-2011 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.
 *
 * @version 2011.07.22.1
 *
 */
if (typeof TeaLeaf === "undefined") {
  TeaLeaf = {};
  TeaLeaf.Private = {};
  TeaLeaf.tlStartLoad = new Date();

  if (!TeaLeaf.Configuration) {
    TeaLeaf.Configuration = {
      "tlversion" :                 "2011.07.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,
      "xhrAsyncOnUnload":           true,

      "tlDisableIfInactive":        false,
      "tlActivityTimeout":          5,     // minutes, 0 = disable

      /* Cross-domain configuration (if any) */
      "xd_CommonDomain":            "",
      "xd_iframeID":                "",
      "xd_iframeSrcURL":            "",
      "xd_iframeSrcURLSecure":      ""
    };
  }
}
/*
 * Copyright � 1999-2011 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 2011.07.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,
            "tlusetopqueue"             : false,
            "tllastdwelltime"           : "",
            "tlidoflastvisitedcontrol"  : "",
            "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-2011 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 2011.07.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-2011 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 2011.07.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,
		    "tlactiontype"       : "No Submit",
		    "tlcontrolsattached" : false,
		    "tlscanupdate"       : 0,
		    "tlIEhref"           : false,
		    "tlEnableAttr"       : true,
		    "tlDiscardInvalidXPath"  : false,
		    "tlUniqueIDCheckEnabled" : false,
		    "tlScrollOffsetX" : 0,
		    "tlScrollOffsetY" : 0,
		    "tlScrollX" : 0,
		    "tlScrollY" : 0,
		    "tlScrollXDirection" : 0,
		    "tlScrollYDirection" : 0,
		    "tlScrollDirection" : "",
		    "tlScrollDirectionOrig" : "",
		    "tlAndroidOrientation" : 0,

		    

		    //	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 element
        //    className: JavaScript regular expression to match against the CSS class of the element
        //    attributeName: String indicating name of the custom attribute
        //    attributeValue: JavaScript regular expression to match against the value of the custom attribute
        //    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:[
        /* Sample block rules:
          // Mask all elements that have "private" or "secure" as one of their CSS class using the PreserveMask() function.
          {"className": "private|secure", "caseinsensitive": true,  "exclude": false, "mask": function () { return TeaLeaf.Client.PreserveMask.apply(this, arguments); }}
          // Mask all field names that have "creditcard" or "password" substrings using the PreserveMask() function.
          {"name": "creditcard|password", "caseinsensitive": true,  "exclude": false, "mask": function () { return TeaLeaf.Client.PreserveMask.apply(this, arguments); }}
          // Mask all field ids that match pvt0, pvt1 ... pvt9 using the EmptyMask() function.
          {"id": "^pvt[0-9]$",           "caseinsensitive": true,  "exclude": false, "mask": function () { return TeaLeaf.Client.EmptyMask.apply(this, arguments); }}
          // Paranoid mode: Mask all name and id values with the BasicMask() function.
          {"id": ".*", "name": ".*",     "caseinsensitive": false, "exclude": true,  "mask": function () { return TeaLeaf.Client.BasicMask.apply(this, arguments); }}
          // Mask all elements that have a private attribute "myID" and value of "secret" using the BasicMask() function.
          {"attributeName": "myID", "attributeValue": "secret", "caseinsensitive": true,  "exclude": false, "mask": function () { return TeaLeaf.Client.PreserveMask.apply(this, arguments); }}
        */

          {"id": "password|new_pass|cvn|cardNum|creditcard|pwd", "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.tlSendScroll"},
			    {"domevent": "beforeprint",     "load": false,  "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    {"domevent": "afterprint",      "load": false,  "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    //Mobile events
                {"domevent": "devicemotion",    "load": false,  "tlhandler": "TeaLeaf.Client.tlMotionEvent"},
                {"domevent": "deviceorientation","load": false,  "tlhandler": "TeaLeaf.Client.tlDeviceOrientationEvent"},
                {"domevent": "orientationchange","load": false,  "tlhandler": "TeaLeaf.Client.tlOrientationChangeEvent"}
			    
		    ],

		    //	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"},
			    {"domevent": "contextmenu",      "load": false,     "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    
			    //Mobile events:
			    {"domevent": "gesturestart",    "load": false,     "tlhandler": "TeaLeaf.Client.tlAddGestureEvent"},
                {"domevent": "gesturechange",   "load": false,     "tlhandler": "TeaLeaf.Client.tlAddGestureEvent"},
                {"domevent": "gestureend",      "load": false,     "tlhandler": "TeaLeaf.Client.tlAddGestureEvent"},
                {"domevent": "touchmove",       "load": false,     "tlhandler": "TeaLeaf.Client.tlAddTouchEvent"},
                {"domevent": "touchstart",      "load": false,     "tlhandler": "TeaLeaf.Client.tlAddTouchEvent"},
                {"domevent": "touchend",        "load": false,     "tlhandler": "TeaLeaf.Client.tlAddTouchEvent"},
                {"domevent": "touchcancel",     "load": false,     "tlhandler": "TeaLeaf.Client.tlAddTouchEvent"}
		    ],
		    
		    tlSingleAttach:[
			    {"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,b;b=30000;a=function(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(a(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}if(o){try{d=setTimeout(function(){TeaLeaf.XHRFactory.deleteXHRObj(n)},b);n.timeoutID=d}catch(g){}}n.send(j);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.getNodeType=function(b){var c,a;if(!b){return""}c=b.nodeName?b.nodeName.toLowerCase():"";a="";if(c==="input"||c==="object"||c==="script"){a=b.type?b.type.toLowerCase():""}return a};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};(function(){var c,a,g,h,b,f,d;c=TeaLeaf;a=c.Client;h=c.Event;g=c.Configuration;b=null;d=false,f=true;c.tlDisable=function(){f=false;if(g.tlDisableIfInactive&&!d){try{h.tlFlushQueue(true);a.tlDetachFromAllControls();TeaLeaf.Event.tlRemoveHandler(window,"beforeunload",TeaLeaf.Event.tlBeforeUnload,false);TeaLeaf.Event.tlRemoveHandler(window,"unload",TeaLeaf.Event.tlUnload,false)}catch(j){}d=true}};c.activitySinceDisabled=function(){return f};c.tlKeepAlive=function(){if(b){window.clearTimeout(b);b=null}if(!d&&g.tlActivityTimeout){b=window.setTimeout(function(){c.tlDisable()},(g.tlActivityTimeout*60000))}if(!f){f=true}}})();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.SendUnloadHeaders&&!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.tlKeepAlive();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};(function(){var f,h,a,d,j,g,c,b;f=TeaLeaf;h=f.Configuration;a=f.Client;d=a.Configuration;j=f.Event;g=j.Configuration;b=false;c=function(l){var o,p;if(b){return}if(!f.activitySinceDisabled()){return}if(d.tlIEhref){d.tlIEhref=false;return}b=true;if(!h.xhrAsyncOnUnload){h.xhrAsync=false}if(d.tlStoreQueueInCookie){var n=new Date();n.setTime(n.getTime()+300000);var m=j.tlQueuedXML.replace(/(\r|\n)/g,"").replace(/;/g,"%3B");f.tlSetCookie("tlQueuedXML",m,n,"/")}g.tllastdwelltime=new Date();p=new j(f.$C("PERFORMANCE"),l);j.SetType=p.EventType;if(!j.SetSubType){j.SetSubType=p.EventSubType}else{j.SetSubType+="; "+p.EventSubType}j.SendUnloadHeaders=true;o=[f.$C("MouseMove"),a.tlHasUserMovement?f.$C("True"):f.$C("False"),f.$C("Action"),d.tlactiontype,f.$C("VisitOrder"),g.tlvisitorder,f.$C("Alerts"),j.tlGetAlertCount()];p.tlAddData(o);p.tlSend();j.tlFlushQueue(true);setTimeout(function(){b=false;h.xhrAsync=true;j.SendUnloadHeaders=false},1000)};j.tlBeforeUnload=function(){c(f.$C("BeforeUnload"))};j.tlUnload=function(){a.tlDetachFromAllControls();c(f.$C("Unload"))}})();TeaLeaf.Event.EventSetup=function(){var b,f,d;b=TeaLeaf;f=b.Event;d=f.Configuration;if(d.tlCatchAlerts){(function(){var g,h,l,j;g=0;if(window.alert&&window.alert.apply){h=window.alert;window.alert=function(){var m;m=h.apply(window,arguments);g++;return m}}if(window.confirm&&window.confirm.apply){l=window.confirm;window.confirm=function(){var m;m=l.apply(window,arguments);g++;return m}}if(window.prompt&&window.prompt.apply){j=window.prompt;window.prompt=function(){var m;m=j.apply(window,arguments);g++;return m}}f.getAlertCount=function(){return g}})()}if(TeaLeaf.Event.Configuration.tlcatcherrors){if(typeof window.onerror!=="function"){window.onerror=TeaLeaf.Event.tlErrorHandler}}TeaLeaf.Event.tlAddHandler(window,"beforeunload",TeaLeaf.Event.tlBeforeUnload,false);TeaLeaf.Event.tlAddHandler(window,"unload",TeaLeaf.Event.tlUnload,false);if(TeaLeaf.Event.Configuration.tlqueueevents){TeaLeaf.Event.tlTimerRoutine=function(){var h=TeaLeaf.Event.Configuration.tlqueueeventstimer;try{h=TeaLeaf.Event.tlFlushQueue()}catch(g){if(TeaLeaf.Event.Configuration.tlshowexceptions){alert(g.name+": "+g.message+"\r\n\r\nPos 7")}}setTimeout("TeaLeaf.Event.tlTimerRoutine()",h)};setTimeout("TeaLeaf.Event.tlTimerRoutine()",TeaLeaf.Event.Configuration.tlqueueeventstimer)}var a=new Date();var c=Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds());TeaLeaf.Event.Configuration.t1970=c;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("UIEventAppInfo"),b);f=0;a=[];for(g in d){if(g&&d.hasOwnProperty(g)){if(typeof d[g]==="undefined"){c="undefined"}else{if(d[g]===null){c="null"}else{c=d[g].toString()}}a[f++]=TeaLeaf.Event.tlXMLEncode(g);a[f++]=c}}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?document.embeds.length:0),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?document.plugins.length:0)];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.innerWidth+"x"+window.innerHeight)])}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.tlHasUserMovement=false;TeaLeaf.Client.tlUserMovement=function(){TeaLeaf.Client.tlHasUserMovement=true;TeaLeaf.Event.tlRemoveHandler(document,"mousemove",TeaLeaf.Client.tlUserMovement,false)};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(c){var b,f,d,a;d=TeaLeaf.Client.Configuration.tlFieldBlock;if(typeof c==="string"){c=document.getElementById(c)}if(!c){return null}for(b=0;b<d.length;b++){a=d[b];if(a.id){if(!a.idRE){a.idRE=new RegExp(a.id,(a.caseinsensitive?"i":""))}if(a.idRE.test(c.id)){return a}}if(a.name){if(!a.nameRE){a.nameRE=new RegExp(a.name,(a.caseinsensitive?"i":""))}if(a.nameRE.test(c.name)){return a}}if(a.className){if(!a.classRE){a.classRE=new RegExp(a.className,(a.caseinsensitive?"i":""))}if(a.classRE.test(c.className)){return a}}if(a.attributeName&&a.attributeValue){f=c.getAttribute(a.attributeName);if(f){if(!a.attributeRE){a.attributeRE=new RegExp(a.attributeValue,(a.caseinsensitive?"i":""))}if(a.attributeRE.test(f)){return 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(TeaLeaf.getNodeType(a)==="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(TeaLeaf.getNodeType(a)==="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.tagName==="HTML"){return null}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(true);if(!h){h=window.event}if(!a.tlQueuedKeysCount){a.tlQueuedKeys=null;a.tlQueuedKeysCount=0}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,n;q=!!p.tlIsReplace(d);n=!!p.tlIsExcluded(d);if(q||n){l=null;s=0}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"),TeaLeaf.getNodeType(d),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=p.tlReplaceValue(d);var r=[TeaLeaf.$C("ValueIn"),a,a,j];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(b){var a=true;if(!b){b=window.event}if(b.clientX){if(TeaLeaf.Client.ScrollClientX==b.clientX&&TeaLeaf.Client.ScrollClientY==b.clientY&&TeaLeaf.Client.ScrollScreenX==b.screenX&&TeaLeaf.Client.ScrollScreenY==b.screenY){a=false}else{TeaLeaf.Client.ScrollClientX=b.clientX;TeaLeaf.Client.ScrollClientY=b.clientY;TeaLeaf.Client.ScrollScreenX=b.screenX;TeaLeaf.Client.ScrollScreenY=b.screenY}}else{if(TeaLeaf.Client.ScrollHeight==b.target.scrollHeight&&TeaLeaf.Client.ScrollWidth==b.target.scrollWidth&&TeaLeaf.Client.ScrollTop==b.target.scrollTop&&TeaLeaf.Client.ScrollLeft==b.target.scrollLeft){a=false}else{TeaLeaf.Client.ScrollHeight=b.target.scrollHeight;TeaLeaf.Client.ScrollWidth=b.target.scrollWidth;TeaLeaf.Client.ScrollTop=b.target.scrollTop;TeaLeaf.Client.ScrollLeft=b.target.scrollLeft}}return a};TeaLeaf.Client.tlCheckScroll=function(){var a=TeaLeaf.Client.Configuration.tlWindowHandlers;for(var b=0;b<a.length;b++){if(a[b].domevent=="scroll"&&a[b].load){return true}}return false};TeaLeaf.Client.tlSendScroll=function(b){if(TeaLeaf.Client.tlCheckScroll()==false){return}var c=0,a=0;if(typeof(window.pageYOffset)=="number"){a=window.pageYOffset;c=window.pageXOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){a=document.body.scrollTop;c=document.body.scrollLeft}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){a=document.documentElement.scrollTop;c=document.documentElement.scrollLeft}}}if(TeaLeaf.Client.Configuration.tlScrollOffsetX==0){TeaLeaf.Client.Configuration.tlScrollOffsetX=c}else{if(c>TeaLeaf.Client.Configuration.tlScrollOffsetX){TeaLeaf.Client.Configuration.tlScrollDirection="right"}else{if(c<TeaLeaf.Client.Configuration.tlScrollOffsetX){TeaLeaf.Client.Configuration.tlScrollDirection="left"}}}if(TeaLeaf.Client.Configuration.tlScrollOffsetY==0){TeaLeaf.Client.Configuration.tlScrollOffsetY=a}else{if(a>TeaLeaf.Client.Configuration.tlScrollOffsetY){TeaLeaf.Client.Configuration.tlScrollDirection="down"}else{if(a<TeaLeaf.Client.Configuration.tlScrollOffsetY){TeaLeaf.Client.Configuration.tlScrollDirection="up"}}}if(c>0){TeaLeaf.Client.Configuration.tlScrollX=c}if(a>0){TeaLeaf.Client.Configuration.tlScrollY=a}if(TeaLeaf.Client.Configuration.tlScrollOffsetX==TeaLeaf.Client.Configuration.tlScrollX&&TeaLeaf.Client.Configuration.tlScrollOffsetY==TeaLeaf.Client.Configuration.tlScrollY){return}if(b==true||(TeaLeaf.Client.Configuration.tlScrollDirectionOrig!=TeaLeaf.Client.Configuration.tlScrollDirection)){var f=new TeaLeaf.Event(TeaLeaf.$C("GUI"),TeaLeaf.$C("scroll"));var d=[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,TeaLeaf.$C("OrigX"),TeaLeaf.Client.Configuration.tlScrollOffsetX+"",TeaLeaf.$C("OrigY"),TeaLeaf.Client.Configuration.tlScrollOffsetY+"",TeaLeaf.$C("CurrX"),TeaLeaf.Client.Configuration.tlScrollX+"",TeaLeaf.$C("CurrY"),TeaLeaf.Client.Configuration.tlScrollY+"",TeaLeaf.$C("OrigDirection"),TeaLeaf.Client.Configuration.tlScrollDirectionOrig,TeaLeaf.$C("CurrDirection"),TeaLeaf.Client.Configuration.tlScrollDirection];f.tlAddData(d);f.tlSend()}TeaLeaf.Client.Configuration.tlScrollOffsetX=TeaLeaf.Client.Configuration.tlScrollX;TeaLeaf.Client.Configuration.tlScrollOffsetY=TeaLeaf.Client.Configuration.tlScrollY;TeaLeaf.Client.Configuration.tlScrollDirectionOrig=TeaLeaf.Client.Configuration.tlScrollDirection};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(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}}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}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.tlOrientationChangeEvent=function(h){var b=TeaLeaf,a=b.Client,f=a.Configuration,g,j,d;if(!h){h=window.event}j=new b.Event(b.$C("GUI"),h.type);if(navigator){var c=navigator.userAgent.toLowerCase()}if(c.indexOf("android")>-1){d=TeaLeaf.Client.Configuration.tlAndroidOrientation+window.orientation;if(d==270){d=-90;TeaLeaf.Client.Configuration.tlAndroidOrientation=90}else{if(d==360){d=0;TeaLeaf.Client.Configuration.tlAndroidOrientation=0}else{TeaLeaf.Client.Configuration.tlAndroidOrientation+=d}}}else{d=window.orientation}tlAddNameValueArray=[b.$C("ClientSize"),(window.innerWidth+"x"+window.innerHeight),"orientation",d];j.tlAddData(tlAddNameValueArray);j.tlSend()};TeaLeaf.Client.tlMotionEvent=function(f){var b=TeaLeaf,a=b.Client,c=a.Configuration,d,g;if(!f){f=window.event}g=new b.Event(b.$C("GUI"),f.type);tlAddNameValueArray=["acceleration",f.acceleration,"accelerationIncludingGravity",f.accelerationIncludingGravity,"interval",f.interval,"rotationRate",f.rotationRate];g.tlAddData(tlAddNameValueArray);g.tlSend()};TeaLeaf.Client.tlDeviceOrientationEvent=function(f){var b=TeaLeaf,a=b.Client,c=a.Configuration,d,g;if(!f){f=window.event}g=new b.Event(b.$C("GUI"),f.type);tlAddNameValueArray=["alpha",f.alpha,"beta",f.beta,"gamma",f.gamma];g.tlAddData(tlAddNameValueArray);g.tlSend()};TeaLeaf.Client.tlAddMobileEventRef=function(a,j){var g=TeaLeaf,f=g.Client,s=f.Configuration,q,r,c,m,n,h,p,t,l,d,b,u,o;if(!a){a=window.event}f.tlSendScroll(true);r=f.tlGetEventSource(a);if(!r){return}o=f.tlGetXPathFromNode(r);if(!o&&s.tlDiscardInvalidXPath){return}m=[];if(s.tlEnableAttr){m=f.tlCheckAttributes(r,a)}h=new g.Event(g.$C("GUI"),a.type);d=f.tlGetName(r);b=r.id;if(!f.CheckIfIdValid(r)){b=""}tlAddNameValueArray=[g.$C("Name"),r.name,g.$C("Id"),b,g.$C("ElementType"),g.getNodeType(r),g.$C("TagName"),r.tagName,g.$C("XPath"),o];h.tlAddData(tlAddNameValueArray);for(var q=0;q<j.length;q++){m.push(j[q])}if(m){h.tlAddData(m)}h.tlSend()};TeaLeaf.Client.tlAddTouchEvent=function(b){if(b.scale){var a=["cancelable",b.cancelable,"screenX",b.screenX,"screenY",b.screenY,"scale",b.scale,"rotation",b.rotation];TeaLeaf.Client.tlAddMobileEventRef(b,a)}};TeaLeaf.Client.tlAddGestureEvent=function(b){if(b.cancelable){var a=["cancelable",b.cancelable]}TeaLeaf.Client.tlAddMobileEventRef(b,a)};TeaLeaf.Client.tlAddEvent=function(b){var g=TeaLeaf,f=g.Client,u=f.Configuration,r,s,j,c,t,m,n,o,h,q,v,l,d,a,w,p;if(!b){b=window.event}s=f.tlGetEventSource(b);if(!s){return}if(b.type.toLowerCase()==="mousedown"&&s.tagName==="BODY"){return}j=g.getNodeType(s);p=f.tlGetXPathFromNode(s);if(!p&&u.tlDiscardInvalidXPath){return}n=[];if(u.tlEnableAttr){n=f.tlCheckAttributes(s,b)}f.tlSendKeys();f.tlSendResize();f.tlSendScroll(true);if(!s.TeaLeafFocusTime){switch(b.type.toLowerCase()){case"keyup":case"change":case"click":case"dblclick":case"mousedown":s.TeaLeafFocusTime=new Date();break}}if(b.type.toLowerCase()==="blur"&&j==="application/x-shockwave-flash"){return}if(b.type.toLowerCase()==="click"&&f.checkIsInput(s)){g.Event.Configuration.tlidoflastvisitedcontrol=f.tlGetName(s)}if(b.type.toLowerCase()==="click"&&(s.tagName.toUpperCase()==="A")&&g.tlBrowserIsIE()){u.tlIEhref=false;q=s.href;if(q==="#"){u.tlIEhref=true}else{v="javascript:";o=q.substr(0,v.length);if(o.toLowerCase()==v){u.tlIEhref=true}}}h=new g.Event(g.$C("GUI"),b.type);d=f.tlGetName(s);a=s.id;if(!f.CheckIfIdValid(s)){a=""}t=[g.$C("Name"),s.name,g.$C("Id"),a,g.$C("ElementType"),j,g.$C("TagName"),s.tagName,g.$C("AltKey"),b.altKey?g.$C("True"):null,g.$C("CtrlKey"),b.ctrlKey?g.$C("True"):null,g.$C("ShiftKey"),b.shiftKey?g.$C("True"):null,g.$C("XPath"),p];h.tlAddData(t);if(u.tlEnableAttr&&n&&n.length>0){h.tlAddData(n)}if(b.type.toLowerCase()==="blur"&&s.TeaLeafFocusTime){c=new Date();h.tlAddData([g.$C("TimeInControl"),g.Event.tlDateDiff(c,s.TeaLeafFocusTime)]);s.TeaLeafFocusTime=null}if(f.tlIsExcluded(s)){h.tlAddData([g.$C("Excluded"),g.$C("True")])}else{w=null;l=null;m=[];if(!s.value&&b.type.toLowerCase()==="change"&&s.tagName.toUpperCase()==="SELECT"){r=s.selectedIndex;if(r>=0&&r<s.options.length){w=escape(s.options[r].text)}}else{w=f.tlReplaceValue(s)}if(w){l=g.Event.tlFormatXMLName(d);if(!l){l=p;l=g.Event.tlFormatXMLName(l)}m=[g.$C("ValueIn"),l,l,w]}if(j==="checkbox"||j==="radio"){m.push(g.$C("Checked"),s.checked?g.$C("True"):g.$C("False"))}h.tlAddData(m)}h.tlSend()};TeaLeaf.Client.tlHandleFormSubmit=function(h){TeaLeaf.Client.Configuration.tlactiontype="Submit";TeaLeaf.Client.tlSendKeys();TeaLeaf.Client.tlSendResize();TeaLeaf.Client.tlSendScroll(true);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.tlReplaceValue(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"),TeaLeaf.getNodeType(j),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"),TeaLeaf.getNodeType(d),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.tlReplaceValue(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(true);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(true);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.tlReplaceValue(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"),TeaLeaf.getNodeType(d),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.tlAttachToAllControls=function(){TeaLeaf.Client.Configuration.tlcontrolsattached=true;TeaLeaf.Client.tlAttachToControls(window);try{var a;for(a=0;a<window.frames.length;a++){if(window==window.frames[a]){continue}TeaLeaf.Client.tlAttachToControls(window.frames[a])}}catch(b){}};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;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.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(c){var b,a;if(!c){c=window.event}b=TeaLeaf.Client.tlGetEventSource(c);a=TeaLeaf.getNodeType(b);if(!b||a==="application/x-shockwave-flash"){return}var b=TeaLeaf.Client.tlGetEventSource(c);if(!b){return}if(!b.TeaLeafFocusTime){b.TeaLeafFocusTime=new Date()}if(TeaLeaf.Client.Configuration.tlsendfocus){TeaLeaf.Client.tlAddEvent(c)}};TeaLeaf.Client.tlHandleBlur=function(c){var b,a;if(!c){c=window.event}b=TeaLeaf.Client.tlGetEventSource(c);a=TeaLeaf.getNodeType(b);if(!b||a==="application/x-shockwave-flash"){return}TeaLeaf.Client.tlEndVisit(b);if(TeaLeaf.Client.checkIsInput(b)){TeaLeaf.Event.Configuration.tlidoflastvisitedcontrol=TeaLeaf.Client.tlGetName(b)}if(TeaLeaf.Client.Configuration.tlsendblur){TeaLeaf.Client.tlAddEvent(c)}b.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"),TeaLeaf.getNodeType(c)];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.addOnLoad(TeaLeaf.Client.tlSetup)};if(TeaLeaf.Client.Configuration.tlinit==false){TeaLeaf.Client.Configuration.tlinit=true;TeaLeaf.Client.CallInit()}};
var Prototype={Version:"1.7",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/.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 C=document.createElement("div"),B=document.createElement("form"),A=false;if(C.__proto__&&(C.__proto__!==B.__proto__)){A=true}C=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 C=0,A=arguments.length;C<A;C++){var D=arguments[C];try{B=D();break}catch(E){}}return B}};var Class=(function(){var D=(function(){for(var E in {toString:1}){if(E==="toString"){return false}}return true})();function C(){}function B(){var G=null,H=$A(arguments);if(Object.isFunction(H[0])){G=H.shift()}function E(){this.initialize.apply(this,arguments)}Object.extend(E,Class.Methods);E.superclass=G;E.subclasses=[];if(G){C.prototype=G.prototype;E.prototype=new C;G.subclasses.push(E)}for(var I=0,F=H.length;I<F;I++){E.addMethods(H[I])}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,H=Object.keys(F);if(D){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()[0]=="$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 Y=Object.prototype.toString,Z="Null",Q="Undefined",X="Boolean",L="Number",T="String",g="Object",l="[object Function]",b="[object Boolean]",G="[object Number]",E="[object String]",H="[object Array]",c="[object Date]",I=window.JSON&&typeof JSON.stringify==="function"&&JSON.stringify(0)==="0"&&typeof JSON.stringify(Prototype.K)==="undefined";function K(p){switch(p){case null:return Z;case (void 0):return Q}var m=typeof p;switch(m){case"boolean":return X;case"number":return L;case"string":return T}return g}function a(p,o){for(var m in o){p[m]=o[m]}return p}function h(m){try{if(D(m)){return"undefined"}if(m===null){return"null"}return m.inspect?m.inspect():String(m)}catch(o){if(o instanceof RangeError){return"..."}throw o}}function W(m){return f("",{"":m},[])}function f(w,y,u){var v=y[w],t=typeof v;if(K(v)===g&&typeof v.toJSON==="function"){v=v.toJSON(w)}var o=Y.call(v);switch(o){case G:case b:case E:v=v.valueOf()}switch(v){case null:return"null";case true:return"true";case false:return"false"}t=typeof v;switch(t){case"string":return v.inspect(true);case"number":return isFinite(v)?String(v):"null";case"object":for(var p=0,q=u.length;p<q;p++){if(u[p]===v){throw new TypeError()}}u.push(v);var m=[];if(o===H){for(var p=0,q=v.length;p<q;p++){var r=f(p,v,u);m.push(typeof r==="undefined"?"null":r)}m="["+m.join(",")+"]"}else{var x=Object.keys(v);for(var p=0,q=x.length;p<q;p++){var w=x[p],r=f(w,v,u);if(typeof r!=="undefined"){m.push(w.inspect(true)+":"+r)}}m="{"+m.join(",")+"}"}u.pop();return m}}function d(m){return JSON.stringify(m)}function F(m){return $H(m).toQueryString()}function A(m){return m&&m.toHTML?m.toHTML():String.interpret(m)}function S(p){if(K(p)!==g){throw new TypeError()}var o=[];for(var m in p){if(p.hasOwnProperty(m)){o.push(m)}}return o}function M(p){var o=[];for(var m in p){o.push(p[m])}return o}function e(m){return a({},m)}function V(m){return !!(m&&m.nodeType==1)}function O(m){return Y.call(m)===H}var P=(typeof Array.isArray=="function")&&Array.isArray([])&&!Array.isArray({});if(P){O=Array.isArray}function J(m){return m instanceof Hash}function B(m){return Y.call(m)===l}function C(m){return Y.call(m)===E}function k(m){return Y.call(m)===G}function U(m){return Y.call(m)===c}function D(m){return typeof m==="undefined"}a(Object,{extend:a,inspect:h,toJSON:I?d:W,toQueryString:F,toHTML:A,keys:Object.keys||S,values:M,clone:e,isElement:V,isArray:O,isHash:J,isFunction:B,isString:C,isNumber:k,isDate:U,isUndefined:D})})();Object.extend(Function.prototype,(function(){var K=Array.prototype.slice;function D(P,M){var O=P.length,L=M.length;while(L--){P[O+L]=M[L]}return P}function J(M,L){M=K.call(M,0);return D(M,L)}function C(){var L=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return L.length==1&&!L[0]?[]:L}function H(M){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var O=this,L=K.call(arguments,1);return function(){var P=J(L,arguments);return O.apply(M,P)}}function F(M){var O=this,L=K.call(arguments,1);return function(Q){var P=D([Q||window.event],L);return O.apply(M,P)}}function I(){if(!arguments.length){return this}var M=this,L=K.call(arguments,0);return function(){var O=J(L,arguments);return M.apply(this,O)}}function E(L){var O=this,M=K.call(arguments,1);L=L*1000;return window.setTimeout(function(){return O.apply(O,M)},L)}function A(){var L=D([0.01],arguments);return this.delay.apply(this,L)}function B(M){var L=this;return function(){var O=D([L.bind(this)],arguments);return M.apply(this,O)}}function G(){if(this._methodized){return this._methodized}var L=this;return this._methodized=function(){var M=D([this],arguments);return L.apply(null,M)}}return{argumentNames:C,bind:H,bindAsEventListener:F,curry:I,delay:E,defer:A,wrap:B,methodize:G}})());(function(B){function A(){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"}function C(){return this.toISOString()}if(!B.toISOString){B.toISOString=A}if(!B.toJSON){B.toJSON=C}})(Date.prototype);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(){var NATIVE_JSON_PARSE_SUPPORT=window.JSON&&typeof JSON.parse==="function"&&JSON.parse('{"test": true}').test;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"),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()),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(){return this.replace(/-+(.)?/g,function(match,chr){return chr?chr.toUpperCase():""})}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 unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")}function isJSON(){var str=this;if(str.blank()){return false}str=str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@");str=str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");str=str.replace(/(?:^|:|,)(?:\s*\[)+/g,"");return(/^[\],:{}\s]*$/).test(str)}function evalJSON(sanitize){var json=this.unfilterJSON(),cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;if(cx.test(json)){json=json.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())}function parseJSON(){var json=this.unfilterJSON();return JSON.parse(json)}function include(pattern){return this.indexOf(pattern)>-1}function startsWith(pattern){return this.lastIndexOf(pattern,0)===0}function endsWith(pattern){var d=this.length-pattern.length;return d>=0&&this.indexOf(pattern,d)===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||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,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:NATIVE_JSON_PARSE_SUPPORT?parseJSON: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(F){if(A==null){return(F[1]+"")}var C=F[1]||"";if(C=="\\"){return F[2]}var D=A,G=F[3],B=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;F=B.exec(G);if(F==null){return C}while(F!=null){var E=F[1].startsWith("[")?F[2].replace(/\\\\]/g,"]"):F[1];D=D[E];if(null==D||""==F[3]){break}G=G.substring("["==F[3]?F[1].length:F[0].length);F=B.exec(G)}return C+String.interpret(D)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function D(a,Z){var Y=0;try{this._each(function(c){a.call(Z,c,Y++)})}catch(b){if(b!=$break){throw b}}return this}function P(Y,b,a){var Z=-Y,c=[],d=this.toArray();if(Y<1){return d}while((Z+=Y)<d.length){c.push(d.slice(Z,Z+Y))}return c.collect(b,a)}function C(Z,Y){Z=Z||Prototype.K;var a=true;this.each(function(c,b){a=a&&!!Z.call(Y,c,b);if(!a){throw $break}});return a}function I(Z,Y){Z=Z||Prototype.K;var a=false;this.each(function(c,b){if(a=!!Z.call(Y,c,b)){throw $break}});return a}function J(a,Z){a=a||Prototype.K;var Y=[];this.each(function(c,b){Y.push(a.call(Z,c,b))});return Y}function M(Z,Y){var a;this.each(function(c,b){if(Z.call(Y,c,b)){a=c;throw $break}});return a}function B(a,Z){var Y=[];this.each(function(c,b){if(a.call(Z,c,b)){Y.push(c)}});return Y}function H(Y,b,a){b=b||Prototype.K;var Z=[];if(Object.isString(Y)){Y=new RegExp(RegExp.escape(Y))}this.each(function(d,c){if(Y.match(d)){Z.push(b.call(a,d,c))}});return Z}function A(Y){if(Object.isFunction(this.indexOf)){if(this.indexOf(Y)!=-1){return true}}var Z=false;this.each(function(a){if(a==Y){Z=true;throw $break}});return Z}function Q(Y,Z){Z=Object.isUndefined(Z)?null:Z;return this.eachSlice(Y,function(a){while(a.length<Y){a.push(Z)}return a})}function W(Y,a,Z){this.each(function(c,b){Y=a.call(Z,Y,c,b)});return Y}function K(Z){var Y=$A(arguments).slice(1);return this.map(function(a){return a[Z].apply(a,Y)})}function S(Z,Y){Z=Z||Prototype.K;var a;this.each(function(c,b){c=Z.call(Y,c,b);if(a==null||c>=a){a=c}});return a}function O(Z,Y){Z=Z||Prototype.K;var a;this.each(function(c,b){c=Z.call(Y,c,b);if(a==null||c<a){a=c}});return a}function E(b,Z){b=b||Prototype.K;var a=[],Y=[];this.each(function(d,c){(b.call(Z,d,c)?a:Y).push(d)});return[a,Y]}function F(Y){var Z=[];this.each(function(a){Z.push(a[Y])});return Z}function G(a,Z){var Y=[];this.each(function(c,b){if(!a.call(Z,c,b)){Y.push(c)}});return Y}function V(Z,Y){return this.map(function(b,a){return{value:b,criteria:Z.call(Y,b,a)}}).sort(function(f,e){var d=f.criteria,c=e.criteria;return d<c?-1:d>c?1:0}).pluck("value")}function T(){return this.map()}function U(){var Z=Prototype.K,Y=$A(arguments);if(Object.isFunction(Y.last())){Z=Y.pop()}var a=[this].concat(Y).map($A);return this.map(function(c,b){return Z(a.pluck(b))})}function L(){return this.toArray().length}function X(){return"#<Enumerable:"+this.toArray().inspect()+">"}return{each:D,eachSlice:P,all:C,every:C,any:I,some:I,collect:J,map:J,detect:M,findAll:B,select:B,filter:B,grep:H,include:A,member:A,inGroupsOf:Q,inject:W,invoke:K,max:S,min:O,partition:E,pluck:F,reject:G,sortBy:V,toArray:T,entries:T,zip:U,size:L,inspect:X,find:M}})();function $A(C){if(!C){return[]}if("toArray" in Object(C)){return C.toArray()}var A=C.length||0,B=new Array(A);while(A--){B[A]=C[A]}return B}function $w(A){if(!Object.isString(A)){return[]}A=A.strip();return A?A.split(/\s+/):[]}Array.from=$A;(function(){var M=Array.prototype,P=M.slice,S=M.forEach;function B(Z,Y){for(var X=0,W=this.length>>>0;X<W;X++){if(X in this){Z.call(Y,this[X],X,this)}}}if(!S){S=B}function O(){this.length=0;return this}function D(){return this[0]}function G(){return this[this.length-1]}function J(){return this.select(function(W){return W!=null})}function I(){return this.inject([],function(X,W){if(Object.isArray(W)){return X.concat(W.flatten())}X.push(W);return X})}function H(){var W=P.call(arguments,0);return this.select(function(X){return !W.include(X)})}function F(W){return(W===false?this.toArray():this)._reverse()}function L(W){return this.inject([],function(Z,Y,X){if(0==X||(W?Z.last()!=Y:!Z.include(Y))){Z.push(Y)}return Z})}function T(W){return this.uniq().findAll(function(X){return W.detect(function(Y){return X===Y})})}function U(){return P.call(this,0)}function K(){return this.length}function V(){return"["+this.map(Object.inspect).join(", ")+"]"}function A(Y,X){X||(X=0);var W=this.length;if(X<0){X=W+X}for(;X<W;X++){if(this[X]===Y){return X}}return -1}function Q(X,W){W=isNaN(W)?this.length:(W<0?this.length+W:W)+1;var Y=this.slice(0,W).reverse().indexOf(X);return(Y<0)?Y:W-Y-1}function C(){var b=P.call(this,0),Z;for(var Y=0,W=arguments.length;Y<W;Y++){Z=arguments[Y];if(Object.isArray(Z)&&!("callee" in Z)){for(var X=0,a=Z.length;X<a;X++){b.push(Z[X])}}else{b.push(Z)}}return b}Object.extend(M,Enumerable);if(!M._reverse){M._reverse=M.reverse}Object.extend(M,{_each:S,clear:O,first:D,last:G,compact:J,flatten:I,without:H,reverse:F,uniq:L,intersect:T,clone:U,toArray:U,size:K,inspect:V});var E=(function(){return[].concat(arguments)[0][0]!==1})(1,2);if(E){M.concat=C}if(!M.indexOf){M.indexOf=A}if(!M.lastIndexOf){M.lastIndexOf=Q}})();function $H(A){return new Hash(A)}var Hash=Class.create(Enumerable,(function(){function D(Q){this._object=Object.isHash(Q)?Q.toObject():Object.clone(Q)}function E(S){for(var Q in this._object){var T=this._object[Q],U=[Q,T];U.key=Q;U.value=T;S(U)}}function K(Q,S){return this._object[Q]=S}function B(Q){if(this._object[Q]!==Object.prototype[Q]){return this._object[Q]}}function P(Q){var S=this._object[Q];delete this._object[Q];return S}function J(){return Object.clone(this._object)}function O(){return this.pluck("key")}function M(){return this.pluck("value")}function G(S){var Q=this.detect(function(T){return T.value===S});return Q&&Q.key}function I(Q){return this.clone().update(Q)}function C(Q){return new Hash(Q).inject(this,function(S,T){S.set(T.key,T.value);return S})}function A(Q,S){if(Object.isUndefined(S)){return Q}return Q+"="+encodeURIComponent(String.interpret(S))}function F(){return this.inject([],function(U,Y){var T=encodeURIComponent(Y.key),V=Y.value;if(V&&typeof V=="object"){if(Object.isArray(V)){var X=[];for(var S=0,Q=V.length,W;S<Q;S++){W=V[S];X.push(A(T,W))}return U.concat(X)}}else{U.push(A(T,V))}return U}).join("&")}function L(){return"#<Hash:{"+this.map(function(Q){return Q.map(Object.inspect).join(": ")}).join(", ")+"}>"}function H(){return new Hash(this)}return{initialize:D,_each:E,set:K,get:B,unset:P,toObject:J,toTemplateReplacements:J,keys:O,values:M,index:G,merge:I,update:C,toQueryString:F,inspect:L,toJSON:J,clone:H}})());Hash.from=$H;Object.extend(Number.prototype,(function(){function D(){return this.toPaddedString(2,16)}function B(){return this+1}function H(J,I){$R(0,this,true).each(J,I);return this}function G(I,K){var J=this.toString(K||10);return"0".times(I-J.length)+J}function A(){return Math.abs(this)}function C(){return Math.round(this)}function E(){return Math.ceil(this)}function F(){return Math.floor(this)}return{toColorPart:D,succ:B,times:H,toPaddedString:G,abs:A,round:C,ceil:E,floor:F}})());function $R(C,A,B){return new ObjectRange(C,A,B)}var ObjectRange=Class.create(Enumerable,(function(){function B(F,D,E){this.start=F;this.end=D;this.exclusive=E}function C(D){var E=this.start;while(this.include(E)){D(E);E=E.succ()}}function A(D){if(D<this.start){return false}if(this.exclusive){return D<this.end}return D<=this.end}return{initialize:B,_each:C,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(C,B,D,A){this.each(function(E){if(Object.isFunction(E[C])){try{E[C].apply(E,[B,D,A])}catch(F){}}})}};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.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 D=Object.isString(this.options.parameters)?this.options.parameters:Object.toQueryString(this.options.parameters);if(!["get","post"].include(this.method)){D+=(D?"&":"")+"_method="+this.method;this.method="post"}if(D&&this.method==="get"){this.url+=(this.url.include("?")?"&":"?")+D}this.parameters=D.toQueryParams();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||D):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(C){this.dispatchException(C)}},onStateChange:function(){var A=this.transport.readyState;if(A>1&&!((A==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var E={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){E["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){E.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var B=this.options.requestHeaders;if(Object.isFunction(B.push)){for(var D=0,A=B.length;D<A;D+=2){E[B[D]]=B[D+1]}}else{$H(B).each(function(F){E[F.key]=F.value})}}for(var C in E){this.transport.setRequestHeader(C,E[C])}},success:function(){var A=this.getStatus();return !A||(A>=200&&A<300)||A==304},getStatus:function(){try{if(this.transport.status===1223){return 204}return this.transport.status||0}catch(A){return 0}},respondToReadyState:function(A){var C=Ajax.Request.Events[A],B=new Ajax.Response(this);if(C=="Complete"){try{this._complete=true;(this.options["on"+B.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(B,B.headerJSON)}catch(E){this.dispatchException(E)}var D=B.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&D&&D.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+C]||Prototype.emptyFunction)(B,B.headerJSON);Ajax.Responders.dispatch("on"+C,this,B,B.headerJSON)}catch(E){this.dispatchException(E)}if(C=="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(C){this.request=C;var D=this.transport=C.transport,A=this.readyState=D.readyState;if((A>2&&!Prototype.Browser.IE)||A==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(D.responseText);this.headerJSON=this._getHeaderJSON()}if(A==4){var B=D.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,C,A,B){this.container={success:(C.success||C),failure:(C.failure||(C.success?null:C))};B=Object.clone(B);var D=B.onComplete;B.onComplete=(function(F,E){this.updateContent(F.responseText);if(Object.isFunction(D)){D(F,E)}}).bind(this);$super(A,B)},updateContent:function(D){var B=this.container[this.success()?"success":"failure"],C=this.options;if(!C.evalScripts){D=D.stripScripts()}if(B=$(B)){if(C.insertion){if(Object.isString(C.insertion)){var A={};A[C.insertion]=D;B.insert(A)}else{C.insertion(B,D)}}else{B.update(D)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,C,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=C;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 $(C){if(arguments.length>1){for(var D=0,A=[],B=arguments.length;D<B;D++){A.push($(arguments[D]))}return A}if(Object.isString(C)){C=document.getElementById(C)}return Element.extend(C)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(F,D){var C=[];var E=document.evaluate(F,$(D)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var B=0,A=E.snapshotLength;B<A;B++){C.push(Element.extend(E.snapshotItem(B)))}return C}}if(!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){function D(F,E){if(F==="select"){return false}if("type" in E){return false}return true}var C=(function(){try{var E=document.createElement('<input name="x">');return E.tagName.toLowerCase()==="input"&&E.name==="x"}catch(F){return false}})();var B=A.Element;A.Element=function(G,F){F=F||{};G=G.toLowerCase();var E=Element.cache;if(C&&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))}var H=D(G,F)?E[G].cloneNode(false):document.createElement(G);return Element.writeAttribute(H,F)};Object.extend(A.Element,B||{});if(B){A.Element.prototype=B.prototype}})(this);Element.idCounter=1;Element.cache={};Element._purgeElement=function(A){var B=A._prototypeUID;if(B){Element.stopObserving(A);A._prototypeUID=void 0;delete Element.Storage[B]}};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 D=(function(){var G=document.createElement("select"),H=true;G.innerHTML='<option value="test">test</option>';if(G.options&&G.options[0]){H=G.options[0].nodeName.toUpperCase()!=="OPTION"}G=null;return H})();var B=(function(){try{var G=document.createElement("table");if(G&&G.tBodies){G.innerHTML="<tbody><tr><td>test</td></tr></tbody>";var I=typeof G.tBodies[0]=="undefined";G=null;return I}}catch(H){return true}})();var C=(function(){try{var G=document.createElement("div");G.innerHTML="<link>";var I=(G.childNodes.length===0);G=null;return I}catch(H){return true}})();var A=D||B||C;var F=(function(){var G=document.createElement("script"),I=false;try{G.appendChild(document.createTextNode(""));I=!G.firstChild||G.firstChild&&G.firstChild.nodeType!==3}catch(H){I=true}G=null;return I})();function E(I,K){I=$(I);var L=Element._purgeElement;var M=I.getElementsByTagName("*"),J=M.length;while(J--){L(M[J])}if(K&&K.toElement){K=K.toElement()}if(Object.isElement(K)){return I.update().insert(K)}K=Object.toHTML(K);var H=I.tagName.toUpperCase();if(H==="SCRIPT"&&F){I.text=K;return I}if(A){if(H in Element._insertionTranslations.tags){while(I.firstChild){I.removeChild(I.firstChild)}Element._getContentFromAnonymousElement(H,K.stripScripts()).each(function(O){I.appendChild(O)})}else{if(C&&Object.isString(K)&&K.indexOf("<link")>-1){while(I.firstChild){I.removeChild(I.firstChild)}var G=Element._getContentFromAnonymousElement(H,K.stripScripts(),true);G.each(function(O){I.appendChild(O)})}else{I.innerHTML=K.stripScripts()}}}else{I.innerHTML=K.stripScripts()}K.evalScripts.bind(K).defer();return I}return E})(),replace:function(B,C){B=$(B);if(C&&C.toElement){C=C.toElement()}else{if(!Object.isElement(C)){C=Object.toHTML(C);var A=B.ownerDocument.createRange();A.selectNode(B);C.evalScripts.bind(C).defer();C=A.createContextualFragment(C.stripScripts())}}B.parentNode.replaceChild(C,B);return B},insert:function(D,F){D=$(D);if(Object.isString(F)||Object.isNumber(F)||Object.isElement(F)||(F&&(F.toElement||F.toHTML))){F={bottom:F}}var E,B,C,G;for(var A in F){E=F[A];A=A.toLowerCase();B=Element._insertionTranslations[A];if(E&&E.toElement){E=E.toElement()}if(Object.isElement(E)){B(D,E);continue}E=Object.toHTML(E);C=((A=="before"||A=="after")?D.parentNode:D).tagName.toUpperCase();G=Element._getContentFromAnonymousElement(C,E.stripScripts());if(A=="top"||A=="after"){G.reverse()}G.each(B.curry(D));E.evalScripts.bind(E).defer()}return D},wrap:function(B,C,A){B=$(B);if(Object.isElement(C)){$(C).writeAttribute(A||{})}else{if(Object.isString(C)){C=new Element(C,A)}else{C=new Element("div",C)}}if(B.parentNode){B.parentNode.replaceChild(C,B)}C.appendChild(B);return C},inspect:function(A){A=$(A);var B="<"+A.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(F){var C=F.first(),D=F.last(),E=(A[C]||"").toString();if(E){B+=" "+D+"="+E.inspect(true)}});return B+">"},recursivelyCollect:function(C,B,D){C=$(C);D=D||-1;var A=[];while(C=C[B]){if(C.nodeType==1){A.push(Element.extend(C))}if(A.length==D){break}}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){var B=[],C=$(A).firstChild;while(C){if(C.nodeType===1){B.push(Element.extend(C))}C=C.nextSibling}return B},previousSiblings:function(A,B){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){B=$(B);if(Object.isString(A)){return Prototype.Selector.match(B,A)}return A.match(B)},up:function(C,D,B){C=$(C);if(arguments.length==1){return $(C.parentNode)}var A=Element.ancestors(C);return Object.isNumber(D)?A[D]:Prototype.Selector.find(A,D,B)},down:function(B,C,A){B=$(B);if(arguments.length==1){return Element.firstDescendant(B)}return Object.isNumber(C)?Element.descendants(B)[C]:Element.select(B,C)[A||0]},previous:function(B,C,A){B=$(B);if(Object.isNumber(C)){A=C,C=false}if(!Object.isNumber(A)){A=0}if(C){return Prototype.Selector.find(B.previousSiblings(),C,A)}else{return B.recursivelyCollect("previousSibling",A+1)[A]}},next:function(B,D,A){B=$(B);if(Object.isNumber(D)){A=D,D=false}if(!Object.isNumber(A)){A=0}if(D){return Prototype.Selector.find(B.nextSiblings(),D,A)}else{var C=Object.isNumber(A)?A+1:1;return B.recursivelyCollect("nextSibling",A+1)[A]}},select:function(A){A=$(A);var B=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(B,A)},adjacent:function(A){A=$(A);var B=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(B,A.parentNode).without(A)},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 C=Element._attributeTranslations.read;if(C.values[A]){return C.values[A](B,A)}if(C.names[A]){A=C.names[A]}if(A.include(":")){return(!B.attributes||!B.attributes[A])?null:B.attributes[A].value}}return B.getAttribute(A)},writeAttribute:function(D,C,F){D=$(D);var B={},E=Element._attributeTranslations.write;if(typeof C=="object"){B=C}else{B[C]=Object.isUndefined(F)?true:F}for(var A in B){C=E.names[A]||A;F=B[A];if(E.values[A]){C=E.values[A](D,F)}if(F===false||F===null){D.removeAttribute(C)}else{if(F===true){D.setAttribute(C,C)}else{D.setAttribute(C,F)}}}return D},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 C=B.className;return(C.length>0&&(C==A||new RegExp("(^|\\s)"+A+"(\\s|$)").test(C)))},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 C=B.firstChild;while(C){var A=C.nextSibling;if(C.nodeType==3&&!/\S/.test(C.nodeValue)){B.removeChild(C)}C=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,C){A=$(A);C=C=="float"?"cssFloat":C.camelize();var D=A.style[C];if(!D||D=="auto"){var B=document.defaultView.getComputedStyle(A,null);D=B?B[C]:null}if(C=="opacity"){return D?parseFloat(D):1}return D=="auto"?null:D},getOpacity:function(A){return $(A).getStyle("opacity")},setStyle:function(E,C){E=$(E);var B=E.style,D;if(Object.isString(C)){E.style.cssText+=";"+C;return C.include("opacity")?E.setOpacity(C.match(/opacity:\s*(\d?\.?\d*)/)[1]):E}for(var A in C){if(A=="opacity"){E.setOpacity(C[A])}else{B[(A=="float"||A=="cssFloat")?(Object.isUndefined(B.styleFloat)?"cssFloat":"styleFloat"):A]=C[A]}}return E},setOpacity:function(A,B){A=$(A);A.style.opacity=(B==1||B==="")?"":(B<0.00001)?0:B;return A},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},clonePosition:function(C,A){var D=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});A=$(A);var E=Element.viewportOffset(A),F=[0,0],B=null;C=$(C);if(Element.getStyle(C,"position")=="absolute"){B=Element.getOffsetParent(C);F=Element.viewportOffset(B)}if(B==document.body){F[0]-=document.body.offsetLeft;F[1]-=document.body.offsetTop}if(D.setLeft){C.style.left=(E[0]-F[0]+D.offsetLeft)+"px"}if(D.setTop){C.style.top=(E[1]-F[1]+D.offsetTop)+"px"}if(D.setWidth){C.style.width=A.offsetWidth+"px"}if(D.setHeight){C.style.height=A.offsetHeight+"px"}return C}};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,C,D){switch(D){case"height":case"width":if(!Element.visible(C)){return null}var E=parseInt(A(C,D),10);if(E!==C["offset"+D.capitalize()]){return E+"px"}var B;if(D==="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(E,function(G,F){var H=A(C,F);return H===null?G:G-parseInt(H,10)})+"px";default:return A(C,D)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(A,B,C){if(C==="title"){return B.title}return A(B,C)})}else{if(Prototype.Browser.IE){Element.Methods.getStyle=function(A,B){A=$(A);B=(B=="float"||B=="cssFloat")?"styleFloat":B.camelize();var C=A.style[B];if(!C&&A.currentStyle){C=A.currentStyle[B]}if(B=="opacity"){if(C=(A.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(C[1]){return parseFloat(C[1])/100}}return 1}if(C=="auto"){if((B=="width"||B=="height")&&(A.getStyle("display")!="none")){return A["offset"+B.capitalize()]+"px"}return null}return C};Element.Methods.setOpacity=function(C,E){function F(G){return G.replace(/alpha\([^\)]*\)/gi,"")}C=$(C);var B=C.currentStyle;if((B&&!B.hasLayout)||(!B&&C.style.zoom=="normal")){C.style.zoom=1}var A=C.getStyle("filter"),D=C.style;if(E==1||E===""){(A=F(A))?D.filter=A:D.removeAttribute("filter");return C}else{if(E<0.00001){E=0}}D.filter=F(A)+"alpha(opacity="+(E*100)+")";return C};Element._attributeTranslations=(function(){var C="className",B="for",A=document.createElement("div");A.setAttribute(C,"x");if(A.className!=="x"){A.setAttribute("class","x");if(A.className==="x"){C="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":C,className:C,"for":B,htmlFor:B},values:{_getAttr:function(D,E){return D.getAttribute(E)},_getAttr2:function(D,E){return D.getAttribute(E,2)},_getAttrNode:function(D,F){var E=D.getAttributeNode(F);return E?E.value:""},_getEv:(function(){var D=document.createElement("div"),F;D.onclick=Prototype.emptyFunction;var E=D.getAttribute("onclick");if(String(E).indexOf("{")>-1){F=function(G,H){H=G.getAttribute(H);if(!H){return null}H=H.toString();H=H.split("{")[1];H=H.split("}")[0];return H.strip()}}else{if(E===""){F=function(G,H){H=G.getAttribute(H);if(!H){return null}return H.strip()}}}D=null;return F})(),_flag:function(D,E){return $(D).hasAttribute(E)?E:null},style:function(D){return D.style.cssText.toLowerCase()},title:function(D){return D.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(C){var B=C.getElementsByTagName("*"),E=[];for(var D=0,F;F=B[D];D++){if(F.tagName!=="!"){E.push(F)}}return E}Element.Methods.down=function(C,D,B){C=$(C);if(arguments.length==1){return C.firstDescendant()}return Object.isNumber(D)?A(C)[D]:Element.select(C,D)[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 D=document.createTextNode(" ");A.appendChild(D);A.removeChild(D)}catch(C){}}}return A}}}}}if("outerHTML" in document.documentElement){Element.Methods.replace=function(E,F){E=$(E);if(F&&F.toElement){F=F.toElement()}if(Object.isElement(F)){E.parentNode.replaceChild(F,E);return E}F=Object.toHTML(F);var C=E.parentNode,D=C.tagName.toUpperCase();if(Element._insertionTranslations.tags[D]){var B=E.next(),A=Element._getContentFromAnonymousElement(D,F.stripScripts());C.removeChild(E);if(B){A.each(function(G){C.insertBefore(G,B)})}else{A.each(function(G){C.appendChild(G)})}}else{E.outerHTML=F.stripScripts()}F.evalScripts.bind(F).defer();return E}}Element._returnOffset=function(A,B){var C=[A,B];C.left=A;C.top=B;return C};Element._getContentFromAnonymousElement=function(A,D,F){var G=new Element("div"),C=Element._insertionTranslations.tags[A];var E=false;if(C){E=true}else{if(F){E=true;C=["","",0]}}if(E){G.innerHTML="&nbsp;"+C[0]+D+C[1];G.removeChild(G.firstChild);for(var B=C[2];B--;){G=G.firstChild}}else{G.innerHTML=D}return $A(G.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,C){C=Element._attributeTranslations.has[C]||C;var B=$(A).getAttributeNode(C);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 C(G){if(typeof window.Element!="undefined"){var I=window.Element.prototype;if(I){var K="_"+(Math.random()+"").slice(2),H=document.createElement(G);I[K]="x";var J=(H[K]!=="x");delete I[K];H=null;return J}}return false}function B(I,H){for(var G in H){var J=H[G];if(Object.isFunction(J)&&!(G in I)){I[G]=J.methodize()}}}var A=C("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(A){return function(G){if(G&&typeof G._extendedByPrototype=="undefined"){var H=G.tagName;if(H&&(/^(?:object|applet|embed)$/i.test(H))){B(G,Element.Methods);B(G,Element.Methods.Simulated);B(G,Element.Methods.ByTag[H.toUpperCase()])}}return G}}return Prototype.K}var E={},D=Element.Methods.ByTag;var F=Object.extend(function(I){if(!I||typeof I._extendedByPrototype!="undefined"||I.nodeType!=1||I==window){return I}var G=Object.clone(E),H=I.tagName.toUpperCase();if(D[H]){Object.extend(G,D[H])}B(I,G);I._extendedByPrototype=Prototype.emptyFunction;return I},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(E,Element.Methods);Object.extend(E,Element.Methods.Simulated)}}});F.refresh();return F})();if(document.documentElement.hasAttribute){Element.hasAttribute=function(A,B){return A.hasAttribute(B)}}else{Element.hasAttribute=Element.Methods.Simulated.hasAttribute}Element.addMethods=function(C){var J=Prototype.BrowserFeatures,D=Element.Methods.ByTag;if(!C){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),BUTTON:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var G=C;C=arguments[1]}if(!G){Object.extend(Element.Methods,C||{})}else{if(Object.isArray(G)){G.each(A)}else{A(G)}}function A(F){F=F.toUpperCase();if(!Element.Methods.ByTag[F]){Element.Methods.ByTag[F]={}}Object.extend(Element.Methods.ByTag[F],C)}function B(L,P,O){O=O||false;for(var F in L){var M=L[F];if(!Object.isFunction(M)){continue}if(!O||!(F in P)){P[F]=M.methodize()}}}function E(M){var F;var O={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(O[M]){F="HTML"+O[M]+"Element"}if(window[F]){return window[F]}F="HTML"+M+"Element";if(window[F]){return window[F]}F="HTML"+M.capitalize()+"Element";if(window[F]){return window[F]}var L=document.createElement(M),P=L.__proto__||L.constructor.prototype;L=null;return P}var I=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(J.ElementExtensions){B(Element.Methods,I);B(Element.Methods.Simulated,I,true)}if(J.SpecificElementExtensions){for(var K in Element.Methods.ByTag){var H=E(K);if(Object.isUndefined(H)){continue}B(D[K],H.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(D){var H=Prototype.Browser,G=document,E,C={};function A(){if(H.WebKit&&!G.evaluate){return document}if(H.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body}return document.documentElement}function F(B){if(!E){E=A()}C[B]="client"+B;D["get"+B]=function(){return E[C[B]]};return D["get"+B]()}D.getWidth=F.curry("Width");D.getHeight=F.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}if(!Element.Storage[B]){Element.Storage[B]=$H()}return Element.Storage[B]},store:function(A,B,C){if(!(A=$(A))){return}if(arguments.length===2){Element.getStorage(A).update(B)}else{Element.getStorage(A).set(B,C)}return A},retrieve:function(A,B,C){if(!(A=$(A))){return}var E=Element.getStorage(A),D=E.get(B);if(Object.isUndefined(D)){E.set(B,C);D=C}return D},clone:function(B,A){if(!(B=$(B))){return}var E=B.cloneNode(A);E._prototypeUID=void 0;if(A){var D=Element.select(E,"*"),C=D.length;while(C--){D[C]._prototypeUID=void 0}}return Element.extend(E)},purge:function(A){if(!(A=$(A))){return}var C=Element._purgeElement;C(A);var D=A.getElementsByTagName("*"),B=D.length;while(B--){C(D[B])}return null}});(function(){function D(W){var X=W.match(/^(\d+)%?$/i);if(!X){return null}return(Number(X[1])/100)}function V(f,g,X){var Y=null;if(Object.isElement(f)){Y=f;f=Y.getStyle(g)}if(f===null){return null}if((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(f)){return window.parseFloat(f)}var c=f.include("%"),Z=(X===document.viewport);if(/\d/.test(f)&&Y&&Y.runtimeStyle&&!(c&&Z)){var W=Y.style.left,h=Y.runtimeStyle.left;Y.runtimeStyle.left=Y.currentStyle.left;Y.style.left=f||0;f=Y.style.pixelLeft;Y.style.left=W;Y.runtimeStyle.left=h;return f}if(Y&&c){X=X||Y.parentNode;var a=D(f);var d=null;var b=Y.getStyle("position");var k=g.include("left")||g.include("right")||g.include("width");var e=g.include("top")||g.include("bottom")||g.include("height");if(X===document.viewport){if(k){d=document.viewport.getWidth()}else{if(e){d=document.viewport.getHeight()}}}else{if(k){d=$(X).measure("width")}else{if(e){d=$(X).measure("height")}}}return(d===null)?0:d*a}return 0}function F(W){if(Object.isString(W)&&W.endsWith("px")){return W}return W+"px"}function L(W){var X=W;while(W&&W.parentNode){var Y=W.getStyle("display");if(Y==="none"){return false}W=$(W.parentNode)}return true}var I=Prototype.K;if("currentStyle" in document.documentElement){I=function(W){if(!W.currentStyle.hasLayout){W.style.zoom=1}return W}}function G(W){if(W.include("border")){W=W+"-width"}return W.camelize()}Element.Layout=Class.create(Hash,{initialize:function($super,X,W){$super();this.element=$(X);Element.Layout.PROPERTIES.each(function(Y){this._set(Y,null)},this);if(W){this._preComputing=true;this._begin();Element.Layout.PROPERTIES.each(this._compute,this);this._end();this._preComputing=false}},_set:function(W,X){return Hash.prototype.set.call(this,W,X)},set:function(W,X){throw"Properties of Element.Layout are read-only."},get:function($super,W){var X=$super(W);return X===null?this._compute(W):X},_begin:function(){if(this._prepared){return}var Z=this.element;if(L(Z)){this._prepared=true;return}var d={position:Z.style.position||"",width:Z.style.width||"",visibility:Z.style.visibility||"",display:Z.style.display||""};Z.store("prototype_original_styles",d);var c=Z.getStyle("position"),X=Z.getStyle("width");if(X==="0px"||X===null){Z.style.display="block";X=Z.getStyle("width")}var W=(c==="fixed")?document.viewport:Z.parentNode;Z.setStyle({position:"absolute",visibility:"hidden",display:"block"});var a=Z.getStyle("width");var b;if(X&&(a===X)){b=V(Z,"width",W)}else{if(c==="absolute"||c==="fixed"){b=V(Z,"width",W)}else{var e=Z.parentNode,Y=$(e).getLayout();b=Y.get("width")-this.get("margin-left")-this.get("border-left")-this.get("padding-left")-this.get("padding-right")-this.get("border-right")-this.get("margin-right")}}Z.setStyle({width:b+"px"});this._prepared=true},_end:function(){var X=this.element;var W=X.retrieve("prototype_original_styles");X.store("prototype_original_styles",null);X.setStyle(W);this._prepared=false},_compute:function(W){var X=Element.Layout.COMPUTATIONS;if(!(W in X)){throw"Property not found."}return this._set(W,X[W].call(this,this.element))},toObject:function(){var W=$A(arguments);var X=(W.length===0)?Element.Layout.PROPERTIES:W.join(" ").split(" ");var Y={};X.each(function(Z){if(!Element.Layout.PROPERTIES.include(Z)){return}var a=this.get(Z);if(a!=null){Y[Z]=a}},this);return Y},toHash:function(){var W=this.toObject.apply(this,arguments);return new Hash(W)},toCSS:function(){var W=$A(arguments);var Y=(W.length===0)?Element.Layout.PROPERTIES:W.join(" ").split(" ");var X={};Y.each(function(Z){if(!Element.Layout.PROPERTIES.include(Z)){return}if(Element.Layout.COMPOSITE_PROPERTIES.include(Z)){return}var a=this.get(Z);if(a!=null){X[G(Z)]=a+"px"}},this);return X},inspect:function(){return"#<Element.Layout>"}});Object.extend(Element.Layout,{PROPERTIES:$w("height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height"),COMPOSITE_PROPERTIES:$w("padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height"),COMPUTATIONS:{height:function(W){if(!this._preComputing){this._begin()}var Z=this.get("border-box-height");if(Z<=0){if(!this._preComputing){this._end()}return 0}var Y=this.get("border-top"),X=this.get("border-bottom");var b=this.get("padding-top"),a=this.get("padding-bottom");if(!this._preComputing){this._end()}return Z-Y-X-b-a},width:function(W){if(!this._preComputing){this._begin()}var X=this.get("border-box-width");if(X<=0){if(!this._preComputing){this._end()}return 0}var b=this.get("border-left"),Y=this.get("border-right");var Z=this.get("padding-left"),a=this.get("padding-right");if(!this._preComputing){this._end()}return X-b-Y-Z-a},"padding-box-height":function(W){var X=this.get("height"),Z=this.get("padding-top"),Y=this.get("padding-bottom");return X+Z+Y},"padding-box-width":function(W){var X=this.get("width"),Y=this.get("padding-left"),Z=this.get("padding-right");return X+Y+Z},"border-box-height":function(W){if(!this._preComputing){this._begin()}var X=W.offsetHeight;if(!this._preComputing){this._end()}return X},"border-box-width":function(W){if(!this._preComputing){this._begin()}var X=W.offsetWidth;if(!this._preComputing){this._end()}return X},"margin-box-height":function(W){var Y=this.get("border-box-height"),X=this.get("margin-top"),Z=this.get("margin-bottom");if(Y<=0){return 0}return Y+X+Z},"margin-box-width":function(W){var X=this.get("border-box-width"),Z=this.get("margin-left"),Y=this.get("margin-right");if(X<=0){return 0}return X+Z+Y},top:function(W){var X=W.positionedOffset();return X.top},bottom:function(Y){var Z=Y.positionedOffset(),X=Y.getOffsetParent(),W=X.measure("height");var a=this.get("border-box-height");return W-a-Z.top},left:function(W){var X=W.positionedOffset();return X.left},right:function(X){var a=X.positionedOffset(),W=X.getOffsetParent(),Z=W.measure("width");var Y=this.get("border-box-width");return Z-Y-a.left},"padding-top":function(W){return V(W,"paddingTop")},"padding-bottom":function(W){return V(W,"paddingBottom")},"padding-left":function(W){return V(W,"paddingLeft")},"padding-right":function(W){return V(W,"paddingRight")},"border-top":function(W){return V(W,"borderTopWidth")},"border-bottom":function(W){return V(W,"borderBottomWidth")},"border-left":function(W){return V(W,"borderLeftWidth")},"border-right":function(W){return V(W,"borderRightWidth")},"margin-top":function(W){return V(W,"marginTop")},"margin-bottom":function(W){return V(W,"marginBottom")},"margin-left":function(W){return V(W,"marginLeft")},"margin-right":function(W){return V(W,"marginRight")}}});if("getBoundingClientRect" in document.documentElement){Object.extend(Element.Layout.COMPUTATIONS,{right:function(X){var W=I(X.getOffsetParent());var Z=X.getBoundingClientRect(),Y=W.getBoundingClientRect();return(Y.right-Z.right).round()},bottom:function(X){var W=I(X.getOffsetParent());var Z=X.getBoundingClientRect(),Y=W.getBoundingClientRect();return(Y.bottom-Z.bottom).round()}})}Element.Offset=Class.create({initialize:function(X,W){this.left=X.round();this.top=W.round();this[0]=this.left;this[1]=this.top},relativeTo:function(W){return new Element.Offset(this.left-W.left,this.top-W.top)},inspect:function(){return"#<Element.Offset left: #{left} top: #{top}>".interpolate(this)},toString:function(){return"[#{left}, #{top}]".interpolate(this)},toArray:function(){return[this.left,this.top]}});function S(X,W){return new Element.Layout(X,W)}function H(X,W){return $(X).getLayout().get(W)}function O(Y){Y=$(Y);var b=Element.getStyle(Y,"display");if(b&&b!=="none"){return{width:Y.offsetWidth,height:Y.offsetHeight}}var Z=Y.style;var X={visibility:Z.visibility,position:Z.position,display:Z.display};var W={visibility:"hidden",display:"block"};if(X.position!=="fixed"){W.position="absolute"}Element.setStyle(Y,W);var a={width:Y.offsetWidth,height:Y.offsetHeight};Element.setStyle(Y,X);return a}function M(X){X=$(X);if(K(X)||J(X)||B(X)||A(X)){return $(document.body)}var W=(Element.getStyle(X,"display")==="inline");if(!W&&X.offsetParent){return $(X.offsetParent)}while((X=X.parentNode)&&X!==document.body){if(Element.getStyle(X,"position")!=="static"){return A(X)?$(document.body):$(X)}}return $(document.body)}function P(W){W=$(W);var X=0,Y=0;if(W.parentNode){do{X+=W.offsetTop||0;Y+=W.offsetLeft||0;W=W.offsetParent}while(W)}return new Element.Offset(Y,X)}function Q(X){X=$(X);var W=X.getLayout();var Y=0,a=0;do{Y+=X.offsetTop||0;a+=X.offsetLeft||0;X=X.offsetParent;if(X){if(B(X)){break}var Z=Element.getStyle(X,"position");if(Z!=="static"){break}}}while(X);a-=W.get("margin-top");Y-=W.get("margin-left");return new Element.Offset(a,Y)}function E(W){var X=0,Y=0;do{X+=W.scrollTop||0;Y+=W.scrollLeft||0;W=W.parentNode}while(W);return new Element.Offset(Y,X)}function U(Z){W=$(W);var Y=0,a=0,X=document.body;var W=Z;do{Y+=W.offsetTop||0;a+=W.offsetLeft||0;if(W.offsetParent==X&&Element.getStyle(W,"position")=="absolute"){break}}while(W=W.offsetParent);W=Z;do{if(W!=X){Y-=W.scrollTop||0;a-=W.scrollLeft||0}}while(W=W.parentNode);return new Element.Offset(a,Y)}function T(Y){Y=$(Y);if(Element.getStyle(Y,"position")==="absolute"){return Y}var a=M(Y);var Z=Y.viewportOffset(),X=a.viewportOffset();var b=Z.relativeTo(X);var W=Y.getLayout();Y.store("prototype_absolutize_original_styles",{left:Y.getStyle("left"),top:Y.getStyle("top"),width:Y.getStyle("width"),height:Y.getStyle("height")});Y.setStyle({position:"absolute",top:b.top+"px",left:b.left+"px",width:W.get("width")+"px",height:W.get("height")+"px"});return Y}function C(X){X=$(X);if(Element.getStyle(X,"position")==="relative"){return X}var W=X.retrieve("prototype_absolutize_original_styles");if(W){X.setStyle(W)}return X}if(Prototype.Browser.IE){M=M.wrap(function(X,Y){Y=$(Y);if(K(Y)||J(Y)||B(Y)||A(Y)){return $(document.body)}var W=Y.getStyle("position");if(W!=="static"){return X(Y)}Y.setStyle({position:"relative"});var Z=X(Y);Y.setStyle({position:W});return Z});Q=Q.wrap(function(X,Y){Y=$(Y);if(!Y.parentNode){return new Element.Offset(0,0)}var W=Y.getStyle("position");if(W!=="static"){return X(Y)}var Z=Y.getOffsetParent();if(Z&&Z.getStyle("position")==="fixed"){I(Z)}Y.setStyle({position:"relative"});var a=X(Y);Y.setStyle({position:W});return a})}else{if(Prototype.Browser.Webkit){P=function(W){W=$(W);var X=0,Y=0;do{X+=W.offsetTop||0;Y+=W.offsetLeft||0;if(W.offsetParent==document.body){if(Element.getStyle(W,"position")=="absolute"){break}}W=W.offsetParent}while(W);return new Element.Offset(Y,X)}}}Element.addMethods({getLayout:S,measure:H,getDimensions:O,getOffsetParent:M,cumulativeOffset:P,positionedOffset:Q,cumulativeScrollOffset:E,viewportOffset:U,absolutize:T,relativize:C});function B(W){return W.nodeName.toUpperCase()==="BODY"}function A(W){return W.nodeName.toUpperCase()==="HTML"}function K(W){return W.nodeType===Node.DOCUMENT_NODE}function J(W){return W!==document.body&&!Element.descendantOf(W,document.body)}if("getBoundingClientRect" in document.documentElement){Element.addMethods({viewportOffset:function(W){W=$(W);if(J(W)){return new Element.Offset(0,0)}var X=W.getBoundingClientRect(),Y=document.documentElement;return new Element.Offset(X.left-Y.clientLeft,X.top-Y.clientTop)}})}})();window.$$=function(){var A=$A(arguments).join(", ");return Prototype.Selector.select(A,document)};Prototype.Selector=(function(){function C(){throw new Error('Method "Prototype.Selector.select" must be defined.')}function B(){throw new Error('Method "Prototype.Selector.match" must be defined.')}function D(G,L,J){J=J||0;var I=Prototype.Selector.match,H=G.length,F=0,K;for(K=0;K<H;K++){if(I(G[K],L)&&J==F++){return Element.extend(G[K])}}}function E(F){for(var H=0,G=F.length;H<G;H++){Element.extend(F[H])}return F}var A=Prototype.K;return{select:C,match:B,find:D,extendElements:(Element.extend===A)?A:E,extendElement:Element.extend}})();Prototype._original_property=window.Sizzle;
/*
 * Sizzle CSS Selector Engine - v1.0
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var Q=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,E=0,I=Object.prototype.toString,O=false,F=true;[0,0].sort(function(){F=false;return 0});var K=function(g,V,e,Y){e=e||[];var a=V=V||document;if(V.nodeType!==1&&V.nodeType!==9){return[]}if(!g||typeof g!=="string"){return e}var d=[],f,c,o,l,b,T,U=true,X=P(V),k=g;while((Q.exec(""),f=Q.exec(k))!==null){k=f[3];d.push(f[1]);if(f[2]){T=f[3];break}}if(d.length>1&&C.exec(g)){if(d.length===2&&B.relative[d[0]]){c=D(d[0]+d[1],V)}else{c=B.relative[d[0]]?[V]:K(d.shift(),V);while(d.length){g=d.shift();if(B.relative[g]){g+=d.shift()}c=D(g,c)}}}else{if(!Y&&d.length>1&&V.nodeType===9&&!X&&B.match.ID.test(d[0])&&!B.match.ID.test(d[d.length-1])){var p=K.find(d.shift(),V,X);V=p.expr?K.filter(p.expr,p.set)[0]:p.set[0]}if(V){var p=Y?{expr:d.pop(),set:A(Y)}:K.find(d.pop(),d.length===1&&(d[0]==="~"||d[0]==="+")&&V.parentNode?V.parentNode:V,X);c=p.expr?K.filter(p.expr,p.set):p.set;if(d.length>0){o=A(c)}else{U=false}while(d.length){var W=d.pop(),Z=W;if(!B.relative[W]){W=""}else{Z=d.pop()}if(Z==null){Z=V}B.relative[W](o,Z,X)}}else{o=d=[]}}if(!o){o=c}if(!o){throw"Syntax error, unrecognized expression: "+(W||g)}if(I.call(o)==="[object Array]"){if(!U){e.push.apply(e,o)}else{if(V&&V.nodeType===1){for(var h=0;o[h]!=null;h++){if(o[h]&&(o[h]===true||o[h].nodeType===1&&G(V,o[h]))){e.push(c[h])}}}else{for(var h=0;o[h]!=null;h++){if(o[h]&&o[h].nodeType===1){e.push(c[h])}}}}}else{A(o,e)}if(T){K(T,a,e,Y);K.uniqueSort(e)}return e};K.uniqueSort=function(U){if(H){O=F;U.sort(H);if(O){for(var T=1;T<U.length;T++){if(U[T]===U[T-1]){U.splice(T--,1)}}}}return U};K.matches=function(T,U){return K(T,null,null,U)};K.find=function(Z,T,b){var a,X;if(!Z){return[]}for(var W=0,V=B.order.length;W<V;W++){var Y=B.order[W],X;if((X=B.leftMatch[Y].exec(Z))){var U=X[1];X.splice(1,1);if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");a=B.find[Y](X,T,b);if(a!=null){Z=Z.replace(B.match[Y],"");break}}}}if(!a){a=T.getElementsByTagName("*")}return{set:a,expr:Z}};K.filter=function(d,e,h,U){var T=d,c=[],Y=e,W,a,X=e&&e[0]&&P(e[0]);while(d&&e.length){for(var b in B.filter){if((W=B.match[b].exec(d))!=null){var Z=B.filter[b],k,g;a=false;if(Y==c){c=[]}if(B.preFilter[b]){W=B.preFilter[b](W,Y,h,c,U,X);if(!W){a=k=true}else{if(W===true){continue}}}if(W){for(var V=0;(g=Y[V])!=null;V++){if(g){k=Z(g,W,V,Y);var f=U^!!k;if(h&&k!=null){if(f){a=true}else{Y[V]=false}}else{if(f){c.push(g);a=true}}}}}if(k!==undefined){if(!h){Y=c}d=d.replace(B.match[b],"");if(!a){return[]}break}}}if(d==T){if(a==null){throw"Syntax error, unrecognized expression: "+d}else{break}}T=d}return Y};var B=K.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(a,T,b){var U=typeof T==="string",Z=U&&!/\W/.test(T),Y=U&&!Z;if(Z&&!b){T=T.toUpperCase()}for(var X=0,W=a.length,V;X<W;X++){if((V=a[X])){while((V=V.previousSibling)&&V.nodeType!==1){}a[X]=Y||V&&V.nodeName===T?V||false:V===T}}if(Y){K.filter(T,a,true)}},">":function(Z,W,a){var V=typeof W==="string";if(V&&!/\W/.test(W)){W=a?W:W.toUpperCase();for(var X=0,T=Z.length;X<T;X++){var Y=Z[X];if(Y){var U=Y.parentNode;Z[X]=U.nodeName===W?U:false}}}else{for(var X=0,T=Z.length;X<T;X++){var Y=Z[X];if(Y){Z[X]=V?Y.parentNode:Y.parentNode===W}}if(V){K.filter(W,Z,true)}}},"":function(W,U,Y){var V=E++,T=S;if(!/\W/.test(U)){var X=U=Y?U:U.toUpperCase();T=M}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=E++,T=S;if(typeof U==="string"&&!/\W/.test(U)){var X=U=Y?U:U.toUpperCase();T=M}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(V,T,U,Z,Y,a){V=" "+V[1].replace(/\\/g,"")+" ";if(a){return V}for(var W=0,X;(X=T[W])!=null;W++){if(X){if(Y^(X.className&&(" "+X.className+" ").indexOf(V)>=0)){if(!U){Z.push(X)}}else{if(U){T[W]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&P(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=E++;return T},ATTR:function(W,T,U,Y,X,Z){var V=W[1].replace(/\\/g,"");if(!Z&&B.attrMap[V]){W[1]=B.attrMap[V]}if(W[2]==="~="){W[4]=" "+W[4]+" "}return W},PSEUDO:function(W,T,U,Y,X){if(W[1]==="not"){if((Q.exec(W[3])||"").length>1||/^\w/.test(W[3])){W[3]=K(W[3],null,null,T)}else{var V=K.filter(W[3],T,U,true^X);if(!U){Y.push.apply(Y,V)}return false}}else{if(B.match.POS.test(W[0])||B.match.CHILD.test(W[0])){return true}}return W},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!K(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,W,X,a){var V=W[1],U=B.filters[V];if(U){return U(Z,X,W,a)}else{if(V==="contains"){return(Z.textContent||Z.innerText||"").indexOf(W[3])>=0}else{if(V==="not"){var Y=W[3];for(var X=0,T=Y.length;X<T;X++){if(Y[X]===Z){return false}}return true}}}},CHILD:function(U,V){var Z=V[1],T=U;switch(Z){case"only":case"first":while((T=T.previousSibling)){if(T.nodeType===1){return false}}if(Z=="first"){return true}T=U;case"last":while((T=T.nextSibling)){if(T.nodeType===1){return false}}return true;case"nth":var W=V[2],b=V[3];if(W==1&&b==0){return true}var Y=V[0],c=U.parentNode;if(c&&(c.sizcache!==Y||!U.nodeIndex)){var X=0;for(T=c.firstChild;T;T=T.nextSibling){if(T.nodeType===1){T.nodeIndex=++X}}c.sizcache=Y}var a=U.nodeIndex-b;if(W==0){return a==0}else{return(a%W==0&&a/W>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(X,V){var U=V[1],Z=B.attrHandle[U]?B.attrHandle[U](X):X[U]!=null?X[U]:X.getAttribute(U),Y=Z+"",W=V[2],T=V[4];return Z==null?W==="!=":W==="="?Y===T:W==="*="?Y.indexOf(T)>=0:W==="~="?(" "+Y+" ").indexOf(T)>=0:!T?Y&&Z!==false:W==="!="?Y!=T:W==="^="?Y.indexOf(T)===0:W==="$="?Y.substr(Y.length-T.length)===T:W==="|="?Y===T||Y.substr(0,T.length+1)===T+"-":false},POS:function(X,V,W,Y){var U=V[2],T=B.setFilters[U];if(T){return T(X,W,V,Y)}}}};var C=B.match.POS;for(var L in B.match){B.match[L]=new RegExp(B.match[L].source+/(?![^\[]*\])(?![^\(]*\))/.source);B.leftMatch[L]=new RegExp(/(^(?:.|\r|\n)*?)/.source+B.match[L].source)}var A=function(U,T){U=Array.prototype.slice.call(U,0);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(J){A=function(X,W){var U=W||[];if(I.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var H;if(document.documentElement.compareDocumentPosition){H=function(U,T){if(!U.compareDocumentPosition||!T.compareDocumentPosition){if(U==T){O=true}return 0}var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){O=true}return V}}else{if("sourceIndex" in document.documentElement){H=function(U,T){if(!U.sourceIndex||!T.sourceIndex){if(U==T){O=true}return 0}var V=U.sourceIndex-T.sourceIndex;if(V===0){O=true}return V}}else{if(document.createRange){H=function(U,T){if(!U.ownerDocument||!T.ownerDocument){if(U==T){O=true}return 0}var W=U.ownerDocument.createRange(),X=T.ownerDocument.createRange();W.setStart(U,0);W.setEnd(U,0);X.setStart(T,0);X.setEnd(T,0);var V=W.compareBoundaryPoints(Range.START_TO_END,X);if(V===0){O=true}return V}}}}(function(){var U=document.createElement("div"),V="script"+(new Date).getTime();U.innerHTML="<a name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){B.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:undefined:[]}};B.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U);T=U=null})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){B.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){B.attrHandle.href=function(U){return U.getAttribute("href",2)}}T=null})();if(document.querySelectorAll){(function(){var T=K,V=document.createElement("div");V.innerHTML="<p class='TEST'></p>";if(V.querySelectorAll&&V.querySelectorAll(".TEST").length===0){return}K=function(Z,Y,W,X){Y=Y||document;if(!X&&Y.nodeType===9&&!P(Y)){try{return A(Y.querySelectorAll(Z),W)}catch(a){}}return T(Z,Y,W,X)};for(var U in T){K[U]=T[U]}V=null})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}B.order.splice(1,0,"CLASS");B.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}};T=null})()}function M(U,b,Y,c,a,d){var Z=U=="previousSibling"&&!d;for(var W=0,V=c.length;W<V;W++){var T=c[W];if(T){if(Z&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=c[T.sizset];break}if(T.nodeType===1&&!d){T.sizcache=Y;T.sizset=W}if(T.nodeName===b){X=T;break}T=T[U]}c[W]=X}}}function S(U,b,Y,c,a,d){var Z=U=="previousSibling"&&!d;for(var W=0,V=c.length;W<V;W++){var T=c[W];if(T){if(Z&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=c[T.sizset];break}if(T.nodeType===1){if(!d){T.sizcache=Y;T.sizset=W}if(typeof b!=="string"){if(T===b){X=true;break}}else{if(K.filter(b,[T]).length>0){X=T;break}}}T=T[U]}c[W]=X}}}var G=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var P=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&T.ownerDocument.documentElement.nodeName!=="HTML"};var D=function(T,Z){var a=[],W="",X,V=Z.nodeType?[Z]:Z;while((X=B.match.PSEUDO.exec(T))){W+=X[0];T=T.replace(B.match.PSEUDO,"")}T=B.relative[T]?T+"*":T;for(var Y=0,U=V.length;Y<U;Y++){K(T,V[Y],a)}return K.filter(W,a)};window.Sizzle=K})();(function(A){var D=Prototype.Selector.extendElements;function C(E,F){return D(A(E,F||document))}function B(F,E){return A.matches(E,[F]).length==1}Prototype.Selector.engine=A;Prototype.Selector.select=C;Prototype.Selector.match=B})(Sizzle);window.Sizzle=Prototype._original_property;delete Prototype._original_property;var Form={reset:function(A){A=$(A);A.reset();return A},serializeElements:function(C,G){if(typeof G!="object"){G={hash:!!G}}else{if(Object.isUndefined(G.hash)){G.hash=true}}var F,H,B=false,A=G.submit,D,E;if(G.hash){E={};D=function(K,I,J){if(I in K){if(!Object.isArray(K[I])){K[I]=[K[I]]}K[I].push(J)}else{K[I]=J}return K}}else{E="";D=function(K,I,J){return K+(K?"&":"")+encodeURIComponent(I)+"="+encodeURIComponent(J)}}return C.inject(E,function(J,I){if(!I.disabled&&I.name){F=I.name;H=$(I).getValue();if(H!=null&&I.type!="file"&&(I.type!="submit"||(!B&&A!==false&&(!A||F==A)&&(B=true)))){J=D(J,F,H)}}return J})}};Form.Methods={serialize:function(B,A){return Form.serializeElements(Form.getElements(B),A)},getElements:function(F){var B=$(F).getElementsByTagName("*"),D,A=[],C=Form.Element.Serializers;for(var E=0;D=B[E];E++){A.push(D)}return A.inject([],function(G,H){if(C[H.tagName.toLowerCase()]){G.push(Element.extend(H))}return G})},getInputs:function(G,E,C){G=$(G);var F=G.getElementsByTagName("input");if(!E&&!C){return $A(F).map(Element.extend)}for(var D=0,H=[],A=F.length;D<A;D++){var B=F[D];if((E&&B.type!=E)||(C&&B.name!=C)){continue}H.push(Element.extend(B))}return H},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(C){var A=$(C).getElements().findAll(function(D){return"hidden"!=D.type&&!D.disabled});var B=A.findAll(function(D){return D.hasAttribute("tabIndex")&&D.tabIndex>=0}).sortBy(function(D){return D.tabIndex}).first();return B?B:A.find(function(D){return/^(?:input|select|textarea)$/i.test(D.tagName)})},focusFirstElement:function(B){B=$(B);var A=B.findFirstElement();if(A){A.activate()}return B},request:function(C,B){C=$(C),B=Object.clone(B||{});var D=B.parameters,A=C.readAttribute("action")||"";if(A.blank()){A=window.location.href}B.parameters=C.serialize(true);if(D){if(Object.isString(D)){D=D.toQueryParams()}Object.extend(B.parameters,D)}if(C.hasAttribute("method")&&!B.method){B.method=C.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 C={};C[A.name]=B;return Object.toQueryString(C)}}return""},getValue:function(A){A=$(A);var B=A.tagName.toLowerCase();return Form.Element.Serializers[B](A)},setValue:function(A,B){A=$(A);var C=A.tagName.toLowerCase();Form.Element.Serializers[C](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=(function(){function C(H,I){switch(H.type.toLowerCase()){case"checkbox":case"radio":return G(H,I);default:return F(H,I)}}function G(H,I){if(Object.isUndefined(I)){return H.checked?H.value:null}else{H.checked=!!I}}function F(H,I){if(Object.isUndefined(I)){return H.value}else{H.value=I}}function D(I,M){if(Object.isUndefined(M)){return(I.type==="select-one"?B:A)(I)}var K,L,O=!Object.isArray(M);for(var J=0,H=I.length;J<H;J++){K=I.options[J];L=this.optionValue(K);if(O){if(L==M){K.selected=true;return}}else{K.selected=M.include(L)}}}function B(I){var H=I.selectedIndex;return H>=0?E(I.options[H]):null}function A(I){var L,H=I.length;if(!H){return null}for(var K=0,L=[];K<H;K++){var J=I.options[K];if(J.selected){L.push(E(J))}}return L}function E(H){return Element.hasAttribute(H,"value")?H.value:H.text}return{input:C,inputSelector:G,textarea:F,select:D,selectOne:B,selectMany:A,optionValue:E,button:F}})();Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,A,C,B){$super(B,C);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 f={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 P="onmouseenter" in H&&"onmouseleave" in H;var A=function(g){return false};if(window.attachEvent){if(window.addEventListener){A=function(g){return !(g instanceof window.Event)}}else{A=function(g){return true}}}var Z;function e(h,g){return h.which?(h.which===g+1):(h.button===g)}var S={0:1,1:4,2:2};function U(h,g){return h.button===S[g]}function Q(h,g){switch(g){case 0:return h.which==1&&!h.metaKey;case 1:return h.which==2||(h.which==1&&h.metaKey);case 2:return h.which==3;default:return false}}if(window.attachEvent){if(!window.addEventListener){Z=U}else{Z=function(h,g){return A(h)?U(h,g):e(h,g)}}}else{if(Prototype.Browser.WebKit){Z=Q}else{Z=e}}function W(g){return Z(g,0)}function Y(g){return Z(g,1)}function O(g){return Z(g,2)}function L(k){k=f.extend(k);var h=k.target,g=k.type,l=k.currentTarget;if(l&&l.tagName){if(g==="load"||g==="error"||(g==="click"&&l.tagName.toLowerCase()==="input"&&l.type==="radio")){h=l}}if(h.nodeType==Node.TEXT_NODE){h=h.parentNode}return Element.extend(h)}function c(h,k){var g=f.element(h);if(!k){return g}while(g){if(Object.isElement(g)&&Prototype.Selector.match(g,k)){return Element.extend(g)}g=g.parentNode}}function a(g){return{x:E(g),y:D(g)}}function E(k){var h=document.documentElement,g=document.body||{scrollLeft:0};return k.pageX||(k.clientX+(h.scrollLeft||g.scrollLeft)-(h.clientLeft||0))}function D(k){var h=document.documentElement,g=document.body||{scrollTop:0};return k.pageY||(k.clientY+(h.scrollTop||g.scrollTop)-(h.clientTop||0))}function V(g){f.extend(g);g.preventDefault();g.stopPropagation();g.stopped=true}f.Methods={isLeftClick:W,isMiddleClick:Y,isRightClick:O,element:L,findElement:c,pointer:a,pointerX:E,pointerY:D,stop:V};var b=Object.keys(f.Methods).inject({},function(g,h){g[h]=f.Methods[h].methodize();return g});if(window.attachEvent){function G(h){var g;switch(h.type){case"mouseover":case"mouseenter":g=h.fromElement;break;case"mouseout":case"mouseleave":g=h.toElement;break;default:return null}return Element.extend(g)}var X={stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}};f.extend=function(h,g){if(!h){return false}if(!A(h)){return h}if(h._extendedByPrototype){return h}h._extendedByPrototype=Prototype.emptyFunction;var k=f.pointer(h);Object.extend(h,{target:h.srcElement||g,relatedTarget:G(h),pageX:k.x,pageY:k.y});Object.extend(h,b);Object.extend(h,X);return h}}else{f.extend=Prototype.K}if(window.addEventListener){f.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(f.prototype,b)}function C(h,g,m){var l=Element.retrieve(h,"prototype_event_registry");if(Object.isUndefined(l)){F.push(h);l=Element.retrieve(h,"prototype_event_registry",$H())}var o=l.get(g);if(Object.isUndefined(o)){o=[];l.set(g,o)}if(o.pluck("handler").include(m)){return false}var k;if(g.include(":")){k=function(p){if(Object.isUndefined(p.eventName)){return false}if(p.eventName!==g){return false}f.extend(p,h);m.call(h,p)}}else{if(!P&&(g==="mouseenter"||g==="mouseleave")){if(g==="mouseenter"||g==="mouseleave"){k=function(q){f.extend(q,h);var p=q.relatedTarget;while(p&&p!==h){try{p=p.parentNode}catch(r){p=h}}if(p===h){return}m.call(h,q)}}}else{k=function(p){f.extend(p,h);m.call(h,p)}}}k.handler=m;o.push(k);return k}function I(){for(var h=0,g=F.length;h<g;h++){f.stopObserving(F[h]);F[h]=null}}var F=[];if(Prototype.Browser.IE){window.attachEvent("onunload",I)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}var B=Prototype.K,J={mouseenter:"mouseover",mouseleave:"mouseout"};if(!P){B=function(g){return(J[g]||g)}}function T(h,g,m){h=$(h);var l=C(h,g,m);if(!l){return h}if(g.include(":")){if(h.addEventListener){h.addEventListener("dataavailable",l,false)}else{h.attachEvent("ondataavailable",l);h.attachEvent("onlosecapture",l)}}else{var k=B(g);if(h.addEventListener){h.addEventListener(k,l,false)}else{h.attachEvent("on"+k,l)}}return h}function M(h,g,q){h=$(h);var p=Element.retrieve(h,"prototype_event_registry");if(!p){return h}if(!g){p.each(function(t){var r=t.key;M(h,r)});return h}var l=p.get(g);if(!l){return h}if(!q){l.each(function(t){M(h,g,t.handler)});return h}var k=l.length,o;while(k--){if(l[k].handler===q){o=l[k];break}}if(!o){return h}if(g.include(":")){if(h.removeEventListener){h.removeEventListener("dataavailable",o,false)}else{h.detachEvent("ondataavailable",o);h.detachEvent("onlosecapture",o)}}else{var m=B(g);if(h.removeEventListener){h.removeEventListener(m,o,false)}else{h.detachEvent("on"+m,o)}}p.set(g,l.without(o));return h}function d(k,h,g,m){k=$(k);if(Object.isUndefined(m)){m=true}if(k==document&&document.createEvent&&!k.dispatchEvent){k=document.documentElement}var l;if(document.createEvent){l=document.createEvent("HTMLEvents");l.initEvent("dataavailable",m,true)}else{l=document.createEventObject();l.eventType=m?"ondataavailable":"onlosecapture"}l.eventName=h;l.memo=g||{};if(document.createEvent){k.dispatchEvent(l)}else{k.fireEvent(l.eventType,l)}return f.extend(l)}f.Handler=Class.create({initialize:function(k,h,g,l){this.element=$(k);this.eventName=h;this.selector=g;this.callback=l;this.handler=this.handleEvent.bind(this)},start:function(){f.observe(this.element,this.eventName,this.handler);return this},stop:function(){f.stopObserving(this.element,this.eventName,this.handler);return this},handleEvent:function(h){var g=f.findElement(h,this.selector);if(g){this.callback.call(this.element,h,g)}}});function K(k,h,g,l){k=$(k);if(Object.isFunction(g)&&Object.isUndefined(l)){l=g,g=null}return new f.Handler(k,h,g,l).start()}Object.extend(f,f.Methods);Object.extend(f,{fire:d,observe:T,stopObserving:M,on:K});Element.addMethods({fire:d,observe:T,stopObserving:M,on:K});Object.extend(document,{fire:d.methodize(),observe:T.methodize(),stopObserving:M.methodize(),on:K.methodize(),loaded:false});if(window.Event){Object.extend(window.Event,f)}else{window.Event=f}})();(function(){var D;function A(){if(document.loaded){return}if(D){window.clearTimeout(D)}document.loaded=true;document.fire("dom:loaded")}function C(){if(document.readyState==="complete"){document.stopObserving("readystatechange",C);A()}}function B(){try{document.documentElement.doScroll("left")}catch(E){D=B.defer();return}A()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",A,false)}else{document.observe("readystatechange",C);if(window==top){D=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,C){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(B,A,C)}this.xcomp=A;this.ycomp=C;this.offset=Element.cumulativeOffset(B);return(C>=this.offset[1]&&C<this.offset[1]+B.offsetHeight&&A>=this.offset[0]&&A<this.offset[0]+B.offsetWidth)},withinIncludingScrolloffsets:function(B,A,D){var C=Element.cumulativeScrollOffset(B);this.xcomp=A+C[0]-this.deltaX;this.ycomp=D+C[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,C,B){B=B||{};return Element.clonePosition(C,A,B)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(B){function A(C){return C.blank()?null:"[contains(concat(' ', @class, ' '), ' "+C+" ')]"}B.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(D,C){C=C.toString().strip();var E=/\s/.test(C)?$w(C).map(A).join(""):A(C);return E?document._getElementsByXPath(".//*"+E,D):[]}:function(F,E){E=E.toString().strip();var C=[],H=(/\s/.test(E)?$w(E):null);if(!H&&!E){return C}var D=$(F).getElementsByTagName("*");E=" "+E+" ";for(var G=0,J,I;J=D[G];G++){if(J.className&&(I=" "+J.className+" ")&&(I.include(E)||(H&&H.all(function(K){return !K.toString().blank()&&I.include(" "+K+" ")})))){C.push(Element.extend(J))}}return C};return function(C,D){return $(D||document.body).getElementsByClassName(C)}}(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);(function(){window.Selector=Class.create({initialize:function(A){this.expression=A.strip()},findElements:function(A){return Prototype.Selector.select(this.expression,A)},match:function(A){return Prototype.Selector.match(A,this.expression)},toString:function(){return this.expression},inspect:function(){return"#<Selector: "+this.expression+">"}});Object.extend(Selector,{matchElements:function(A,G){var D=Prototype.Selector.match,F=[];for(var E=0,B=A.length;E<B;E++){var C=A[E];if(D(C,G)){F.push(Element.extend(C))}}return F},findElement:function(B,G,E){E=E||0;var A=0,D;for(var F=0,C=B.length;F<C;F++){D=B[F];if(Prototype.Selector.match(D,G)&&E===A++){return Element.extend(D)}}},findChildElements:function(B,C){var A=C.toArray().join(", ");return Prototype.Selector.select(A,B||document)}})})();Object.extend(Class.Methods,{logMethods:function(B){var B=B||{},C=(B.id&&B.id+".")||"",D=!!B.trace,F=this.prototype;for(var E in F){var A=F.hasOwnProperty(E)?"":" (inherited)";if((D||!A)&&Object.isFunction(F[E])){F[E]=F[E].wrap(function(H,I,G){return function(J){(B.callback||log.info)(H+I+G);return J.apply(this,$A(arguments).slice(1))}}(C,E,A))}}}});Element.exception=undefined;Element.addMethods({getElementsByTagAndClass:function(C,A){var B=arguments[0];var C=arguments[1];var A=arguments[2];var D=B.getElementsByTagName(C);return $A(D).inject([],function(F,E){if(E.className.match(new RegExp("(^|\\s)"+A+"(\\s|$)"))){F.push(Element.extend(E))}return F})},getNthElementByClassName:function(){if(arguments.length<3){return Element.exception}var D=arguments[0];var B=arguments[1];var A=parseInt(arguments[2]);var C=(arguments[3]?arguments[3]:"*");if(isNaN(A)){return Element.exception}var F=$A((D||document.body).getElementsByTagName(C));if(A==0){return Element.exception}else{if(A<0){F.reverse(true);A=Math.abs(A)}}var G=0;var H=null;for(var E=0;E<F.length;E++){if(F[E].className.match(new RegExp("(^|\\s)"+B+"(\\s|$)"))){G++;if(G==A){H=Element.extend(F[E]);break}}}return H},getFirstElementByClassName:function(){var C=arguments[0];var A=arguments[1];var B=arguments[2];if(B){return C.getNthElementByClassName(A,1,B)}else{return C.getNthElementByClassName(A,1)}},getLastElementByClassName:function(){var C=arguments[0];var A=arguments[1];var B=arguments[2];if(B){return C.getNthElementByClassName(A,-1,B)}else{return C.getNthElementByClassName(A,-1)}},containsElementWithClassName:function(){if(arguments.length<2){return null}var C=arguments[0];var A=arguments[1];var B=arguments[2];var D=null;if(B){D=C.getNthElementByClassName(A,1,arguments[2])}else{D=C.getNthElementByClassName(A,1)}if(D){return true}else{return false}},getElementsByAttribute:function(){if(arguments.length<2){return null}var C=arguments[0];var F=arguments[1];if(F.toLowerCase()=="class"||F.toLowerCase()=="classname"){log.error("getElementsByAttribute does not support 'class' or 'className' as the attribute parameter");return null}var B=C.getElementsByTagName(arguments[2]||"*");var E=$A();var G=B.length;for(var D=0;D<G;D++){var A=B[D];if(A.getAttribute(F)){E.push(Element.extend(A))}}return E},getParentByTagName:function(){var C=$A(arguments),B=C.shift(),A=C[0].toUpperCase();while(B.parentNode){if(B.tagName==A){return Element.extend(B)}B=B.parentNode}return null},getParentByClassName:function(){var C=$A(arguments),B=C.shift(),A=C[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(),C=B[0];while(A.tagName!="HTML"){if(A.hasAttribute(C)){return Element.extend(A)}A=$(A.parentNode)}return null},toggleClasses:function(D,C){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("noneInlineBlock")||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("inlineBlock")){A.removeClassName("inlineBlock");A.addClassName("noneInlineBlock")}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("noneInlineBlock")){A.removeClassName("noneInlineBlock");A.addClassName("inlineBlock")}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 E,B;var D=arguments[0];this.params=null;if(typeof(D)=="object"){B=D.getAttribute("data-agent")}if(B){var A="["+B.unescapeJSON()+"]";try{E=A.evalJSON()}catch(C){Errors.capture(C,"Error converting attributes to json object "+A)}return E}},getPosition:function(){var B=$(arguments[0]);var A=B.cumulativeOffset();var C=B.cumulativeScrollOffset();return{x:A[0]-C[0],y:A[1]-C[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(D){log.debug("updateAndFocus - updating");var C=arguments[0];var E=arguments[1]?arguments[1]:1000;if(C){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(C);if(window.virtualBufferManager){window.virtualBufferManager.update();clearTimeout(window.virtualBufferManager.timeout)}else{log.error("Element.updateAndFocus(): virtualBufferManager does not exist!")}var A=setTimeout(B,E);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 C=0,D=0;do{if(Element.getStyle(A,"position")=="fixed"){var B=Position.calculateScroll();C+=B.y+A.offsetTop;D+=B.x+A.offsetLeft;A=null}else{C+=A.offsetTop||0;D+=A.offsetLeft||0;A=$(A.offsetParent)}}while(A);return Element._returnOffset(D,C)}});String.prototype.unescapeJSON=function(){var A=this.toString();A=A.replace(/!#/,"{");A=A.replace(/#!/,"}");return A};String.prototype.escapeRegex=function(){return this.toString().replace(/([\[|\\|\^|\$|\.|\||\?|\*|\+|\(|\)])/gm,"\\$1")};Form.HiddenField={add:function(B,A,D){var C=document.createElement("INPUT");C.setAttribute("name",A);C.setAttribute("type","hidden");C.setAttribute("value",D);log.debug("adding hidden field:"+A+":"+D);B.appendChild(C)}};Form.Element.resetValue=function(B){var A=B.getElementsByTagName("select")[0];if(A){A.selectedIndex=0}var D=B.getElementsByTagName("input");if(D){for(var C=0;D[C];C++){switch(D[C].type){case"radio":case"checkbox":D[C].checked=false;break;case"text":case"password":D[C].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)}});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(C,B){var A=Event.element(C);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,F){var E=Position.calculateViewport();var I=Position.calculateScroll();var C=Position.calculatePageHeight();F.dim=F.getDimensions();F.pos=F.getPosition();A.pos=Position.cumulativeOffset(A);A.dim=A.getDimensions();A.pos=A.getPosition();var B=A.pos.x-F.dim.width;if(A.pos.x+A.dim.width+F.dim.width<=E.width||B<=0){B=A.dim.width+A.pos.x}var H=(parseInt(I.x)+E.width-(B+F.dim.width)>=0);if(Units.TYPE=="em"){B=B/Units.PX_TO_EM}F.setStyle({left:B+Units.TYPE});E=Position.calculateViewport();var G=A.pos.y+(A.dim.height/2);if(E.height<F.dim.height||parseInt(I.y)-G>=0){G=parseInt(I.y)}else{if(G+F.dim.height>=parseInt(I.y)+E.height){G=G-(G+F.dim.height-(parseInt(I.y)+E.height))}}var D=(parseInt(I.y)+E.height-(G+F.dim.height)>=0);if(Units.TYPE=="em"){G=G/Units.PX_TO_EM}F.setStyle({top:G+Units.TYPE});return{x:B,y:G,inViewport:(H&&D),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 C=document.documentElement;var B=window.innerHeight;var A=window.innerWidth;if(B!=null&&C.clientHeight!=null){B=(C.clientHeight<B&&C.clientHeight>0)?C.clientHeight:B;A=(C.clientWidth<window.innerWidth&&C.clientWidth>0)?C.clientWidth:A}else{if(C&&C.clientHeight){B=C.clientHeight;A=C.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 D=function(){var F=A.split("?")[1];var E=B.parameters;if(typeof E!="undefined"&&typeof F!="undefined"){throw new Error("Cannot resolve both parameters and queryString in Ajax.PartialRequest. Must choose either parameters or querystring.")}if(typeof E=="undefined"&&typeof F=="undefined"){return""}return E||F}();if(!D.match(/req=partial/)){var D=D.split("&");D.push("rep=partial");D=D.join("&")}B.parameters=D;return new Ajax.Request(A.split("?")[0],B)}catch(C){Errors.capture(C)}};Ajax.PartialPage=Class.create(Ajax.Request,{formControls:["input","select","textarea"],initialize:function($super,A,B){B=Object.clone(B);var C=B.onSuccess;B.onSuccess=(function(D){this.processResponse(D);if(this.json&&Object.isFunction(C)){C(D,this.json)}else{if(!this.json&&Object.isFunction(B.onFailure)){B.onFailure(D)}}}).bind(this);$super(A,B)},processResponse:function(A){this.json=this.evalJSONResponse(A);if(this.json){this.updatePageWithJSON()}},evalJSONResponse:function(B){var A;try{A=B.responseText.evalJSON()}catch(C){log.error("Ajax.PartialPage: Invalid JSON.");return false}return A},updatePageWithJSON:function(){this.updateErrors();for(var C in this.json.modules){var A=$$("."+C+"Mod","div[data-placeholder="+C+"]");for(var D=0;D<A.length;D++){var B=A[D];var F=this.json.modules[C][D];if(F!==null){var E=new Element("div");E.innerHTML=F;var G=E.down();if(!G){log.error("Ajax.PartialPage: No content for module '"+C+"'.");return false}this.updateModule(B,G,C)}}}if(this.json.tracking){document.fire("content:update",{webtrends:this.json.tracking})}},updateErrors:function(){var A=$("pageErrors");A.replace(this.json.errors).purge()},updateModule:function(C,D,B){var A=$(document.activeElement);log.info("Ajax.PartialPage: replacing module: "+B);C.replace(D).purge();Page.initializeDOMFragment(D,true);this.preserveFocus(D,A)},preserveFocus:function(D,B){if(B!=document.activeElement&&!B.descendantOf(document.documentElement)&&B.name){var A=B.nodeName.toLowerCase();if(this.formControls.include(A)){var E=D.select(A+"[name="+B.name+"]");var C=E.length>1?E.find(function(F){return B.value==F.value}):E[0];if(C){C.focus();B=C;C.value=B.value}}}}});Ajax.StreamingPartialPage=Class.create(Ajax.PartialPage,{initialize:function($super,A,B){$super(A,B)},updateErrors:function(){}});Ajax.CachedPartialPage=Class.create(Ajax.StreamingPartialPage,{initialize:function($super,A,B){$super(A,B)},updateModule:function(B,C,A){if(C.hasClassName("cached")){log.info("Ajax.CachedPartialPage: caching module: "+A);this.cachedModules=this.cachedModules||{};this.cachedModules[A]=this.cachedModules[A]||$A();this.cachedModules[A].push({origEl:B,newEl:C})}else{this.replaceModule(B,C,A)}},replaceModule:function(C,D,B){var A=$(document.activeElement);log.info("Ajax.CachedPartialPage: replacing module: "+B);C.replace(D).purge();Page.initializeDOMFragment(D,true);this.preserveFocus(D,A)},updateCachedModules:function(){if(this.cachedModules){Object.keys(this.cachedModules).each(function(B){var A=this.cachedModules[B];A.each(function(C){this.replaceModule(C.origEl,C.newEl,B)},this)},this);this.cachedModules=null}}});Ajax.IncrementalPartialPage=Class.create(Ajax.PartialPage,{updateModule:function($super,B,C){if(C.hasClassName("incremental")){var A=new Element("div");A.innerHTML=C.innerHTML;B.insert(A);Page.initializeDOMFragment(A,true)}else{$super(B,C)}}});var ManagedEventObservers=Class.create();ManagedEventObservers.prototype={initialize:function(){this.observers=$A()},add:function(A,B,D,C){if(arguments.length>=3){A=$(A);C=C||false;Event.observe(A,B,D,C);this.observers.push([A,B,D,C])}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 C=false;if($(A)){for(var B=0;B<this.observers.length;B++){if(this.observers[B][0]==A){C=true}}}return C}};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));String.prototype.parseColor=function(){var A="#";if(this.slice(0,4)=="rgb("){var C=this.slice(4,this.length-1).split(",");var B=0;do{A+=parseInt(C[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(C){return(C.nodeType==3?C.nodeValue:((C.hasChildNodes()&&!Element.hasClassName(C,A))?Element.collectTextNodesIgnoreClass(C,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 C=document.createTextNode(" ");A.appendChild(C);A.removeChild(C)}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(C){if(C.nodeType==3){C.nodeValue.toArray().each(function(D){A.insertBefore(new Element("span",{style:B}).update(D==" "?String.fromCharCode(160):D),C)});Element.remove(C)}})},multiple:function(C,B){var A;if(((typeof C=="object")||Object.isFunction(C))&&(C.length)){A=C}else{A=$(C).childNodes}var D=Object.extend({speed:0.1,delay:0},arguments[2]||{});var E=D.delay;$A(A).each(function(G,F){new B(G,Object.extend(D,{delay:F*D.speed+E}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(B,A,C){B=$(B);A=(A||"appear").toLowerCase();return Effect[Effect.PAIRS[A][B.visible()?1:0]](B,Object.extend({queue:{position:"end",scope:(B.id||"global"),limit:1}},C||{}))}};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 C=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(D){return D.state=="idle"}).each(function(D){D.startOn+=B.finishOn;D.finishOn+=B.finishOn});break;case"with-last":C=this.effects.pluck("startOn").max()||C;break;case"end":C=this.effects.pluck("finishOn").max()||C;break}B.startOn+=C;B.finishOn+=C;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 C=new Date().getTime();for(var B=0,A=this.effects.length;B<A;B++){this.effects[B]&&this.effects[B].loop(C)}}});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){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 B(D,C){if(D.options[C+"Internal"]){D.options[C+"Internal"](D)}if(D.options[C]){D.options[C](D)}}return function(C){if(this.state==="idle"){this.state="running";B(this,"beforeSetup");if(this.setup){this.setup()}B(this,"afterSetup")}if(this.state==="running"){C=(this.options.transition(C)*this.fromToDelta)+this.options.from;this.position=C;B(this,"beforeUpdate");if(this.update){this.update(C)}B(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 C=(A-this.startOn)/this.totalTime,B=(C*this.totalFrames).round();if(B>this.currentFrame){this.render(C);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(C,F,E){C=Object.isString(C)?$(C):C;var A=$A(arguments),D=A.last(),B=A.length==5?A[3]:null;this.method=Object.isFunction(D)?D.bind(C):Object.isFunction(C[D])?C[D].bind(C):function(G){C[D]=G};this.start(Object.extend({from:F,to:E},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,C,A){return new Effect.Move(B,Object.extend({x:A,y:C},arguments[3]||{}))};Effect.Scale=Class.create(Effect.Base,{initialize:function(B,A){this.element=$(B);if(!this.element){throw (Effect._elementDoesNotExistError)}var C=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:A},arguments[2]||{});this.start(C)},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(D,C){var E={};if(this.options.scaleX){E.width=C.round()+"px"}if(this.options.scaleY){E.height=D.round()+"px"}if(this.options.scaleFromCenter){var B=(D-this.dims[0])/2;var A=(C-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){E.top=this.originalTop-B+"px"}if(this.options.scaleX){E.left=this.originalLeft-A+"px"}}else{if(this.options.scaleY){E.top=-B+"px"}if(this.options.scaleX){E.left=-A+"px"}}}this.element.setStyle(E)}});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,C,D){return B+((this._base[D]+(this._delta[D]*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]||{},D=document.viewport.getScrollOffsets(),C=$(A).cumulativeOffset();if(B.offset){C[1]+=B.offset}return new Effect.Tween(null,D.top,C[1],B,function(E){scrollTo(D.left,E.round())})};Effect.Fade=function(B){B=$(B);var A=B.getInlineOpacity();var C=Object.extend({from:B.getOpacity()||1,to:0,afterFinishInternal:function(D){if(D.options.to!=0){return}D.element.hide().setStyle({opacity:A})}},arguments[1]||{});return new Effect.Opacity(B,C)};Effect.Appear=function(A){A=$(A);var B=Object.extend({from:(A.getStyle("display")=="none"?0:A.getOpacity()||0),to:1,afterFinishInternal:function(C){C.element.forceRerendering()},beforeSetup:function(C){C.element.setOpacity(C.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(C){Position.absolutize(C.effects[0].element)},afterFinishInternal:function(C){C.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(C){C.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(C){C.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(C){new Effect.Scale(C.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(D){D.element.makePositioned().makeClipping()},afterFinishInternal:function(D){D.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(C){C.effects[0].element.makePositioned()},afterFinishInternal:function(C){C.effects[0].element.hide().undoPositioned().setStyle(A)}},arguments[1]||{}))};Effect.Shake=function(B){B=$(B);var D=Object.extend({distance:20,duration:0.5},arguments[1]||{});var E=parseFloat(D.distance);var C=parseFloat(D.duration)/10;var A={top:B.getStyle("top"),left:B.getStyle("left")};return new Effect.Move(B,{x:E,y:0,duration:C,afterFinishInternal:function(F){new Effect.Move(F.element,{x:-E*2,y:0,duration:C*2,afterFinishInternal:function(G){new Effect.Move(G.element,{x:E*2,y:0,duration:C*2,afterFinishInternal:function(H){new Effect.Move(H.element,{x:-E*2,y:0,duration:C*2,afterFinishInternal:function(I){new Effect.Move(I.element,{x:E*2,y:0,duration:C*2,afterFinishInternal:function(J){new Effect.Move(J.element,{x:-E,y:0,duration:C,afterFinishInternal:function(K){K.element.undoPositioned().setStyle(A)}})}})}})}})}})}})};Effect.SlideDown=function(B){B=$(B).cleanWhitespace();var C=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(D){D.element.makePositioned();D.element.down().makePositioned();if(window.opera){D.element.setStyle({top:""})}D.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(D){D.element.down().setStyle({bottom:(D.dims[0]-D.element.clientHeight)+"px"})},afterFinishInternal:function(D){D.element.undoClipping().undoPositioned();D.element.down().undoPositioned().setStyle({bottom:C})}},arguments[1]||{}))};Effect.SlideUp=function(B){B=$(B).cleanWhitespace();var C=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(D){D.element.makePositioned();D.element.down().makePositioned();if(window.opera){D.element.setStyle({top:""})}D.element.makeClipping().show()},afterUpdateInternal:function(D){D.element.down().setStyle({bottom:(D.dims[0]-D.element.clientHeight)+"px"})},afterFinishInternal:function(D){D.element.hide().undoClipping().undoPositioned();D.element.down().undoPositioned().setStyle({bottom:C})}},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 C=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 H=B.getDimensions();var F,G;var E,D;switch(C.direction){case"top-left":F=G=E=D=0;break;case"top-right":F=H.width;G=D=0;E=-H.width;break;case"bottom-left":F=E=0;G=H.height;D=-H.height;break;case"bottom-right":F=H.width;G=H.height;E=-H.width;D=-H.height;break;case"center":F=H.width/2;G=H.height/2;E=-H.width/2;D=-H.height/2;break}return new Effect.Move(B,{x:F,y:G,duration:0.01,beforeSetup:function(I){I.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(I){new Effect.Parallel([new Effect.Opacity(I.element,{sync:true,to:1,from:0,transition:C.opacityTransition}),new Effect.Move(I.element,{x:E,y:D,sync:true,transition:C.moveTransition}),new Effect.Scale(I.element,100,{scaleMode:{originalHeight:H.height,originalWidth:H.width},sync:true,scaleFrom:window.opera?1:0,transition:C.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(J){J.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(J){J.effects[0].element.undoClipping().undoPositioned().setStyle(A)}},C))}})};Effect.Shrink=function(B){B=$(B);var C=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 F=B.getDimensions();var E,D;switch(C.direction){case"top-left":E=D=0;break;case"top-right":E=F.width;D=0;break;case"bottom-left":E=0;D=F.height;break;case"bottom-right":E=F.width;D=F.height;break;case"center":E=F.width/2;D=F.height/2;break}return new Effect.Parallel([new Effect.Opacity(B,{sync:true,to:0,from:1,transition:C.opacityTransition}),new Effect.Scale(B,window.opera?1:0,{sync:true,transition:C.scaleTransition,restoreAfterFinish:true}),new Effect.Move(B,{x:E,y:D,sync:true,transition:C.moveTransition})],Object.extend({beforeStartInternal:function(G){G.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(G){G.effects[0].element.hide().undoClipping().undoPositioned().setStyle(A)}},C))};Effect.Pulsate=function(C){C=$(C);var D=arguments[1]||{},B=C.getInlineOpacity(),E=D.transition||Effect.Transitions.linear,A=function(F){return 1-E((-Math.cos((F*(D.pulses||5)*2)*Math.PI)/2)+0.5)};return new Effect.Opacity(C,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(F){F.element.setStyle({opacity:B})}},D),{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(C){new Effect.Scale(B,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(D){D.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 C=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(C.style)){this.style=$H(C.style)}else{if(C.style.include(":")){this.style=C.style.parseStyle()}else{this.element.addClassName(C.style);this.style=$H(this.element.getStyles());this.element.removeClassName(C.style);var B=this.element.getStyles();this.style=this.style.reject(function(D){return D.value==B[D.key]});C.afterFinishInternal=function(D){D.element.addClassName(D.options.style);D.transforms.each(function(E){D.element.style[E.style]=""})}}}this.start(C)},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(C){return parseInt(B.slice(C*2+1,C*2+3),16)})}this.transforms=this.style.map(function(G){var B=G[0],F=G[1],E=null;if(F.parseColor("#zzzzzz")!="#zzzzzz"){F=F.parseColor();E="color"}else{if(B=="opacity"){F=parseFloat(F);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(F)){var D=F.match(/^([\+\-]?[0-9\.]+)(.*)$/);F=parseFloat(D[1]);E=(D.length==3)?D[2]:null}}}var C=this.element.getStyle(B);return{style:B.camelize(),originalValue:E=="color"?A(C):parseFloat(C||0),targetValue:E=="color"?A(F):F,unit:E}}.bind(this)).reject(function(B){return((B.originalValue==B.targetValue)||(B.unit!="color"&&(isNaN(B.originalValue)||isNaN(B.targetValue))))})},update:function(A){var D={},B,C=this.transforms.length;while(C--){D[(B=this.transforms[C]).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(D,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 C=B.values().first();this.tracks.push($H({ids:B.keys().first(),effect:Effect.Morph,options:{style:C}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(B){var E=B.get("ids"),C=B.get("effect"),D=B.get("options");var A=[$(E)||$$(E)].flatten();return A.map(function(F){return new C(F,Object.extend({sync:true},D))})}).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(C){if(B[C]){A.set(C,B[C])}});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(D,C){D[C]=B[C];return D})}}else{Element.getStyles=function(B){B=$(B);var C=B.currentStyle,A;A=Element.CSS_PROPERTIES.inject({},function(E,D){E[D]=C[D];return E});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(C,B,D){C=$(C);var E=B.dasherize().camelize(),A=E.charAt(0).toUpperCase()+E.substring(1);new Effect[A](C,D);return C},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,C){B=$(B);Effect[A.charAt(0).toUpperCase()+A.substring(1)](B,C);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,C,B){A=$(A);this.element=A;this.update=$(C);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(D,E){if(!E.style.position||E.style.position=="absolute"){E.style.position="absolute";Position.clone(D,E,{setHeight:false,offsetTop:D.offsetHeight})}Effect.Appear(E,{duration:0.15})};this.options.onHide=this.options.onHide||function(D,E){new Effect.Fade(E,{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(F){if(this.options.updateElement){this.options.updateElement(F);return}var D="";if(this.options.select){var B=$(F).select("."+this.options.select)||[];if(B.length>0){D=Element.collectTextNodes(B[0],this.options.select)}}else{D=Element.collectTextNodesIgnoreClass(F,"informal")}var A=this.getTokenBounds();if(A[0]!=-1){var E=this.element.value.substr(0,A[0]);var C=this.element.value.substr(A[0]).match(/^\s+/);if(C){E+=C[0]}this.element.value=E+D+this.element.value.substr(A[1])}else{this.element.value=D}this.oldElementValue=this.element.value;this.element.focus();if(this.options.afterUpdateElement){this.options.afterUpdateElement(this.element,F)}},updateChoices:function(C){if(!this.changed&&this.hasFocus){this.update.innerHTML=C;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 E=this.element.value;if(E.strip().empty()){return[-1,0]}var F=arguments.callee.getFirstDifferencePos(E,this.oldElementValue);var H=(F==this.oldElementValue.length?1:0);var D=-1,C=E.length;var G;for(var B=0,A=this.options.tokens.length;B<A;++B){G=E.lastIndexOf(this.options.tokens[B],F+H-1);if(G>D){D=G}G=E.indexOf(this.options.tokens[B],F+H);if(-1!=G&&G<C){C=G}}return(this.tokenBounds=[D+1,C])}});Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos=function(C,A){var D=Math.min(C.length,A.length);for(var B=0;B<D;++B){if(C[B]!=A[B]){return B}}return D};Ajax.Autocompleter=Class.create(Autocompleter.Base,{initialize:function(B,D,A,C){this.baseInitialize(B,D,C);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,C,D,B){this.baseInitialize(A,C,B);this.options.array=D},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 C=[];var E=[];var H=B.getToken();var G=0;for(var D=0;D<B.options.array.length&&C.length<B.options.choices;D++){var F=B.options.array[D];var I=B.options.ignoreCase?F.toLowerCase().indexOf(H.toLowerCase()):F.indexOf(H);while(I!=-1){if(I==0&&F.length!=H.length){C.push("<li><strong>"+F.substr(0,H.length)+"</strong>"+F.substr(H.length)+"</li>");break}else{if(H.length>=B.options.partialChars&&B.options.partialSearch&&I!=-1){if(B.options.fullSearch||/\s/.test(F.substr(I-1,1))){E.push("<li>"+F.substr(0,I)+"<strong>"+F.substr(I,H.length)+"</strong>"+F.substr(I+H.length)+"</li>");break}}}I=B.options.ignoreCase?F.toLowerCase().indexOf(H.toLowerCase(),I+1):F.indexOf(H,I+1)}}if(E.length){C=C.concat(E.slice(0,B.options.choices-C.length))}return"<ul>"+C.join("")+"</ul>"}},A||{})}});Field.scrollFreeActivate=function(A){setTimeout(function(){Field.activate(A)},1)};Ajax.InPlaceEditor=Class.create({initialize:function(B,A,C){this.url=A;this.element=B=$(B);this.prepareOptions();this._controls={};arguments.callee.dealWithDeprecatedOptions(C);Object.extend(this.options,C||{});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(G,C,B){var E=this.options[G+"Control"];var F=this.options[G+"Text"];if("button"==E){var A=document.createElement("input");A.type="submit";A.value=F;A.className="editor_"+G+"_button";if("cancel"==G){A.onclick=this._boundCancelHandler}this._form.appendChild(A);this._controls[G]=A}else{if("link"==E){var D=document.createElement("a");D.href="#";D.appendChild(document.createTextNode(F));D.onclick="cancel"==G?this._boundCancelHandler:this._boundSubmitHandler;D.className="editor_"+G+"_link";if(B){D.className+=" "+B}this._form.appendChild(D);this._controls[G]=D}}},createEditField:function(){var C=(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=C;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(E,C){var D=B.options["text"+E+"Controls"];if(!D||C===false){return}B._form.appendChild(document.createTextNode(D))}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(D){var B=this._form;var C=$F(this._controls.editor);this.prepareSubmission();var E=this.options.callback(B,C)||"";if(Object.isString(E)){E=E.toQueryParams()}E.editorId=this.element.id;if(this.options.htmlResponse){var A=Object.extend({evalScripts:true},this.options.ajaxOptions);Object.extend(A,{parameters:E,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:E,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Request(this.url,A)}if(D){Event.stop(D)}},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(C){this._form.removeClassName(this.options.loadingClassName);var B=C.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,C){this._extraDefaultOptions=Ajax.InPlaceCollectionEditor.DefaultOptions;$super(B,A,C)},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(D){return 2===D.length?D:[D,D].flatten()});var B=("value" in this.options)?this.options.value:this._text;var C=this._collection.any(function(D){return D[0]==B}.bind(this));this._controls.editor.update("");var A;this._collection.each(function(E,D){A=document.createElement("option");A.value=E[0];A.selected=C?E[0]==B:0==D;A.appendChild(document.createTextNode(E[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(C,D){if(C in A||D===undefined){return}A[C]=D}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,C){this.delay=A||0.5;this.element=$(B);this.callback=C;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,D,A,C){this.baseInitialize(B,D,C);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,C){if(!C.style.position||C.style.position=="absolute"){C.style.position="relative";var B=(this.options.cloneWidth==false)?false:true;Element.clonePosition(A,C,{setHeight:false,setWidth:B,offsetTop:A.offsetHeight});C.style.position="absolute";C.hide()}Effect.Appear(C,{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(E){try{var B=E.responseText.evalJSON(true);if(B.length>0){this.results=B}}catch(G){log.error("Ajax.Autocompleter: invalid response")}var C=new Element("div");var F=new Element("ul");C.appendChild(F);for(var A=0;A<B.length;A++){var D=new Element("li").update(B[A].suggestion);if(A%2==0){D.setAttribute("class","odd")}else{D.setAttribute("class","even")}F.appendChild(D)}if(this.options.transformResponse){F=this.options.transformResponse(F)}this.updateChoices(C.innerHTML)}});Effect.Transitions.easeFrom=function(A){return Math.pow(A,0.5)};Effect.Transitions.easeTo=function(A){return Math.pow(A,0.2)};Abstract.Agent=Class.create();Abstract.Agent.prototype={initialize:function(B,C){if(typeof(B)=="object"){try{Profiler.start(C.type);log.debug(C.type+".initialize() *");if(!C.params){C.params={}}Object.extend(this,C);this.element=$(B);this.initExtend(B,this.params);Profiler.stop(C.type)}catch(A){Errors.capture(A,"Initialization failure : "+C.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(C,A){if(typeof(C)=="object"){try{this.parent=A;this.element=Element.extend(C);this.agent=this.element.getAgents()[0];Object.extend(this,this.agent);if(!this.params){this.params={}}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 : "+C)}}},initExtend:function(){}};var Page={debug:false,prevNumTags:0,isDOMReady:false,onLoadFired:false,initializationComplete:false,initInterval:100,childAgents:[],hideRevealRadios:[],deferredAdverts:{ads:[],newAd:function(A){this.ads.push(A)},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=[];this.processedElements=[];var C=function(){if(!this.isDOMReady){try{this.initPage()}catch(D){var E="beforeDOMReady init: "+D.name+": "+D.message;if(D.lineNumber){E+="; line "+D.lineNumber}log.error(E)}window.setTimeout(C.bind(this),this.initInterval)}};var A=function(){try{this.initPage(true)}catch(D){var E="onDOMReady init: "+D.name+": "+D.message;if(D.lineNumber){E+="; line "+D.lineNumber}log.error(E)}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));C.call(this)},initAgent:function(A,C){try{var B=new (this.locateAgentClass(C.type))(A,C);var E=A.retrieve("_agents");if(E){E.push(B)}else{E=[B]}A.store("_agents",E)}catch(D){log.error("Error trying to instantiate agent of type "+C.type+". Error: \n\n"+D)}},initializeAjaxResponse:function(A){var B=$(document.createElement("DIV"));B.innerHTML=A;Page.initializeDOMFragment(B)},locateAgentClass:function(E){try{var B=E.split(".");var C=window;for(var A=0;A<B.length;A++){C=C[B[A]]}}catch(D){return}return C},initPage:function(J){Profiler.start("Page.init");if(!this.pageInitNum){this.pageInitNum=1}else{this.pageInitNum++}var M=0;var B=0;var Q=document.getElementsByTagName("*");var C=Q.length;if(C>this.prevNumTags||J){this.prevNumTags=C;var H=[];for(var G=0;G<C;G++){var P=Q[G];if(P.getAttribute("data-agent")){if(this.processedElements.indexOf(P)==-1&&$(P).isDOMReady()){H.push(P)}}}var K=H.length;for(var G=0;G<K;G++){var D=H[G];var I=D.getAgents();if(I){if(window.clientPerf&&window.clientPerf.agentsNotStarted){window.clientPerf.timestamp("agentsStart")}var L=I.length;for(var F=0;F<L;F++){var E=I[F];var A=this.locateAgentClass(E.type);if(!Object.isString(E.type)){log.error("Agent type is not a string for "+D.inspect().escapeHTML()+". Missing quotes in SystemText popup?")}else{if(!A){log.error("Agent '"+E.type+"' does not exist. Element: "+D.inspect().escapeHTML())}else{var O=A.prototype.beforeDOMReady;if(E.deferred=="true"){B++;this.deferredAgents.push({element:D,agent:E})}else{if(E.childOf){B++;if(!this.childAgents[E.childOf]){this.childAgents[E.childOf]=[]}this.childAgents[E.childOf].push({element:D,agent:E})}else{if(!O&&E.lazy!="true"){B++;this.domReadyAgents.push({element:D,agent:E})}else{if(E.lazy!="true"){M++;this.initAgent(D,E)}}}}}}}}else{log.error("Could not retrieve agents for "+D.inspect().escapeHTML())}}this.processedElements=this.processedElements.concat(H);if(J){this.pageInitNum=this.pageInitNum.toString()+" [final DOMReady initPage]"}log.info("Page.initPage() run: "+this.pageInitNum);if(J){if(window.clientPerf&&window.clientPerf.agentsNotStarted){window.clientPerf.timestamp("agentsStart")}for(var G=0;G<this.domReadyAgents.length;G++){this.initAgent(this.domReadyAgents[G].element,this.domReadyAgents[G].agent)}for(var G=0;G<this.deferredAgents.length;G++){this.initAgent(this.deferredAgents[G].element,this.deferredAgents[G].agent)}this.initializationComplete=true;if(window.clientPerf){window.clientPerf.timestamp("agentsFinish")}delete this.deferredAgents;delete this.domReadyAgents;delete this.processedElements;delete this.initInterval;this.deferredAdverts.populate();window.setTimeout((function(){if(this.onLoadFired){document.fire("page:complete")}else{Event.observe(window,"load",function(){window.setTimeout(function(){document.fire("page:complete")},0)})}}).bind(this),0)}}else{log.info("Page.initPage() run: "+this.pageInitNum+" [no new elements]")}Profiler.stop("Page.init")},initializeDOMFragment:function(D,K){Profiler.start("DOMFragment.init");D=Element.extend(D);var B=D.getElementsByAttribute("data-agent");if(K&&D.getAttribute("data-agent")){B.unshift(D)}var C=[];var J=$A();for(var H=0;B[H];H++){var L=B[H];var I=L.getAgents();for(var G=0;I[G];G++){var F=I[G];var A=this.locateAgentClass(F.type);if(!Object.isString(F.type)){log.error("Agent type is not a string for "+L.inspect().escapeHTML()+". Missing quotes in SystemText popup?")}else{if(!A){log.error("Agent '"+F.type+"' does not exist. Element: "+L.inspect().escapeHTML())}else{if(F.deferred=="true"){C.push({element:L,agent:F})}else{if(F.childOf!=""&&F.childOf!=undefined){if(this.childAgents[F.childOf]==null){this.childAgents[F.childOf]=[]}this.childAgents[F.childOf].push({element:L,agent:F})}else{if(F.lazy!="true"){this.initAgent(L,F)}}}}}}}for(var E=0;C[E];E++){this.initAgent(C[E].element,C[E].agent)}Page.deferredAdverts.populate();Profiler.stop("DOMFragment.init")},initializeLazyAgents:function(D){var A,E,B,C;C=D.getElementsByAttribute("data-agent");C.each(function(F){B=F.getAgents();if(B){B.each(function(G){if(G.lazy==="true"){this.initAgent(F,G)}}.bind(this))}}.bind(this))}};Event.observe(window,"load",function(){Page.onLoadFired=true;Page.deferredAdverts.populate()});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),E=A.shift();var F=["name","message","description","number","fileName","sourceURL","lineNumber","line"];var D=A;for(var C=0;C<F.length;C++){if(E[F[C]]!==undefined){D.push(F[C]+":"+E[F[C]])}}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(D);log.error(""+D.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(D,C){var B=new RegExp("^&|&$","g");var A=new RegExp("&&","g");String.prototype.deleteQueryStringParam=function(H,F){var E=H+(F===true?"[^&]*":"=[^&]*");var G=new RegExp(E,"g");return this.replace(G,"").replace(A,"&").replace(B,"")};return this.deleteQueryStringParam(D,C)};var $QS=QueryString=function(A){A=A.replace(/&amp;/g,"&");var B=A.split("&");return{addParam:function(E){for(var D=0,C=arguments.length;D<C;D++){B.push(arguments[D])}B=B.uniq();return this},removeParam:function(E){for(var D=0,C=arguments.length;D<C;D++){B=B.without(arguments[D])}return this},toString:function(){return B.join("&")}}};(function(){var A={hashRegex:/^#/,ieHashPrefix:"/",ieHashPrefixRegex:/^\//,init:function(){this.lastHash="";var D=Prototype.Browser.IE&&(!document.documentMode||document.documentMode<8);if(D){var C=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(C.search(this.ieHashPrefixRegex)==-1){C=this.ieHashPrefix+C;window.location.replace("#"+C)}this.updateIFrame(C);document.observe("click",(function(G){var F=G.findElement("a");if(F){if(F.href.split("#")[0]==window.location.href.split("#")[0]){var H=F.href.split("#")[1];var E=$(H);if(E&&!E.rendered()){G.preventDefault();window.location.href=F.href.replace("#","#"+this.ieHashPrefix)}}}}).bindAsEventListener(this))}if("onhashchange" in window&&!D){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(D){var E=window.location.hash.replace(this.hashRegex,"");if(this.iframe){var C=this.iframe.document.location.hash.replace(this.hashRegex,"");if(E!==this.lastHash){if(E.search(this.ieHashPrefixRegex)==-1){E=this.ieHashPrefix+E;window.location.replace("#"+E)}if(E!==C){this.updateIFrame(E)}}else{if(C!==this.lastHash){window.location.href=window.location.href.split("#")[0]+"#"+C}}}if(E!==this.lastHash||D){if(!this.iframe&&E.search(this.ieHashPrefixRegex)!=-1){E=E.replace(this.ieHashPrefixRegex,"");window.location.replace("#"+E)}this.lastHash=E;document.fire("hash:change",{hash:this.iframe?E.replace(this.ieHashPrefixRegex,""):E})}},updateIFrame:function(C){this.iframe.document.open().close();this.iframe.document.location.hash="#"+C}};document.observe("hash:check",function B(){document.stopObserving("hash:check",B);A.init.call(A)})})();(function(){var B={};this.processTemplate=function A(E,D){var C=!/\W/.test(E)?B[E]=B[E]||A(document.getElementById(E).innerHTML.split("\\").join("\\\\")):new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+E.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 D?C(D):C}})();var Persist=(function(){var B=function(E){return JSON.stringify(E)},A=function(E){return JSON.parse(E)},D=(function(){try{return !!localStorage.getItem}catch(E){return false}})(),C=(function(){try{return !!sessionStorage.getItem}catch(E){return false}})();return{get:function(E,F){if(window.JSON){if(F&&D){return A(localStorage.getItem(E))}else{if(C){return A(sessionStorage.getItem(E))}}}else{return null}},set:function(E,F,G){if(window.JSON){if(G&&D){localStorage.setItem(E,B(F))}else{if(C){sessionStorage.setItem(E,B(F))}}}},remove:function(E,F){if(F&&D){localStorage.removeItem(E)}else{if(C){sessionStorage.removeItem(E)}}},clear:function(E){if(E&&D){localStorage.clear()}else{if(C){sessionStorage.clear()}}}}})();var DateUtils=(function(){return{formatDateAsString:function(D,B){if(D instanceof Date&&B.length>0){var H=$A();B.gsub(/[^a-z0-9]+|[a-z0-9]+/,function(I){H.push(I[0])});for(var E=0,A=H.length;E<A;E++){if(H[E].indexOf("y")!=-1){var F=D.getFullYear()+"";while(F.length>H[E].length){F=F.substr(1)}H[E]=F}else{if(H[E].indexOf("m")!=-1){var G=D.getMonth()+1+"";if(G.length!=2){G="0"+G}H[E]=G}else{if(H[E].indexOf("d")!=-1){var C=D.getDate()+"";if(C.length!=2){C="0"+C}H[E]=C}}}}return H.join("")}}}})();var Persistent={initPersistence:function(A){if(!A){return}this.persistenceId=A;this.persistenceStores={session:this.initPersistenceStore(),local:this.initPersistenceStore()}},initPersistenceStore:function(B){var A=null;if(this.persistenceId){A=Persist.get(this.persistenceId,B)}return(A===null)?{}:A},setPersistent:function(B,D,C){var A;if(this.persistenceId){A=C?this.persistenceStores.local:this.persistenceStores.session;A[B]=D;Persist.set(this.persistenceId,A,C)}},getPersistent:function(B,D){var A,C=null;if(this.persistenceId){A=Persist.get(this.persistenceId,D);if(A!==null){if(D){this.persistenceStores.local=A}else{this.persistenceStores.session=A}C=(A[B]!==undefined)?A[B]:null}}return C}};(function(){var B=2;var A=[],C=document.getElementsByTagName("head")[0];var D=function(){if(!A.length){return}var F=A.shift();var E=document.createElement("script");E.type="text/javascript";if(E.readyState){E.onreadystatechange=function(){if(E.readyState=="loaded"||E.readyState=="complete"){E.onreadystatechange=null;if(F.callback){F.callback()}D()}}}else{E.onload=function(){E.onload=null;if(F.callback){F.callback()}D()}}E.src=F.url;C.appendChild(E)};document.observe("page:complete",function(){A.sort(function(H,G){return H.priority-G.priority});var F=A.length;for(var E=0;E<F&&E<B;E++){D()}});Page.queue=function(F,E,G){E=window.parseFloat(E);if(!F||!window.isFinite(E)||E>1||E<0){log.error("Page.queue: Invalid argument");return}if(window.location.protocol=="https:"&&F.indexOf("http:")==0){log.error("Page.queue: Invalid protocol on secure page");return}A.push({callback:G,priority:E,url:F})}})();var FacebookSDK={session:null,callbacks:[],loading:false,initialized:false,initParams:{},load:function(F,B){if(F){this.callbacks.push(F)}if(this.loading){return}this.loading=true;this.initParams=B.params.initParams;var A=B.element;var D=document.createElement("div");D.id="fb-root";A.insert({top:D});var C=this.initParams.locale||"en_US";var E=document.createElement("script");E.async=true;E.src=document.location.protocol+"//connect.facebook.net/"+C+"/all.js";D.appendChild(E);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 C=this.initParams;var E=window.location.protocol+"//"+window.location.host,B="/script/vendor/facebook/facebook-channel.htm",A="/script/vendor/facebook/facebook-channel-secure.htm",D=E+(document.location.protocol.toLowerCase()==="http:"?B:A);FB.init({appId:C.appId,status:true,cookie:true,channelUrl:D});this.initialized=true;this.callback()}};var GoogleMapAPILoader={callbacks:[],loading:false,load:function(D,C,E){if(D){this.callbacks.push(D)}if(this.loading){return}this.loading=true;var A=window.location.protocol+"//maps.googleapis.com/maps/api/js?client=gme-orbitz&sensor="+(E?true:false)+"&callback=GoogleMapAPILoader.callback&v=3.7&libraries=places&language="+C;var B=document.createElement("SCRIPT");B.type="text/javascript";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 GoogleMapControls={OutlierControl:function(A){var B={element:null,show:function(E,C){var D=this.position;if(!D){D=E.controls[C];D.push(this.element);this.position=D}},hide:function(){var C=this.position;if(C){var D=C.getArray();D.each(function(F,E){if(F===this.element){C.removeAt(E);$break}}.bind(this));delete this.position}}};google.maps.event.addListener(A.map,"idle",function(){var C=(function(){if(A.markerLevel=="location"){var G=A.markers,F=A.map.getBounds();for(var E=0;E<G.length;E++){if(!F.contains(G[E].getPosition())){return true}}}})();if(C){if(!this.element){this.element=function(){var F=new Element("div",{"class":"buttonControl"}),E=new Element("a",{"class":"link controlUI"}).update(A.params.outlierControlText);google.maps.event.addDomListener(E,"click",function(G){this.map.fitBounds(G)}.bind(A,A.bounds));F.appendChild(E);return F}.call(this)}this.show(A.map,google.maps.ControlPosition.TOP_CENTER)}else{var D=this;if(D&&D.position){D.hide(A.map)}}}.bind(B))}};var GoogleMapUtil={getStreetView:function(B,C){var A=new google.maps.StreetViewService();A.getPanoramaByLocation(B,50,function(D,E){if(E==google.maps.StreetViewStatus.OK){if(typeof C==="function"){C(D)}}else{if(E==google.maps.StreetViewStatus.ZERO_RESULTS){log.info("GoogleMapUtil: Streetview unavailable for this location")}else{if(E==google.maps.StreetViewStatus.UNKNOWN_ERROR){log.error("GoogleMapUtil: Streetview server error")}else{log.error("GoogleMapUtil: Streetview unknown error")}}}})},calculateBearing:function(B,E){var F=E.lat()-B.lat();var A=E.lng()-B.lng();var C=Math.atan2(A,F);var D=C*180/Math.PI;if(D<0){D+=360}return D}};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,C,A){this.type=B;this.content=C;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 E=Element.extend(document.createElement("iframe"));E.style.display="none";this.markup.shim.appendChild(E);this.markup.shim.className="dialogShim "+this.options.classes;E.src="/cacheable/empty.html";E.scrolling="no";E.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 C=this.markup.shim.currentStyle.paddingTop.replace("px","")*1;var D=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;E.style.width=(this.dialogBoundingBox.x2-this.dialogBoundingBox.x1-D-B)+"px";E.style.height=(this.dialogBoundingBox.y2-this.dialogBoundingBox.y1-C-A)+"px";E.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 C=this.markup.mainInfo.getElementsByClassName("closeListener");for(var A=0;C[A];A++){if(!C[A].isAttached){this.managedEventObservers.add(C[A],"click",B);C[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){this.content.url=this.content.url.unescapeHTML();log.debug("Dialog.Base.getContent - url: "+this.content.url);this.request=new Ajax.Request(this.content.url,{method:(this.options.ajaxParameters)?"post":"get",parameters:(this.options.ajaxParameters)?this.options.ajaxParameters:"",onCreate:function(){if(!this.options.interstitial){this.showIntrastitial()}}.bind(this),onComplete:this.showDialog.bind(this),onSuccess:function(A){log.debug(A.status+": Dialog.Base.getContent() content.url successful");if(A.responseText.indexOf("<html")!=-1){if(this.options.sessionTimeoutUrl){this.sessionHasExpired=true;top.location.href=this.options.sessionTimeoutUrl}else{if(this.options.fallbackMessage){A.responseText=this.options.fallbackMessage}}}if(!this.options.interstitial){this.hideIntrastitial()}if(this.content.stripWhitespace){A.responseText=A.responseText.replace(/>[ \t\r\n\v\f]*</g,"><")}}.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")}}}}}}},showIntrastitial:function(){this.pi=new ProgressIndicator();this.markup.mainInfo.addClassName("loadingContent");this.markup.mainInfo.insert(this.pi.container)},hideIntrastitial:function(){if(this.pi){this.pi.stop();this.markup.mainInfo.removeClassName("loadingContent");this.pi.container.hide()}},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 C=0;C<A.length;C++){this.markup.mainInfo.appendChild(A[C])}}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{if(this.content.jsTemplate.dataAttributeName){var E=this.trigger.readAttribute(this.content.jsTemplate.dataAttributeName)||this.trigger.getParentByAttribute(this.content.jsTemplate.dataAttributeName).readAttribute(this.content.jsTemplate.dataAttributeName);this.dataJSON=E.unescapeJSON().evalJSON()}else{if(this.content.jsTemplate.dataObj){this.dataJSON=this.content.jsTemplate.dataObj}}if(this.dataJSON.microContentHeading){this.resetHeading(this.dataJSON.microContentHeading)}else{var D=this.getHeadingElement().innerHTML.unescapeHTML();if(D){this.resetHeading(processTemplate(D,this.dataJSON))}else{this.resetHeading("")}}this.markup.mainInfo.update(processTemplate(this.content.jsTemplate.id,this.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"}}},setTemplateData:function(A){this.content.jsTemplate.dataObj=A},getTemplateData:function(A){return this.content.jsTemplate.dataObj},getContentElement:function(){return this.markup.mainInfo},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(C){log.debug("Clearing close link focus timeout");clearTimeout(A);this.stopObserving("mousedown",B)};$("bodyWrapper").observe("mousedown",B)}},resetHeading:function(A){this.getHeadingElement().innerHTML=A},getHeadingElement:function(){return this.markup.dialogTitleH3}};var Microcontent=Class.create(Dialog.Base,{initialize:function(A,D,E){var C={triggerEvent:"mouseover",heading:null,triggerDelay:0,compact:false,displayBeak:true,preferredPosition:"bottomRight",debug:{enabled:false}};var A=$A(A);Object.extend(C,E||{});this.setProperties("Microcontent",D,C);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();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 P={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 I={x:P.x1,y:P.y1+(this.trigger.dim.height/2)};var J={x:P.x2,y:P.y1+(this.trigger.dim.height/2)}}else{var I={x:P.x2,y:P.y1+(this.trigger.dim.height/2)};var J={x:P.x1,y:P.y1+(this.trigger.dim.height/2)}}var d=this.markup.dialogWrapper.getDimensions();var V=function(){var m=0;var l=0;var g;var f;if(this.markup.main.currentStyle){if(this.options.displayBeak){var e=this.markup.beak.currentStyle;var m=(e.height.replace("px",""))*1;var l=(e.width.replace("px",""))*1}var k=this.markup.main.currentStyle;var h=this.markup.mainRight.currentStyle;var g=(k.paddingLeft.replace("px",""))*1;var f=(h.paddingRight.replace("px",""))*1}else{if(this.options.displayBeak){var e=document.defaultView.getComputedStyle(this.markup.beak,"");var m=(e.getPropertyValue("height").replace("px",""))*1;var l=(e.getPropertyValue("width").replace("px",""))*1}var k=document.defaultView.getComputedStyle(this.markup.main,"");var h=document.defaultView.getComputedStyle(this.markup.mainRight,"");var g=(k.getPropertyValue("padding-left").replace("px",""))*1;var f=(h.getPropertyValue("padding-right").replace("px",""))*1}if(this.options.displayBeak){this.offsets={top:(this.markup.bottom.dim.height+(m/2)),right:l-g,bottom:(0-this.markup.top.dim.height-(m/2)),left:(0-(l-f))}}else{this.offsets={top:this.markup.bottom.dim.height,right:0-g*2,bottom:0-this.markup.top.dim.height/2,left:f*2}}this.beakHeight=m}.bind(this);var G=function(){if(this.options.displayBeak){this.markup.beak.className="microcontentBeakRight";this.markup.beak.setStyle({left:d.width+"px"})}V()}.bind(this);var c=function(){if(this.options.displayBeak){this.markup.beak.className="microcontentBeakLeft";this.markup.beak.setStyle({left:"0"})}V()}.bind(this);c();var A={x1:J.x+this.offsets.right+this.triggerContext.pos.x,y1:J.y-d.height+this.offsets.top+this.triggerContext.pos.y,x2:J.x+d.width+this.offsets.right+this.triggerContext.pos.x,y2:J.y+this.offsets.top+this.triggerContext.pos.y};var T={x1:J.x+this.offsets.right+this.triggerContext.pos.x,y1:J.y+this.offsets.bottom+this.triggerContext.pos.y,x2:J.x+d.width+this.offsets.right+this.triggerContext.pos.x,y2:J.y+d.height+this.offsets.bottom+this.triggerContext.pos.y};G();var H={x1:I.x-d.width+this.offsets.left+this.triggerContext.pos.x,y1:I.y-d.height+this.offsets.top+this.triggerContext.pos.y,x2:I.x+this.offsets.left+this.triggerContext.pos.x,y2:I.y+this.offsets.top+this.triggerContext.pos.y};var Y={x1:I.x-d.width+this.offsets.left+this.triggerContext.pos.x,y1:I.y+this.offsets.bottom+this.triggerContext.pos.y,x2:I.x+this.offsets.left+this.triggerContext.pos.x,y2:I.y+d.height+this.offsets.bottom+this.triggerContext.pos.y};var X=Position.calculateViewport();var Q=Position.calculateScroll();var E={x1:Q.x,y1:Q.y,x2:(Q.x+X.width),y2:(Q.y+X.height)};var D=(T.x2<=E.x2)&&(T.y2<=E.y2);var M=(Y.x1>=E.x1)&&(Y.y2<=E.y2);var C=(A.x2<=E.x2)&&(A.y1>=E.y1);var b=(H.x1>=E.x1)&&(H.y1>=E.y1);this.debugPosition({dialogWrapperDimensions:d,topRightBoundingBox:A,topLeftBoundingBox:H,bottomRightBoundingBox:T,bottomLeftBoundingBox:Y,bottomRightGood:D,bottomLeftGood:M,topRightGood:C,topLeftGood:b});var B=function(){G();this.markup.dialogWrapper.setStyle({left:((this.dialogBoundingBox.x1-this.triggerContext.pos.x)/Units.PX_TO_EM)+"em"})}.bind(this);var S=function(){c();this.markup.dialogWrapper.setStyle({left:((this.dialogBoundingBox.x1-this.triggerContext.pos.x)/Units.PX_TO_EM)+"em"})}.bind(this);var U=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 F=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 Z=function(){this.dialogBoundingBox=T;S();F()}.bind(this);var K=function(){this.dialogBoundingBox=A;S();U()}.bind(this);var a=function(){this.dialogBoundingBox=Y;B();F()}.bind(this);var L=function(){this.dialogBoundingBox=H;B();U()}.bind(this);var O=Z;var W=false;if(this.options.preferredPosition=="bottomRight"){if(D){W=true}O=Z}else{if(this.options.preferredPosition=="topRight"){if(C){W=true}O=K}else{if(this.options.preferredPosition=="bottomLeft"){if(M){W=true}O=a}else{if(this.options.preferredPosition=="topLeft"){if(b){W=true}O=L}}}}if(W){O()}else{if(D){Z()}else{if(C){K()}else{if(M){a()}else{if(b){L()}else{O()}}}}}},open:function(C,A){log.debug("Microcontent.open()");if(C){C.preventDefault()}if(this.isOpen){this.close(C)}if(this.isOpen==false&&this.activated==false){this.triggerFocused=true;this.dialogFocused=false;this.activated=true;var B=A||$(Event.element(C));this.inspectTrigger(B);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,D,C){var B="Microcontent.inspectPositioningData:<br/>viewport.height: "+A.height+"<br/>scroll.y: "+D.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(C){log.debug("bottomRightGood: "+C.bottomRightGood+", bottomLeftGood: "+C.bottomLeftGood+", topRightGood: "+C.topRightGood+", topLeftGood: "+C.topLeftGood);var H="border:3px solid green;";var E="border:3px dashed red;";var A="border:3px solid blue;";var D=C.topRightGood?H:E;var B=C.topLeftGood?H:E;var F=C.bottomRightGood?H:E;var G=C.bottomLeftGood?H:E;if(this.options.debug.enabled){this.options.debug.topRightDebugBox=new Element("div",{style:D+"z-index:40; top:"+C.topRightBoundingBox.y1+"px; left:"+C.topRightBoundingBox.x1+"px; width:"+(C.dialogWrapperDimensions.width-6)+"px; height:"+(C.dialogWrapperDimensions.height-6)+"px; position:absolute;"});this.options.debug.topLeftDebugBox=new Element("div",{style:B+"z-index:40; top:"+C.topLeftBoundingBox.y1+"px; left:"+C.topLeftBoundingBox.x1+"px; width:"+(C.dialogWrapperDimensions.width-6)+"px; height:"+(C.dialogWrapperDimensions.height-6)+"px; position:absolute;"});this.options.debug.bottomRightDebugBox=new Element("div",{style:F+"z-index:40; top:"+C.bottomRightBoundingBox.y1+"px; left:"+C.bottomRightBoundingBox.x1+"px; width:"+(C.dialogWrapperDimensions.width-6)+"px; height:"+(C.dialogWrapperDimensions.height-6)+"px; position:absolute;"});this.options.debug.bottomLeftDebugBox=new Element("div",{style:G+"z-index:40; top:"+C.bottomLeftBoundingBox.y1+"px; left:"+C.bottomLeftBoundingBox.x1+"px; width:"+(C.dialogWrapperDimensions.width-6)+"px; height:"+(C.dialogWrapperDimensions.height-6)+"px; position:absolute;"});this.options.debug.triggerDebugBox=new Element("div",{style:A+"z-index:40; top:"+(this.trigger.pos.y-this.triggerContext.pos.y)+"px; left:"+(this.trigger.pos.x-this.triggerContext.pos.x)+"px; width:"+(this.trigger.dim.width-6)+"px; height:"+(this.trigger.dim.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);$("bodyWrapper").appendChild(this.options.debug.triggerDebugBox)}},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();this.options.debug.triggerDebugBox.remove()}}});var Lightbox=Class.create(Dialog.Base,{initialize:function(A,C,D){var B={triggerEvent:"click",interstitial:"",id:"",compact:false,openOnInit:false};Object.extend(B,D||{});this.setProperties("Lightbox",C,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()},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.positionInViewport();this.isFixedAtBottom=false},attachResizeListeners:function(B,D){var C;if(arguments.length>1&&$(D).getElementsByClassName){C=$(D).getElementsByClassName("resizeListener")}else{C=this.markup.dialogWrapper.getElementsByClassName("resizeListener")}for(var A=0;C[A];A++){this.managedEventObservers.add(C[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")},getCurrentDimensions:function(){return this.markup.dialogWrapper.getDimensions()},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,C){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 D=Position.calculatePageHeight();this.markup.mask.dim=this.markup.mask.getDimensions();if(D.height>this.markup.mask.dim.height){this.markup.mask.setStyle({height:D.height+"px"})}if(arguments.length>1){var B=$H(C).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 C=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:C.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<C.y&&this.bottomOfDialog>(C.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(C.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((C.y+A.height)>this.bottomOfDialog){if(!this.isFixedAtBottom){this.markup.dialogWrapper.addClassName("fixed");this.isFixedAtBottom=true}if(this.positionFixedUnsupported()){this.markup.dialogWrapper.setStyle({top:(C.y-this.dialogViewportDiff)+"px"})}else{this.markup.dialogWrapper.setStyle({top:-(this.dialogViewportDiff)+"px"})}}}else{if(C.y<this.lastScroll.y){if(this.positionFixedUnsupported()&&C.y<=this.markup.dialogWrapper.pos.y){this.markup.dialogWrapper.setStyle({top:C.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(C.y<=this.markup.dialogWrapper.pos.y&&!this.isFixedAtTop){this.markup.dialogWrapper.addClassName("fixed");this.markup.dialogWrapper.setStyle({top:0});this.isFixedAtTop=true}}}}}}}this.lastScroll=C},inspectScrollData:function(A,D,C){var B="Lightbox.inspectScrollData:<br/>viewport.height: "+A.height+"<br/>scroll.y: "+D.y+"<br/>page.height: "+C.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.response=null;this.triggers.clear()}});var ContainedLightbox=Class.create(Lightbox,{initialize:function($super,A,B,C){$super(A,B,C)},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(C){C.style.visibility="hidden";return Element.extend(C)});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,D){$super(A,B,D);var C=this.content.url;if(C.indexOf("book")!=-1){this.content.url="/book/bookingpath"}else{this.content.url="/shop/searchForm"}C=C.substr(C.indexOf("?")+1);C=C.replace(/&amp(;|%3B)/g,"&");C=C.replace(/\+/g,"%20");C="changeSearch=true&"+C;this.options.ajaxParameters=C}});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)}});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 C=this.getProjection();if(C){var A=C.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(){var A=this.getPane();A.insertBefore(this.overlay,A.firstChild);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(C,A,B){this.getDomListeners().push(google.maps.event.addDomListener(C,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(C){google.maps.event.trigger(this,"webtrends",C)}.bind(this,A));return B},destroy:function(){this.clearListeners();this.clearDomListeners();this.setMap(null)}});return new BaseOverlay()};var MapInfoWindow=function(C,B){function A(D){Event.extend(D);D.stopPropagation()}MapInfoWindow=function(E,D){this.setProperties("MapInfoWindow",{},{closeLabel:D.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=D;this.setVisible(false);this.setMap(E);this.onAdd()};MapInfoWindow.prototype=Object.extend(new BaseOverlay(),Object.extend(Dialog.Base,{open:function(D,E){if(this.marker!==D){if(this.marker){google.maps.event.trigger(this,"marker_changed",this.marker)}this.setPosition(D.getPosition());this.marker=D;this.clearDomListeners();this.setHeader(E);this.populateInfoWindow(E);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(D){D.infoWindow.setHeader.call(this,D)},populateInfoWindow:function(D){D.infoWindow.populateInfoWindow.call(this,D)},enableStreetview:function(D){var E=new Element("li");var F=new Element("a",{"class":"link streetviewLink",href:"javascript:void(0);"}).update(this.content.streetviewLabel);this.addWebTrendsEventListener(F,"Streetview");this.markup.mainInfo.down(".infoWindowContent ul.pipedList").insert({bottom:E});E.insert({bottom:F});this.addDomListener(F,"click",function(){google.maps.event.trigger(this,"showStreetView",D)}.bind(this))},getPane:function(){return this.getPanes().floatPane},getNorthEast:function(E,F){if(this.marker){var D=this.marker.getPixelBounds();return new google.maps.Point(D.getCenter().x+(F.width/2),D.getNorthEast().y-(F.height))}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.getCenter().x-(F.width/2),D.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(C,B)};var HotelMapInfoWindow={setHeader:function(D){var B=D.resultCardElement;this.markup.dialogTitle.innerHTML="";var A=new Element("h3");var E=B.down("a.hotelNameLink");if(E){this.addWebTrendsEventListener(A.appendChild(E.cloneNode(true)),"Hotel name");this.markup.dialogTitle.appendChild(A)}var C=B.down("img.stars");if(C){this.markup.dialogTitle.appendChild(C.cloneNode(true))}},populateInfoWindow:function(G){var D=G.resultCardElement;var C=new Element("div",{className:"infoWindowContent"});var F=new Element("div",{className:"price"});this.markup.mainInfo.innerHTML="";var I=D.down("a.thumbnail");if(I){this.addWebTrendsEventListener(this.markup.mainInfo.appendChild(I.cloneNode(true)),"Hotel photo")}var P=D.down("div.hotelPriceInfo");if(P){var B=$(P.cloneNode(true));var H=B.down(".totalPriceMicrocontentLink");if(H){H.replace(H.innerHTML)}F.appendChild(B)}var O=D.down("ul.hotelPriceDisclaimers");if(O){F.appendChild(O.cloneNode(true))}C.appendChild(F);var A=D.down(".hotelUserRatingsSummary");if(A){C.appendChild(A.cloneNode(true))}var K=new Element("UL",{"class":"pipedList"});var E=D.down("a.detailsLink");if(E){this.addWebTrendsEventListener(K.appendChild(new Element("LI").update(E.cloneNode(true))),"More hotel details")}C.appendChild(K);this.markup.mainInfo.appendChild(C);var J=D.down(".priceButtonLink");if(J){if(G.datedSearch){J=this.addWebTrendsEventListener(this.markup.mainInfo.appendChild(J.cloneNode(true)),(G.rate)?"Select":"Check rates")}else{J=this.addWebTrendsEventListener(this.markup.mainInfo.appendChild(J.cloneNode(true)),"Check availability")}var L=J.down("a[agent]");if(L){var M=L.getAgents()[0];if(M&&M.type=="MicrocontentAgent"){M.type="ContainedLightboxAgent";M.params.options.container=".resultsMap";M.params.options.closeEvents=["agent:updatingResults"];J.down("a[agent]").stopObserving();J.down("a[agent]").setAttribute("agent",Object.toJSON(M))}}}this.markup.mainInfo.descendants().each(function(Q){Q.removeAttribute("id")});Page.initializeDOMFragment(this.markup.mainInfo);GoogleMapUtil.getStreetView(this.getPosition(),this.enableStreetview.bind(this))}};var MapMarker=function(B){var C=new Element("DIV");var D=C.appendChild(new Element("DIV"));var A=D.appendChild(new Element("DIV"));D.appendChild(new Element("DIV")).className="beakBorder";D.appendChild(new Element("DIV")).className="beak";C.className="mapMarker";D.className="content";A.className="label";C.style.position="absolute";MapMarker=function(E){if(arguments.length){this.init(E)}};MapMarker.prototype=Object.extend(new BaseOverlay(),{init:function(E){this.overlay=C.cloneNode(true);this.overlay.addClassName(E.type+"MapMarker");if(E.classes){this.overlay.addClassName(E.classes)}this.label=this.overlay.down("DIV.label");this.currentPageMarker=E.currentPage;this.type=E.type;if(E.label){this.setLabel(E.label)}else{this.overlay.addClassName("marketMarker")}this.setPosition(E.position);this.setMap(E.map);this.addDomListener(this.overlay,"mouseover",function(){google.maps.event.trigger(this,"mouseover")}.bind(this));this.addDomListener(this.overlay,"mouseout",function(){google.maps.event.trigger(this,"mouseout")}.bind(this));this.addDomListener(this.label,"click",function(){google.maps.event.trigger(this,"click")}.bind(this))},getSize:function(){return this.size||(this.size=BaseOverlay.prototype.getSize.call(this))},setLabel:function(E){this.label.innerHTML=E},getPane:function(){return this.getPanes().overlayImage}});return new MapMarker(B)};var MarketMarker=function(A,D,E,B,C){MarketMarker=function(F,I,J,G,H){this.init(F,I,J,G,H);this.overlay.addClassName("marketMarker")};MarketMarker.prototype=Object.extend(new MapMarker(),{getSize:function(){var F=MapMarker.prototype.getSize.call(this);MarketMarker.prototype.getSize=function(){return F};return this.getSize()}});return new MarketMarker(A,D,E,B,C)};var MarkerToolTip=function(C,A){var B=new Element("DIV");B.style.position="absolute";B.className="markerToolTip";MarkerToolTip=function(D){this.detailsLinkTemplate=A;this.overlay=B;this.setVisible(false);this.setMap(D);this.addDomListener(this.overlay,"mouseover",function(){this.setVisible(true)}.bind(this));this.addDomListener(this.overlay,"mouseout",function(){this.setVisible(false)}.bind(this))};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(C)};var HotelMarkerToolTip={populateToolTip:function(A){if(A.resultCardElement&&(!A.name||!A.detailsURL)){var C=A.resultCardElement.down("a.hotelNameLink");if(!A.name){A.name=C.innerHTML}if(!A.detailsURL){A.detailsURL=C.href}}if(!A.detailsURL){var B=this.detailsLinkTemplate;A.detailsURL=B.replace("hid",A.id).replace("hkey",A.key)}var D='<strong class="name"><a href="'+A.detailsURL+'">'+A.name+"</a></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(D)}};var MapResultSetBase={load:function(){Event.observe(window,"load",function(){this.loadMap()}.bind(this));if(Page.onLoadFired){this.loadMap()}},commonInit:function(){this.resultCardsContainerId=(this.params.resultCardsContainerId?this.params.resultCardsContainerId:"main");this.resultSelectorForPopulatingMarker=(this.params.resultSelectorForPopulatingMarker?this.params.resultSelectorForPopulatingMarker:"div[data-map-info]");this.bigResultsMapContainerSelector=(this.params.bigResultsMapContainerSelector?this.params.bigResultsMapContainerSelector:"#main");Element.extend(document.body).down(this.bigResultsMapContainerSelector);this.disableInfoWindow=(this.params.disableInfoWindow?this.params.disableInfoWindow:false);this.mapState=(this.params.initialMapState?this.params.initialMapState:"wee")},loadMap:function(){if(!this.loaded){this.loaded=true;GoogleMapAPILoader.load(this.mapLoadCallback.bind(this),this.params.locale)}},createMapMarkup:function(){},mapLoadCallback:function(){},getMapMarker:function(C){for(var B=0,A=this.data.length;B<A;B++){if(this.data[B].id==C){return this.markers[B]}}},getMainMarkerData:function(setBounds){var result;var bounds=new google.maps.LatLngBounds();var current=$(this.resultCardsContainerId).select(this.resultSelectorForPopulatingMarker).collect(function(el){var datum=el.getAttribute("data-map-info").evalJSON();datum.resultCardElement=el;datum.currentPage=true;if(setBounds){bounds.extend(new google.maps.LatLng(datum.lat,datum.lng))}return datum});if(setBounds){this.bounds=bounds}var extraMarkers=$("extraMapMarkers");if(extraMarkers){current=current.concat(eval("(["+extraMarkers.innerHTML+"])"))}return current},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()}google.maps.event.trigger(this.map,"resize")},handleCloseZoom:function(){var A=this.map;google.maps.event.addListenerOnce(A,"bounds_changed",function(){if(A.getZoom()>17){A.setZoom(17)}})},onUnload:function(){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,this.params.detailsLinkTemplate))},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(C){var B=this.getStreetView();var A=B.panorama;this.headerWrapper.appendChild(B.backToMapLink);A.setPosition(C.location.latLng);A.setPov({heading:GoogleMapUtil.calculateBearing(C.location.latLng,this.getInfoWindow().getPosition()),pitch:3,zoom:1});A.setVisible(true)},markerClick:function(C,A){if(this.mapState=="collapsed"||this.disableInfoWindow){return false}var B=this.data[C.id];this.getInfoWindow().open(C,B);C.overlay.addClassName("mapMarkerCurrent");this.getMarkerTooltip().close();if(A){this.fireWebTrendsEvent(B.type+" pin")}},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()},markerVisited:function(A){if(this.mapState=="collapsed"){return false}A.overlay.addClassName("mapMarkerVisited")},fireWebTrendsEvent:function(A){this.element.fire("webtrends:multiTrackEvent",{"DCSext.wtNav":"srmap","DCSext.srmap":1,"WT.dl":1,"WT.ti":A})}};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(E,A,B){var D=window.open(E,A,B);if(typeof D=="undefined"){if(document.all){document.getElementById("test").href=E;document.getElementById("test").click()}else{var C=window.open(E,"_blank");C.focus()}}return false},walkAnchors:function(G,E,H,B){var F=1000;var D=0;while(G&&E>0){D++;if(D>=F){var A=function(){OnlineOpinion.util.walkAnchors(G,E,H,B)};setTimeout(A,50);return}if(G.tagName=="A"){if(H.test(G.href)){G.onmousedown=function(){B.Preferences.Plugins.Events.poX=0}}}if(G.tagName=="INPUT"){if(G.type=="submit"||G.type=="image"){G.onmousedown=function(){B.Preferences.Plugins.Events.poX=0}}}if(G.tagName=="FORM"){if(typeof G.onsubmit!="function"){G.onsubmit=function(){B.Preferences.Plugins.Events.poX=0}}else{var I=G.onsubmit;G.onsubmit=function(){B.Preferences.Plugins.Events.poX=0;I()}}}if(G.nodeType==1){var C=/^(script|style|textarea)/i;if(!C.test(G.tagName)&&G.childNodes.length>0){G=G.childNodes[0];E++;continue}}if(G.nextSibling){G=G.nextSibling}else{while(E>0){G=G.parentNode;E--;if(G==null){break}if(G.nextSibling){G=G.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(C){return C};this.f=null};mboxUrlBuilder.prototype.addParameter=function(F,E){var D=new RegExp("('|\")");if(D.exec(F)){throw"Parameter '"+F+"' contains invalid characters"}for(var C=0;C<this.c.length;C++){var B=this.c[C];if(B.name==F){B.value=E;return this}}var A=new Object();A.name=F;A.value=E;this.c[this.c.length]=A;return this};mboxUrlBuilder.prototype.addParameters=function(C){if(!C){return this}for(var B=0;B<C.length;B++){var A=C[B].indexOf("=");if(A==-1||A==0){continue}this.addParameter(C[B].substring(0,A),C[B].substring(A+1,C[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 E=this.f?this.f:"/m2/"+this.b+"/mbox/"+this.o;var D=document.location.protocol=="file:"?"http:":document.location.protocol;var F=D+"//"+this.a+E;var C=F.indexOf("?")!=-1?"&":"?";for(var B=0;B<this.c.length;B++){var A=this.c[B];F+=C+encodeURIComponent(A.name)+"="+encodeURIComponent(A.value);C="&"}return this.t(this.d(F))};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,C){if(!this.y[B]){this.z[this.z.length]=B}this.y[B]=C};mboxMap.prototype.get=function(B){return this.y[B]};mboxMap.prototype.remove=function(B){this.y[B]=undefined};mboxMap.prototype.each=function(E){for(var C=0;C<this.z.length;C++){var B=this.z[C];var D=this.y[B];if(D){E(B,D)}}};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,C){return D.create(B,C)},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(C){C.getUrlBuilder().addParameter("mboxPage",mboxGenerateId());C.load(B)})};mboxFactory.prototype.create=function(A,I,G){if(!this.isSupported()){return null}var H=this.w.clone();H.addParameter("mboxCount",this.E.length()+1);H.addParameters(I);var L=this.E.get(A).length();var D=this.C+"-"+A+"-"+L;var K;if(G){K=new mboxLocatorNode(G)}else{if(this.D){throw"The page has already been loaded, can't write marker"}K=new mboxLocatorDefault(D)}try{var C=this;var F="mboxImported-"+D;var B=new mbox(A,L,H,K,F);if(this.G){B.setFetcher(this.D?new mboxAjaxFetcher():new mboxStandardFetcher())}B.setOnError(function(M,O){B.setMessage(M);B.activate();if(!B.isActivated()){C.disable(60*60,M);window.location.reload(false)}});this.E.add(B)}catch(J){this.disable();throw'Failed creating mbox "'+A+'", the error was: '+J}var E=new Date();H.addParameter("mboxTime",E.getTime()-(E.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(D){D+="&mboxURL="+encodeURIComponent(document.location);var C=encodeURIComponent(document.referrer);if(D.length+C.length<2000){D+="&mboxReferrer="+C}D+="&mboxVersion="+mboxVersion;return D})};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,E){this.I=E;var C=E.getCookieNames("signal-");for(var D=0;D<C.length;D++){var F=C[D];var G=E.getCookie(F).split("&");var A=B(G[0],G);A.load();E.deleteCookie(F)}};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(C){var D=new mboxList();for(var B=0;B<this.E.length;B++){var A=this.E[B];if(A.getName()==C){D.add(A)}}return D};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,C){var A=mboxFactoryDefault.create(C,mboxShiftArray(mboxShiftArray(arguments)),B);return A};mboxUpdate=function(A){mboxFactoryDefault.update(A,mboxShiftArray(arguments))};mbox=function(D,A,B,C,E){this.Ab=null;this.Bb=0;this.gb=C;this.hb=E;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=D;this.Gb();B.addParameter("mbox",D).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 C=this.w.getParameters();var B=new Array();for(var A=0;A<C.length;A++){if(C[A].name.indexOf("mbox")!=0){B[B.length]=C[A].name+"="+C[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(C){if(this.Cb==null){return this}this.setEventTime("load.start");this.cancelTimeout();this.Bb=0;var B=(C&&C.length>0)?this.w.clone().addParameters(C):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 C=A.showContent(B);if(C==1){this.Ib()}return C};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(C,B,A){if(typeof C!="undefined"&&typeof B!="undefined"&&typeof A!="undefined"){var D=new Object();D.name=C;D.value=escape(B);D.expireOn=Math.ceil(A+new Date().getTime()/1000);this.Vb.put(C,D);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(C,D){if(C.indexOf(A)==0){B[B.length]=C}});return B};mboxCookieManager.prototype.saveCookies=function(){var B=new Array();var A=0;this.Vb.each(function(D,E){B[B.length]=D+"#"+E.value+"#"+E.expireOn;if(A<E.expireOn){A=E.expireOn}});var C=new Date(A*1000);document.cookie=this.g+"="+B.join("|")+"; expires="+C.toGMTString()+"; path=/"+this.Ub};mboxCookieManager.prototype.loadCookies=function(){this.Vb=new mboxMap();var E=document.cookie.indexOf(this.g+"=");if(E!=-1){var G=document.cookie.indexOf(";",E);if(G==-1){G=document.cookie.indexOf(",",E);if(G==-1){G=document.cookie.length}}var A=document.cookie.substring(E+this.g.length+1,G).split("|");var C=Math.ceil(new Date().getTime()/1000);for(var B=0;B<A.length;B++){var F=A[B].split("#");if(C<=F[2]){var D=new Object();D.name=F[0];D.value=F[1];D.expireOn=F[2];this.Vb.put(D.name,D)}}}};mboxSession=function(D,E,C,A,B){this.hc=E;this.pb=C;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(C);if(this.yb==null||this.yb.length==0){this.yb=D;this.jc=true}}B.setCookie(C,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(C,A,B){this.pb=C;this.ic=A;this.I=B;this.yb=typeof mboxForcePCId!="undefined"?mboxForcePCId:B.getCookie(C);if(this.yb!=null){B.setCookie(C,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 D=null;var A=new RegExp(B+"=([^&]*)");var C=A.exec(document.location);if(C!=null&&C.length>=2){D=C[1]}return D};mboxSetCookie=function(C,B,A){return mboxFactoryDefault.getCookieManager().setCookie(C,B,A)};mboxGetCookie=function(A){return mboxFactoryDefault.getCookieManager().getCookie(A)};mboxCookiePageDomain=function(){var B=(/([^:]*)(:[0-9]{0,5})?/).exec(document.location.host)[1];var C=/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/;if(!C.exec(B)){var A=(/([^\.]+\.[^\.]{3}|[^\.]+\.[^\.]+\.[^\.]{2})$/).exec(B);if(A){B=A[0]}}return B?B:""};mboxShiftArray=function(B){var C=new Array();for(var A=1;A<B.length;A++){C[C.length]=B[A]}return C};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 D=/:[1-9]+[0-9]*$/;var B=this.getCookie();for(var C=0,A=B.length;C<A;C++){if(B[C].search(D)!=-1){return true}}return false},updateMyTests:function(E,A){var I=28;var C=new Date();C.setTime(C.getTime()+(I*86400000));var D="expires="+C.toGMTString();var G=this.getCookie();var F=E+":";var B=A;for(var H=0,J=G.length;H<J;H++){if(G[H].indexOf(F)==0){G[H]=F+B;break}}document.cookie=this.cookieName+"="+G.join("|")+"; "+D+"; path=/"}};function dcsCookie(){if(typeof(dcsOther)=="function"){dcsOther()}else{if(typeof(dcsPlugin)=="function"){dcsPlugin()}else{if(typeof(dcsFPC)=="function"){dcsFPC(gTimeZone)}}}}function dcsGetCookie(B){var D=document.cookie.indexOf(B+"=");if(D!=-1){var C=D+B.length+1;var A=document.cookie.indexOf(";",C);if(A==-1){A=document.cookie.length}return unescape(document.cookie.substring(C,A))}return null}function dcsGetCrumb(B,A){var D=dcsGetCookie(B).split(":");for(var C=0;C<D.length;C++){var E=D[C].split("=");if(A==E[0]){return E[1]}}return null}function dcsGetIdCrumb(C,A){var B=dcsGetCookie(C);var F=B.substring(0,B.indexOf(":lv="));var E=F.split("=");for(var D=0;D<E.length;D++){if(A==E[0]){return E[1]}}return null}function dcsFPC(E){if(typeof(E)=="undefined"){return}if(document.cookie.indexOf("WTLOPTOUT=")!=-1){return}var A=gFpc;var J=new Date();var I=(J.getTimezoneOffset()*60000)+(E*3600000);J.setTime(J.getTime()+I);var D=new Date(J.getTime()+315360000000);var K=new Date(J.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 L=J.getTime().toString();for(var G=2;G<=(32-L.length);G++){WT.co_f+=Math.floor(Math.random()*16).toString(16)}WT.co_f+=L;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 C=parseInt(dcsGetCrumb(A,"lv"));var M=parseInt(dcsGetCrumb(A,"ss"));if((B==null)||(B=="null")||isNaN(C)||isNaN(M)){return}WT.co_f=B;var F=new Date(C);WT.vt_f_tlh=Math.floor((F.getTime()-I)/1000);K.setTime(M);if((J.getTime()>(F.getTime()+1800000))||(J.getTime()>(K.getTime()+28800000))){WT.vt_f_tlv=Math.floor((K.getTime()-I)/1000);K.setTime(J.getTime());WT.vt_f_s="1"}if((J.getDay()!=F.getDay())||(J.getMonth()!=F.getMonth())||(J.getYear()!=F.getYear())){WT.vt_f_d="1"}}WT.co_f=escape(WT.co_f);WT.vt_sid=WT.co_f+"."+(K.getTime()-I);DCSext.wsid=getSessionID("logging")||getSessionID("JSESSIONID");if(document.cookie.indexOf("anon")!=-1){DCSext.avid=dcsGetCookie("anon")}var H="; expires="+D.toGMTString();document.cookie=A+"=id="+WT.co_f+":lv="+J.getTime().toString()+":ss="+K.getTime().toString()+H+"; 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 C=B.target||B.srcElement;while(C.tagName&&(C.tagName!=A)){C=C.parentElement||C.parentNode}return C}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");dcsCustom();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(D){var F=D.onclick.toString();var B=F.substring(F.indexOf("dcsSetVar(")+10,F.length);var C=B.substring(0,B.indexOf(");")).replace(/\s"/gi,"").replace(/"/gi,"");var E=C.split(",");if(E.length!=-1){for(var A=0;A<E.length;A+=2){if(E[A].indexOf("WT.")==0){WT[E[A].substring(3)]=E[A+1]}else{if(E[A].indexOf("DCS.")==0){DCS[E[A].substring(4)]=E[A+1]}else{if(E[A].indexOf("DCSext.")==0){DCSext[E[A].substring(7)]=E[A+1]}}}}}}function dcsNavigation(C){try{var B=0;while(B!=1){if(C.parentNode.tagName!="DIV"){C=C.parentNode}if(C.parentNode.tagName=="DIV"){if((C.parentNode.getAttribute("id"))||(C.parentNode.className)){DCSext.wtNav=C.parentNode.getAttribute("id")||C.parentNode.className;B=1}else{C=C.parentNode}}}}catch(A){}}function dcsDownload(A){A=A||(window.event||"");if(A){var D=dcsEvt(A,"A");if(D){if(D.href&&D.hostname&&D.protocol&&(D.protocol.indexOf("http")!=-1)){if(D.getAttribute("delegatedtracking")=="true"){}else{dcsNavigation(D);if((navigator.appVersion.indexOf("MSIE")==-1)&&(D.onclick)){dcsSetVarCap(D)}var C=D.pathname?((D.pathname.indexOf("/")!=0)?"/"+D.pathname:D.pathname):"/";if(document.all){var B=D.innerText||D.innerHTML||""}else{var B=D.textContent.replace(/^\s+/,"").replace(/\s+$/,"")||D.innerHTML||""}dcsMultiTrack("DCS.dcssip",D.hostname,"DCS.dcsuri",C,"DCS.dcsqry",D.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=C=""}}}}}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 C=B.pathname?((B.pathname.indexOf("/")!=0)?"/"+B.pathname:B.pathname):"/";dcsMultiTrack("DCS.dcssip",B.hostname,"DCS.dcsuri",C,"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(H){H=H||(window.event||"");if(H){var I="INPUT,BUTTON,SPAN";var G=I.toUpperCase().split(",");for(var B=0;B<G.length;B++){var D=dcsEvt(H,G[B]);var F=D.type||"";if(F&&((F=="submit")||(F=="image")||(F=="button")||(F=="reset"))||((F=="text")&&((H.which||H.keyCode)==13))){var A=gTitle=gMethod=qry="";dcsNavigation(D);if(D.form){A=D.form.action||window.location.pathname;gTitle=D.form.id||D.form.className||D.form.name||"Unknown";gMethod=D.form.method||"Unknown"}else{A=window.location.pathname;gTitle=D.name||D.id||D.className||"Unknown";gMethod="Input"}if((A!="")&&(gTitle!="")&&(gMethod!="")&&(H.keyCode!=9)){if(A.indexOf("?")!=-1){var C=A.split("?");A=C[0];qry=C[1]}if(A.indexOf("http://")!=-1||A.indexOf("https://")!=-1){var E=A.substr(7).split("/");A="";for(var B=1;B<E.length;B++){A+="/"+E[B]}}dcsMultiTrack("DCS.dcssip",D.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 C=0;C<document.links.length;C++){var A=document.links[C].href+"";var F=A.toUpperCase().indexOf("WT.AC=");if(F!=-1){var E=F+6;var B=A.indexOf("&",E);var D=A.substring(E,(B!=-1)?B:A.length);WT.ad=WT.ad?(WT.ad+";"+D):D}}}}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.tld=DCSext.tld;_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 E=10;E>0;E--){try{var D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+E);WT.fi="Yes";WT.fv=E+".0";break}catch(G){}}}else{if(navigator.plugins&&navigator.plugins.length){for(var E=0;E<navigator.plugins.length;E++){if(navigator.plugins[E].name.indexOf("Shockwave Flash")!=-1){WT.fi="Yes";WT.fv=navigator.plugins[E].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 E=0;E<gQP.length;E++){var H=DCS.dcsqry.indexOf(gQP[E]);if(H!=-1){var F=DCS.dcsqry.substring(0,H);var A=DCS.dcsqry.substring(H+gQP[E].length,DCS.dcsqry.length);DCS.dcsqry=F+A}}}}if((window.document.referrer!="")&&(window.document.referrer!="-")){var C=window.document.referrer;if(C.split("?")[0].indexOf(window.location.hostname)!=-1){C=C.split("?")[0]}if(!(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)<4)){DCS.dcsref=gI18n?dcsEscape(C,I18NRE):C}}}function dcsA(B,A){return"&"+B+"="+dcsEscape(A,RE)}function dcsEscape(A,B){if(typeof(B)!="undefined"){var C=new String(A);for(R in B){C=C.replace(B[R],R)}return C}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 C=A.item(B-1);if(C.name){if(C.name.indexOf("WT.")==0){WT[C.name.substring(3)]=(gI18n&&(C.name.indexOf("WT.ti")==0))?dcsEscape(dcsEncode(C.content),I18NRE):C.content}else{if(C.name.indexOf("DCSext.")==0){DCSext[C.name.substring(7)]=C.content}else{if(C.name.indexOf("DCS.")==0){DCS[C.name.substring(4)]=(gI18n&&(C.name.indexOf("DCS.dcsref")==0))?dcsEscape(C.content,I18NRE):C.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 I=parseInt(navigator.appVersion);var H=(B.indexOf("mac")!=-1);var M=((B.indexOf("mozilla")!=-1)&&(B.indexOf("compatible")==-1));var C=(M&&(I==4));var L=(M&&(I>=5));var A=((B.indexOf("msie")!=-1)&&(B.indexOf("opera")==-1));var D=(A&&(I==4)&&(B.indexOf("msie 4")!=-1));var E=(A&&!D);var G=(B.indexOf("opera")!=-1);var K=(B.indexOf("opera 5")!=-1||B.indexOf("opera/5")!=-1);var J=(B.indexOf("opera 6")!=-1||B.indexOf("opera/6")!=-1);var F=(G&&!K&&!J);var O="1.1";if(L||F){O="1.5"}else{if((H&&E)||J){O="1.4"}else{if(E||C||K){O="1.3"}else{if(D){O="1.2"}}}}return O}function dcsFunc(A){if(typeof(window[A])=="function"){window[A]()}}function dcsUnQry(A){var B=DCS.dcsqry.indexOf(A);if(B!=-1){var F=DCS.dcsqry.substring(0,B);var D=DCS.dcsqry.substring(B+A.length+1);var C="";var E;if(D.indexOf("&")==-1){E=D}else{E=D.substring(0,D.indexOf("&"));C=D.substring(E.length+1)}if(A.substring(0,3)=="WT."){WT[A.substring(3)]=E}else{if(A.substring(0,4)=="DCS."){DCS[A.substring(4)]=E}else{DCSext[A]=E}}DCS.dcsqry=F+C}}function dcsCustom(){if(DCS.dcsqry){dcsUnQry("WT.mc_id");dcsUnQry("gcid");var C=DCSext.gcid;if(C){var A=C.indexOf("-");var B=C.substring(A+1,A+3);if(B=="CY"||B=="DN"||B=="OG"){DCSext.gcid=C.substring(0,A)}WT.mc_id=DCSext.gcid}}}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");dcsCustom();dcsTag();dcsCleanUp()}function getSessionID(E){var C=document.cookie;var B=C.lastIndexOf(E+"=");if(B==-1){return null}var D=C.substring(B+E.length+1);var A=D.indexOf(";");if(A==-1){A=D.length}D=D.substring(0,A);D=D.split("|")[0];return D}var BrTrk={getTracker:function(B,A){return(new BrTrkClass(B,A))}};var BrUtils={returnObjById:function(A){if(document.getElementById){var B=document.getElementById(A)}else{if(document.all){var B=document.all[A]}else{if(document.layers){var B=document.layers[A]}}}return B},isValid:function(A){return(A!=null)},addEvent:function(A,B,C){if(A.addEventListener){A.addEventListener(B,C,true)}else{if(A.attachEvent){A.attachEvent("on"+B,C)}else{A["on"+B]=C}}},onLoadHandler:function(B,A){if(B.addEventListener){B.addEventListener("DOMContentLoaded",A,false)}else{if(B.attachEvent){B.attachEvent("onreadystatechange",function(){if(B.readyState==="complete"){A()}})}}}};function BrTrkClass(Aa,Y){var AA="http://lb-static1-1568763564.us-east-1.elb.amazonaws.com/pix.gif";var At="https://cdns.brsrvr.com/pix.gif";var Av="_br_uid_1";var X="_br_uid_2";var AR=undefined;var Ap=undefined;var Aw=undefined;var AM=undefined;var AG=[5000,25000,75000,150000];var AJ=undefined;var Ay=undefined;var Au=undefined;this.version=Aa;this.data=Y;function Al(){if(typeof br_related_rid!="undefined"&&BrUtils.isValid(br_related_rid)){Aw=br_related_rid}}function Ao(A){var C=[];for(var B in A){C.push(B+"="+encodeURIComponent(A[B]))}return C.join("&")}function Ax(C){var B=C.split(".");var A=B.length;if(A<=2){return C}if(B[A-1].length<=2&&B[A-2].length<=3){return B[A-3]+"."+B[A-2]+"."+B[A-1]}else{return B[A-2]+"."+B[A-1]}}function AE(A,C,B){var E=new Date();E.setDate(E.getDate()+365*100);var D=A+"="+escape(C)+"; expires="+E.toGMTString()+"; path=/";if(BrUtils.isValid(B)){D=D+"; domain="+B}document.cookie=D}function AL(A){if(BrUtils.isValid(document.cookie)&&(document.cookie.length>0)){var C=document.cookie.indexOf(A+"=");if(C!=-1){C=C+A.length+1;var B=document.cookie.indexOf(";",C);if(B==-1){B=document.cookie.length}return unescape(document.cookie.substring(C,B))}}return""}function AF(D,B){var C=B.split("_");for(var A in C){if(C[A]==D){return true}}return false}function Ak(){var B=AL(Av);if(BrUtils.isValid(B)&&B.length>0){AR=B;return}var A=Math.round(Math.random()*10000000000000);AR="uid="+A+":";AE(Av,AR);AR=AL(Av)}function Af(){var D=AL(Av);var E=AL(X);var A=false;if(BrUtils.isValid(D)&&D.length>0){AR=D;A=true}var B=(BrUtils.isValid(E)&&E.length>0);var C=Math.round(Math.random()*10000000000000);if(!A){AR="uid="+C+":";AE(Av,AR);AR=AL(Av)}if(!B){E=AR+":"}else{if(!AF(AR,E)){E=E+"_"+AR}}if(E!=Ap&&E.length<1000){var F=Ax(document.domain);AE(X,E,F);Ap=AL(X)}}function An(B,C,D){for(var A=0;A<B.length;A++){if(BrUtils.isValid(B[A].getAttribute("name"))){if(B[A].getAttribute("name").toLowerCase()==C){return B[A].getAttribute("content").substr(0,D)}}if(BrUtils.isValid(B[A].getAttribute("NAME"))){if(B[A].getAttribute("NAME").toLowerCase()==C){return B[A].getAttribute("CONTENT").substr(0,D)}}}return""}function Ag(B){var A=document.getElementsByTagName("meta");if(!BrUtils.isValid(A)||A.length==0){A=document.getElementsByTagName("META")}B.mk=An(A,"keywords",200);B.md=An(A,"description",200);return B}function AC(B){var J=document.getElementsByTagName("img");if(!BrUtils.isValid(J)){return B}var M=[];var C={};var K=0;for(var H=0;H<J.length;H++){var E=5;var A=5;if(BrUtils.isValid(J[H].width)){A=J[H].width;if(A<=10){continue}}if(BrUtils.isValid(J[H].height)){E=J[H].height;if(E<=10){continue}}if(BrUtils.isValid(J[H].getAttribute("src"))){var D=J[H].getAttribute("src");if(!BrUtils.isValid(D)){continue}if(!(D in C)){M[K++]=J[H];C[D]=1}}}M.sort(function(P,Q){var O=0;if(BrUtils.isValid(Q.height)&&BrUtils.isValid(Q.width)){O=Q.height*Q.width}var S=0;if(BrUtils.isValid(P.height)&&BrUtils.isValid(P.width)){S=P.height*P.width}return(O-S)});var I=[];var L=5;if(L>M.length){L=M.length}var G=0;var F=0;for(var H=0;H<L;H++){if(BrUtils.isValid(M[H].getAttribute("src"))){F=F+M[H].getAttribute("src").length;if(F>500){break}I[G++]=M[H].getAttribute("src")}}B.briu=I.join(":::");return B}function Az(){var A=Y;A.version=Aa;A.url=location.href;if(Y.explicit_referrer&&Y.explicit_referrer!=""){A.ref=Y.explicit_referrer}else{A.ref=document.referrer}if(A.acct_id=="4024"&&(!A.ref||A.ref=="")){if(s.referrer){A.ref=s.referrer}}A.sid=Aw;A.cookie=AR;A.cookie2=Ap;A.rand=Math.random();return A}function Ar(B){var A=Ao(B);var D=new Image();if(A.length>1900){A=A.substr(0,1900)+"&tr=1"}var C=("https:"==document.location.protocol)?At:AA;D.src=C+"?"+A}function AP(){var A=Az();A.type="pageview";if(BrUtils.isValid(document.title)){A.title=document.title.substr(0,200)}AB();if(BrUtils.isValid(AJ)){A.fbappid=AJ;A.fbacctok=Au;A.fbuid=Ay}if(Y.acct_id=="4041"){Ag(A)}if(Y.acct_id=="4041"||Y.acct_id=="4014"||Y.acct_id=="4034"){AC(A)}Ar(A)}function Am(){var A=Az();A.type="showclick";Ar(A)}function Ah(){var A=Az();A.type="hideclick";Ar(A)}function AK(){var A=BrUtils.returnObjById("br_show_id");if(!BrUtils.isValid(A)){setTimeout(function(){AK()},1000);return}BrUtils.addEvent(A,"mousedown",function(){Am()})}function Ai(){var A=BrUtils.returnObjById("br_hide_id");if(!BrUtils.isValid(A)){setTimeout(function(){Ai()},1000);return}BrUtils.addEvent(A,"mousedown",function(){Ah()})}function Aq(A){var B=Az();B.type="linkclick";B.link=A;if(BrUtils.isValid(this.startTime)){B.time=(new Date()).getTime()-this.startTime}Ar(B)}function AI(A){if(BrUtils.isValid(A)&&BrUtils.isValid(A.href)){BrUtils.addEvent(A,"mousedown",function(){Aq(A.href)})}}function AH(A){if(!BrUtils.isValid(A)){return}var C=A.getElementsByTagName("a");if(!BrUtils.isValid(C)){return}for(var B=0;B<C.length;++B){AI(C[B])}}function As(B){var A=BrUtils.returnObjById("br-related-searches-widget");if(!BrUtils.isValid(A)&&B){BrUtils.onLoadHandler(document,function(){As(false)});return}AH(A)}function AN(B){var A=Az();A.type="sitetime";A.time=AG[B];Ar(A)}function AQ(){for(var A=0;A<AG.length;++A){(function(B){setTimeout(function(){AN(B)},AG[B])})(A)}}function Ac(){if(Y.acct_id=="4024"&&(!Y.explicit_referrer||Y.explicit_referrer=="")&&(!document.referrer||document.referrer=="")){setTimeout(function(){AP()},1000)}else{AP()}As(true);if(Y.acct_id=="4035"){AQ()}if(Y.acct_id=="4041"){AK();Ai();Z()}}function Ab(){BrUtils.onLoadHandler(document,function(){AH(document)})}function Ae(){this.startTime=(new Date()).getTime();Af();Al()}function Z(){if(typeof FB==="undefined"){setTimeout(Z,1000);return}Aj()}function AD(A){var B=Az();B.type="fblikebtnclick";B.link=A;AB();if(BrUtils.isValid(AJ)){B.fbappid=AJ;B.fbacctok=Au;B.fbuid=Ay}if(BrUtils.isValid(this.startTime)){B.time=(new Date()).getTime()-this.startTime}Ar(B)}function Aj(){AO()}function AO(){FB.Event.subscribe("edge.create",function(A){AD(A)})}function AB(){var C=Ad();for(key in C){if(key.indexOf("fbs_")==0){AJ=key.split("_")[1];var D=C[key].replace(/^"+|"+$/g,"");var B=D.split("&");for(i=0;i<B.length;i++){var A=B[i].split("=");if(A[0]=="access_token"){Au=A[1]}else{if(A[0]=="uid"){Ay=A[1]}}}}}}function Ad(){var G=[];if(BrUtils.isValid(document.cookie)&&(document.cookie.length>0)){var F=document.cookie.replace(/,/g,";");var E=F.split(";");for(i=0;i<E.length;i++){var D=E[i].replace(/^\s+|\s+$/g,"");var C=D.indexOf("=");var A=D.substring(0,C);var B=D.substring(C+1).replace(/^"+|"+$/g,"");G[A]=B}}return G}this.enableTracking=Ac;this.logPageView=AP;this.enableLinkTracking=As;this.enableTimeTracking=AQ;this.enableFullLinkTracking=Ab;this.enableFBLikeButtonClickTracking=Aj;this.enableShowTracking=AK;this.enableHideTracking=Ai;Ae()}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 I=[];var G=this.iframe.contentWindow.document.body.all;for(var F=0;F<G.length;F++){if(G[F].tagName=="OBJECT"){I.push(G[F])}}var E=0;var D=0;for(var F=0;F<I.length;F++){var H=$(I[F]).getDimensions();H.width=I[F].width>H.width?I[F].width:H.width;H.height=I[F].height>H.height?I[F].height:H.height;E=H.width>E?H.width:E;D=H.height>D?H.height:D}this.iframe.width=E+"px";this.iframe.height=D+"px";this.repairBadUrlTargets();if(this.debug&&I.length>0){log.debug("Advert: IE6 OBJECT tag: "+E+"px x "+D+"px")}}}.bind(this),B);this.repairBadUrlTargets=function(){var D=$A(this.iframe.contentWindow.document.getElementsByTagName("A"));var F=$A(this.iframe.contentWindow.document.getElementsByTagName("AREA"));var E=D.concat(F);for(var G=0;G<E.length;G++){if(Element.hasAttribute(E[G],"href")){var H=E[G].target.toLowerCase();if(H===""||(H!=="_blank"&&H!=="_parent"&&H.indexOf("_")==0)){if(H===""){H="undeclared"}if(this.debug){log.debug("Advert: repairing link target: "+H+" -&gt; _parent")}E[G].target="_parent"}}}};this.fixIE6Glitch=function(){if(window.isIE6){var D=$(this.iframe.parentNode);D.hide();D.show()}};var C=function(){contentWindow=this.iframe.contentWindow;contentBody=contentWindow.document.body;if(contentBody){var G=contentBody.scrollWidth;var F=contentBody.scrollHeight;this.iframe.width="0px";this.iframe.height="0px";var E=contentBody.scrollWidth;var D=contentBody.scrollHeight;if(E>0&&D>0){window.clearInterval(this.resizerInterval);window.clearTimeout(this.resizerTimeout);this.resizerInterval=null;this.resizerTimeout=null;this.iframe.width=E+"px";this.iframe.height=D+"px";this.iframe.style.visibility="visible";contentWindow.resized=true;this.repairBadUrlTargets();if(this.debug){log.debug("Advert: resized: "+E+"px x "+D+"px")}}else{this.iframe.width=G+"px";this.iframe.height=F+"px"}}}.bind(this);this.iframe=A;this.fixIE6Glitch();this.resizerInterval=window.setInterval(C,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 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(E){var F=$((new Element("div")).update(E.responseText).getElementsByClassName("details")[0]);if(F){this.swapContent.replace(F);this.pi.stop();this.pi=null;this.swapContent=F;Page.initializeDOMFragment(this.swapContent);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 H=$A((new Element("div")).update(E.responseText).getElementsByClassName("error"));if(H.length!=0){var G=this.swapContent.up(".resultsCardPanelAir");G.setStyle({position:"relative"});var C=new Element("div",{"class":"resultMask"});C.setOpacity(0.8);C.setStyle({width:G.getWidth()+"px",height:G.getHeight()+"px",top:"0px"});var D=$(new Element("div"));D.addClassName("airResultsError");H.each(function(I){D.insert({bottom:I})});G.insert({bottom:C});G.insert({bottom:D});D.setStyle({width:G.getWidth()+"px",marginTop:(((G.getHeight()-D.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 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 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 C=this.checkboxes[0].checked;for(var B=1;B<A;B++){if(this.checkboxes[B].checked!=C){return false}}return true},checkAny:function(){this.anyCheckbox.checked=true;this.anyCheckbox.disabled=true;this.uncheckOthers()},uncheckAny:function(){this.anyCheckbox.disabled=false;this.anyCheckbox.checked=false},uncheckOthers:function(){this.checkboxes.each(function(A){A.checked=false})}});var AutoSubmitter=Class.create();AutoSubmitter.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){setTimeout(function(){this.element.click()}.bind(this),500)}});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(C){var B=this.input.value.strip();B=B.escapeRegex();B=new RegExp("("+B+")","im");var A=$(C).select("li");A.each(function(D){D.cleanWhitespace();$A(D.childNodes).each(function(F){if(F.nodeName=="#text"){var E=new Element("span").update(F.nodeValue.replace(B,'<span class="match">$1</span>'));D.replaceChild(E,F)}})});return C},matchResults:function(){if(this.autocompleter.results){var A=this.input.value.strip().toLowerCase();var C=this.autocompleter.results;for(var B=0;B<C.length;B++){if(A==C[B].suggestion.toLowerCase()){this.additionalInfo.value=C[B].additionalInfo;break}}}}});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(C){C.showByClass()}.bind(this))}else{this.targetFields.each(function(C){C.hideByClass()}.bind(this))}}});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(E){for(i=0;i<this.creditCardList.length;i++){if(this.creditCardList[i].code==Event.element(E).value){var A=Element.extend(this.content3DSBlock[1]).getElementsBySelector(".cc3DSContentItem");var C=this.creditCardList[i].secureLogoCode;var D="cc3DSContentItem"+C;for(var B=0;B<A.length;B++){if(D.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 DatePickerWidget=Class.create();DatePickerWidget.prototype={daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],initialize:function(A,D,C,B){log.info("initializing DatePickerWidget for input "+C);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=C===0;this.dateInputIndex=C;this.params=this.dateInputObj.params;this.target=$(D);this.calContainer=$(document.body);this.container=$(D.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(!this.calContainer.calendarWidget){this.calContainer.calendarWidget=new CalendarWidget(this.today,this.calContainer,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,container:this.calContainer})},updateMonths:function(){var D,B=this.isFirstDate?this.cloneDateObject(this.today):this.cloneDateObject(this.dateInputObj.validateDate(this.dateInputObj.dateInputArray[this.dateInputIndex-1].value));if(this.selectedDate!=null){D=this.selectedDate.getMonth()}this.minDate=this.cloneDateObject(B);this.monthSelect.innerHTML="";B.setDate(1);this.initialized=false;while(B<=this.maxDate){var E=B.getMonth();var C=B.getFullYear();var A=new Element("option").update(this.params.abbrMonths[E]+" "+C);A.setAttribute("value","["+E+","+C+"]");if(E==D){A.setAttribute("selected","selected")}this.monthSelect.appendChild(A);B.setMonth((E+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);var isLeapYear=((year%4==0&&year%100!=0)||year%400==0);var normalDays=this.daysPerMonth[month];var daysInMonth=month==1&&isLeapYear?normalDays+1:normalDays;for(var i=day;i<=daysInMonth;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={NUM_WEEKS:6,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],X_OFFSET:60,Y_OFFSET:-82,initialize:function(A,C,B){log.info("initializing CalendarWidget");this.today=A;this.container=C||$(document.body);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(){this.element=new Element("div").addClassName("calendar noneBlock");this.element.setAttribute("data-context","calendar");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 I=$A();var V=document.createDocumentFragment();var T=new Element("table",{cellpadding:0,cellspacing:0,border:0});var G=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);G.appendChild(this.previousArrow);this.monthName=new Element("span").addClassName("monthName");G.appendChild(this.monthName);G.appendChild(this.nextArrow);T.appendChild(new Element("thead")).appendChild(new Element("tr")).appendChild(new Element("th",{colspan:this.params.days.length})).appendChild(G);var S=document.createDocumentFragment();for(var P=0;this.params.days[P];P++){var J=(P+Number(this.params.firstDayOfWeekIndex))%this.params.days.length;var H=new Element("th");var B=new Element("span").update(this.params.days[J]);H.appendChild(B);S.appendChild(H)}var A=new Element("tbody");A.appendChild(new Element("tr")).appendChild(S);var D=document.createDocumentFragment();var C=document.createDocumentFragment();for(var P=0;this.params.days[P];P++){var K=new Element("td");var Q=new Element("span");K.appendChild(Q);C.appendChild(K)}var U=new Element("tr").addClassName("week");U.appendChild(C);D.appendChild(U);for(var O=1;O<this.NUM_WEEKS;O++){var L=U.cloneNode(true);if(O===this.NUM_WEEKS-1){L.addClassName("last")}D.appendChild(L)}A.appendChild(D);if("ontouchstart" in document){Event.observe(A,"click",this.dateTouch.bindAsEventListener(this))}else{Event.observe(A,"mousedown",this.selectDate.bindAsEventListener(this))}Event.observe(A,"mouseover",this.highlight.bindAsEventListener(this));Event.observe(A,"mouseout",this.clearHighlight.bindAsEventListener(this));T.appendChild(A);var F=A.getElementsByTagName("td");for(var P=0;F[P];P++){var K=F[P].down("span");I.push(K)}var M=new Element("span").update(this.params.close);var E=new Element("div").addClassName("closeBar");E.appendChild(M);V.appendChild(T);V.appendChild(E);Event.observe(this.nextArrow,"click",function(W){this.changeMonth(W,true)}.bindAsEventListener(this));Event.observe(this.previousArrow,"click",function(W){this.changeMonth(W,false)}.bindAsEventListener(this));Event.observe(M,"click",this.hideCalendar.bindAsEventListener(this));this.element.addClassName("active");this.calBody.appendChild(V);this.container.appendChild(this.element);return I},repositionAndShim:function(){var A=new Element("iframe");A.src="/cacheable/empty.html";this.element.insertBefore(A,this.element.childNodes[0])},showAndPosition:function(A){if(this.container!==A.memo.container){return}var J=A.memo.dateInputObj;this.calendarFocused=false;var K=this.eventElement;log.info("previous event element="+K);this.eventElement=A.memo.targetInput?A.memo.targetInput:Event.element(A.memo.rootEvent);this.maxDate=A.memo.maxDate;this.minDate=A.memo.minDate;if(K!=this.eventElement||!this.element.visibleByClass()){if(this.element.visibleByClass()){this.element.hideByClass()}var F=this.eventElement.positionedOffset();var H=$(document.viewport);var I=H.getDimensions();var C=H.getScrollOffsets();var M=this.eventElement.getOffsetParent().cumulativeOffset();var G={top:C.top-M[1],bottom:I.height+C.top-M[1]-147};var E=(F[0]+this.X_OFFSET);var B=(F[1]+this.Y_OFFSET);if(B>G.bottom){B=G.bottom}if(B<G.top){B=G.top}if(E<1){E=1}if(B<1){B=1}this.element.style.left=E+"px";this.element.style.top=B+"px";var D=true;var L=J.validateDate(this.eventElement.value);if(L===null){L=this.today;D=false}this.calDate=this.minDate>L?this.minDate:L;this.dateInInput=this.cloneDateObject(L);this.update(this.minDate,D);if(!this.element.visibleByClass()){this.element.showByClass()}}if(!A.memo.targetInput){this.eventElement.select()}},update:function(L,I){log.info("calling calendar.update()");var W=false;if(L==null){L=this.today;W=true}var U=this.calDate.getMonth();var f=this.calDate.getFullYear();var F=this.cloneDateObject(this.calDate);F.setDate(1);var c=F.getDay()-Number(this.params.firstDayOfWeekIndex);var D=(c<0?c+7:c);var a=L.getMonth();var e=L.getFullYear();var E=this.maxDate.getMonth();var X=this.maxDate.getFullYear();var O=U==a&&f==e;var P=U==E&&f==X;var K=(f<e)||(U<a&&f==e);var Y=(f>X)||(U>E&&f==X);var J=this.getDaysInMonth(U,f);if(O){this.previousArrow.hide()}else{this.previousArrow.show()}if(P){this.nextArrow.hide()}else{this.nextArrow.show()}this.monthName.update(this.params.months[U]+" "+f);var F=this.cloneDateObject(this.calDate);F.setDate(1);var c=F.getDay()-Number(this.params.firstDayOfWeekIndex);var D=(c<0?c+7:c);var b=false;var M=U-1,B=U+1;var S=f,G=f;if(M<0){M=11;S=f-1}if(B>11){B=0;G=f+1}var C=this.getDaysInMonth(M,S);for(var Z=0;this.days[Z];Z++){var Q=(Z-D+1);var T=this.days[Z];T.className="";T.setAttribute("data-date","");T.update("&nbsp;");if(Z==D){b=true}var V=C+Z-D+1;var H=Z-D-J+1;var d=L.getDate();var A=((K||(Q<d&&O)||(Z<D&&V<d))||(Y||(Q>this.maxDate.getDate()&&P)));if(A){T.addClassName("inactive")}if(Q==L.getDate()&&O&&W){T.addClassName("today")}if(Q==this.calDate.getDate()&&I){T.addClassName("selected")}if(b){T.update(Q);if(!A){T.setAttribute("data-date",(U+"_"+Q+"_"+f))}}if(Q>=J){b=false}}},changeMonth:function(A,I){var C=A.element();var B=this.cloneDateObject(this.calDate);var J=B.getMonth();var H=B.getFullYear();if(I===false){var D=J-1;if(D<0){D=11;H=H-1}var K=this.getDaysInMonth(D,H);if(B.getDate()>K){B.setDate(K)}B.setMonth(B.getMonth()-1);B.setYear(H);if(B.getMonth()<this.today.getMonth()&&B.getFullYear()==this.today.getFullYear()){B=this.today}}else{if(I===true){var G=J+1;if(G>11){G=0;H=H+1}var K=this.getDaysInMonth(G,H);if(B.getDate()>K){B.setDate(K)}B.setMonth(B.getMonth()+1);B.setYear(H);if(B.getMonth()>this.maxDate.getMonth()&&B.getFullYear()==this.maxDate.getFullYear()){B=this.maxDate}}}this.calDate=B;var E=(this.calDate.getMonth()==this.dateInInput.getMonth()&&this.calDate.getFullYear()==this.dateInInput.getFullYear());var F=this.minDate||this.cloneDateObject(this.today);this.update(F,E)},dateTouch:function(B){this.highlight(B);var A=B;window.setTimeout(function(){this.selectDate(A)}.bind(this),150)},selectDate:function(C){var B=C.element();var A=B.getAttribute("data-date");if(A){document.fire("calendar:selectDate",{eventElement:this.eventElement,selectedDate:A})}Event.stop(C)},getDaysInMonth:function(D,B){var C=((B%4==0&&B%100!=0)||B%400==0);var A=this.daysPerMonth[D];return(D==1&&C?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("data-date")){A.addClassName("highlight")}}},clearHighlight:function(B){if(Event.element){var A=Event.element(B);if(A!=this.selectionElement&&A.getAttribute("data-date")){A.removeClassName("highlight")}}},cloneDateObject:function(A){return new Date(A.getFullYear(),A.getMonth(),A.getDate())}};var DateInputManager=Class.create(Abstract.Agent,{daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],initExtend:function(){this.container=$(this.element.up("form").parentNode);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};if(this.pattern.string.length!=0){this.pattern.patternArray=$A();this.pattern.string.gsub(/[^a-z0-9]+|[a-z0-9]+/,function(G){this.pattern.patternArray.push(G[0])}.bind(this));for(var D=0,A=this.pattern.patternArray.length;D<A;D++){if(this.pattern.patternArray[D].indexOf("y")!=-1){this.pattern.yearStringLength=this.pattern.patternArray[D].length;this.pattern.yearPosition=D}if(this.pattern.patternArray[D].indexOf("m")!=-1){this.pattern.monthPosition=D}if(this.pattern.patternArray[D].indexOf("d")!=-1){this.pattern.dayPosition=D}}var F=this.pattern.patternArray.clone();F[this.pattern.dayPosition]="\\d{1,2}";F[this.pattern.monthPosition]="\\d{1,2}";F[this.pattern.yearPosition]="\\d{1,"+this.pattern.yearStringLength+"}";var C=F.join("");this.pattern.regExpPattern=new RegExp(C)}var E=true;if(!this.pattern.string){E=false;log.warning("Calendar: unsupported date format or date separator pattern supplied.")}if(this.params.months.length!==12){E=false;log.warning("Calendar: twelve (12) month names not defined")}if(this.params.days.length!==7){E=false;log.warning("Calendar: seven (7) day names not defined")}if(this.pattern.string.length===0){E=false;log.warning("Calendar: invalid date format pattern")}if(E){this.isFirstDate=null;document.stopObserving("calendar:formatDate");document.observe("calendar:formatDate",this.formatDate.bindAsEventListener(this));document.stopObserving("calendar:selectDate");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 C=parseInt(A[0])+1+"";if(C.length!=2){C="0"+C}var F=A[1]+"";if(F.length!=2){F="0"+F}var E=A[2]+"";if(E.length!=this.pattern.yearStringLength){while(E.length>this.pattern.yearStringLength){E=E.substr(1)}}var D=this.pattern.patternArray.clone();D[this.pattern.dayPosition]=F;D[this.pattern.monthPosition]=C;D[this.pattern.yearPosition]=E;D=D.join("");return D},addInputObservers:function(){this.dateInputArray=$A();if(this.params.selectors){this.selectors=this.params.selectors.split(",");for(var H=0;this.selectors[H];H++){var G=this.ancestor.getElementsBySelector(this.selectors[H]);for(var E=0;G[E];E++){var B=G[E];var C=G[E].getElementsByTagName("input");for(var D=0;C[D];D++){var A=C[D];A.datePairParent=B;A.index=D;this.dateInputArray.push(A);var I=null;if(A.value.length==0){A.value=this.pattern.localisedString}else{I=this.validateDate(A.value)}if(this.params.enableDatePicker){A.datePickerWidget=new DatePickerWidget(this,A,(this.dateInputArray.length-1),I)}}if(this.dateInputArray.length==2){this.computeDuration(B)}}}for(var H=0;this.dateInputArray[H];H++){if(!this.params.enableDatePicker){this.dateInputArray[H].parentNode.appendChild(new Element("div").addClassName("secondaryDate"));document.fire("calendar:formatDate",{dateInputIndex:H,callback:this.setSecondaryDate.bind(this,H)})}Event.observe(this.dateInputArray[H],"focus",this.showWidget.bindAsEventListener(this));Event.observe(this.dateInputArray[H],"blur",this.setInputBlur.bindAsEventListener(this,H));if(this.dateInputArray[H].form){var F=this.dateInputArray[H].form.getInputs("submit");for(var E=0;F[E];E++){Event.observe(F[E],"click",this.clearField.bindAsEventListener(this,this.dateInputArray[H]));document.observe("dateInput:clearField",this.clearField.bindAsEventListener(this,this.dateInputArray[H]))}}}}},createWidget:function(){if(!this.container.calendarWidget){this.container.calendarWidget=new CalendarWidget(this.today,this.container,this.params)}},showWidget:function(E){this.createWidget();this.eventElement=Event.element(E);this.inputHasFocus=true;this.isFirstDate=true;var B=null;for(var D=1,C=this.dateInputArray.length;D<C;D++){if(this.dateInputArray[D]==this.eventElement){var A=null;var F=D-1;while(A==null&&F>=0){A=this.validateDate(this.dateInputArray[F].value);F--}B=A;this.isFirstDate=false;break}}document.fire("calendar:showAndPosition",{rootEvent:E,dateInputObj:this,minDate:B,maxDate:this.maxDate,isFirstDate:this.isFirstDate,container:this.container})},validateDate:function(I){var B=null;var A=true;var D=(I==undefined?$F(this.eventElement):I);if(this.pattern.regExpPattern.test(D)){var G=$A();D.gsub(/[^a-z0-9]+|[a-z0-9]+/,function(J){G.push(J[0])});var E=G[this.pattern.dayPosition];var C=G[this.pattern.monthPosition];var F=G[this.pattern.yearPosition];if(F.length==2){F="20"+F}if(E<1||E>this.getDaysInMonth((C-1),F)){A=false}if(A&&(C<1||C>12)){A=false}if(A){var H=new Date(F,C-1,E,0,0,0);if(H<=this.maxDate&&H>=this.today){B=H}}}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");document.fire("calendar:formatDate",{dateInputIndex:this.eventElement.index,callback:this.setSecondaryDate.bind(this,this.eventElement.index)});document.fire("secondaryDate:changeDate",{index:this.eventElement.index});this.eventElement.blur()},getDaysInMonth:function(D,B){var C=((B%4==0&&B%100!=0)||B%400==0);var A=this.daysPerMonth[D];return(D==1&&C?A+1:A)},computeDuration:function(B){if(this.dateInputArray.length==2){var A=this.validateDate(this.dateInputArray[0].value);var C=this.validateDate(this.dateInputArray[1].value);if(A!=null&&C!=null){B.tripDuration=Math.round((C-A)/86400000);DateDuration.prototype.updateDuration(B)}}},setInputBlur:function(B,A){this.inputHasFocus=false;document.fire("calendar:formatDate",{dateInputIndex:A,callback:this.setSecondaryDate.bind(this,A)});window.setTimeout(this.getFocus.bind(this),100)},setSecondaryDate:function(A,B){$(this.dateInputArray[A].parentNode).select(".secondaryDate")[0].innerHTML=B},getFocus:function(){var A=this.container.calendarWidget;if(this.inputHasFocus==false&&A.calendarFocused==false&&A.element.visibleByClass()){document.fire("calendar:hide")}},clearField:function(B,A){if(A.value==this.pattern.localisedString){A.value=""}},formatDate:function(C){var B=this.validateDate(this.dateInputArray[C.memo.dateInputIndex].value);var A="";if(B!=null){var A=this.params.abbrFullDatePattern;A=A.replace(/\bd{1,}\b/,B.getDate()).replace(/\bE{3,}\b/,this.params.abbrDays[B.getDay()]).replace(/\bM{1,}\b/,this.params.abbrMonths[B.getMonth()]).replace(/\by{2,}\b/,B.getFullYear())}C.memo.callback(A)}});var CarXSellMatrixDetails=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){$("bodyWrapper").observe("click",this.onClick.bindAsEventListener(this));this.dialog=new Microcontent([],{string:""},{triggerEvent:"click",compact:true,classes:"carXSellMatrixDetails",closeLabel:this.params.closeLabel,topBoundaryText:this.params.topBoundaryText,bottomBoundaryText:this.params.bottomBoundaryText,wrapLinkText:this.params.wrapLinkText})},onClick:function(C){var B=C.findElement();if(this.dialog.markup&&this.dialog.markup.dialogWrapper&&B.descendantOf(this.dialog.markup.dialogWrapper)){return}else{this.dialog.close()}var A=B.tagName=="TD"?B:B.up("TD");if(A&&A.hasAttribute("data-carDetails")){this.dialog.content.string=A.getAttribute("data-carDetails");this.dialog.open(C,A.down("A")||A)}}});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 C="";if(this.params.url){C=this.params.url;C="&"+C.substr(C.indexOf("?")+1)}else{C="&"+location.search.substring(1)}if(this.params.url&&this.params.url.indexOf("book")!=-1){C=C.replace("&amp%3B","&");C=C.replace("&amp;","&");var A=new Ajax.Request("/book/bookingpath",{parameters:"changeSearch=true"+C,onSuccess:this.success.bind(this),onFailure:this.failure})}else{var A=new Ajax.Request("/shop/searchForm",{parameters:"changeSearch=true"+C,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 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 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 CheckboxListFilter=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){this.checkboxes=this.element.select(".checkbox input");if(!this.checkboxes){log.error("No checkboxes found for CheckboxListFilter");return}if(this.params.toggleLinks){this.element.insert({top:this.params.toggleLinks})}var C=this.element.select("input");C.each(function(D){if(D.readAttribute("type")=="hidden"&&D.readAttribute("name").startsWith("_")){this.hiddenInput=D}},this);this.paramName=this.checkboxes[0].readAttribute("name");if(this.params.csvInput){if(this.hiddenInput){this.hiddenInput.remove()}this.element.insert({top:this.params.csvInput});this.csvInput=this.element.down("input");var B=this.getValues();var A=B.length;this.checkboxes.each(function(E,D){if(A==0){E.checked=true;B.push(E.value)}else{E.checked=(B.indexOf(E.value)>=0)}E.paramName=E.readAttribute("name");E.writeAttribute("name","")});this.paramName=this.csvInput.readAttribute("name");this.setValues(B)}this.element.on("click","a",this.handleLinkClicked.bind(this));this.element.on("click",".checkbox input",this.handleCheckboxClicked.bind(this))},handleLinkClicked:function(D,C){var A=C.readAttribute("href").toQueryParams();if(Object.keys(A).length<=0){return}var B=[];var E=A[this.paramName];this.checkboxes.each(function(F){var G=F.readAttribute("value");if(!F.readAttribute("disabled")){if(E==="ALL"){F.checked=true}else{if(E==="NONE"){F.checked=false}else{F.checked=(E==G)}}if(F.checked){B.push(G)}}},this);if(this.csvInput){this.setValues(B);this.fireFilterEvent()}else{this.fireFilterEvent(B)}D.preventDefault()},handleCheckboxClicked:function(B,C){if(C.readAttribute("disabled")){return}var A=[];if(this.csvInput){A=this.getValues();if(C.checked){A.push(C.value)}else{A.splice(A.indexOf(C.value),1)}this.setValues(A)}else{this.checkboxes.each(function(D){if(D.checked==true){A.push(D.readAttribute("value"))}})}this.fireFilterEvent(A)},fireFilterEvent:function(A){var B={};if(this.csvInput){B[this.csvInput.name]=this.csvInput.value}else{if(this.hiddenInput){B[this.hiddenInput.readAttribute("name")]=this.hiddenInput.value}B[this.paramName]=A}this.element.fire("agent:filter",{params:B});if(this.params.webtrendsLabel){this.element.fire("webtrends:multiTrackEvent",{"DCSext.fctkw":this.params.webtrendsLabel})}},getValues:function(){var B=[];var A=this.csvInput.value;if(A){if(A.indexOf(",")>=0){B=A.split(",")}else{B.push(A)}}return B},setValues:function(A){if(A.length==0){this.csvInput.value="NONE"}else{this.csvInput.value=A.join(",")}}});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 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 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 CountdownTimer=Class.create();CountdownTimer.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:true,initExtend:function(){var F=new Date();var B=new Date(0);B.setUTCHours(this.params.hours);B.setUTCMinutes(this.params.minutes);B.setUTCSeconds(this.params.seconds);var A=this.element.rows[0].cells[0];var E=this.element.rows[0].cells[1];var D=this.element.rows[0].cells[2];(function C(){var H=new Date();var I=B-(H-F);if(I<0){I=0}I=new Date(I);var G=((I.getUTCDate()-1)*24+I.getUTCHours()).toPaddedString(2);A.innerHTML=(G>99)?99:G;E.innerHTML=":"+I.getUTCMinutes().toPaddedString(2)+":";D.innerHTML=I.getUTCSeconds().toPaddedString(2);if(I>0){window.setTimeout(C,250)}})()}});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(D){var F="";var E=new RegExp('name="[^"]*"');F=D.replace(E,'name="'+this.params.stateProvinceBindNode+'"');var A=new RegExp('value="[^"]*"');F=F.replace(A,'value="'+this.initialValue+'"');this.stateProvince.update(F);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 C=0;B.options[C];C++){if(B.options[C].value==this.initialValue){B.selectedIndex=C}}}},initialFill:function(A){this.stateProvince.innerHTML=A}});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 C=A.getFirstElementByClassName("readOnlyValue","span");C.innerHTML=B.tripDuration}}}});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(C){var B=700;var A=C.totalOffset-DeferredImages.viewportScroll;if(A<(DeferredImages.viewportHeight+B)&&A>-(C.height+B)){return true}return false},isInDocument:function(A){var C=A.parentNode,B=false;while(C){B=(C==document);C=C.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 C=A.src;Event.observe(A,"error",function(){log.warning("Request for "+B.src+" timed out");A.src=C});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 DelayedContent=Class.create(Abstract.Agent,{beforeDOMReady:false,initExtend:function(){this.container=Element.extend(this.element);this.url=this.params.ajaxUrl||document.location.href;this.latency=this.params.latency;this.busy=false;this.delay=this.retrieve.bind(this).delay(this.latency)},retrieve:function(){if(!this.busy){this.busy=true;log.debug("loading content from: "+this.url);var A=new Ajax.Request(this.url,{method:"get",onSuccess:(function(C){var B=C.responseText;log.info(B);this.updateContent(B);this.busy=false;document.fire("agent:resultsUpdated")}).bind(this),onFailure:(function(){log.error("DelayedContent: No response from application for Element Updates")})})}},updateContent:function(B){var A=Element.update(this.container,B);Page.initializeDOMFragment(this.container)},cleanup:function(){window.clearTimeout(this.delay)}});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 DisableContactTypes=Class.create(Abstract.Agent,{beforeDOMReady:false,initExtend:function(){var A=this.element.down("input",1);var B=function(C){this.element.select("input","select").each(function(D){if(A.checked){D.enable()}else{D.disable()}A.enable()})};A.on("click",B.bind(this))}});var DropDownList=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){if(this.params.type==="fromSelect"){this.initFromSelect()}else{this.initFromDom()}this.trigger.writeAttribute("tabindex","0");this.toggleObserver=this.toggle.bindAsEventListener(this);this.trigger.observe("click",this.toggleObserver);this.trigger.observe("keypress",this.toggleObserver)},initFromDom:function(){this.trigger=this.element.down(this.params.triggerElement);this.content=this.element.down(this.params.contentElement);this.element.addClassName("dropDown");this.trigger.addClassName("trigger");this.content.addClassName("content");this.content.setStyle({minWidth:(this.trigger.getLayout().get("padding-box-width"))+"px"})},initFromSelect:function(){var B=this.element.down("select");var A=new Element("ul");this.trigger=new Element("div",{"class":"trigger"});this.content=new Element("div",{"class":"content noneBlock"});this.element.addClassName("dropDown");B.setStyle({display:"none"});if(this.params.parentWidth){Element.extend(this.element.parentNode).setStyle({width:this.params.parentWidth})}B.select("option").each(function(D){if(D.selected){this.trigger.update("<div>"+D.text+"</div>")}else{var C,E=new Element("a").update(D.text);E.href="#";C=new Element("li").update(E);E.observe("click",function(){D.selected=true;B.form.submit()});A.insert(C)}}.bind(this));this.element.insert(this.trigger);this.content.update(A);this.element.insert(this.content)},toggle:function(C){if(C.keyCode!=Event.KEY_RETURN&&C.type!="click"){return}if(!this.element.hasClassName("opened")){this.element.addClassName("opened");if(!this.shimAdded){this.insertShim()}if(this.params.matchWidths){var D=this.trigger.getLayout();var B=this.content.getLayout();var A=D.get("padding-left")+D.get("padding-right");if(!this.width){if(D.get("padding-box-width")>B.get("padding-box-width")){this.width=D.get("padding-box-width")}else{this.width=B.get("padding-box-width")}}this.trigger.setStyle({width:(this.width-A)+"px"});this.content.setStyle({width:(this.width)+"px"})}window.setTimeout(this.attachBodyListeners.bind(this),0)}else{this.element.removeClassName("opened");if(this.params.matchWidths){this.trigger.setStyle({width:""})}this.detachBodyListeners()}},insertShim:function(){if(window.isIE6){var A=new Element("iframe");A.src="/cacheable/empty.html";A.width=this.content.getWidth()+"px";A.height=this.content.getHeight()+"px";this.trigger.insert({after:A})}this.shimAdded=true},attachBodyListeners:function(){document.observe("click",this.toggleObserver);document.observe("keypress",this.toggleObserver)},detachBodyListeners:function(){document.stopObserving("click",this.toggleObserver);document.stopObserving("keypress",this.toggleObserver)}});var DropDownMenu=Class.create(Abstract.Agent,{beforeDOMReady:false,initExtend:function(){this.showMenuClass=this.params.showMenuClass;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.addClassName(this.showMenuClass);this.element.observe("click",this.toggleMenu.bind(this));document.observe("click",this.closeMenu.bind(this))},toggleMenu:function(C){var B=C.element();var A=B.up();if(B.hasClassName(this.menuLinkClass)||A.hasClassName(this.menuLinkClass)){C.stop();if(A.hasClassName(this.menuLinkClass)){A=A.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 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){log.error("ElementUpdater: Error");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 C=this.control.form;var D=Form.serialize(C).deleteQueryStringParam("_eventId",true)+"&"+this.params.eventId+"=true";var A=new Ajax.Request(C.action,{method:"post",parameters:D,onSuccess:function(E){document.fire("content:update",E.responseText.unescapeJSON().evalJSON())},onFailure:function(){log.error("ElementUpdateTrigger: No response from application for Element Updates")}})}});var SubmitUpdateTrigger=Class.create();SubmitUpdateTrigger.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){var A=this.params.event?this.params.event:"click";this.control=this.element;Event.observe(this.control,A,this.updateSummary.bindAsEventListener(this))},updateSummary:function(B){B.preventDefault();document.fire("contentUpdate:started");var C=this.control.form;var D=Form.serialize(C).deleteQueryStringParam("_eventId",true)+"&"+this.params.eventId+"=true";var A=new Ajax.Request(C.action,{method:"post",parameters:D,onSuccess:function(E){document.fire("content:update",E.responseText.unescapeJSON().evalJSON())},onFailure:function(){log.error("SubmitUpdateTrigger: No response from application for Element Updates")}})}});var ExpandCollapse=Class.create(Abstract.Agent,Persistent,{beforeDOMReady:true,initExtend:function(){this.initPersistence(this.params.persistenceId);this.opened=this.getPersistent("opened");if(this.opened===null){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(true);this.expandCollapseLink.on("click",this.toggleCollapse.bind(this))},updateContent:function(A){if(this.opened){this.target.showByClass();if(A){this.expandCollapseLink.insert(this.collapseLink)}else{this.expandCollapseLink.update(this.collapseLink)}this.expandCollapseLink.addClassName("expanded");this.element.removeClassName("collapsed")}else{this.target.hideByClass();if(A){this.expandCollapseLink.insert(this.expandLink)}else{this.expandCollapseLink.update(this.expandLink)}this.expandCollapseLink.removeClassName("expanded");this.element.addClassName("collapsed")}},toggleCollapse:function(A){A.preventDefault();this.opened=!(this.opened);this.setPersistent("opened",this.opened);this.updateContent()}});var FacebookXFBMLParse=Class.create();FacebookXFBMLParse.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:false,initExtend:function(){var A=function(){if(this.params.markup){this.element.insert(this.params.markup)}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 D="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 C=new Element("iframe",{src:D});C.frameBorder=0;C.scrolling="no";this.element.insert({bottom:C})};if(Page.onLoadFired){A.call(this)}else{Event.observe(window,"load",A.bind(this))}}});var Filter=Class.create(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");if(B){B.stopObserving("submit");B.observe("submit",this.processEvent.bindAsEventListener(this,"submit"));this.lastQuery=B.serialize()}var A=this.element.select("select");for(i=0;i<A.length;i++){Event.observe(A[i],"change",function(D){var C=$(Event.findElement(D,"form"));this.fetch(C.action,C.serialize())}.bind(this))}},processEvent:function(D,B){var A=Event.element(D);if((B=="agent:filter"&&!D.memo.url)||(B=="submit")||(A.tagName.toLowerCase()=="input"&&A.getAttribute("type")=="checkbox")){if(A.className=="agentCtrl"){return}var C=$(Event.findElement(D,"form"));if(!C){return}this.fetch(C.action,C.serialize())}else{if(B=="agent:filter"&&D.memo.url){this.fetch(D.memo.url)}}if(B=="submit"){D.preventDefault()}},fetch:function(A,B){if(B&&B==this.lastQuery){return}this.lastQuery=B;document.fire("agent:updatingResults");B=B?B+"&":"";new Ajax.Request(A,{method:"get",parameters:B+"rep=partial",onCreate:(function(C){if(!this.mostRecentRequest){this.intrastitial.show()}this.mostRecentRequest=C.transport}).bind(this),onSuccess:(function(C){if(C.transport==this.mostRecentRequest){Page.initializeAjaxResponse(C.responseText);this.intrastitial.hide();this.mostRecentRequest=null;document.fire("agent:resultsUpdated")}}).bind(this),onFailure:(function(C){if(C.transport==this.mostRecentRequest){this.intrastitial.hide();this.mostRecentRequest=null;window.location.reload()}}).bind(this)})}});var FilterOnLinkClick=Class.create(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})}},callFilter:function(B){var A=B.findElement("a");if(A){if(this.hiddenInput){this.hiddenInput.value=A.href.toQueryParams()[this.hiddenInput.name]||"";this.element.fire("agent:filter")}else{this.element.fire("agent:filter",{url:A.href})}B.preventDefault()}if(this.params.webtrendsLabel){this.element.fire("webtrends:multiTrackEvent",{"DCSext.fctkw":this.params.webtrendsLabel})}}});var FilterLinksToggleState=Class.create(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(C){var B=C.findElement("a");if(B){var A=B.up("li");if(A){var D=B.down("img");if(D){A.removeClassName(this.className);B.addClassName("offscreen")}else{A.addClassName(this.className);A.siblings().each(function(E){if(E.hasClassName(this.className)){E.removeClassName(this.className);if(E.down("a img")){E.down("a").remove()}}}.bind(this))}}else{log.error("FilterLinksToggleState : listItem undefined")}}}});var FilterRequestManager=Class.create(Abstract.Agent,{beforeDOMReady:false,initExtend:function(){this.mainLayoutElement=$("main");this.intrastitialMessage=this.params.intrastitialMessage||"";this.rep=this.params.rep||"filter";this.intrastitial=new Intrastitial(this.intrastitialMessage,this.mainLayoutElement);this.mostRecentRequest=null;this.element.on("agent:filter",this.processEvent.bind(this));this.element.stopObserving("submit");this.element.on("submit",this.processEvent.bind(this));var A=this.params.url.unescapeHTML();var B=A.toQueryParams();this.query={};Object.keys(B).each(function(C){if(C.startsWith("models['searchView']")){this.query[C]=B[C];delete B[C]}},this);this.url=A.split("?")[0]+"?"+Object.toQueryString(B)},processEvent:function(A){if(A.memo&&A.memo.params){Object.extend(this.query,A.memo.params);this.fetch(this.url,this.query)}else{if(A.memo&&A.memo.url){this.fetch(A.memo.url)}else{this.fetch(this.url,this.query);A.preventDefault()}}},fetch:function(A,B){var C="";if(B){C=Object.toQueryString(B)}if(C&&C==this.lastQuery){return}this.lastQuery=C;document.fire("agent:updatingResults");var C=Object.toQueryString(B);if(this.request){this.request.abort()}this.request=new Ajax.PartialPage(A,{method:"get",parameters:C+"&rep="+this.rep,onCreate:(function(D){if(!this.mostRecentRequest){this.intrastitial.show()}this.mostRecentRequest=D.transport}).bind(this),onSuccess:(function(D){if(D.transport==this.mostRecentRequest){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}}).bind(this)})}});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&&Persist){var B=Persist.get("fixedAgent",true);if(!B||!B.expires||!(new Date().getTime()-B.expires<0)){this.show()}}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 "+this.params.shadowExtendClass}));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(C){C.preventDefault();this.disable();if(Persist){Persist.set("fixedAgent",{expires:new Date().getTime()+604800000},true)}}.bind(this))}this.placeHolder=$(this.element.cloneNode(false));if(this.placeHolder.hasAttribute("id")){this.placeHolder.removeAttribute("id")}if(this.placeHolder.hasAttribute("data-agent")){this.placeHolder.removeAttribute("data-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(C){document.stopObserving("mvt:HOTEL200_stalkbar",this.mvtListener);if(C.memo=="disable"){this.disable()}else{if(C.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})},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 FlexHotelResults=Class.create(Abstract.Agent,{beforeDOMReady:false,initExtend:function(){this.results=this.element.down(".hotelResults");$(this.element).down(".select select").observe("change",this.submit.bindAsEventListener(this));this.intrastitial=new GenericIntrastitial(this.element,"intrastitialOverlay",this.params.message)},submit:function(B){B.preventDefault();var A=B.element().form;var C=$(A).serialize()+"&ajax=true";this.intrastitial.show();new Ajax.PartialRequest(A.action,{parameters:C,method:"get",onSuccess:function(D){this.results.update(D.responseText);Page.initializeDOMFragment(this.results);this.intrastitial.hide()}.bind(this),onFailure:function(D){this.intrastitial.hide()}.bind(this)})}});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 FlexHotelResultsLinkFilter=Class.create(Abstract.Agent,{beforeDOMReady:false,initExtend:function(){this.elementToUpdate=this.element.up(this.params.elementToUpdate);if(this.params.filterLinksMarkup){this.addFilterLinks()}var A=$(this.element).select(".filterTrigger");for(i=0;i<A.length;i++){A[i].observe("click",this.handleLinkClick.bindAsEventListener(this))}this.intrastitial=new GenericIntrastitial(this.element,"intrastitialOverlay",this.params.message)},handleLinkClick:function(B){B.preventDefault();var A=B.element().href;this.intrastitial.show();new Ajax.PartialRequest(A,{method:"get",onSuccess:function(C){this.elementToUpdate.update(C.responseText);Page.initializeDOMFragment(this.elementToUpdate);this.intrastitial.hide()}.bind(this),onFailure:function(C){this.intrastitial.hide()}.bind(this)})},addFilterLinks:function(){var B=document.createElement("div");B.innerHTML=this.params.filterLinksMarkup;var A=this.element.down(this.params.insertBeforeClass);this.element.insertBefore(B.firstChild,A)}});var flexMiniAirForm=Class.create();flexMiniAirForm.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){if(this.params.setUpDefaults){this.params.mcOptions.setUp=function(){var B=this.dialogObject.markup.mainInfo.down("form");var A=this.element.readAttribute("data-mini-air-form");var C=A.unescapeJSON().evalJSON();if(C.defaultStartDate&&C.defaultEndDate){B.elements["ar.rt.leaveSlice.date"].value=C.defaultStartDate;B.elements["ar.rt.returnSlice.date"].value=C.defaultEndDate}if(C.origin&&C.destination){B.elements["ar.rt.leaveSlice.orig.key"].value=C.origin;B.elements["ar.rt.leaveSlice.dest.key"].value=C.destination}this.dialogObject.markup.mainContent.down("h3").innerHTML=C.microContentHeading}.bind(this)}this.dialogObject=new Microcontent(this.element.select(".miniAirFormTrigger a"),{url:"/helper/flexMiniSearch?type=air"},this.params.mcOptions)}});var FlexMiniHotelForm=Class.create();FlexMiniHotelForm.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){if(this.params.setUpDefaults){this.params.mcOptions.setUp=function(){var E=this.dialogObject.markup.mainInfo.down("form");var A=this.element.select(this.params.identifier);var C=A[0].readAttribute("data-mini-hotel-form");var F=C.unescapeJSON().evalJSON();for(var B=0;B<F.availabilityCheckParams.length;++B){var D=new Element("input",{type:"hidden",name:F.availabilityCheckParams[B].key,value:F.availabilityCheckParams[B].value});E.insert({top:D})}}.bind(this)}this.dialogObject=new Microcontent(this.element.select(this.params.identifier),{url:"/helper/flexMiniSearch?type=hotel"},this.params.mcOptions)}});var FrequentFlierTraveler=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){this.select=this.element.down("select");this.textInput=this.element.down("input");if(this.select){this.select.on("change",this.onProgramChange.bind(this))}else{log.error("Select not found for FrequentFlier agent");return}document.observe("traveler"+this.params.travelerIndex+"Name:changed",this.onNameChange.bind(this));document.fire("traveler"+this.params.travelerIndex+":getData",{callback:this.onNameChange.bind(this)})},onProgramChange:function(B){if(this.loyaltyPrograms){var A=this.loyaltyPrograms.get("airLoyaltyProgram"+this.select.value);if(A){this.textInput.value=A}else{this.textInput.value=""}}else{log.error("Loyalty programs not found for FrequentFlier agent")}},onNameChange:function(B){if(B.memo.get("index")===this.params.travelerIndex){var C=B.memo.get("travelerInformation");if(C){this.loyaltyPrograms=$H(C.loyaltyPrograms);var A=this.loyaltyPrograms.get("airLoyaltyProgram"+this.select.value);if(A){this.textInput.value=A}else{this.textInput.value=""}}else{this.textInput.value=""}}}});var GenericIntrastitial=Class.create();GenericIntrastitial.prototype={initialize:function(A,B,C){this.spinner=new ProgressIndicator();this.overlayClass=B;this.wrapper=new Element("div",{style:"position: relative;"});if(window.isIE6){this.wrapper.setStyle({height:A.getHeight()+"px",width:A.getWidth()+"px;"})}$(A).insert({before:this.wrapper});this.msgContainer=(new Element("div",{"class":"message"})).insert(this.spinner.container).insert(new Element("div").innerHTML=C);this.overlay=(new Element("div",{"class":B+" visible"})).insert(this.msgContainer).setOpacity(0.8);this.wrapper.insert($(A).remove()).insert(this.overlay);this.hide()},hide:function(){this.overlay.hideByClass()},show:function(){this.overlay.showByClass()}};var GoogleCSESearchBox=Class.create(Abstract.Agent,{initExtend:function(){this.element.insert(this.params.markup);Event.observe(this.element.down("form"),"submit",this.handleSubmit.bind(this))},handleSubmit:function(C){var B=this.element.down("input.searchBox");var D=this.element.down("input.searchValue");var A=(B)?B.value:"";A=A.replace(/^\s+/,"");A=A.replace(/\s+$/,"");if(D){D.value=A}if(A==""){if(C){Event.stop(C)}return false}}});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.map.getTilt()==0){this.map.setTilt(45)}}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 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(C,B){var A=C?C:this.toggle;var D=B?B:this;Event.observe(this.element,this.eventType,A.bindAsEventListener(D));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(D){if(this.parentClass){var E=this.element.getParentByClassName(this.parentClass);var C=E.getElementsBySelector(D);for(var F=0;C[F];F++){B.push(C[F])}}else{if(this.parentTag){var E=this.element.getParentByTagName(this.parentTag);var C=E.getElementsBySelector(D);for(var F=0;C[F];F++){B.push(C[F])}}else{var C=$$(D);for(var F=0;C[F];F++){B.push(C[F])}}}}.bind(this));return B},changeRadio:function(){var B=this.radioValue;var A,C;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(E){var D=E.getElementsByTagName("input")[0];if(D.value==B){D.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(C){if(this.targets.length==0&&this.selectors.length>0){this.findTargets()}if(C){var A=Element.extend(Event.element(C));if(A.hasClassName("selected")){A.removeClassName("selected")}else{A.addClassName("selected")}if(this.hrType=="link"){Event.stop(C);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 C=Page.hideRevealRadios[this.groupName];for(var B=0;C[B];B++){if(C[B].hrRadio.input.defaultChecked){C[B].hrRadio.toggle()}C[B].checked=false}this.hrRadio.toggle()}this.checked=true}},groupEvent:function(C){var A=Event.element(C);if(this.checked){return}var D=Page.hideRevealRadios[this.groupName];for(var B=0;D[B];B++){if(D[B].checked){D[B].hrRadio.toggle(C)}D[B].checked=false}this.hrRadio.toggle(C);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 C=0;C<this.params.validIndices.length;C++){var B=parseInt(this.params.validIndices[C]);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 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 HighlightContainerOnHover=Class.create(Abstract.Agent,{initExtend:function(){if(!this.params.parentClass){log.error("Invalid HighlightContainerOnHover params.");return}this.highlightClass="highlight";this.element.observe("mouseover",this.handleMouseOver.bind(this));this.element.observe("mouseout",this.handleMouseOut.bind(this))},initContainer:function(){if(!this.container){this.container=this.element.getParentByClassName(this.params.parentClass)}},handleMouseOver:function(){this.initContainer();if(this.container){this.container.addClassName(this.highlightClass)}},handleMouseOut:function(){this.initContainer();if(this.container){this.container.removeClassName(this.highlightClass)}}});var HPCDriverOptionToggle=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){if(this.params.switchTo==="select"){Event.observe(this.element,"click",this.pickFromTravellers.bindAsEventListener(this))}else{if(this.params.switchTo==="text"){Event.observe(this.element,"click",this.nameAsText.bindAsEventListener(this))}else{log.error("HPCDriverOptionToggle.initExtend: can't initialize, unrecognized mode")}}},findTargetElements:function(){if(this.textModeWrapper&&this.pickModeWrapper&&this.defaultModeWrapper){return true}else{this.textModeWrapper=$$(".hpcDriverTextMode")[0];this.selectModeWrapper=$$(".hpcDriverSelectMode")[0];this.defaultModeWrapper=$$(".hpcDriverDefaultMode")[0];if(this.textModeWrapper&&this.selectModeWrapper&&this.defaultModeWrapper){return true}else{log.error("HPCDriverOptionToggle.findTargetElements: not all target elements could be found");return false}}},pickFromTravellers:function(){if(this.findTargetElements()){this.defaultModeWrapper.hideByClass();this.textModeWrapper.hideByClass();this.selectModeWrapper.showByClass();this.textModeWrapper.select("input[type=radio]")[0].checked=false;this.selectModeWrapper.select("input[type=radio]")[0].checked=true}return false},nameAsText:function(){if(this.findTargetElements()){this.defaultModeWrapper.hideByClass();this.textModeWrapper.showByClass();this.selectModeWrapper.hideByClass();this.textModeWrapper.select("input[type=radio]")[0].checked=true;this.selectModeWrapper.select("input[type=radio]")[0].checked=false}return false}});var Interstitial=Class.create(Abstract.Agent,{interstitialResponseTimeout:2000,interstitialAssetsTimeout:2000,url:"/helper/interstitial",initExtend:function(){var A=this.element.tagName;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")}}}},setBodyWrapper:function(){if(!this.bodyWrapper){this.bodyWrapper=this.params.targetParent?Element.extend(window.parent.document.getElementById("bodyWrapper")):Element.extend(document.getElementById("bodyWrapper"))}},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(D){this.setBodyWrapper();var A=setTimeout(this.action,this.interstitialResponseTimeout);var C=new Ajax.Request(this.url,{parameters:D,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,F){this.setBodyWrapper();clearTimeout(B);if(F.responseText.indexOf('status:"failed"')>-1){return}else{var E=$(document.createElement("DIV"));E.innerHTML=F.responseText;Page.initializeDOMFragment(E);this.bodyWrapper.insert({before:E})}var C=E.getElementsByTagName("IFRAME");if(C.length>0){var D=C[0];var A=function(){if(!D.contentWindow.adLoaded||!D.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()}}});var Intrastitial=Class.create();Intrastitial.prototype={initialize:function(C,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>"+C+"</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 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 C=A.length-1;C>=0;C--){window.external.msSiteModeAddJumpListItem(A[C].text,A[C].link,A[C].icon);log.info("added a jump list item - "+A[C].text+" - "+A[C].link+" - "+A[C].icon)}window.external.msSiteModeShowJumplist()}});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 C=function(){switch(A){case"JS":var D=document.createElement("script");D.type="text/javascript";D.src=document.location.protocol+"//"+B;document.getElementsByTagName("head")[0].appendChild(D);break;case"CSS":var D=document.createElement("link");D.type="text/css";D.rel="stylesheet";D.media=(this.params.media)?this.params.media.toLowerCase():"all";D.href=document.location.protocol+"//"+B;document.getElementsByTagName("head")[0].appendChild(D);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){C()}else{Event.observe(window,"load",C.bind(this))}}});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 LinkAddParam=Class.create(Abstract.Agent,{initExtend:function(){var C=this.element.readAttribute("href");var B=C.split("?");var A=this.params.qsParams;if(B.size()>1){var A=B[1].toQueryParams();Object.extend(A,this.params.qsParams)}this.element.writeAttribute("href",B[0]+"?"+Object.toQueryString(A))}});var SimulateLocationFilterSelection=Class.create();SimulateLocationFilterSelection.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:false,initExtend:function(){document.observe("map:locationLabelClicked",this.selectLocationFilter.bind(this))},selectLocationFilter:function(A){if(A.memo.filterType==="checkbox"){this.checkbox=this.element.select('input[value="'+A.memo.locId+'"]')[0];if(this.checkbox.checked!==true){this.checkbox.checked=true;this.checkbox.fire("agent:filter")}}else{this.link=this.element.select('a[href="'+A.memo.searchUrl+'"]')[0];this.link.fire("agent:filter",{url:A.memo.searchUrl})}if(A){A.stopPropagation()}}});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 C=B[A].getElementsByTagName("input")[0];if(C==null){C=B[A].getElementsByTagName("select")[0]}if(C){this.clearableFields.push(C)}}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 C=new LoyaltyProgram(A[B]);if(C.isVisible){this.nextAvailableLoyaltyProgram++}this.loyaltyPrograms.push(C)}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 HpcHotelMarkerToolTip={populateToolTip:function(A){HotelMarkerToolTip.populateToolTip.call(this,A)}};var HpcHotelMapInfoWindow={setHeader:function(D){var B=D.resultCardElement;this.markup.dialogTitle.innerHTML="";var A=new Element("h3");var E=B.down("a.hotelNameLink");if(E){this.addWebTrendsEventListener(A.appendChild(E.cloneNode(true)),"Hotel name");A.insert({bottom:D.productPlusText});this.markup.dialogTitle.appendChild(A)}var C=B.down("img.stars");if(C){this.markup.dialogTitle.appendChild(C.cloneNode(true))}Page.initializeDOMFragment(this.markup.dialogTitle)},populateInfoWindow:function(G){var D=G.resultCardElement;var C=new Element("div",{className:"infoWindowContent"});var F=new Element("div",{className:"price"});this.markup.mainInfo.innerHTML="";var H=D.down("a.thumbnail");if(H){this.addWebTrendsEventListener(this.markup.mainInfo.appendChild(H.cloneNode(true)),"Hotel photo")}var B=D.down("div.priceAndDisclaimers");var K=$(B.cloneNode(true));F.appendChild(K);C.appendChild(F);var A=D.down(".hotelUserRatingsSummary");if(A){C.appendChild(A.cloneNode(true))}var J=new Element("UL",{"class":"pipedList"});var E=D.down("a.detailsLink");if(E){this.addWebTrendsEventListener(J.appendChild(new Element("LI").update(E.cloneNode(true))),"More hotel details")}C.appendChild(J);this.markup.mainInfo.appendChild(C);var I=D.down(".priceButtonLink");I=this.addWebTrendsEventListener(this.markup.mainInfo.appendChild(I.cloneNode(true)),(G.rate)?"Select":"Check rates");this.markup.mainInfo.descendants().each(function(L){L.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(C){this.markup.dialogTitle.innerHTML="";var D=C.resultCardElement;var B=D.down("div.summary").down("div.data");var E=B.down("div.brand");var A=new Element("div",{className:"carLocation"});A.innerHTML=C.carLocation;this.markup.dialogTitle.appendChild(E.cloneNode(true));this.markup.dialogTitle.appendChild(A)},populateInfoWindow:function(D){var E=D.resultCardElement;var C=new Element("div",{className:"infoWindowContent"});this.markup.mainInfo.innerHTML="";var B=E.down("div.imageColumn");var A=E.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 PkgMarkerToolTip={populateToolTip:function(A){if(!A.name){A.name=A.resultCardElement.down("p.hotelName").down("a").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="pkgRating">'+A.rating+"</span>":"");this.overlay.update(B)}};var PkgMapInfoWindow={setHeader:function(D){var B=D.resultCardElement;this.markup.dialogTitle.innerHTML="";var A=new Element("h3");var E=B.down("p.hotelName").down("a");if(E){this.addWebTrendsEventListener(A.appendChild(E.cloneNode(true)),"Hotel name");A.insert({bottom:D.productPlusText});this.markup.dialogTitle.appendChild(A)}var C=B.down("img.stars");if(C){this.markup.dialogTitle.appendChild(C.cloneNode(true))}Page.initializeDOMFragment(this.markup.dialogTitle)},populateInfoWindow:function(H){var C=H.resultCardElement;var G=new Element("div",{className:"infoWindowContent"});var F=new Element("div",{className:"price"});this.markup.mainInfo.innerHTML="";var B=C.down(".hotelThumb").addClassName("thumbnail");if(B){this.markup.mainInfo.appendChild(B.cloneNode(true))}var E=C.down(".hotelUserRatingsSummary").addClassName("pkgRating");if(E){G.appendChild(E.cloneNode(true))}var D=new Element("UL",{"class":"pipedList"});var A=H.detailsLink;if(A){this.addWebTrendsEventListener(D.appendChild(new Element("LI").update(A)),"More hotel details")}G.appendChild(D);this.markup.mainInfo.appendChild(G);this.markup.mainInfo.descendants().each(function(I){I.removeAttribute("id")});Page.initializeDOMFragment(this.markup.mainInfo);GoogleMapUtil.getStreetView(this.getPosition(),this.enableStreetview.bind(this))}};var SimpleResultSetMap=Class.create(Abstract.Agent,MapResultSetBase,{beforeDOMReady:true,initExtend:function(){this.commonInit();this.createMapMarkup();this.load()},createMapMarkup:function(){this.element.addClassName("bigResultsMapModule");this.headerWrapper=new Element("DIV",{className:"mapHeader"});this.element.appendChild(this.headerWrapper);this.mapElement=new Element("DIV",{className:"resultsMap bigResultsMapContainer"});this.element.appendChild(this.mapElement);this.mapElement.style.backgroundImage="url("+this.params.staticMap+")";if(!this.pi){this.pi=new ProgressIndicator();this.mapElement.appendChild(this.pi.container)}},mapLoadCallback:function(){google.maps.event.addDomListener(window,"unload",this.onUnload.bind(this));var B=this;this.infoWindowVisible=false;this.streetViewVisible=false;if(this.pi){this.pi.destroy()}var C=new google.maps.Map(this.mapElement,{panControl:true,scaleControl:true,zoomControlOptions:{style:google.maps.ZoomControlStyle.LARGE},streetViewControl:false});document.observe("agent:resultsUpdated",function(){this.resetMap();this.setMapMarkers(this.getMainMarkerData());this.handleCloseZoom();this.map.fitBounds(this.bounds)}.bind(this));this.infoWindowData=this.params.infoWindowData;this.datedSearch=this.params.datedSearch;this.map=C;var A=this.getMainMarkerData(true);this.setMapMarkers(A,this.markerLimit);C.setMapTypeId(google.maps.MapTypeId.ROADMAP);this.handleCloseZoom();this.map.fitBounds(this.bounds);google.maps.event.addListener(C,"zoom_changed",function(){if(this.infoWindowVisible){this.infoWindow.close()}}.bind(this))},setMapMarkers:function(markerData,limit){if(this.markers){this.clearMapMarkers()}var bounds=new google.maps.LatLngBounds();var markers=[];var currentMarkers=[];var data=[];var marker;if(limit){for(var i=0;i<markerData.length;i++){if(currentMarkers.length<limit){var datum=markerData[i];var markerLatLng=new google.maps.LatLng(datum.lat,datum.lng);if(!bounds.contains(markerLatLng)){continue}currentMarkers.push(markerData[i])}else{break}}}else{currentMarkers=markerData}for(var i=currentMarkers.length;i--;){var datum=currentMarkers[i];var markerOptions={position:new google.maps.LatLng(datum.lat,datum.lng),type:datum.type,map:this.map,label:datum.label};datum.tooltip=eval(datum.type+"MarkerToolTip");datum.infoWindow=eval(datum.type+"MapInfoWindow");markerOptions.currentPage=datum.currentPage;if(datum.isFeatured){markerOptions.classes="featured"}marker=new MapMarker(markerOptions);datum.datedSearch=this.datedSearch;marker.id=i;if(markerOptions.currentPage){bounds.extend(marker.getPosition());google.maps.event.addListener(marker,"click",this.markerClick.bind(this,marker,true));google.maps.event.addListenerOnce(marker,"click",this.markerVisited.bind(this,marker))}google.maps.event.addListener(marker,"mouseover",this.markerMouseover.bind(this,marker));google.maps.event.addListener(marker,"mouseout",this.markerMouseout.bind(this,marker));markers[i]=marker;data[i]=datum}this.bounds=bounds;this.markers=markers;this.data=data}});var ResizeableResultSetMap=Class.create(SimpleResultSetMap,{beforeDOMReady:true,initExtend:function(){this.commonInit();this.checkPersist();this.createInitialMapMarkup();this.load()},toggleMapState:function(){this.mapState=(this.mapState==="wee"?"big":"wee")},checkPersist:function(){if(Persist){var A=this.mapData=Persist.get("ResizeableResultSetMapAgent",true);if(A){if(A.searchKey==this.params.searchKey){if(A.mapState==="big"){this.persistMapDetails=function(){return/showDetails=true/.test(document.referrer)}();this.mapState=A.mapState}}}}},createInitialMapMarkup:function(){if(this.mapState==="big"){this.createBigMapModuleMarkup();this.createBigMapContainerMarkup();this.createToggleSizeLink();this.mapElement=this.bigResultsMapContainer}else{this.createWeeMapModuleMarkup();this.createWeeMapContainerMarkup();this.createToggleSizeLink();this.mapElement=this.weeResultsMapContainer}if(!this.pi&&this.mapState==="big"){this.pi=new ProgressIndicator();this.mapElement.appendChild(this.pi.container)}},createWeeMapModuleMarkup:function(){this.weeMapModuleContainer=new Element("DIV",{className:"weeResultsMapModule","data-context":"hotelMap"});$$(this.params.weeMapModuleContainerSelector)[0].insert({top:this.weeMapModuleContainer});this.weeMapHeader=new Element("DIV",{className:"mapHeader"});this.weeMapModuleContainer.appendChild(this.weeMapHeader);var A=new Element("H3",{className:"mapLabel"});A.appendChild(document.createTextNode(this.params.weeMapHeading));this.weeMapHeader.appendChild(A)},createWeeMapContainerMarkup:function(){this.weeResultsMapContainer=new Element("DIV",{className:"resultsMap weeResultsMapContainer","data-context":"hotelMapMap"});this.weeResultsMapContainer.style.backgroundImage="url("+this.params.weeStaticMap+")";this.weeMapModuleContainer.appendChild(this.weeResultsMapContainer)},createBigMapModuleMarkup:function(){this.element.addClassName("bigResultsMapModule");this.headerWrapper=new Element("DIV",{className:"mapHeader"});this.element.appendChild(this.headerWrapper);this.bigMapHeader=this.element.down("div.mapHeader")},createBigMapContainerMarkup:function(){this.bigResultsMapContainer=new Element("DIV",{className:"resultsMap bigResultsMapContainer"});this.element.appendChild(this.bigResultsMapContainer);this.bigResultsMapContainer.style.backgroundImage="url("+this.params.staticMap+")"},mapLoadCallback:function(){google.maps.event.addDomListener(window,"unload",this.onUnload.bind(this));var B=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});document.observe("agent:resultsUpdated",function(){this.resetMap();this.setMapMarkers(this.getMainMarkerData());this.handleCloseZoom();this.map.fitBounds(this.bounds)}.bind(this));this.infoWindowData=this.params.infoWindowData;this.datedSearch=this.params.datedSearch;this.map=E;this.setMapOptions[this.mapState].call(this);var A=this.getMainMarkerData(true);this.setMapMarkers(A,this.markerLimit);if(this.persistMapDetails){var D=this.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 C=this.getMapMarker(D.activeId);if(C){google.maps.event.addListener(C,"domready",this.markerClick.bind(this,C,false))}}}else{E.setMapTypeId(google.maps.MapTypeId.ROADMAP);this.handleCloseZoom();this.map.fitBounds(this.bounds)}google.maps.event.addListener(E,"zoom_changed",function(){if(this.infoWindowVisible){this.infoWindow.close()}}.bind(this))},createToggleSizeLink:function(){var B=(this.mapState==="big"?this.bigMapHeader:this.weeMapHeader);var A=B.appendChild(new Element("A",{className:"mapLink",id:"mapToggleSize",href:"javascript:void(0);",delegatedtracking:"true"}));A.appendChild(document.createTextNode(this.params.linkText[this.mapState]));if(this.mapState==="big"){A.observe("click",this.toggleDynamicMapSize.bind(this))}else{this.weeMapModuleContainer.observe("click",this.toggleDynamicMapSize.bind(this))}},toggleDynamicMapSize:function(){this.toggleMapState();this.setMapOptions[this.mapState].call(this);var A=$("mapToggleSize");A.removeChild($("mapToggleSize").firstChild);A.appendChild(document.createTextNode(this.params.linkText[this.mapState]));if(this.mapState==="big"){if(this.weeMapModuleContainer){this.weeMapModuleContainer.stopObserving("click");this.weeMapModuleContainer.addClassName("noneBlock");this.mapElement.removeClassName("weeResultsMapContainer").addClassName("bigResultsMapContainer")}if(this.bigMapHeader){this.element.removeClassName("noneBlock")}else{this.createBigMapModuleMarkup()}this.element.appendChild(this.mapElement);this.mapElement.style.backgroundImage="url("+this.params.staticMap+")";this.bigMapHeader.appendChild(A);A.observe("click",this.toggleDynamicMapSize.bind(this))}else{if(this.bigMapHeader){A.stopObserving("click");this.element.addClassName("noneBlock");this.mapElement.removeClassName("bigResultsMapContainer").addClassName("weeResultsMapContainer")}if(this.weeMapHeader){this.weeMapModuleContainer.removeClassName("noneBlock")}else{this.createWeeMapModuleMarkup()}this.weeMapModuleContainer.appendChild(this.mapElement);this.mapElement.style.backgroundImage="url("+this.params.weeStaticMap+")";this.weeMapHeader.appendChild(A);this.weeMapModuleContainer.observe("click",this.toggleDynamicMapSize.bind(this))}this.mapResizeHelper();this.fireWebtrendsToggleSizeEvent()},mapResizeHelper:function(){google.maps.event.trigger(this.map,"resize");this.map.fitBounds(this.bounds)},setMapOptions:{wee:function(){this.resetMap();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})},big:function(){this.map.setOptions({disableDefaultUI:false,disableDoubleClickZoom:false,draggable:true,keyboardShortcuts:true,mapTypeControl:true,panControl:true,zoomControl:true,scaleControl:true,scrollwheel:true})}},onUnload:function(){var A=this.map.getCenter();var C;if(this.infoWindowVisible){C=this.data[this.getInfoWindow().marker.id].id}if(Persist){var B={searchKey:this.params.searchKey,mapState:this.mapState,zoom:this.map.getZoom(),position:{lat:A.lat(),lng:A.lng()},mapType:this.map.getMapTypeId(),activeId:C};Persist.set("ResizeableResultSetMapAgent",B,true)}if(this.infoWindow){this.infoWindow.destroy()}if(this.tooltip){this.tooltip.destroy()}this.clearMapMarkers()},fireWebtrendsToggleSizeEvent:function(){var A=(this.mapState==="wee"?"collapsed":"expanded");this.fireWebTrendsEvent(A+" map")}});var DestinationExplorerResultSetMap=Class.create(ResizeableResultSetMap,{beforeDOMReady:true,initExtend:function(){this.commonInit();this.markerLimit=this.params.markerLimit;this.markerLevel=(this.params.markerLevel?this.params.markerLevel:"property");this.toggleLocationPropertyMarkers=(this.params.toggleLocationPropertyMarkers?this.params.toggleLocationPropertyMarkers:true);this.locationViewDefault=(this.params.locationViewDefault?this.params.locationViewDefault:false);this.locationLabelsWithPrices=(this.params.locationLabelsWithPrices?this.params.locationLabelsWithPrices:false);this.checkPersist();this.createInitialMapMarkup();this.load()},checkPersist:function(){if(Persist){var A=this.mapData=Persist.get("DestinationExplorerResultSetMapAgent",true);if(A){if(A.searchKey==this.params.searchKey){if(A.mapState==="big"){this.persistMapDetails=function(){return/showDetails=true/.test(document.referrer)}();this.mapState=A.mapState;this.presistedMarkerLevel=A.markerLevel;this.zoomLevelToShowLocations=A.zoomLevelToShowLocations}}}}},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 D=new google.maps.Map(this.mapElement,{panControl:true,scaleControl:true,zoomControlOptions:{style:google.maps.ZoomControlStyle.LARGE},streetViewControl:false});document.observe("agent:resultsUpdated",function(){this.resetMap();this.clearMapMarkers();this.checkInitialMarkerLevelAndLoadMarkers();this.setZoomAndCenter()}.bind(this));this.infoWindowData=this.params.infoWindowData;this.datedSearch=this.params.datedSearch;this.map=D;this.setMapOptions[this.mapState].call(this);this.checkInitialMarkerLevelAndLoadMarkers();if(this.persistMapDetails){var C=this.mapData;D.setMapTypeId(C.mapType);D.setCenter(new google.maps.LatLng(C.position.lat,C.position.lng));D.setZoom(C.zoom);if(C.activeId){var B=this.getMapMarker(C.activeId);if(B){google.maps.event.addListener(B,"domready",this.markerClick.bind(this,B,false))}}}else{D.setMapTypeId(google.maps.MapTypeId.ROADMAP);this.setZoomAndCenter()}google.maps.event.addListener(D,"zoom_changed",function(){if(this.infoWindowVisible){this.infoWindow.close()}}.bind(this));this.setMarkerLevelListeners()},setMarkerLevelListeners:function(){if(this.toggleLocationPropertyMarkers&&this.mapState==="big"){this.toggleMarkerListener=google.maps.event.addListener(this.map,"zoom_changed",this.toggleMarkersOnZoom.bind(this));GoogleMapControls.OutlierControl(this);if(this.locationViewDefault){if(!this.params.zoomLevel&&this.params.markerLevel==="location"&&!this.zoomLevelToShowLocations){google.maps.event.addListenerOnce(this.map,"idle",this.setDefaultZoomLevelForLocations.bind(this))}}else{if(!this.zoomLevelToShowProperties){google.maps.event.addListenerOnce(this.map,"idle",this.setDefaultZoomLevelForProperties.bind(this))}}}},setMapMarkers:function(markerData,limit){var bounds=this.map.getBounds()||new google.maps.LatLngBounds();var markers=[];var currentMarkers=[];var data=[];var marker;var idOffset;var locationDetails;if(this.locationDetails){locationDetails=this.locationDetails}if(this.markers&&this.markers.length){this.allMarkers=this.allMarkers.concat(markerData);idOffset=this.markers.length;limit-=this.markers.length;this.totalMarkers+=markerData.length}else{this.allMarkers=markerData;idOffset=0;this.totalMarkers=markerData.length;this.markers=[];this.data=[]}if(limit){for(var i=0,len=markerData.length;i<len;i++){if(currentMarkers.length<limit){var datum=markerData[i];var markerLatLng=new google.maps.LatLng(datum.lat,datum.lng);if(!bounds.contains(markerLatLng)){continue}currentMarkers.push(markerData[i])}else{break}}}else{currentMarkers=markerData}for(var i=0,len=currentMarkers.length;i<len;i++){var datum=currentMarkers[i];if(this.markerLevel==="location"){var labelText;var Markup;labelText="<h4>"+datum.label+"</h4>";if(this.locationLabelsWithPrices&&locationDetails){for(var ii=0,ilen=locationDetails.length;ii<ilen;ii++){var currentLoc=locationDetails[ii];var locDisplayPrice;if(currentLoc.id===datum.locId){locDisplayPrice=currentLoc.rate}}Markup='<div class="secondary"><div class="count">'+datum.hotelCountMarkup+'</div> <div class="rating">'+locDisplayPrice+"</div> </div>";datum.label=labelText+Markup}else{datum.label=labelText}if(!locationDetails){log.warning("DestinationExplorerResultsSetMapAgent - setMapMarkers - Label details (prices per rating) is undefined. Ajax call failed or returned empty object most likely.")}}var markerOptions={position:new google.maps.LatLng(datum.lat,datum.lng),type:datum.type,map:this.map,label:datum.label};if(this.markerLevel==="property"||datum.locLongDesc){datum.tooltip=eval(datum.type+"MarkerToolTip")}if(this.markerLevel==="property"){datum.infoWindow=eval(datum.type+"MapInfoWindow");markerOptions.currentPage=datum.currentPage;if(datum.isFeatured){markerOptions.classes="featured"}marker=new MapMarker(markerOptions)}else{marker=new MapMarker(markerOptions);bounds.extend(marker.getPosition());google.maps.event.addListener(marker,"click",this.markerClick.bind(this,marker,true))}datum.datedSearch=this.datedSearch;marker.id=i+idOffset;if(markerOptions.currentPage){bounds.extend(marker.getPosition());google.maps.event.addListener(marker,"click",this.markerClick.bind(this,marker,true));google.maps.event.addListenerOnce(marker,"click",this.markerVisited.bind(this,marker))}google.maps.event.addListener(marker,"mouseover",this.markerMouseover.bind(this,marker));google.maps.event.addListener(marker,"mouseout",this.markerMouseout.bind(this,marker));markers[i]=marker;data[i]=datum}this.bounds=bounds;this.markers=this.markers.concat(markers);this.data=this.data.concat(data)},getShowLocationLabelsFlag:function(){if($("showMapLocationLabelsFlag")){return true}else{return false}},setDefaultZoomLevelForLocations:function(){this.zoomLevelToShowLocations=this.map.getZoom()},setDefaultZoomLevelForProperties:function(){this.zoomLevelToShowProperties=this.map.getZoom()},checkInitialMarkerLevelAndLoadMarkers:function(){if(this.idleListener){google.maps.event.removeListener(this.idleListener)}if(this.boundsListener){google.maps.event.removeListener(this.boundsListener)}if(this.toggleLocationPropertyMarkers&&this.getShowLocationLabelsFlag()&&this.locationViewDefault&&this.mapState!="wee"){this.markerLevel="location";this.setMapMarkers(this.getLocationMarkerData())}else{this.markerLevel="property";var A=this.getMainMarkerData(true);this.boundsListener=google.maps.event.addListenerOnce(this.map,"bounds_changed",function(){this.setMapMarkers(A,this.markerLimit);this.getOutlierMarkerData()}.bind(this))}},setZoomAndCenter:function(){if(this.params.zoomLevel&&this.params.lat&&this.markerLevel==="location"&&this.locationViewDefault){this.map.setCenter(new google.maps.LatLng(this.params.lat,this.params.lng));this.map.setZoom(this.params.zoomLevel);this.zoomLevelToShowLocations=(this.zoomLevelToShowLocations?this.zoomLevelToShowLocations:this.map.getZoom())}else{this.handleCloseZoom();this.map.fitBounds(this.bounds)}},mapResizeHelper:function(){this.zoomLevelChangedOnResizeMap=true;if(this.toggleMarkerListener){google.maps.event.removeListener(this.toggleMarkerListener)}google.maps.event.trigger(this.map,"resize");if(this.mapState==="big"){this.setMarkerLevelListeners()}else{if(this.mapState==="wee"&&this.markerLevel==="location"){this.clearMapMarkers();this.markerLevel="property";this.checkInitialMarkerLevelAndLoadMarkers()}}this.setZoomAndCenter()},clearInvalidMarkers:function(A){var A=A||[];while(A.length){A.shift().destroy()}},setReplot:function(){var A;if(this.markerLimit){this.idleListener=google.maps.event.addListener(this.map,"idle",function(){if(this.markerLevel==="property"){A=this.markers;this.markers=null;this.setMapMarkers(this.allMarkers,this.markerLimit);setTimeout(this.clearInvalidMarkers.bind(this,A),0)}}.bind(this))}},getOutlierMarkerData:function(){var results;if(!this.params.outlierAjaxURL){var outlierMarkers=document.getElementById("extraMapMarkers");if(outlierMarkers){this.setMapMarkers(eval("(["+outlierMarkers.innerHTML+"])"),this.markerLimit);this.setReplot()}}else{new Ajax.Request(this.params.outlierAjaxURL,{method:"get",onSuccess:function(response){results=response.responseText.evalJSON().mapData.otherHotels;this.setMapMarkers(results,this.markerLimit);this.setReplot()}.bind(this)})}},getMainMarkerData:function(C){var B;var A=new google.maps.LatLngBounds();var D=$("main").select("div[data-map-info]").collect(function(F){var E=F.getAttribute("data-map-info").evalJSON();E.resultCardElement=F;E.currentPage=true;if(C){A.extend(new google.maps.LatLng(E.lat,E.lng))}return E});if(C){this.bounds=A}return D},getLocationMarkerData:function(){if(this.locationLabelsWithPrices&&!this.locationDetails&&this.params.outlierAjaxURL){this.setLocationMarkerRates()}return $("leftRail").select("label[data-params]","li[data-params]").collect(function(B){var A=B.getAttribute("data-params").evalJSON();return A})},setLocationMarkerRates:function(){var A;new Ajax.Request(this.params.outlierAjaxURL,{method:"get",asynchronous:false,onSuccess:function(B){A=B.responseText.evalJSON().mapData.neighborhoods}});this.locationDetails=A},toggleMarkersOnZoom:function(){if(this.mapState==="big"&&!this.zoomLevelChangedOnResizeMap){if(this.locationViewDefault){if((this.map.getZoom()>this.zoomLevelToShowLocations&&this.markerLevel==="location")||(this.map.getZoom()<=this.zoomLevelToShowLocations&&this.markerLevel==="property"&&this.getShowLocationLabelsFlag())){this.toggleMarkerLevel()}}else{if((this.map.getZoom()>=this.zoomLevelToShowProperties&&this.markerLevel==="location")||(this.map.getZoom()<this.zoomLevelToShowProperties&&this.markerLevel==="property"&&this.getShowLocationLabelsFlag())){this.toggleMarkerLevel()}}}this.zoomLevelChangedOnResizeMap=false},toggleMarkerLevel:function(){if(this.idleListener){google.maps.event.removeListener(this.idleListener)}if(this.boundsListener){google.maps.event.removeListener(this.boundsListener)}if(this.markerLevel==="location"){this.markerLevel="property";var A=this.getMainMarkerData(false);this.boundsListener=google.maps.event.addListenerOnce(this.map,"bounds_changed",function(){this.clearMapMarkers();this.setMapMarkers(A,this.markerLimit);this.getOutlierMarkerData()}.bind(this))}else{this.markerLevel="location";this.clearMapMarkers();this.setMapMarkers(this.getLocationMarkerData())}},onUnload:function(){var A=this.map.getCenter();var C;if(this.infoWindowVisible){C=this.data[this.getInfoWindow().marker.id].id}if(Persist){var B={searchKey:this.params.searchKey,mapState:this.mapState,zoom:this.map.getZoom(),position:{lat:A.lat(),lng:A.lng()},mapType:this.map.getMapTypeId(),activeId:C,markerLevel:this.markerLevel,zoomLevelToShowLocations:this.zoomLevelToShowLocations};Persist.set("DestinationExplorerResultSetMapAgent",B,true)}if(this.infoWindow){this.infoWindow.destroy()}if(this.tooltip){this.tooltip.destroy()}this.clearMapMarkers()},markerClick:function(C,A){if(this.mapState=="wee"||this.disableInfoWindow){return false}var B=this.data[C.id];if(B.type!="location"){this.getInfoWindow().open(C,B);C.overlay.addClassName("mapMarkerCurrent");this.getMarkerTooltip().close()}else{document.fire("map:locationLabelClicked",{locId:B.locId,searchUrl:B.searchUrl,filterType:B.locFilterType})}if(A){this.fireWebTrendsEvent(B.type+" pin")}},markerMouseover:function(B){if(this.mapState=="wee"){return false}var A=this.data[B.id];B.overlay.addClassName("mapMarkerHover");if(this.markerLevel==="property"||A.locLongDesc){this.getMarkerTooltip().open(B,A)}}});var locationMarkerToolTip={populateToolTip:function(A){var B="<span>"+A.locLongDesc+"</span>";this.overlay.update(B)}};var SimilarHotelsResultSetMap=Class.create(SimpleResultSetMap,{beforeDOMReady:false,setMapMarkers:function(markerData){if(this.markers){this.clearMapMarkers()}var bounds=this.map.getBounds()||new google.maps.LatLngBounds();var markers=[];var currentMarkers=[];var data=[];var marker;currentMarkers=markerData;for(var i=currentMarkers.length;i--;){var datum=currentMarkers[i];var markerOptions={position:new google.maps.LatLng(datum.lat,datum.lng),type:datum.type,map:this.map,label:datum.label};datum.tooltip=eval(datum.type+"MarkerToolTip");datum.infoWindow=eval(datum.type+"MapInfoWindow");if(!datum.iconSrc){marker=new MapMarker(markerOptions)}else{marker=new IconMapMarker(new google.maps.LatLng(datum.lat,datum.lng),datum.type,this.map,datum.iconSrc,datum.isFeatured&&"featured")}marker.id=i;bounds.extend(marker.getPosition());google.maps.event.addListener(marker,"click",this.markerClick.bind(this,marker,true));google.maps.event.addListenerOnce(marker,"click",this.markerVisited.bind(this,marker));google.maps.event.addListener(marker,"mouseover",this.markerMouseover.bind(this,marker));google.maps.event.addListener(marker,"mouseout",this.markerMouseout.bind(this,marker));markers[i]=marker;data[i]=datum}this.bounds=bounds;this.markers=markers;this.data=data}});var IconMapMarker=function(A,E,F,B,C){var D=new Element("IMG",{src:B,"class":"mapMarker"});D.className="mapMarker";D.style.position="absolute";IconMapMarker=function(G,J,K,H,I){this.overlay=D.cloneNode(true);this.overlay.addClassName(J+"MapMarker");if(I){this.overlay.addClassName(I)}this.setPosition(G);this.setMap(K);this.addDomListener(this.overlay,"mouseover",function(){google.maps.event.trigger(this,"mouseover")}.bind(this));this.addDomListener(this.overlay,"mouseout",function(){google.maps.event.trigger(this,"mouseout")}.bind(this));this.addDomListener(this.overlay,"click",function(){google.maps.event.trigger(this,"click")}.bind(this))};IconMapMarker.prototype=Object.extend(new BaseOverlay(),{getPane:function(){return this.getPanes().overlayImage},getPosition:function(){return this.get("position")},getNorthEast:function(G,H){return new google.maps.Point(G.x+(H.width)-5,G.y-(H.height))},getSouthWest:function(G,H){return new google.maps.Point(G.x-5,G.y)},getCenter:function(G,H){return new google.maps.Point((G.x-5)+(H.width/2),G.y-(H.height/2))}});return new IconMapMarker(A,E,F,B,C)};var SimilarHotelMarkerToolTip={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 SimilarHotelMapInfoWindow={setHeader:function(A){},populateInfoWindow:function(A){}};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(C,D){if(D<A){return}if(C.title!=""){C.title=C.title.strip()}$(C);if(C.innerHTML==""||C.hasClassName("noHighlight")){return}Event.observe(C,"mouseover",this.colHeaderMouseEvent.bind(this,D));Event.observe(C,"mouseout",this.colHeaderMouseEvent.bind(this,D));Event.observe(C,"click",this.cellClickEvent.bind(this,"TH",this.params.columnHeaderWTLabel))}.bind(this))}.bind(this));$A(this.table.tBodies[0].rows).each(function(B){$A(B.cells).each(function(C,D){if(C.title!=""){C.title=C.title.strip()}$(C);if(C.innerHTML==""||C.hasClassName("noHighlight")){return}if(C.tagName=="TH"){Event.observe(C,"mouseover",this.rowHeaderMouseEvent.bind(this));Event.observe(C,"mouseout",this.rowHeaderMouseEvent.bind(this));Event.observe(C,"click",this.cellClickEvent.bind(this,"TH",this.params.rowHeaderWTLabel))}else{Event.observe(C,"mouseover",this.cellMouseEvent.bind(this,D));Event.observe(C,"mouseout",this.cellMouseEvent.bind(this,D));Event.observe(C,"click",this.cellClickEvent.bind(this,"TD",this.params.cellWTLabel))}}.bind(this))}.bind(this));document.observe("agent:updatingResults",this.handleResultsUpdated.bind(this))},cellMouseEvent:function(A,C){var B=Event.findElementByTagName(C,"TD");var D=(C.type=="mouseover");this.highlightCell(B,D);this.highlightRowHeader(B,D);this.highlightColumnHeader(A,D)},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,A,C){if(!this.params.ignoreClicks){var B=Event.findElementByTagName(C,D);if(B.getElementsByTagName("a")[0]){if(A){B.fire("webtrends:multiTrackEvent",{"WT.ti":A,"WT.dl":"1"})}window.location=B.getElementsByTagName("a")[0].href}C.preventDefault()}},highlightRowHeader:function(A,B){$A(A.parentNode.cells).each(function(C){if(C.tagName!="TH"){throw $break}this.highlightCell(C,B)}.bind(this))},highlightColumnHeader:function(A,B){$A(this.table.tHead.rows).each(function(C){this.highlightCell(C.cells[A],B)}.bind(this))},highlightRow:function(A,C,B){$A(A.parentNode.cells).each(function(D){this.highlightCell(D,C)}.bind(this))},highlightColumn:function(B,C,A){$A(this.table.rows).each(function(D){this.highlightCell(D.cells[B],C)}.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 merchMiniAirForm=Class.create();merchMiniAirForm.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){if(this.params.setUpDefaults){this.params.mcOptions.setUp=function(){var A=this.dialogObject.markup.mainInfo.down("form");if(this.dialogObject.dataJSON.defaultOrigin&&this.dialogObject.dataJSON.defaultDestination){A.elements["ar.rt.leaveSlice.orig.key"].value=this.dialogObject.dataJSON.defaultOrigin;A.elements["ar.rt.leaveSlice.dest.key"].value=this.dialogObject.dataJSON.defaultDestination}}.bind(this)}this.dialogObject=new Microcontent(this.element.select(".miniAirFormTrigger a"),{jsTemplate:{id:this.params.templateId,dataAttributeName:"data-mini-air-form"}},this.params.mcOptions)}});var MicrocontentAgent=Class.create();MicrocontentAgent.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:false,initialize:function(A,C){Object.extend(this,C);this.element=Element.extend(A);var B=$A();if(!C.params.useAdditionalTriggersOnly){B.push(this.element)}if(C.params.additionalTriggers){C.params.additionalTriggers.each(function(D){$$(D).each(function(E){B.push(E)})})}this.dialogObject=new Microcontent(B,C.params.content,C.params.options)}});var SavedHotelsMicrocontent=Class.create(MicrocontentAgent,{initialize:function($super,A,B){B.params.options.setUp=SavedHotelsWebtrendsEventSender.onSavedHotelsListViewed.bind(this,B.params.viewMyFavoritesLink,B.params.context);$super(A,B)}});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 MicrocontentFromTemplate=Class.create(Abstract.Agent,{initExtend:function(){this.dialogObject=new Microcontent(this.element.select(this.params.identifier),{jsTemplate:{id:this.params.templateId,dataAttributeName:this.params.dataAttribute}},this.params.mcOptions)}});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 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 RevealOtherActivitiesControl=Class.create(Abstract.Agent,{initExtend:function(){var A=function(C){if(C.target.tagName.toLowerCase()=="a"){document.fire("otherActivities:reveal");B(C)}};var B=function(C){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 C=new Element("div").addClassName("otherCategoriesReveal");var A=new Element("a").addClassName("link").update(this.params.linkText);C.appendChild(A);var D=function(E){this.element.showByClass();this.element.getElementsByTagName("input")[0].value=true;B(E);E.preventDefault()}.bindAsEventListener(this);var B=function(E){A.stopObserving("click",D);C.removeChild(A);this.element.parentNode.removeChild(C);document.fire("otherActivitiesControl:remove")}.bindAsEventListener(this);Event.observe(A,"click",D);document.observe("otherActivities:reveal",D);this.element.parentNode.appendChild(C)}});var OasOptionsToggle=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){this.moreOptionsLink=null;this.element.addClassName("collapsedView");this.showMoreOptionsLink=new Element("a",{href:"#"}).update(this.params.showDetailsText);this.element.down(".oasProductFooter").insert({top:this.showMoreOptionsLink});this.showMoreOptionsLink.observe("click",function(A){if(this.element.hasClassName("collapsedView")){this.showMoreOptionsLink.update(this.params.hideDetailsText);this.element.removeClassName("collapsedView")}else{this.showMoreOptionsLink.update(this.params.showDetailsText);this.element.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(C){if(C.type.toLowerCase()==="checkbox"){B.push(C)}});var A=function(){var C=[];B.each(function(E){if(E.checked){var D=E.name.substring(E.name.lastIndexOf("['")+2,E.name.lastIndexOf("']"));C[C.length]=D}});return C};Event.observe(this.element,"click",function(E){var D=E.target;if(D.tagName.toLowerCase()==="input"&&D.type.toLowerCase()==="checkbox"){var C=A();document.fire("oasSubOptions"+this.params.activityKey+":changed",C)}}.bindAsEventListener(this));document.observe("oasSubOptions"+this.params.activityKey+":getKey",function(D){var C=A().toString();if(C!=D.memo.displayedKey){var E={memo:C};D.memo.callback(E)}}.bindAsEventListener(this))}});var OasOptionsTableManager=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){var B=function(H){if(H.target.tagName.toLowerCase()=="input"){var G=Element.extend(H.target).getParentByTagName("tbody").getElementsByClassName("displayedRow")[0];if(G){G.removeClassName("displayedRow")}var F=Element.extend(H.target).getParentByTagName("tr");F.addClassName("displayedRow");document.fire("oasOption"+this.params.activityKey+":changed",this.element)}}.bindAsEventListener(this);Event.observe(this.element,"click",B);if(this.params.subOptions){var E=function(){var H=$A();var I=this.element.getElementsByTagName("input");for(var G=0;G<I.length;G++){var F=I[G];if(F.type=="radio"){H.push(F)}}return H}.bindAsEventListener(this);var D=function(){var H=false;var I=E();for(var G=0;G<I.length;G++){var F=I[G];if(F.checked){H=F.value}}return H};var A=function(J){var I=E();var F=false;for(var H=0;H<I.length;H++){var G=I[H];if(G.value==J){G.click();F=true;return}}if(!F){log.debug("defaulting selected option to first radio since lists did not match");I[0].click()}};var C=function(F){if(this.params.subOptions[F.memo]){var H=D();var G=this.params.subOptions[F.memo];this.element.update(G);A(H)}}.bindAsEventListener(this);document.observe("oasSubOptions"+this.params.activityKey+":changed",C);document.fire("oasSubOptions"+this.params.activityKey+":getKey",{displayedKey:this.params.displayedKey,callback:C})}}});var OasSubOptionEventManagerAjax=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){this.element.on("click",function(C){var B=C.findElement("input[type=checkbox]");if(B&&B!=document){if(!this.pi){this.pi=new ProgressIndicator();this.element.down("fieldset").appendChild(this.pi.container)}A(B.up("form"))}}.bind(this));var A=function(C){var D=C.serialize()+"&"+this.params.eventId+"=true&pageView=optionsAjax";var B=new Ajax.Request(C.action,{method:"get",parameters:D,onSuccess:function(E){try{this.element.update(E.responseText);this.pi.stop();this.pi=null}catch(F){log.error("OasSubOptionEventManagerAjax: Error");Errors.capture(F)}}.bind(this),onFailure:function(){log.error("SubmitUpdateTrigger: No response from application for OasSubOptionEventManagerAjax");this.pi.stop();this.pi=null}})}.bind(this)}});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 C=function(D){this.OOobj.show();Event.stopObserving(A,"click",B);this.removeHeaderListItem();D.preventDefault()};var B=C.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 Pagination=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){if(this.params.streaming){document.on("agent:streamingComplete",this.initAjaxButton.bind(this));document.on("agent:streamingUpdate",this.handleStreamingUpdate.bind(this))}else{this.initAjaxButton()}},handleStreamingUpdate:function(A){if(event.memo.status=="timedout"){this.initAjaxButton()}},initAjaxButton:function(){this.element.on("click",this.onMoreResultsClick.bind(this));this.canUpdate=true;document.on("agent:updatingResults",this.onUpdatingResults.bind(this))},onMoreResultsClick:function(B){if(this.canUpdate){document.fire("agent:updatingResults");this.element.innerHTML=this.params.loadingText;var A=this.element.down(".animate");if(A){Effect.Pulsate(A,{pulses:60,duration:60})}this.element.addClassName("loading");this.update()}B.preventDefault()},update:function(){this.request=new Ajax.IncrementalPartialPage(this.element.readAttribute("href"),{method:"get",parameters:"rep=pagination&models['searchView'].startingIndex="+this.params.startingIndex})},onUpdatingResults:function(A){this.canUpdate=false}});var PanelCollapse=Class.create(Abstract.Agent,Persistent,{beforeDOMReady:true,initExtend:function(){this.titleBar=this.element.getFirstElementByClassName("titleBar","div");this.titleBar.addClassName("collapsible");this.initPersistence(this.params.persistenceId);this.opened=this.getPersistent("opened");if(this.opened===null){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.insert(this.params.collapseIcon+this.params.expandIcon);this.collapseIcon=this.expandCollapseLink.childElements()[0];this.expandIcon=this.expandCollapseLink.childElements()[1];if(this.opened){this.open()}else{this.close()}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 E=this.panelMessageElement.getParams();if((E!=null)&&(E.dirtyFieldsMessage!=null)){this.dirtyFieldsMessage=E.dirtyFieldsMessage}}this.fieldsToObserve=[];if(this.dirtyFieldsMessage!=""){var C=$A(this.element.getElementsByTagName("input"));var A=$A(this.element.getElementsByTagName("select"));var D=$A(this.element.getElementsByTagName("textArea"));this.fieldsToObserve=C.concat(A,D)}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))}this.titleBar.on("click",this.toggleCollapse.bind(this))},setFieldsDirty:function(){this.fieldsDirty=true;log.info("fields dirtied")},open:function(){this.expandIcon.hide();this.collapseIcon.show();this.panelContent.showByClass();if(!this.contentInitialized&&this.params.initLazyAgents){Page.initializeLazyAgents(this.panelContent);this.contentInitialized=true}},close:function(){this.collapseIcon.hide();this.expandIcon.show();this.panelContent.hideByClass()},toggleCollapse:function(A){this.titleBar.toggleClasses("open","closed");this.opened=!this.opened;if(this.opened){this.open();if(this.params.webtrendsLabel){this.element.fire("webtrends:multiTrackEvent",{"WT.ti":"Link: Expand "+this.params.webtrendsLabel})}}else{this.close();if(this.params.webtrendsLabel){this.element.fire("webtrends:multiTrackEvent",{"WT.ti":"Link: Collapse "+this.params.webtrendsLabel})}}this.setPersistent("opened",this.opened);if(this.fieldsDirty){if(this.opened){this.panelMessageElement.update(this.panelMessage)}else{this.panelMessageElement.update(this.dirtyFieldsMessage)}}A.preventDefault()}});var PhotoCarousel=Class.create(Abstract.Agent,{beforeDOMReady:true,bgOpacity:0.5,posIndex:0,lastImage:0,canMove:false,itemsLoaded:0,disabled:false,lockButtons:false,buttonOpacity:0.5,initExtend:function(){if(this.params.imageSet.length<2){return}if(this.params.imageSet.length==2){this.params.imageSet[2]=this.params.imageSet[0];this.params.imageSet[3]=this.params.imageSet[1]}this.cacheSize=this.params.imageSet.length;this.cache=$A(this.cacheSize);if(!this.params.lookAhead||(this.params.lookAhead>=this.cacheSize)){this.params.lookAhead=1}this.lookAhead=this.params.lookAhead;this.imgLink=this.element.getFirstElementByClassName("link");this.photoFrame=this.element.getFirstElementByClassName("photoFrame");this.imgWidth=this.element.getFirstElementByClassName("slide").getWidth();this.photoFrame.setStyle({width:this.imgWidth*(this.lookAhead*2+1)+"px"});this.placeHolderImg=new Element("span").update(this.params.placeHolderImage);this.buttonOpacity=(this.params.buttonOpacity?this.params.buttonOpacity:this.buttonOpacity);this.lockButtons=this.params.lockButtons;this.createControlPanel()},updatePhotoFrame:function(){this.updateCache();var D=this.imgLink.clone(false);var F=this.posIndex-this.lookAhead;if(F<0){F=this.cacheSize+F}var G=(this.lookAhead*2)+1;for(var E=0,C=F;E<G;E++){var A=(F+E)%this.cacheSize;if(this.imageIsPresent(this.cache[A])){D.insert({bottom:this.cache[A]})}else{D.insert({bottom:this.placeHolderImg.clone(true)})}}var B=-((G-1)/2)*this.imgWidth;this.photoFrame.setStyle({left:B+"px",position:"relative"});this.imgLink.update(D.innerHTML);this.canMove=true},imageIsPresent:function(A){if(!A.complete||((typeof A.naturalWidth)!=undefined&&A.naturalWidth==0)){return false}else{return true}},updateCache:function(){if(this.itemsLoaded>=this.cacheSize){return}var E=this.posIndex-this.lookAhead;if(E<0){E=this.cacheSize+E}var F=(this.lookAhead*2)+1;var C=function(G){Event.observe(G,"error",function(){Event.stopObserving(G,"error");G.innerText=this.placeHolderImg}.bind(this))}.bind(this);for(var D=0;D<F;D++){var B=(E+D)%this.cacheSize;if(!this.cache[B]){var A=new Element("img",{"class":"slide",src:this.params.imageSet[B]});C(A);A.removeAttribute("width");A.removeAttribute("height");this.cache[B]=A;this.itemsLoaded++}}},createControlPanel:function(){try{this.prev=new Element("a",{"class":"prevImageIcon",href:"#"}).update(this.params.previousButtonMarkup);this.prev.observe("click",this.scrollImageList.bindAsEventListener(this,"prev"));this.prev.setOpacity(this.buttonOpacity);this.nxt=new Element("a",{"class":"nextImageIcon",href:"#"}).update(this.params.nextButtonMarkup);this.nxt.observe("click",this.scrollImageList.bindAsEventListener(this,"next"));this.nxt.setOpacity(this.buttonOpacity);this.ctrlPanel=new Element("div",{"class":"controlPanel"});if(!this.lockButtons){this.ctrlPanel.hide()}this.ctrlPanel.insert({bottom:this.prev});this.ctrlPanel.insert({bottom:this.nxt});this.element.insert({bottom:this.ctrlPanel});this.parentElement=this.element.up();if(!this.lockButtons){this.parentElement.observe("mouseenter",this.showControls.bindAsEventListener(this));this.parentElement.observe("mouseleave",this.hideControls.bindAsEventListener(this))}else{this.parentElement.observe("mouseenter",this.updatePhotoFrame.bind(this));this.parentElement.observe("mouseleave",this.updatePhotoFrame.bind(this))}}catch(A){log.error(A)}},showControls:function(){this.ctrlPanel.appear({duration:0.25,afterFinish:this.updatePhotoFrame.bind(this)})},hideControls:function(){this.ctrlPanel.fade({duration:0.25});this.ctrlPanel.hide()},scrollImageList:function(A,C){A.preventDefault();if(this.canMove){this.canMove=false;var B;if(C=="next"){this.posIndex=(this.posIndex+1)%this.cacheSize;B=-1}else{this.posIndex--;if(this.posIndex<0){this.posIndex=this.cacheSize+this.posIndex}B=1}new Effect.MoveBy(this.photoFrame,0,B*this.imgWidth,{duration:0.4,transition:Effect.Transitions.sinoidal,afterFinish:this.updatePhotoFrame.bind(this)})}}});var PhotoGallery=Class.create();PhotoGallery.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){var C=this.element.parentNode;this.images=$A();this.imageIndex=0;$A(C.getElementsByTagName("A")).each(function(D){this.images.push(D)}.bind(this));C.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));C.appendChild(this.header)}C.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 G=this.params.imageList.eachSlice(this.params.groupSize);var E;for(var F=0;F<G.length;F++){var D=$A();this.tGrps[F]={};if(F==0){this.tGrps[F].wrapper=this.thCon.down("ul");var A=this.tGrps[F].wrapper.getElementsByTagName("img");var C=function(H){Event.observe(H,"load",function(){Event.stopObserving(H,"load");this.numImagesLoaded++;if(this.numImagesLoaded==A.length){this.firstRun()}}.bind(this))}.bind(this);for(var B=0;B<A.length;B++){C(A[B])}this.tGrps[F].initialized=true;this.offset=parseInt(window.getComputedStyle?window.getComputedStyle(this.thLst,null).left:this.thLst.currentStyle.left);E=this.tGrps[F].wrapper.getWidth()}else{this.tGrps[F].wrapper=$(new Element("ul",{"class":"hidden"}));this.tGrps[F].initialized=false}this.tGrps[F].wrapper.setStyle({left:(F*E)+"px"});for(var B=0;B<G[F].length;B++){D.push({imageURL:G[F][B].imgURL,thumbURL:G[F][B].thumbURL})}this.tGrps[F].images=D;this.tGrps[F].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(D){var E=this.tGrps[D];if(!E||E.initialized){return}for(var C=0;C<E.images.length;C++){var B=(new Element("li")).update(new Element("a",{href:E.images[C].imageURL}));var A=new Element("img");if(E.images[C].thumbURL){A.src=E.images[C].thumbURL}else{A.src=E.images[C].imageURL}B.down("a").update(A);E.wrapper.insert({bottom:B})}E.initialized=true;this.thLst.insert({bottom:E.wrapper})},firstRun:function(){if(!this.neverOpened){return}this.neverOpened=false;this.toggleThumbnailList()},toggleThumbnailList:function(F){if(F){F.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 G=this.tGrps[this.cGrp].wrapper.getPositionOffset(this.cls).x;var D=0;A.each(function(H){H.setStyle({position:"absolute",left:D+"px"});D=D+H.getWidth()});this.unsetSelectedImage();for(var C=0;C<A.length;C++){var B={style:"left: "+G+"px",duration:0.35-0.3*C/(this.params.groupSize-1),transition:Effect.Transitions.easeFrom};if(C==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[C],B)}}else{var G=this.tGrps[this.cGrp].wrapper.getPositionOffset(this.opn).x;A.each(function(H){H.setStyle({position:"absolute",left:G+"px"})});this.tGrps[this.cGrp].wrapper.showByClass();var E=A[0].getWidth();var D=E*(A.length-1);for(var C=A.length-1;C>-1;C--){var B={style:"left: "+D+"px",duration:0.35-0.3*C/(this.params.groupSize-1),transition:Effect.Transitions.easeTo};if(C==0){B.afterFinish=function(){A.each(function(I){I.setStyle({position:"",left:""});var J=this.currentImageLink;if(J){this.setSelectedImage(J)}else{this.setSelectedImage(A[0].down("a"))}}.bind(this));var H=$A([{el:this.bck,op:this.bgOpacity}]);if(this.cGrp!=0){H.push({el:this.prv,op:1})}if(this.cGrp<this.tGrps.length-1){H.push({el:this.nxt,op:1})}H.each(function(I){I.el.setStyle({opacity:0});I.el.showByClass();new Effect.Morph(I.el,{style:"opacity: "+I.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[C],B);D-=E}}},scrollThumbnailList:function(C,E){C.preventDefault();if(this.eff){return}this.eff=true;var B,D,A;if(E=="next"){B=this.cGrp+1}else{B=this.cGrp-1}D=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()}D.showByClass();new Effect.Morph(this.thLst,{style:"left: "+(-1*parseFloat(D.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 D=new Element("img",{src:A.href});this.unsetSelectedImage();this.setSelectedImage(A);var C=this.img;new Effect.Morph(C,{style:"opacity: 0",duration:0.25,afterFinish:function(){C.update(D);new Effect.Morph(C,{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 PkgCardToggle=Class.create();PkgCardToggle.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){var B=this.element.getFirstElementByClassName("titleLink");var A=(new Element("a").update(B.innerHTML).addClassName("link")).insert({top:this.params.collapseImg}).insert({top:this.params.expandImg});A.observe("click",this.toggle.bindAsEventListener(this));B.replace(A);if(this.params.expanded){this.swapIcon(this.element)}},toggle:function(B){if(this.element.next().hasClassName(this.params.targetClass)){this.element.next().toggleByClass()}else{var A=$(this.element.up("."+this.params.parentClass)).getElementsByClassName(this.params.targetClass)[0].clone(true);A.showByClass();Page.initializeDOMFragment(A);this.element.insert({after:A})}this.swapIcon(this.element)},swapIcon:function(A){$A(A.getElementsByTagName("img")).each(function(B){B.toggleByClass()})}});var PkgMatrix=Class.create(Abstract.Agent,{initExtend:function(){this.headTable=$("content").getFirstElementByClassName("pkgHeaderGroup");Event.observe(this.element,"mouseover",this.over.bind(this));Event.observe(this.element,"mouseout",this.out.bind(this))},over:function(B){var A=$(Event.findElementByTagName(B,"TD"));if(A.hasClassName("pkgMatrixCell")){A.addClassName("hover");$(A.parentNode.getElementsByTagName("TH")[0]).addClassName("hover");$(this.headTable.tBodies[0].rows[0].cells[A.cellIndex-1]).addClassName("hover")}},out:function(B){var A=$(Event.findElementByTagName(B,"TD"));if(A.hasClassName("pkgMatrixCell")){A.removeClassName("hover");$(A.parentNode.getElementsByTagName("TH")[0]).removeClassName("hover");$(this.headTable.tBodies[0].rows[0].cells[A.cellIndex-1]).removeClassName("hover")}}});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.LargeSizeNoToolBar=Class.create();PopupWindow.LargeSizeNoToolBar.prototype=Object.extend(new PopupWindow(),{windowProps:"width=800,height=600,left=0,top=0,resizable=yes,toolbar=no,location=yes,scrollbars=yes,status=yes",windowName:"popWinLargeSizeNoToolBar"});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"});PopupWindow.VirtualTour=Class.create();PopupWindow.VirtualTour.prototype=Object.extend(new PopupWindow(),{windowProps:"width=750,height=600,left=0,top=0,resizable=yes,toolbar=no,location=yes,scrollbars=yes,status=yes",windowName:"popWinVirtualTour"});PopupWindow.FullSite=Class.create();PopupWindow.FullSite.prototype=Object.extend(new PopupWindow(),{windowProps:"width=1024,height=700,left=0,top=0,resizable=yes,toolbar=yes,location=yes,scrollbars=yes,status=yes,directories=yes",windowName:"popWinFullSite"});var Print=Class.create();Print.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){window.print()}});ProductNav=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){Page.initializeLazyAgents(this.element);this.radios=this.element.select(".radio input");this.radios.each(function(A){A.on("click",this.selectProduct.bind(this));if(A.checked){this.currentType=A.value}}.bind(this))},isAjaxUpdateEnabled:function(){if(this.element.hasClassName("quickSearchNav")){return Page.isDOMReady}else{return false}},selectProduct:function(D){var B=D.element();var C=B.value;if(C!=this.currentType){document.fire("webtrends:multiTrackEvent",{"DCSext.rbck":C});if(this.isAjaxUpdateEnabled()&&C!="cru"){this.element.fire("agent:showIntrastitial");if(this.request){this.request.abort()}var A=C.substring(0,10)=="thirdParty";var E=A?"/helper/searchFormThirdParty":"/shop/searchForm";this.request=new Ajax.Request(E,{parameters:"quickSearch=true&pathId=home&type="+C,onSuccess:function(F){log.info("Response received from /shop/searchForm");this.element.fire("agent:hideIntrastitial",{newMarkup:F.responseText});this.request=null}.bind(this),onFailure:function(){log.error("No response from /shop/searchForm");this.request=null}});this.currentType=C}else{location.href=B.getAttribute("data-url")}}}});var ProgressBar=Class.create();ProgressBar.prototype={initialize:function(B,A){this.progress=0;this.container=$(B);this.bar=new Element("div");this.bar.setStyle({width:"100%",height:"100%",position:"absolute",top:"0px",right:"0px"});this.container.appendChild(this.bar);this.width=this.bar.getDimensions().width;this.options={interval:0.25,step:1};Object.extend(this.options,A||{})},start:function(){this.executer=new PeriodicalExecuter(this.step.bind(this,this.options.step),this.options.interval)},stop:function(){if(this.executer){this.executer.stop()}},step:function(A){this.progress=Math.min(100,this.progress+A);this.bar.setStyle({width:(this.width-Math.floor((parseInt(this.progress,10)/100)*this.width))+"px"});if(this.progress>=100){this.stop()}}};var ProgressIndicator=Class.create();ProgressIndicator.prototype={initialize:function(C,I){log.debug("ProgressIndicator.initialize");var F=I?I:"&#8226;";var A=C?C*0.75:0.75;this.container=new Element("div").addClassName("progressIndicator").setStyle({position:"relative"});this.spinners=$A();for(var G=0;G<12;G++){var B=1-((G*83333)/1000000);var J=new Element("span").update(F).setOpacity(B);var E=(Math.PI*G)/6;var D=(Math.sin(E)*A).toFixed(3);var H=(Math.cos(E)*A).toFixed(3);J.setStyle({position:"absolute",top:D?D+"em":"0",left:H?H+"em":"0"});this.spinners.push(J);this.container.appendChild(J)}this.start()},start:function(){this.interval=setInterval(this.fadeStep.bind(this),83)},stop:function(){clearInterval(this.interval)},fadeStep:function(){this.spinners.each(function(C){var B=C.getOpacity();var A=B+0.083;if(A>=0.99){A=0}C.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(){this.pi=new ProgressIndicator(this.params.radius,this.params.symbol);this.element.appendChild(this.pi.container)}});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 RadioAsLink=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){if(!this.params.name){log.error("RadioAsLink: Missing arg");return}if(!this.params.value){this.params.value=""}var A="control radio",C="";if(this.params.checked){A+=" checked";C='checked="checked"'}var B='<label class="'+A+'"><input '+C+' name="'+this.params.name+'" type="radio" value="'+this.params.value+'" data-url="'+this.element.href+'" /><span class="primaryRadioMessage">'+this.element.innerHTML+"</span></label>";this.element.replace(B)}});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-mini-air-form"}},this.params.mcOptions);this.attachEventHandlers(false);if(this.params.intrastitialMessage){this.intrastitial=new Intrastitial(this.params.intrastitialMessage,$(this.element.parentNode),true)}},addDialogContentToRecentlyViewedBox:function(C){var E;var A;if(C){E=this.recentlyViewedList;A=this.recentlyViewedHeader}else{var B=$(this.dialogObject.markup.mainInfo).getFirstElementByClassName("airFareDatesContainer");E=B&&B.innerHTML;A=B&&this.dialogObject.markup.mainInfo.getFirstElementByClassName("dateSelectionHeading").innerHTML}if(E){if(!this.recentlyViewedList||C){this.element.down(".rateCalendar").insert({after:this.params.recentlyViewedMarkup})}try{this.recentlyViewedList=E;this.recentlyViewedHeader=A;Page.initializeDOMFragment($(this.element).getFirstElementByClassName("airFareDatesContainer").update(E));$(this.element).getFirstElementByClassName("recentlyViewedHeader").update(A)}catch(D){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(C){this.initPartial(C)}.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 ReadMore=Class.create(Abstract.Agent,{beforeDOMReady:true,minLinesForFade:6,initExtend:function(){if(!this.params.lines||!this.params.label){log.error("ReadMoreFade: Missing required param");return}var A=this.element;A.addClassName("readMoreAgent");var I=A.getLayout().get("height");var G=A.getStyle("line-height");G=G.substring(G.length-2)=="pt"?Math.round(parseFloat(G)*4/3):parseFloat(G);var F=G*this.params.lines;if(I<=F){return}F-=G;var C=new Element("div",{"class":"readMoreContent"});$A(A.childNodes).each(function(J){C.appendChild(J)});A.appendChild(C);var E=new Element("a",{"class":"link moreLink",href:"#"}).update(this.params.label);E.observe("click",function(J){if(B){B.remove()}E.remove();if(D){A.insert({bottom:D})}C.setStyle({height:"",overflow:""});J.preventDefault()});if(this.params.lines>this.minLinesForFade){var B=new Element("div",{"class":"fade"})}var H=function(J){if(D){D.remove()}if(B){A.insert({bottom:B})}A.insert({bottom:E});C.setStyle({height:F+"px",overflow:"hidden"});if(J){J.preventDefault()}};H();if(this.params.lessLinkLabel){var D=new Element("a",{"class":"link lessLink",href:"#"}).update(this.params.lessLinkLabel);D.observe("click",H)}}});var RecentSearchClear=Class.create(Abstract.Agent,{beforeDOMReady:false,initExtend:function(){this.element.observe("click",this.clear.bindAsEventListener(this))},clear:function(B){B.preventDefault();var A=new Ajax.Request("/helper/clearRecentSearch?type="+this.params.type,{onSuccess:function(D){var C=D.responseText.unescapeJSON().evalJSON();var E=this.element.up(".recentSearch");E.insert({before:C.message});E.hide()}.bind(this)})}});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.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 RemoveLinks=Class.create();RemoveLinks.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){$A(this.element.getElementsByTagName("a")).each(function(B){var C=document.createElement("span");C.innerHTML=B.innerHTML;var A=B.parentNode;A.replaceChild(C,B)})}});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(C){this.revealLink.remove();this.revealLink=null;for(var B=0,A=this.hiddenElements.length;B<A;B++){this.hiddenElements[B].showByClass()}C.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(){this.noCookiesMessage=this.params.noCookiesMessage||"";this.updateListURL=this.params.updateListURL;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(C){var B=parseSavedHotelsResponse(C);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(C){if(C.memo.length>=3){var B=C.memo[0];var A=C.memo[1];var D=C.memo[2];this.removeLinks.add(B,A,D)}},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(){this.noCookiesMessage=this.params.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){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;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))},add:function(A){A.preventDefault();this.request=new Ajax.Request(this.url,{method:"get",parameters:{cacheBuster:new Date().getTime()},onSuccess:function(C){var B=parseSavedHotelsResponse(C);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){this.hotelId=this.params.hotelId;this.url=this.params.url;this.element.fire("savedHotel:removeAgentCreated",[this.element,"click",this.remove.bindAsEventListener(this)])},remove:function(A){A.preventDefault();this.request=new Ajax.Request(this.url,{method:"get",parameters:{cacheBuster:new Date().getTime()},onSuccess:function(C){var B=parseSavedHotelsResponse(C);B.element=this.element;$(document.body).fire("savedHotel:removed",B);$(document.body).fire("savedHotel:removed_"+this.hotelId,B)}.bind(this)})}});var parseSavedHotelsResponse=function(F){if(F&&F.responseText){var C=new Element("div");C.innerHTML=F.responseText;var D=C.select("div.savedHotelsData")[0].innerHTML;var G=C.select("span.savedHotelsTotal")[0];var E=C.select("div.savedHotelsStatusContent")[0];var B=C.select("div.savedHotelsContent")[0];var A={savedHotelsData:D.evalJSON(),savedHotelsTotal:G,savedHotelsStatusContent:E,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(C,E,F){if(arguments.length==3){var A;if(E=="SEARCH"){A="HP"}else{if(E=="RESULTS"){A="SR"}}if(F){var B=Event.findElement(F,"A");var D=B.innerText||B.textContent;var G=new RegExp("\\s*\\d+\\s*","g");D=D.strip();D=D.replace(G,"");B.fire("webtrends:multiTrackEvent",{"DCS.dcsuri":C,"WT.dl":"0","WT.si_n":"FH","WT.ti":"Link:"+D,"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 ScriptContent=Class.create(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(I){var C=I.targetClass?this.element.getFirstElementByClassName(I.targetClass):this.element;if(!C){log.warning("ScriptContent.initExtend: exiting because target node [class: "+I.targetClass+"] was not valid")}else{var G=new Element(I.containerType||"div");G.innerHTML=I.content;if(I.containerClass){G.className=I.containerClass}var B;if(!I.containerType){var A=document.createDocumentFragment();B=G.childElements();while(G.firstChild){A.appendChild(G.firstChild)}G=A}var F=I.insertAtTop?C.insertBefore(G,C.firstChild):C.appendChild(G);if(I.containerType){B=[F]}if(this.clickHandler){var H=this.clickHandler.bindAsEventListener(this,I);for(var D=0,E=B.length;D<E;D++){Event.observe(B[D],"click",H)}}for(var D=0,E=B.length;D<E;D++){Page.initializeDOMFragment(B[D],true)}}}.bind(this))}});var ScriptContentCloseWindow=Class.create(ScriptContent,{clickHandler:function(){window.close()}});var ScriptContentCloseSelf=Class.create(ScriptContent,{clickHandler:function(){self.close()}});var ScriptContentCloseMobilePopup=Class.create(ScriptContent,{clickHandler:function(){var A=location.href;window.history.back();setTimeout(function(){if(A==location.href&&location.hash){location.hash=""}},0)}});var ScriptContentPrint=Class.create(ScriptContent,{clickHandler:function(){window.print()}});var ScriptContentGoTo=Class.create(ScriptContent,{clickHandler:function(B,A){window.location.href=A.url}});var ScriptContentAccountBookingPanel=Class.create(ScriptContent,{clickHandler:function(A){Event.stop(A);window.location=Event.element(A)}});var SearchForm=Class.create(Abstract.Agent,{initExtend:function(){this.dialogManager=new DialogManager(this.element);this.form=this.element.getFirstElementByClassName("searchFormForm","form");this.initializeChildren();this.listenElement=this.element.up(".searchFormPanel");if(!this.listenElement){this.listenElement=this.element}var A=this.form.strm;if(A&&!this.params.disableStreaming){A.value=true}this.listenElement.observe("agent:showIntrastitial",this.showIntrastitial.bindAsEventListener(this));this.listenElement.observe("agent:hideIntrastitial",this.hideIntrastitial.bindAsEventListener(this))},showIntrastitial:function(A){this.dialogManager.close();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.parentNode.insert({top:this.pi.container})}this.pi.container.addClassName("visible");if(A){A.stopPropagation()}},hideIntrastitial:function(C){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(C&&C.memo&&C.memo.newMarkup){this.destroy();C.stopPropagation();var A=this.element.parentNode;this.element=null;A.update(C.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(C){Element.extend(C.parentNode);Event.observe(C,"click",this.onClick.bind(this));if(C.checked){this.currentType=C.value}}.bind(this))},onClick:function(){var B;var D;this.radios.each(function(E){if(E.checked){B=E.value;D=$(E).readAttribute("data-url").split("?")[1]}});if(this.params.path=="air"){var A=this.searchForm.form.serialize();D=A+"&ar.newType="+B}if(B!=this.currentType){var C=new Ajax.Request("/shop/searchForm",{parameters:D,onSuccess:this.success.bind(this),onFailure:this.failure});this.currentType=B;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(D){var C=new Element("a",{"class":"link "+D,href:"#"}).update(this.params[D+"Text"]);C.observe("click",this[D].bind(this));this[D+"Item"]=new Element("li").update(C)}.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 C=this.element.getElementsByTagName("fieldset");var A=C.length;if(A<this.params.maxRooms){B.appendChild(this.addRoomItem)}if(A>1){B.appendChild(this.removeRoomItem)}$(C[A-1]).down(".guests").appendChild(B)},addRoom:function(B){B.preventDefault();if(this.busy){return}this.busy=true;var C=this.searchForm.form.serialize()+"&hotel.addRoom=true";var A=new Ajax.Request("/helper/hotelRoom",{method:"get",parameters:C,onSuccess:this.insertNewRoom.bind(this),onFailure:this.failure.bind(this)})},insertNewRoom:function(D){var C=this.searchForm.form.down(".travelers");var E=new Element("div").update(D.responseText);var F=E.down("ul.addRemove");if(F){F.remove()}var A=E.childElements();for(var B=0;B<A.length;B++){C.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(C,A){this.guestLabels=this.element.select("label");this.guestDropdowns=this.element.select("label select");this.guestDropdowns.each(function(D,E){if(E!=0){D.removeChild(D.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 D=(B)?parseInt(B.value):1;var A=(D<=this.guestLabels.length)?D:1;var C=this.visibilityClass;var E=this.multipleRoomsOptionText;this.guestLabels.each(function(H,G){var F=H.down("span");if(A==1&&F){F.addClassName(C);this.element.removeClassName("extraRoomSelectsShown")}else{F.removeClassName(C);this.element.addClassName("extraRoomSelectsShown")}if((A==E)||(G<A)){H.removeClassName("noneInlineBlock")}else{H.addClassName("noneInlineBlock")}}.bind(this))}});SearchForm.APHButton=Class.create(Abstract.ChildAgent,{initExtend:function(B,A){var C=this.element;var D=function(F){if(F&&C.disabled){return}C.disabled=F;C[(F)?"addClassName":"removeClassName"]("disabled")};var E=A.form.select(this.params.selectors);E.each(function(F){if(F.checked){D(true)}F.observe("click",function(){var G=false;if(this.checked){D(true)}else{E.each(function(H){if(H.checked){G=true;throw $break}});D(G)}})})}});SearchForm.CarLocationTypes=Class.create(Abstract.ChildAgent,{initExtend:function(B,A){this.searchForm=A;this.parentForm=$(this.searchForm.form);if(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.dropoffType){this.dropoff=B.getElementsBySelector('[name="'+this.params.dropoffType+'"]')[0]}else{this.dropoff=B.getElementsBySelector('[name="car.dropoffType"]')[0]}if(this.dropoff){Event.observe(this.dropoff,"change",this.requestForm.bindAsEventListener(this))}this.element.down(".submit").remove()},requestForm:function(E){var B="";if(/\/home/.test(location.pathname)){B="&quickSearch=true"}var D="/shop/searchForm";if(/\/book/.test(location.pathname)){D="/book/bookingpath";var A=this.searchForm.form.elements.execution.value;B="&quickSearch=true&changeSearch=true&_eventId=changeSearchXSellCar&execution="+A}document.fire("dateInput:clearField");var F=Form.serialize(this.searchForm.form).deleteQueryStringParam("search",false)+B;var C=new Ajax.Request(D,{parameters:F,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(C,B){var A=C.getElementsByTagName("select")[0];this.ageNote=C.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(C,B){this.formSubmits=$A();$A(B.element.getElementsByClassName("submit")).each(function(H){this.formSubmits.push(H.getElementsByTagName("input")[0])}.bind(this));this.multiBookingAlert=C.getFirstElementByClassName("alert","p");this.multipleRoomsOptionText=this.params.multipleRoomsText;if(this.multipleRoomsOptionText!=null&&this.formSubmits.length>0){if(C.getFirstElementByClassName("readOnlyValue","span")){var G=C.getFirstElementByClassName("readOnlyValue","span");var F=G.innerHTML;var A=Element.extend(C.getElementsByTagName("input")[0]);if(A){var D=A.name;var E=A.value;A.remove()}else{D="fakeRoomsSelect";E=F}optionText=F;this.fauxSelect=Element.extend(document.createElement("select"));this.fauxSelect.name=D;this.addOptionToSelect(this.fauxSelect,E,optionText);G.parentNode.appendChild(this.fauxSelect);G.remove()}else{if(C.getElementsByTagName("select")[0]){this.fauxSelect=C.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,C,D){var A=Element.extend(document.createElement("option"));A.value=C;A.update(D);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(C,B){var A=C.getParentByTagName("form");this.checkbox=C.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 C=B.select('.location input[type="text"]');this.element=B;this.errorCode=this.params.errorCode.replace(".","-");this.errorMsg=this.element.down("."+this.errorCode);if(C.length<2){log.error("SearchForm.OandDValidator: could not find origin and destination fields");return}this.originField=C[0];this.destinationField=C[1];this.originField.observe("blur",this.validateLocations.bindAsEventListener(this));this.destinationField.observe("blur",this.validateLocations.bindAsEventListener(this))},validateLocations:function(B){var C=this.originField.value.strip().toLowerCase();var A=this.destinationField.value.strip().toLowerCase();if(C&&C===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 D=this.validateLocations.bindAsEventListener(this);for(var C=0;C<this.locations.length;C++){this.locations[C].observe("blur",D)}},validateLocations:function(D){var E=$A();var F=this.locations.length;for(var C=0;C<F;C++){E[C]=this.locations[C].value.strip().toLowerCase()}for(var B=0;B<(F-2);B+=2){if(E[B]&&E[B+1]){for(var A=B+2;A<F;A+=2){if(E[B]===E[A]&&E[B+1]===E[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 SeatMap=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){this.element.addClassName("interactiveMap");this.travelers=$A();var A=this.element.select(".travelerSeatSelection .traveler");A.each(function(D,C){var E=D.down("select");var B=new SeatMapTraveler(D,this.params.flightNumber,C+1);this.travelers.push(B);if(B.isModified(this.params.canClearSeats)){this.initResetLink()}E.on("change",this.handleSelectChanged.bindAsEventListener(this,B.number));B.controlEl.on("click",this.handleTravelerClicked.bind(this))},this);this.selectTraveler(1);document.on("agent:seatSummaryCellClicked",this.handleSummaryCellClicked.bind(this));this.element.on("click",".available",this.handleSeatClicked.bind(this))},initResetLink:function(){if(!this.resetLink&&this.params.resetLinkText){var A=this.element.down(".travelers");this.resetLink=new Element("a",{"class":"resetSelections block",href:"#"});this.resetLink.innerHTML=this.params.resetLinkText;A.insert(this.resetLink);this.resetLink.on("click",this.resetSeats.bind(this))}},initSeats:function(){if(!this.seats){var B=$H();var A=this.element.select(".available");A.each(function(C){var D=new SeatMapCell(C,this.params.flightNumber,this.params.premiumLabel);B.set(D.data.seatId,D);C.store("seat",D)},this);this.seats=B}},handleTravelerClicked:function(C,B){var A=C.findElement("input");if(A){this.selectTraveler(A.value)}},handleSeatClicked:function(C,A){this.initSeats();var B=this.seats.values();var D=A.retrieve("seat");if(D.data.isExit){if(!window.confirm(this.params.confirmText)){return}}this.selectSeat(D.data.seatId);this.selectTraveler((this.selectedTraveler.number==this.travelers.length)?1:this.selectedTraveler.number+1)},handleSelectChanged:function(A,B){this.initSeats();var C=this.seats.get(A.element().value);if(C.data.isExit){if(!window.confirm(this.params.confirmText)){return}}this.selectTraveler(B);this.selectSeat(C.data.seatId)},handleSummaryCellClicked:function(A){if(A.memo.flightNumber!=this.params.flightNumber){return}window.scrollTo(0,0);this.selectTraveler(A.memo.travelerNumber)},selectTraveler:function(A){this.travelers.each(function(B){if(B.number==A){B.select();this.selectedTraveler=B}else{B.deselect()}},this)},resetSeats:function(A){Event.stop(A);this.initSeats();this.seats.values().each(function(B){if(this.params.canClearSeats){B.clear()}else{B.reset()}},this);this.travelers.each(function(B){if(this.params.canClearSeats){B.clear()}else{B.reset()}},this);if(this.resetLink){this.resetLink.hideByClass()}this.selectTraveler(1)},selectSeat:function(A){this.initSeats();this.seats.values().each(function(C){if(C.data.seatId==A){C.setTraveler(this.selectedTraveler)}else{if(C.data.travelerNumber==this.selectedTraveler.number){C.clear()}}},this);var B=false;this.travelers.each(function(C){if(C.number==this.selectedTraveler.number){C.setSeat(A)}else{if(C.seatId==A){C.clear()}}if(C.isModified(this.params.canClearSeats)){B=true}},this);if(B){if(this.resetLink){this.resetLink.showByClass()}else{this.initResetLink()}}else{if(this.resetLink){this.resetLink.hideByClass()}}}});var SeatMapTraveler=Class.create({initialize:function(A,F,E){this.element=A;this.number=E;this.selectEl=A.down("select");this.defaultIndex=this.selectEl.selectedIndex;this.controlEl=new Element("label",{"class":"control radio"});var C=this.element.down(".primaryLabel").clone(true);this.radioEl=new Element("input",{type:"radio",name:"travelers"+F,value:E});this.controlEl.insert(C);this.controlEl.insert({top:this.radioEl});this.element.insert({top:this.controlEl});var B=this.element.down(".radio .name");this.name=B.innerHTML.strip();this.seatEl=new Element("span",{"class":"selectedSeat"});B.innerHTML=B.innerHTML+" -";var D=this.selectEl.options[this.selectEl.selectedIndex];this.seatEl.innerHTML=D.value||D.text;B.insert(this.seatEl)},select:function(){this.element.addClassName("selected");this.radioEl.checked=true;this.radioEl.focus()},deselect:function(){this.element.removeClassName("selected");this.radioEl.checked=false},setSeat:function(A){this.selectEl.value=A;this.seatEl.innerHTML=A},clear:function(){this.selectEl.selectedIndex=0;this.seatEl.innerHTML=this.selectEl.options[this.selectEl.selectedIndex].text},reset:function(){this.selectEl.selectedIndex=this.defaultIndex;this.seatEl.innerHTML=this.selectEl.options[this.selectEl.selectedIndex].text},isModified:function(A){return(A)?(this.selectEl.selectedIndex>0):(this.selectEl.selectedIndex!=this.defaultIndex)}});var SeatMapCell=Class.create({initialize:function(A,C,D){this.element=A;this.descriptionEl=this.element.down(".description");this.travelerEl=this.element.down(".traveler");this.data={travelerNumber:0,isPremium:false,isExit:false,flightNumber:C,premiumLabel:D};var B=this.element.readAttribute("data-seat");if(B){Object.extend(this.data,B.unescapeJSON().evalJSON())}if(this.data.travelerNumber>0){this.data.travelerName=this.element.readAttribute("title")}this.defaultTraveler={name:this.data.travelerName,number:this.data.travelerNumber}},setTraveler:function(A){if(this.data.travelerNumber!=A.number){if(!this.travelerEl){this.travelerEl=new Element("span",{"class":"traveler"});this.element.insert(this.travelerEl)}this.data.travelerNumber=A.number;this.data.travelerName=A.name;this.travelerEl.innerHTML=A.number;this.descriptionEl.hide();this.element.addClassName("selected");this.element.setAttribute("title",A.name);this.element.fire("agent:seatMapCellUpdated",Object.clone(this.data))}},clear:function(){if(this.data.travelerNumber!=0){this.data.travelerNumber=0;this.data.travelerName="";if(this.travelerEl){this.travelerEl.innerHTML=""}this.descriptionEl.show();this.element.removeClassName("selected");var A=this.data.seatId;if(this.data.isPremium){A+=this.data.premiumLabel}this.element.setAttribute("title",A);this.element.fire("agent:seatMapCellUpdated",Object.clone(this.data))}},reset:function(){if(this.defaultTraveler.number==0){this.clear()}else{this.setTraveler(this.defaultTraveler)}}});var SeatMapPreferences=Class.create(Abstract.Agent,{initExtend:function(){this.element.on("click",".radio",this.handleClick.bind(this))},handleClick:function(F,E){var C=E.down("input");var D=E.down("span");if(!D){log.error("Invalid markup for SeatMapPreferences radio button");return}var A=E.down(".seatId");var B={travelerNumber:this.params.travelerNumber,preference:D.innerHTML.strip(),flightNumber:this.params.flightNumber};if(A){B.preference=A.innerHTML.strip();B.seatId=C.value}this.element.fire("agent:seatPreferencesUpdated",B)}});var SeatSummary=Class.create(Abstract.Agent,{initExtend:function(){document.on("agent:seatPreferencesUpdated",this.handleUpdate.bind(this));document.on("agent:seatMapCellUpdated",this.handleUpdate.bind(this));this.element.on("click",".seatSelection",this.handleClick.bind(this))},initCells:function(){if(!this.cells){var A=this.element.select(".seatSelection");this.cells=$A();A.each(function(D,C){var B=this.cells[C]=new SeatSummaryCell(D,this.params.premiumMarkup);D.store("seatSummaryCell",B)},this)}},handleClick:function(C,B){this.initCells();var A=B.retrieve("seatSummaryCell");this.element.fire("agent:seatSummaryCellClicked",{flightNumber:A.data.flightNumber,travelerNumber:A.data.travelerNumber})},handleUpdate:function(A){this.initCells();this.cells.each(function(B){if(B.data.flightNumber!=A.memo.flightNumber){return}if(B.data.travelerNumber==A.memo.travelerNumber){B.update(A.memo)}else{if(B.data.seatId&&B.data.seatId==A.memo.seatId){B.clear()}}})}});var SeatSummaryCell=Class.create({initialize:function(A,B){this.element=A;this.premiumMarkup=B;this.link=A.down("a");this.status=A.down(".seatStatus");this.endColor=A.up("tr").getStyle("backgroundColor").parseColor("#ffffff");this.data={preference:this.link.innerHTML};var C=A.readAttribute("data-seat");if(C){Object.extend(this.data,C.unescapeJSON().evalJSON())}this.origSeat=this.data.seatId},update:function(B){var A;this.data.seatId=B.seatId;if(B.preference){A=B.preference}else{A=B.seatId;if(B.isPremium){A+=this.premiumMarkup}}if(this.status){if(B.seatId==this.origSeat){this.status.show()}else{this.status.hide()}}this.link.innerHTML=A;this.highlight()},clear:function(){this.link.innerHTML=this.data.preference;this.data.seatId=null;if(this.status){this.status.hide()}this.highlight()},highlight:function(){var A=new Effect.Highlight(this.element,{startcolor:"#FEF19B",endcolor:this.endColor,restorecolor:this.endColor,duration:3})}});var ViewSeatsAgent=Class.create(Abstract.Agent,{initExtend:function(){var C,B,A;B={ajaxParameters:"rep=partial",compact:true,classes:"viewSeatsLightBox"};Object.extend(B,this.params.options||{});A={url:this.element.readAttribute("href"),stripWhitespace:(Prototype.Browser.IE&&document.documentMode>=9)};C=new Lightbox([this.element],A,B)}});var SeatPreferences=Class.create();SeatPreferences.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:true,initExtend:function(){this.target=this.element.down(this.params.preferencesTarget);if(!this.target){log.error('SeatPreferences: Required parameter "preferencesTarget" missing');return}this.element.on("click",(function(A){switch(A.target.value){case this.params.hideOnValue:this.target.hideByClass();break;case this.params.showOnValue:this.target.showByClass();break;default:break}}).bindAsEventListener(this))}});var SeatPreferencesTraveler=Class.create();SeatPreferencesTraveler.prototype=Object.extend(new Abstract.Agent,{beforeDOMReady:true,initExtend:function(){this.travelerIndex=this.params.travelerIndex;this.radioControls=this.element.select("input[type=radio]");this.nameElement=this.element.previous();this.updateMember=true;document.on("traveler"+this.params.travelerIndex+"Name:changed",this.onNameChange.bind(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.onNameChange.bind(this)})}},onNameChange:function(A){var B;if(A.memo.get("index")===this.travelerIndex){B=A.memo.get("travelerInformation");if(B){this.updateSeatPreference(B.flightPreferences.seat)}else{this.updateSeatPreference(this.params.defaultSeatPrefType)}this.updateName(A.memo.get("name"))}},updateSeatPreference:function(B){var C,D;var A=B||this.params.defaultSeatPrefType;for(C=0;C<this.radioControls.length;C++){D=this.radioControls[C];D.checked=(D.value===A)?true:false}},updateName:function(A){this.nameElement.innerHTML=A.blank()?this.params.travelerLabel:A},savedTravelerChanged:function(B){var A=B.memo.get("useMemberName");if(A){this.updateMember=false;this.updateName(B.memo.get("name"))}}});var SecondaryDate=Class.create(Abstract.Agent,{initExtend:function(){this.dateDiv=new Element("div").addClassName(this.params.divClass);this.element.appendChild(this.dateDiv);document.observe("secondaryDate:changeDate",this.changeDate.bindAsEventListener(this));document.fire("calendar:formatDate",{dateInputIndex:this.params.index,callback:this.setDate.bind(this)})},setDate:function(A){this.dateDiv.update(A)},changeDate:function(A){if(this.params.index==A.memo.index){document.fire("calendar:formatDate",{dateInputIndex:this.params.index,callback:this.setDate.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 SelectHideReveal=Class.create();SelectHideReveal.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){log.debug("SelectHideReveal...");this.dropDown=$(this.element.getElementsByTagName("select")[0]);this.parentNode=this.dropDown.getParentByClassName(this.params.parentClass);this.toggleElements();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 C=0;C<this.params.listOptions[A].showClasses.length;C++){$A(this.parentNode.getElementsByClassName(this.params.listOptions[A].showClasses[C])).each(function(D){D.showByClass()})}for(var B=0;B<this.params.listOptions[A].hideClasses.length;B++){$A(this.parentNode.getElementsByClassName(this.params.listOptions[A].hideClasses[B])).each(function(D){D.hideByClass()})}}});var SendFlightStatus=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){this.flightStatusTypes=Element.extend(this.element.getElementsByTagName("input"));this.hideAndReveal();function A(B){this.hideAndReveal()}Event.observe(this.flightStatusTypes[0],"click",A.bindAsEventListener(this));Event.observe(this.flightStatusTypes[1],"click",A.bindAsEventListener(this))},hideAndReveal:function(){if(!this.flightStatusTypes[0].checked&&this.flightStatusTypes[1].checked){this.element.getElementsByClassName("showFlightAlerts")[0].style.display="inline"}else{if(this.flightStatusTypes[0].checked&&!this.flightStatusTypes[1].checked){this.element.getElementsByClassName("showFlightAlerts")[0].style.display="none"}}}});var SendOntimeAlerts=Class.create();SendOntimeAlerts.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:true,initExtend:function(){this.onTimeAlerts=this.element.getElementsByTagName("input");this.hourPrefSelect=this.element.getElementsByTagName("select")[0];this.hideAndReveal();Event.observe(this.onTimeAlerts[0],"click",this.hideAndReveal.bindAsEventListener(this));Event.observe(this.hourPrefSelect,"change",this.hideAndReveal.bindAsEventListener(this))},hideAndReveal:function(){if(this.onTimeAlerts[0].checked){this.hourPrefSelect.disabled=false;if(this.params.hourPrefInfo==""){return}if(this.params.hourPrefInfo.indexOf(this.hourPrefSelect.options[this.hourPrefSelect.selectedIndex].value)>=0){this.element.getElementsByClassName("alert")[0].style.display="inline"}else{this.element.getElementsByClassName("alert")[0].style.display="none"}}else{if(!this.onTimeAlerts[0].checked){this.hourPrefSelect.disabled=true;if(this.params.hourPrefInfo!==""){this.element.getElementsByClassName("alert")[0].style.display="none"}}}}});var Slider=Class.create(Abstract.Agent,{restricted:true,snapInterval:false,tickSubdivisions:false,tickInterval:false,sliderPosition:"bottom",trackType:"lessThan",hideTicks:false,hidden:false,initExtend:function(){Object.extend(this,this.params||{});this.useTouchEvents=("ontouchstart" in document);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}if(!this.hidden){this.initMarkup()}},show:function(){this.hidden=false;if(!this.track){this.initMarkup()}},initMarkup:function(){this.disabled=this.disabled||(this.min==this.max)||(this.snapInterval&&(this.max-this.min==this.snapInterval));var G=new Element("div",{"class":"slider  slider"+this.fields.length+"Handled"});var F="sliderTrack";if(this.hideTicks==true){F=F+" noTicks"}if(this.fields.length===1){F=F+" "+this.trackType}this.track=new Element("div",{"class":F});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 H=(Math.floor(this.min/this.tickInterval)+1)*this.tickInterval;var C=(Math.ceil(this.max/this.tickInterval)-1)*this.tickInterval;var M=Math.ceil((C-H)/this.tickInterval)+3;var L=(Math.floor(this.min/this.tickSubdivisions/this.tickInterval)+1)*this.tickInterval*this.tickSubdivisions;var K=(Math.round((L-H)/this.tickInterval)+1)%this.tickSubdivisions}else{var M=2}for(var D=0;D<M;D++){var O;if(D==0){O="tick lowRange"}else{if(D==M-1){O="tick highRange"}else{if(D%this.tickSubdivisions==K){O="tick"}else{O="minorTick"}}}var E=new Element("div",{"class":O});this.ticks.push(E);A.appendChild(E)}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 D=0;D<this.fields.length;D++){var B=new Element("div",{"class":"handle handle"+D});B.style.cursor="pointer";this.handles[D]={element:B,index:D,field:this.fields[D]};A.appendChild(B)}this.track.appendChild(A);var I=new Element("div",{"class":"sliderRange"});I.appendChild((new Element("span",{"class":"rangeLow"})).insert(this.rangeMinLabel||this.min));I.appendChild((new Element("span",{"class":"rangeHigh"})).insert(this.rangeMaxLabel||this.max));G.insert(this.track);if(this.sliderPosition==="top"){I.addClassName("aboveTrack");G.insert({top:I})}else{G.insert(I)}if(this.sliderPosition==="top"){this.container.insert({top:G})}else{this.container.insert(G)}for(var D=0;D<this.fields.length;D++){var J=this.fields[D];J.index=D;this.updateField(J);J.lastValue=J.value;if(this.min!=this.max){this.addFieldEventListeners(J)}}this.fieldTimestamp=new Date();this.update();if(this.disabled){this.disable()}else{if(this.useTouchEvents){G.observe("touchstart",this.startDrag.bindAsEventListener(this))}else{G.observe("mousedown",this.startDrag.bindAsEventListener(this))}}},getFields:function(){return this.fields||this.container.select(".textInput input")},addFieldEventListeners:function(A){A.observe("blur",this.checkFieldAndUpdate.bindAsEventListener(this));A.observe("keypress",this.handleFieldKeyPress.bindAsEventListener(this))},getContainer:function(){var A=this.container;if(!A&&this.selector){A=this.element.down(this.selector)}A=A||this.element;return A},startDrag:function(E){E.preventDefault();var B=E.element();for(var C=0;C<this.handles.length;C++){if(this.handles[C].element==B){var A=this.handles[C];break}}if(!A||(this.useTouchEvents&&E.touches.length>1)||(!this.useTouchEvents&&!E.isLeftClick())){return}document.body.style.cursor="pointer";var F=0;if(this.restricted&&A.index>0){var D=this.handles[A.index-1].element;F=parseInt(D.getStyle("marginLeft"))}var G=this.width;if(this.restricted&&A.index<this.handles.length-1){var D=this.handles[A.index+1].element;G=parseInt(D.getStyle("marginLeft"))}this.drag={handle:A,mousePos:this.getEventX(E),handlePos:parseInt(B.getStyle("marginLeft")),minimum:F,maximum:G};if(this.useTouchEvents){this.eventListeners={touchmove:this.continueDrag.bindAsEventListener(this),touchend:this.stopDrag.bindAsEventListener(this),touchcancel:this.stopDrag.bindAsEventListener(this),selectstart:this.preventTextSelection.bindAsEventListener(this)}}else{this.eventListeners={mousemove:this.continueDrag.bindAsEventListener(this),mouseup:this.stopDrag.bindAsEventListener(this),selectstart:this.preventTextSelection.bindAsEventListener(this)}}for(var C in this.eventListeners){document.observe(C,this.eventListeners[C])}},continueDrag:function(A){A.preventDefault();if(!this.drag||(this.useTouchEvents&&A.touches.length>1)){return}var C=this.getEventX(A)-this.drag.mousePos+this.drag.handlePos;if(C<this.drag.minimum){C=this.drag.minimum}else{if(C>this.drag.maximum){C=this.drag.maximum}}var B=this.pixelsToValue(C);if(this.snapInterval){var B=this.snapValue(B);C=this.valueToPixels(B)}this.moveHandle(this.drag.handle,C);if(new Date()-this.fieldTimestamp>=50){this.updateField(this.drag.handle.field,B);this.fireUpdateEvent(this.drag.handle,false)}},stopDrag:function(B){B.preventDefault();if(!this.drag){return}var D=parseInt(this.drag.handle.element.getStyle("marginLeft"));var C=this.pixelsToValue(D);if(this.snapInterval){C=this.snapValue(C)}this.updateField(this.drag.handle.field,C);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},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(D){var B=D.element();for(var C=0;C<this.handles.length;C++){if(this.handles[C].field==B){var A=this.handles[C];break}}if(!A){return}this.updateField(A.field);var F=this.correctHandleValue(this.correctFieldValue(A.field));var E=this.min;if(this.restricted&&A.index>0){E=this.correctFieldValue(this.handles[A.index-1].field)}var G=this.max;if(this.restricted&&A.index<this.handles.length-1){G=this.correctFieldValue(this.handles[A.index+1].field)}if(F<E){F=E}else{if(F>G){F=G}}if(this.snapInterval){F=this.snapValue(F)}this.moveHandle(A,this.valueToPixels(F));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 C=this.correctFieldValue(this.handles[A].field);this.moveHandle(this.handles[A],this.valueToPixels(C))}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.fireFilterEvent()}},getEventX:function(A){if(this.useTouchEvents){var C=A.touches[0];var B=C.pageX}else{var B=A.pointerX()}return B},fireFilterEvent:function(A){var B={};A=A||this.fields;A.each(function(C){B[C.name]=C.value},this);this.container.fire("agent:filter",{params:B})}});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.useTouchEvents=("ontouchstart" in document);this.container=this.getContainer();this.fields=this.container.select("select");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;this.selected=true}this.initToggle();if(this.hidden||!this.selected){this.hide()}else{this.initSlider()}},initToggle:function(){var A=this.element.down(".subheading");if(!A){log.error("No toggle element found.");return}var D=A.down(".toggle");if(!D){D=new Element("div",{"class":"toggle"});A.insert(D)}var B=new Element("label");this.toggle=new Element("input",{type:"checkbox","class":"agentCtrl"});var C=new Element("span");B.insert(this.toggle);C.insert(this.toggleLabelText);B.insert(C);D.insert(B);if(this.selected){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")},addFieldEventListeners:function(A){A.observe("change",this.checkFieldAndUpdate.bindAsEventListener(this))},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(D){var B=arguments[1]||D.selectedIndex;var A=D.options.length-1;var C=0;if(D.index>0){C=this.fields[D.index-1].selectedIndex}if(D.index<this.fields.length-1){A=this.fields[D.index+1].selectedIndex}if(B<C){B=C}else{if(B>A){B=A}}return B},handleSliderUpdated:function(C,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(C){this.element.fire("webtrends:multiTrackEvent",{"DCSext.fctkw":"Flight Times Filter"});this.fireFilterEvent([B])}},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.selected==true;this.show()}else{this.selected==false;this.hide()}},hide:function(){if(!this.hidden){this.container.hideByClass();for(var B=0;B<this.fields.length;B++){var C=this.fields[B];var A=(B==0)?0:C.options.length-1;C.selectedIndex=A;if(this.labels[B]){this.labels[B].remove()}}if(this.interacted){this.fireFilterEvent();this.interacted=false}this.updateLabel()}this.hidden=true},show:function(){if(this.hidden){this.hidden=false;this.container.showByClass();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 PriceFilter=Class.create(Slider,{beforeDOMReady:true,sliderPosition:"top",hideTicks:true,initExtend:function($super){$super();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))},initMarkup:function($super){$super();this.startColor=this.track.getStyle("color").parseColor("#ffffff");this.endColor=this.fields[0].getStyle("backgroundColor").parseColor("#ffffff")},correctFieldValue:function(B){var A=arguments[1]||B.value;if(A){if(typeof A==="string"){A=A.strip();var D=1.1;var C=D.toLocaleString().substring(1,2);if(C!="."){A=A.replace(C,".")}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(C,A){var B=this.fields[A];B.blur();this.addHighlight(B);if(C){this.fadeHighlight(B);this.element.fire("webtrends:multiTrackEvent",{"DCSext.fctkw":"Total Price Filter"});this.fireFilterEvent([B])}},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(D){var C=arguments[1]||D.value;C=this.correctHandleValue(C);C=parseFloat(C).toFixed(1);var A=parseFloat(this.max).toFixed(1);var B=parseFloat(this.min).toFixed(1);if(D.index>0){B=this.fields[D.index-1].value}if(D.index<this.fields.length-1){A=this.fields[D.index+1].value}if(C<B){C=B}else{if(C>A){C=A}}return C},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 SlideShow=Class.create(Abstract.Agent,{initExtend:function(){this.container=Element.extend(this.element.parentNode);if(this.params.compactMode){this.container.addClassName("compactImageGallery")}var D=new ProgressIndicator();this.container.parentNode.appendChild(D.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(G,F){var H=Element.extend(G);this.images.push({imageRef:H,initialized:false,parent:Element.extend(H.parentNode),imageIndex:F});if(F===0){this.images[F].parent.addClassName("current")}if(F>=this.imagesPerGroup){this.images[F].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 E=new Element("div").addClassName("mainImage");this.image=new Element("img",{alt:""});E.appendChild(this.image);this.header=new Element("div").addClassName("galleryHeader");var C=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);C.appendChild(this.currentPosition);C.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(F){if(F.findElement("a")===this.previousButton){this.previousClick(true)}if(F.findElement("a")===this.nextButton){this.nextClick(true)}if(F.findElement("a")===this.showButton){if(this.slideShowController){this.stopSlideShow()}else{this.startSlideShow()}}F.stop()}.bindAsEventListener(this);Event.observe(this.header,"click",A);C.insert({top:this.previousButton,bottom:this.nextButton});this.header.appendChild(C);this.header.appendChild(this.showButton)}this.container.appendChild(this.header);this.container.appendChild(E);this.showImage(0,0);if(this.galleryExists&&!this.params.compactMode){this.container.appendChild(this.setupThumbnails());this.element.show()}setTimeout(function(){D.stop();this.container.parentNode.removeChild(D.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(C){var F=C.target;if(C.findElement("a")===this.backControl){this.previousThumbGroup()}if(C.findElement("a")===this.forwardControl){this.nextThumbGroup()}if(F.hasClassName("thumbnail")){var E=this.images.detect(function(G){if(F.src==G.imageRef){return G}});this.showImage(this.currentImageIndex,E.imageIndex);var D=this.currentImageIndex+this.loadAdvanceImages;if(D>=this.images.length){D=0}if(!this.images[D].initialized){this.initializeThumbGroup(this.currentThumbGroup+1)}this.currentPosition.update(this.currentImageIndex+1)}this.stopSlideShow();C.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 C=new Element("img",{src:this.images[A].imageRef.href,"class":"thumbnail"});B.update(C);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 E=this.currentImageIndex+1;var C=E>=this.images.length;if(this.endlessLoop&&C){E=0;C=false}if(!C){this.showImage(this.currentImageIndex,E);var A=this.currentImageIndex+this.loadAdvanceImages;if(A>=this.images.length){A=0}if(!this.images[A].initialized){var D=this.currentThumbGroup+1;if(D>this.groups.length){D=0}this.initializeThumbGroup(D)}if(this.currentThumbGroup!==this.images[this.currentImageIndex].groupIndex){this.swapGroupVisibility(this.currentThumbGroup,this.images[this.currentImageIndex].groupIndex)}C=(!this.endlessLoop&&this.currentImageIndex===this.images.length-1)}if(B||C){this.stopSlideShow()}},previousClick:function(B){var E=this.currentImageIndex-1;var C=E<0;if(this.endlessLoop&&C){E=this.images.length-1;C=false}if(!C){this.showImage(this.currentImageIndex,E);var A=this.currentImageIndex-this.loadAdvanceImages;if(A<=0){A=this.images.length-1}if(!this.images[A].initialized){var D=this.currentThumbGroup-1;if(D<=0){D=this.groups.length-1}this.initializeThumbGroup(D)}if(this.currentThumbGroup!==this.images[this.currentImageIndex].groupIndex){this.swapGroupVisibility(this.currentThumbGroup,this.images[this.currentImageIndex].groupIndex)}C=(!this.endlessLoop&&this.currentImageIndex===0)}if(B||C){this.stopSlideShow()}},nextThumbGroup:function(){var B=this.currentThumbGroup;var C=this.currentThumbGroup+1;var A=C>=this.groups.length;if(this.endlessLoop&&A){C=0;A=false}if(!A){if(!this.groups[C][0].initialized){this.initializeThumbGroup(C)}this.swapGroupVisibility(B,C)}},previousThumbGroup:function(){var B=this.currentThumbGroup;var C=this.currentThumbGroup-1;var A=C<0;if(this.endlessLoop&&A){C=this.groups.length-1;A=false}if(!A){if(!this.groups[C][0].initialized){this.initializeThumbGroup(C)}this.swapGroupVisibility(B,C)}},swapGroupVisibility:function(B,C){this.currentThumbGroup=C;for(var A=0;A<this.imagesPerGroup;A++){if(this.groups[B][A]){this.groups[B][A].parent.hide()}if(this.groups[C][A]){this.groups[C][A].parent.show()}}if(!this.endlessLoop&&C===0){this.disableLink(this.backControl,"back")}else{this.enableLink(this.backControl,"back")}if(!this.endlessLoop&&C===this.groups.length-1){this.disableLink(this.forwardControl,"forward")}else{this.enableLink(this.forwardControl,"forward")}}});var StreamingResults=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){var B=this.params.url||document.location.href;var A=this.params.numResults||0;if(this.params.stream){log.info("StreamingResults: incomplete");document.fire("agent:streamingUpdate",{status:"incomplete",url:B,numResults:A})}else{log.info("StreamingResults: complete");document.fire("agent:streamingUpdate",{status:"complete"})}}});var StreamingPoller=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){this.pollTimedOut=false;this.updateTimedOut=false;this.interval=this.params.interval||1;this.numResults=this.params.numResults||0;this.minResults=this.params.minResults||200;this.isComplete=false;this.indicator=new Element("div").addClassName("indicator");var A=new Element("div").addClassName("progressBar");this.indicator.insert(A);this.message=new Element("span").addClassName("msg");this.message.insert(this.params.message);this.indicator.insert(this.message);this.element.insert(this.indicator);this.progressBar=new ProgressBar(A,{interval:0.4});this.progressBar.start();this.pollTimer=this.handlePollTimeout.bind(this).delay(this.params.pollTimeout||60);this.updateTimer=this.handleUpdateTimeout.bind(this).delay(this.params.updateTimeout||20);document.on("agent:streamingUpdate",this.handleStreamingUpdate.bind(this));document.on("agent:updatingResults",this.handleResultsUpdated.bind(this));Event.observe(window,"unload",this.destroy.bind(this))},handleStreamingUpdate:function(A){if(A.memo.status=="complete"){if(this.cachedRequest&&this.cachedRequest.cachedModules){this.clearTimeouts();this.removeIndicator();this.showAlert();this.isComplete=true}else{this.destroy();return}}else{this.numResults=A.memo.numResults;this.delay=this.poll.bind(this).delay(this.interval,A.memo.url)}},showAlert:function(){this.alert=this.element.down(".pageAlert");var A=this.alert.down("a");A.on("click",this.showCachedResults.bind(this));this.alert.showByClass()},showCachedResults:function(A){A.preventDefault();this.alert.hideByClass();this.cachedRequest.updateCachedModules();this.destroy()},poll:function(A){if(this.pollTimedOut){return}var C=this.cachedRequest;var B={method:"get",onSuccess:function(F,E){var G=false;for(var D in E.modules){G=true;break}if(!this.request.cachedModules){this.cachedRequest=C}if(this.pollTimedOut){this.handleError("Streaming timed out")}else{if(G){document.fire("agent:resultsUpdated");this.progressBar.step(20)}else{this.delay=this.poll.bind(this).delay(this.interval,A)}}}.bind(this),onFailure:function(D){this.handleError("No response from streaming results update.")}.bind(this)};if(this.updateTimedOut){this.request=this.cachedRequest=new Ajax.CachedPartialPage(A,B)}else{this.request=new Ajax.StreamingPartialPage(A,B)}},handleError:function(B){log.error("StreamingPoller: "+B);this.removeIndicator();if(this.cachedRequest&&this.cachedRequest.cachedModules){this.showAlert()}else{if(this.numResults<this.minResults){var A=new Element("div").addClassName("pageError");A.insert(this.params.errorMsg);this.element.insert(A)}else{this.destroy()}}},removeIndicator:function(){if(this.indicator){this.progressBar.stop();this.indicator.remove();this.indicator=null}},handlePollTimeout:function(){log.info("StreamingPoller: poll timed out");this.pollTimedOut=true;document.fire("agent:streamingUpdate",{status:"timedout"})},handleUpdateTimeout:function(){log.info("StreamingPoller: updates timed out");this.updateTimedOut=true;document.fire("agent:streamingUpdate",{status:"timedout"})},handleResultsUpdated:function(){if(this.isComplete){this.destroy()}else{if(this.delay){window.clearTimeout(this.delay)}if(this.request){this.request.abort()}this.cachedRequest=null}},clearTimeouts:function(){if(this.pollTimer){window.clearTimeout(this.pollTimer)}if(this.updateTimer){window.clearTimeout(this.updateTimer)}if(this.delay){window.clearTimeout(this.delay)}},destroy:function(){if(this.element){this.progressBar.stop();this.clearTimeouts();this.element.remove();this.element=null}}});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).down("input[type=submit]").click()}}}});var TableScroller=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){if(!this.params.numVisibleColumns||!this.params.scrollIncrement||!this.params.tableSelector||!this.params.scrollRightSelector||!this.params.scrollLeftSelector){log.error("TableScroller.initExtend: too few parameters")}else{this.table=this.element.down(this.params.tableSelector);this.scrollRightElem=this.element.down(this.params.scrollRightSelector);this.scrollLeftElem=this.element.down(this.params.scrollLeftSelector);if(!this.table||!this.scrollLeftElem||!this.scrollRightElem){log.error("TableScroller.initExtend: one or more required element not found")}else{if(this.params.classes){this.element.addClassName(this.params.classes)}this.gatherColumns();if(this.columns.length>this.params.numVisibleColumns){var A=new Element("span");A.innerHTML=this.params.scrollRightLabel;this.scrollRightElem.appendChild(A);var B=new Element("span");B.innerHTML=this.params.scrollLeftLabel;this.scrollLeftElem.appendChild(B);this.scrollPosition=0;this.scrollLeftElem.observe("click",this.scrollLeft.bindAsEventListener(this));this.scrollRightElem.observe("click",this.scrollRight.bindAsEventListener(this));this.updateView()}}}},gatherColumns:function(){if(!this.columns){var C=this.table.rows;this.columns=$A();for(var B=0;B<C.length;B++){var D=$(C[B]).childElements();for(var A=1;A<D.length;A++){if(!this.columns[A-1]){this.columns[A-1]=$A()}this.columns[A-1].push(D[A])}}}},updateView:function(){for(var C=0;C<this.columns.length;C++){var B=this.columns[C];if(C>=this.scrollPosition&&C<this.scrollPosition+this.params.numVisibleColumns){for(var A=0;A<B.length;A++){B[A].removeClassName("noneTableCell")}}else{for(var A=0;A<B.length;A++){B[A].addClassName("noneTableCell")}}}if(this.scrollPosition<=0){this.scrollLeftElem.addClassName("disabled");this.scrollLeftElem.removeClassName("link")}else{this.scrollLeftElem.removeClassName("disabled");this.scrollLeftElem.addClassName("link")}if(this.scrollPosition+this.params.numVisibleColumns>=this.columns.length){this.scrollRightElem.addClassName("disabled");this.scrollRightElem.removeClassName("link")}else{this.scrollRightElem.removeClassName("disabled");this.scrollRightElem.addClassName("link")}},scrollRight:function(){if(!this.scrollRightElem.hasClassName("disabled")){if(this.scrollPosition+this.params.scrollIncrement<this.columns.length){this.scrollPosition+=this.params.scrollIncrement}else{this.scrollPosition=this.columns.length}this.updateView()}},scrollLeft:function(){if(!this.scrollLeftElem.hasClassName("disabled")){if(this.scrollPosition-this.params.scrollIncrement>0){this.scrollPosition-=this.params.scrollIncrement}else{this.scrollPosition=0}this.updateView()}}});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 C=0,A=B.length;C<A;C++){this.tabs.push(new Tab(B[C],this.container,this))}if(this.params.affectHistory){document.observe("hash:change",this.updateTabs.bindAsEventListener(this));document.fire("hash:check")}document.observe("tab:show",this.updateTabs.bindAsEventListener(this));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(D){var C=D.responseText;if(C.isJSON()){this.populateContent(C.evalJSON())}else{this.selectedTab.populateContentBlock(C)}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(C){for(tabId in C){for(var A=0;A<this.tabs.length;A++){var B=this.tabs[A];if(B.type==="ajax"&&B.tabId===tabId){B.populateContentBlock(C[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 F=A.memo.hash;if(F){for(var E=0;E<this.tabs.length;E++){if(this.tabs[E].key==F){var G=this.tabs[E];break}}if(G){if(!G.selected){G.click()}}else{var B,I,H=this.container.getElementsByTagName("A");for(var D=0;D<H.length;D++){var J=Element.extend(H[D]);if(J.name&&J.name==F){I=J.up("div.tabContent").getElementsByTagName("A")[0];break}}if(I){for(var C=0;C<this.tabs.length;C++){if(this.tabs[C].key==I.name&&!this.tabs[C].selected){B=this.tabs[C];break}}if(B){B.click();J.scrollTo()}}}}else{if(!this.defaultTab.selected){this.defaultTab.click()}}}});var Tab=Class.create();Tab.prototype={initialize:function(B,A,C){this.agentsInitialized=false;this.link=B.getElementsByTagName("A")[0];this.element=$(B);this.tabMenu=C;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-tab"):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 C=this.contentWrapper.getElementsByTagName("A");for(var D=0,A=C.length;D<A;D++){var B=Element.extend(C[D]);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;document.fire("tab:change",{hash:this.key})},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();Page.initializeLazyAgents(this.contentBlock);this.agentsInitialized=true}};var TabMenuPagination=Class.create(Abstract.Agent,{initExtend:function(){var A=this.params.selector||"a";this.element.on("click",A,function(C,B){var D=B.readAttribute("href").split("#")[1];document.fire("tab:show",{hash:D});C.preventDefault()})}});var ToggleInsurance=Class.create(Abstract.Agent,{beforeDOMReady:false,initExtend:function(){this.element.down("input").on("click",this.update.bind(this))},update:function(){var A=this.element.up("form");if(A){Form.HiddenField.add(A,"_eventId_updateInsuranceSinglePageCar","true");A.submit()}else{log.error("UpdateView.getUpdate failed: couldn't find the form");return}}});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(D){var C=this.getNameInfoHash();document.fire("traveler"+this.params.travelerIndex+"Name:changed",C)}$A(this.element.getElementsByTagName("select")).each(function(D){var C=this.getNameInputName(D);this.nameInputs.set(C,D);Event.observe(D,"change",A.bindAsEventListener(this))}.bind(this));$A(this.element.getElementsByTagName("input")).each(function(C){var D=this.getNameInputName(C);this.nameInputs.set(D,C);Event.observe(C,"change",A.bindAsEventListener(this))}.bind(this));function B(D){var C={memo:this.getNameInfoHash()};D.memo.callback(C)}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(C){if(C.type=="select-one"){var D=C.options[C.selectedIndex];if(D.value!=""){A+=D.text+" "}}else{if(C.type!="radio"){A+=C.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(C){var B=this.initialText;var A=C.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(E){var D=true;if(E.target.type=="radio"){if(!E.target.checked){D=false}}if(D){var C=this.getNameInfoHash(this.savedMemberSelect.selectedIndex);document.fire("traveler"+this.params.get("travelerIndex")+"Name:changed",C)}}Event.observe(this.savedMemberSelect,"change",A.bindAsEventListener(this));Event.observe(this.useSavedMemberRadio,"change",A.bindAsEventListener(this));function B(E){var C=this.getNameInfoHash(this.savedMemberSelect.selectedIndex);var D={memo:C};E.memo.callback(D)}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 C=this.savedMemberSelect.options[B];A.set("name",C.value==""?"":C.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.redressNumber=null;this.knownTravelerNumber=null;this.gender={};this.dateOfBirth={};$A(this.element.getElementsByTagName("input")).each(function(J){if(J.name.indexOf("redressNumber")!=-1){this.redressNumber=J}else{if(J.name.indexOf("travelerNumber")!=-1){this.knownTravelerNumber=J}else{log.debug("Unknown Input field in TSA module")}}}.bind(this));var G=this.element.getElementsByTagName("select");this.selectHash=$H();for(var F=0,H=G.length;F<H;F++){var I=G[F];var B=I.name.substring((I.name.lastIndexOf(".")+1));this.selectHash.set(B,$(I))}var E=this.element.up(".traveler").down(".dateOfBirth").getElementsByTagName("select");for(var F=0,H=E.length;F<H;F++){var I=E[F];var B=I.name.substring((I.name.lastIndexOf(".")+1));this.selectHash.set(B,$(I))}var C=function(L){log.debug("TravelerTSAInfo travelerChanged() has fired");var O=L.memo.get("travelerInformation");if(O){var M=$H(O.tsaInfo);this.selectHash.each(function(P){P.value.value=M.get(P.key)});this.redressNumber.value=M.get("redressNumber");this.knownTravelerNumber.value=M.get("knownTravelerNumber")}else{this.selectHash.each(function(P){P.value.value=""})}if(this.hiddenElements2){for(var J=0;this.hiddenElements2[J];J++){this.locationElement2.insert({bottom:this.hiddenElements2[J]})}}if(this.hiddenElements){for(var J=0;this.hiddenElements[J];J++){this.locationElement.insert({bottom:this.hiddenElements[J]})}}this.removeCheckboxes=this.element.select("label[class=control checkbox hideRevealCheckbox]");for(var J=0;this.removeCheckboxes[J];J++){this.removeCheckboxes[J].remove()}this.checkErrors=this.element.select("p.error");if(this.checkErrors.length){return}if(!this.redressNumber.value&&!this.knownTravelerNumber.value){var K=new Template('<label class="control checkbox hideRevealCheckbox">				<input name="" value="" type="checkbox" />				<span>#{label}</span>			</label>');K=K.evaluate({label:this.params.label2});this.locationElement2=this.element.down("[class=optionalTSAInfo]");this.locationElement2.insert({top:K});this.hiddenElements2=this.locationElement2.select(".redressKnownTravelerInput");for(var J=0;this.hiddenElements2[J];J++){this.hiddenElements2[J].remove()}this.hideRevealCheckbox2=this.locationElement2.down("input");this.hideRevealCheckbox2.observe("click",this.checkStatus2.bindAsEventListener(this))}if(!this.gender.value&&!this.dateOfBirth.dobDay&&!this.params.genderDateOfBirthRequired){var K=new Template('<label class="control checkbox hideRevealCheckbox">				<input name="" value="" type="checkbox" />				<span>#{label}</span>			</label>');K=K.evaluate({label:this.params.label1});this.locationElement=this.element.down("[class=optionalOrRequiredTSAInfo]");this.locationElement.insert({top:K});this.hiddenElements=this.locationElement.select(".allInput");for(var J=0;this.hiddenElements[J];J++){this.hiddenElements[J].remove()}this.hideRevealCheckbox=this.locationElement.down("input");this.hideRevealCheckbox.observe("click",this.checkStatus.bindAsEventListener(this));this.checkStatus()}};var D=C.bindAsEventListener(this);var A="traveler"+this.params.travelerIndex+"Name:changed";document.observe(A,D);log.debug("TravelerTSAInfo firing travelerX:getData function");document.fire("traveler"+this.params.travelerIndex+":getData",{callback:C.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 C=function(E){var F=E.memo.get("travelerInformation");if(F){var D=F.phone;this.countryCode.value=D.countryCode;this.phoneNumber.value=D.phoneNumber;log.info("phoneValue"+this.phoneNumber.value);this.extension.value=D.extension}else{this.countryCode.value="";this.phoneNumber.value="";this.extension.value=""}};var B=C.bindAsEventListener(this);var A="traveler"+this.params.travelerIndex+"Name:changed";document.observe(A,B);Event.observe(this.countryCode,"change",function(D){document.stopObserving(A,B)});Event.observe(this.phoneNumber,"change",function(D){document.stopObserving(A,B)});Event.observe(this.extension,"change",function(D){document.stopObserving(A,B)});if(this.phoneNumber.value==""){log.debug("TravelerPhoneNumber firing travelerX:getData function");document.fire("traveler"+this.params.travelerIndex+":getData",{callback:C.bind(this)})}}});var TravelerEmailAddress=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){var B=Element.extend(this.element.getElementsByTagName("input")[0]);var D=function(F){log.debug("TravelerEmailAddress travelerChanged() has fired");var G=F.memo.get("travelerInformation");if(G){var E=G.email.strip();B.value=E}else{B.value=""}};var C=D.bindAsEventListener(this);var A="traveler"+this.params.travelerIndex+"Name:changed";document.observe(A,C);Event.observe(B,"change",function(E){document.stopObserving(A,C)})}});var TravelerLoyaltyPrograms=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){var B=Element.extend(this.element.getElementsByTagName("input")[0]);var D=function(E){log.debug("TravelerLoyaltyPrograms travelerChanged() has fired");var F=E.memo.get("travelerInformation");if(F){var G=$H(F.loyaltyPrograms);B.value=G.get(this.params.loyaltyProgramType+"LoyaltyProgram"+this.params.loyaltyProgramCode)}else{B.value=""}};var C=D.bindAsEventListener(this);var A="traveler"+this.params.travelerIndex+"Name:changed";document.observe(A,C);Event.observe(B,"change",function(E){document.stopObserving(A,C)});if(B.value==""){log.debug("firing travelerX:getData function");document.fire("traveler"+this.params.travelerIndex+":getData",{callback:D.bind(this)})}}});var TravelerSeatPreferences=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){var C=false;var B=this.element.getElementsByTagName("select")[0];var A=function(E){log.debug("TravelerSeatPreferences travelerChanged() executing for traveler"+this.params.travelerIndex);var F=E.memo.get("travelerInformation");if(F){var D=F.flightPreferences;if(D.seat){B.value=D.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){C=true}Event.observe(B,"change",this.stopObserving.bindAsEventListener(this));if(!C){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 C=false;var A=new Hash({seat:"",meal:"",specialRequest:""});var B=function(E){log.debug("TravelerFlightSpecialRequests travelerChanged() executing for traveler"+this.params.travelerIndex);var F=E.memo.get("travelerInformation");if(F){var D=F.flightPreferences;A.get("meal").value=D.meal;A.get("specialRequest").value=D.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(D){A.set(D.name.substr(D.name.lastIndexOf(".")+1),D);if(D.selectedIndex!=0){C=true}Event.observe(D,"change",this.stopObserving.bindAsEventListener(this))}.bind(this));if(!C){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.parentNode);this.radio=this.parentElement.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 UserReviewGraph=Class.create(Abstract.Agent,{initExtend:function(){$A(this.element.getElementsByClassName("score")).each(function(C){var D=C.innerHTML.replace(/,/g,".");C.style.width=(D/0.05)+"%"});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]).insert({top:A});this.element.addClassName("userReviewGraph")}});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(D){var F=D;var E=F.pathname?((F.pathname.indexOf("/")!=0)?"/"+F.pathname:F.pathname):"/";var C=F.textContent||F.innerText||F.innerHTML||"";var B=this.defaultTags.clone();B.set("DCS.dcsuri",E);B.set("DCS.dcsqry",F.search||"");B.update($H(D.memo));var A=[];B.each(function(G){A.push(G.key);A.push(G.value)});log.debug("WebTrends, sending: dcsMultiTrack() with parameters: "+A);dcsMultiTrack.apply(undefined,A);dcsCleanUp()}.bind(this));document.observe("content:update",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 C=this.defaultTags.clone();C.set("DCS.dcsuri",F);C.set("DCS.dcsqry",G.search||"");var B=E.memo.webtrends;C.update(Object.isString(B)?B.evalJSON():B);var A=[];C.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();if(this.params.dynamicallyAddValue){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){this.params.dynamicallyAddValue.each(function(C){this.tags[C]=this.tagPrefixes.get(C)+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){this.params.dynamicallyAddValue.each(function(C){this.tags[C]+=elem.value}.bind(this))}elem.fire("webtrends:multiTrackEvent",this.tags)}.bind(this))}}});
