//****************************************************************************
// Copyright (c) 2005, Coveo Solutions Inc.
//****************************************************************************

//****************************************************************************
// Shortcut for document.getElementById(...).
//****************************************************************************
function G(p_Id)
{
    return document.getElementById(p_Id);
}

//****************************************************************************
// Returns whether the current browser is Internet Explorer.
//****************************************************************************
function CNL_IsIE()
{
    return navigator.userAgent.indexOf('MSIE') != -1;
}

//****************************************************************************
// Returns whether the browser is in standard mode.
//****************************************************************************
function CNL_IsStandard()
{
    // I tested those with IE, FireFox and Opera.
    return document.compatMode != 'BackCompat' && document.compatMode != 'QuirksMode';
}

//****************************************************************************
// Adds an event handler to an object.
// p_Target  - The object tag fires the event.
// p_Event   - The name of the event.
// p_Handler - The event handler to register.
//****************************************************************************
function CNL_WireEvent(p_Target, p_Event, p_Handler)
{
    if (CNL_IsIE()) {
        p_Target.attachEvent(p_Event, p_Handler);
    } else {
        // addEventLister takes an event type that is usually the name of the
        // event with the 'on' at the start removed.
        if (p_Event.substring(0, 2) != 'on') {
            throw "Unknown event type: " + p_Event;
        }
        var name = p_Event.substring(2, p_Event.length);
        p_Target.addEventListener(name, p_Handler, false);
    }
}

//****************************************************************************
// Stops the propagation of an event.
// p_Event - The event whose propagation to stop.
//****************************************************************************
function CNL_StopPropagation(p_Event)
{
    if (CNL_IsIE()) {
        p_Event.cancelBubble = true;
    } else {
        p_Event.stopPropagation();
    }
}

//****************************************************************************
// Cancels an event (prevents it from bubbling up, and disable the default action).
// p_Event - The event to cancel.
//****************************************************************************
function CNL_CancelEvent(p_Event)
{
    if (CNL_IsIE()) {
        p_Event.cancelBubble = true;
        p_Event.returnValue = false;
    } else {
        p_Event.stopPropagation();
        p_Event.preventDefault();
    }
}

//****************************************************************************
// Returns a new  XMLHttpRequest object.
//****************************************************************************
function CNL_CreateXmlHttpRequest()
{
    var req;
    if (CNL_IsIE()) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
    } else {
        req = new XMLHttpRequest();
    }

    return req;
}

//****************************************************************************
// Parses a string as xml and returns the xml dom object.
// p_Xml - The xml to parse.
// Returns the DOM object.
//****************************************************************************
function CNL_ParseStringAsXml(p_Xml)
{
    var dom;
    if (CNL_IsIE()) {
        dom = new ActiveXObject("Microsoft.XMLDOM");
        dom.loadXML(p_Xml);
    } else {
        var parser = new DOMParser();
        dom = parser.parseFromString(p_Xml, 'text/xml');
    }

    return dom;
}

//****************************************************************************
// Performs a SelectNodes in a cross-browser compatible way.
// p_Node  - The node on which to perform the operation.
// p_XPath - The xpath expression to use.
// Returns the matching nodes.
//****************************************************************************
function CNL_SelectNodes(p_Node, p_XPath)
{
    var nodes;
    if (CNL_IsIE()) {
        nodes = p_Node.selectNodes(p_XPath);
    } else {
        var doc = p_Node.ownerDocument ? p_Node.ownerDocument : p_Node;
        var resolver = doc.createNSResolver(doc);
        var results = doc.evaluate(p_XPath, p_Node, resolver, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);

        nodes = new Array();
        for (var i = 0; i < results.snapshotLength; ++i) {
            nodes.push(results.snapshotItem(i));
        }
    }

    return nodes;
}

//****************************************************************************
// Performs a SelectSingleNode in a cross-browser compatible way.
// p_Node  - The node on which to perform the operation.
// p_XPath - The xpath expression to use.
// Returns the first matching node, if any, and null otherwise.
//****************************************************************************
function CNL_SelectSingleNode(p_Node, p_XPath)
{
    var node;
    if (CNL_IsIE()) {
        node = p_Node.selectSingleNode(p_XPath);
    } else {
        var nodes = CNL_SelectNodes(p_Node, p_XPath);
        node = nodes.length != 0 ? nodes[0] : null;
    }

    return node;
}

//****************************************************************************
// Returns the text content of an xml node.
//****************************************************************************
function CNL_GetTextContent(p_Node)
{
    return CNL_IsIE() ? p_Node.text : p_Node.textContent;
}

//****************************************************************************
// Converts an RGB value to a color string.
// p_Red   - The Red component.
// p_Green - The Green component.
// p_Blue  - The Blue component.
// Returns The color as a string (in the #xxxxxx format).
//****************************************************************************
function CNL_RGBToString(p_Red, p_Green, p_Blue)
{
    var r = p_Red.toString(16);
    if (r.length == 1) {
        r = '0' + r;
    }
    var g = p_Green.toString(16);
    if (g.length == 1) {
        g = '0' + g;
    }
    var b = p_Blue.toString(16);
    if (b.length == 1) {
        b = '0' + b;
    }

    return ('#' + r + g + b).toUpperCase();
}

//****************************************************************************
// Sets the absolute position of an object, relative to the document.
// p_Object - The object whose position should be set.
// p_X      - The X offset from the left of the document.
// p_Y      - The Y offset from the top of the document.
//****************************************************************************
function CNL_SetPosition(p_Object, p_X, p_Y)
{
    p_Object.style.left = p_X + 'px';
    p_Object.style.top = p_Y + 'px';
}

//****************************************************************************
// Retrieves the absolute position of an HTML object (in pixels) from the top of the document.
// p_Object - The object whose position to retrieve.
// Returns an object that contains the information.
//****************************************************************************
function CNL_GetPosition(p_Object)
{
    var pos = new Object();
    pos.m_Left = 0;
    pos.m_Top = 0;

    var obj = p_Object;
    while (obj != null) {
        pos.m_Left += obj.offsetLeft - obj.scrollLeft;
        pos.m_Top += obj.offsetTop - obj.scrollTop;
        obj = obj.offsetParent;
    }

    return pos;
}

//****************************************************************************
// Retrieves the size of an HTML object (in pixels).
// p_Object - The object whose size to retrieve.
// Returns An object that contains the information.
//****************************************************************************
function CNL_GetSize(p_Object)
{
    var size = new Object();
    size.m_Width = p_Object.offsetWidth;
    size.m_Height = p_Object.offsetHeight;
  
    return size;
}

//****************************************************************************
// Sets the size of an object.
// p_Object - The object whose size should be set.
// p_Width  - The width to set.
// p_Height - The height to set.
//****************************************************************************
function CNL_SetSize(p_Object, p_Width, p_Height)
{
    p_Object.style.width = p_Width + 'px';
    p_Object.style.height = p_Height + 'px';
}

//****************************************************************************
// Retrieves the bounding rectangle of an HTML object (in pixels).
// p_Object - The object whose bounding rectangle to retrieve.
// Returns An object that contains the information.
//****************************************************************************
function CNL_GetBoundingRectangle(p_Object)
{
    var pos = CNL_GetPosition(p_Object);
    var size = CNL_GetSize(p_Object);
    var rect = new Object();
    rect.m_Left = pos.m_Left;
    rect.m_Top = pos.m_Top;
    rect.m_Right = pos.m_Left + size.m_Width;
    rect.m_Bottom = pos.m_Top + size.m_Height;
  
    return rect;
}

//****************************************************************************
// Retrieves the bounding of the region that is visible in the window (in pixels).
// Returns An object that contains the information.
//****************************************************************************
function CNL_GetVisibleRectangle()
{
    var rect = new Object();
    if (CNL_IsStandard()) {
        rect.m_Left = document.documentElement.scrollLeft;
        rect.m_Top = document.documentElement.scrollTop;
        rect.m_Right = rect.m_Left + document.documentElement.clientWidth;
        rect.m_Bottom = rect.m_Top + document.documentElement.clientHeight;
    } else {
        rect.m_Left = document.body.scrollLeft;
        rect.m_Top = document.body.scrollTop;
        rect.m_Right = rect.m_Left + document.body.clientWidth;
        rect.m_Bottom = rect.m_Top + document.body.clientHeight;
    }

    rect.m_Width = rect.m_Right - rect.m_Left;
    rect.m_Height = rect.m_Bottom - rect.m_Top;
  
    return rect;
}

//****************************************************************************
// Checks if a point is within a rectangle.
// p_X - The X coordinate.
// p_Y - The Y coordinate.
// p_Rect - The rectangle.
// Returns Whether the point is within the rectangle.
//****************************************************************************
function CNL_IsWithin(p_X, p_Y, p_Rect)
{
    return p_X >= p_Rect.m_Left && p_X < p_Rect.m_Right &&
           p_Y >= p_Rect.m_Top && p_Y < p_Rect.m_Bottom; 
}

//****************************************************************************
// Checks if a rectangle is within another rectangle.
// p_Inside  - The rectangle that should be inside.
// p_Outside - The rectangle that should contain p_Inside.
// Returns Whether the first rectangle is within the second one.
//****************************************************************************
function CNL_IsRectangleWithin(p_Inside, p_Outside)
{
    return CNL_IsWithin(p_Inside.m_Left, p_Inside.m_Top, p_Outside) &&
           CNL_IsWithin(p_Inside.m_Right, p_Inside.m_Top, p_Outside) &&
           CNL_IsWithin(p_Inside.m_Left, p_Inside.m_Bottom, p_Outside) &&
           CNL_IsWithin(p_Inside.m_Right, p_Inside.m_Bottom, p_Outside);
}

//****************************************************************************
// Checks if two rectangles overlap.
// p_Rect1 - The first rectangle.
// p_Rect2 - The second rectangle.
// Returns Whether the two rectangles overlap.
//****************************************************************************
function CNL_IsOverlap(p_Rect1, p_Rect2)
{
    // Look for an horizontal overlap
    var horiz = (p_Rect1.m_Left >= p_Rect2.m_Left &&
                 p_Rect1.m_Left < p_Rect2.m_Right) ||
                (p_Rect1.m_Right > p_Rect2.m_Left &&
                 p_Rect1.m_Right < p_Rect2.m_Right) ||
                (p_Rect2.m_Left >= p_Rect1.m_Left &&
                 p_Rect2.m_Left < p_Rect1.m_Right) ||
                (p_Rect2.m_Right > p_Rect1.m_Left &&
                 p_Rect2.m_Right < p_Rect1.m_Right);

    // Look for a vertical overlap
    var vert = (p_Rect1.m_Top >= p_Rect2.m_Top &&
                p_Rect1.m_Top < p_Rect2.m_Bottom) ||
               (p_Rect1.m_Bottom > p_Rect2.m_Top &&
                p_Rect1.m_Bottom < p_Rect2.m_Bottom) ||
               (p_Rect2.m_Top >= p_Rect1.m_Top &&
                p_Rect2.m_Top < p_Rect1.m_Bottom) ||
               (p_Rect2.m_Bottom > p_Rect1.m_Top &&
                p_Rect2.m_Bottom < p_Rect1.m_Bottom);

    return horiz && vert;
}

//****************************************************************************
// Positions an object relative to another.
// p_Object - The object to position.
// p_Reference - The object to position relatively to.
// p_Position - Where to place the object from the other.
//****************************************************************************
function CNL_PositionObject(p_Object, p_Reference, p_Position)
{
    // Determine the default major and minor positions
    var position1;
    var position2;
    if (p_Position == 'LeftBelow') {
        position1 = 'Left';
        position2 = 'Below';
    } else if (p_Position == 'LeftAbove') {
        position1 = 'Left';
        position2 = 'Above';
    } else if (p_Position == 'AboveLeft') {
        position1 = 'Above';
        position2 = 'Left';
    } else if (p_Position == 'AboveRight') {
        position1 = 'Above';
        position2 = 'Right';
    } else if (p_Position == 'RightBelow') {
        position1 = 'Right';
        position2 = 'Below';
    } else if (p_Position == 'RightAbove') {
        position1 = 'Right';
        position2 = 'Above';
    } else if (p_Position == 'BelowLeft') {
        position1 = 'Below';
        position2 = 'Left';
    } else if (p_Position == 'BelowRight') {
        position1 = 'Below';
        position2 = 'Right';
    } else {
        throw 'Invalid value for p_Position';
    }
    
    var left;
    var top;
    var done = false;
    var attempts = 0;
    var osize = CNL_GetSize(p_Object);
    var rrect = CNL_GetBoundingRectangle(p_Reference);
    var vrect = CNL_GetVisibleRectangle();

    // Try 3 times to position the object. Globally speaking, when first iteration
    // fails, the invert position on all bad levels will be tried. If this position
    // is bad too, we want to allow another iteration to revert positions to the
    // initial ones (which are better when everything is bad).
    while (!done && attempts < 3) {
        // Position the object using the two indicators
        if (position1 == 'Left') {
            left = rrect.m_Left - osize.m_Width;
        } else if (position1 == 'Right') {
            left = rrect.m_Right - 1;
        } else if (position1 == 'Above') {
            top = rrect.m_Top - osize.m_Height;
        } else if (position1 == 'Below') {
            top = rrect.m_Bottom - 1;
        }
        if (position2 == 'Left') {
            left = rrect.m_Left;
        } else if (position2 == 'Right') {
            left = rrect.m_Right - osize.m_Width;
        } else if (position2 == 'Above') {
            top = rrect.m_Bottom - osize.m_Height;
        } else if (position2 == 'Below') {
            top = rrect.m_Top;
        }

        // Invert major and/or minor positions when needed
        done = true;
        var right = left + osize.m_Width;
        var bottom = top + osize.m_Height;
        if (left < vrect.m_Left || right >= vrect.m_Right) {
            if (position1 == 'Left') {
                position1 = 'Right';
            } else if (position1 == 'Right') {
                position1 = 'Left'
            } else if (position2 == 'Left') {
                position2 = 'Right'
            } else if (position2 == 'Right') {
                position2 = 'Left'
            }
            done = false;
        }
        if (top < vrect.m_Top || bottom >= vrect.m_Bottom) {
            if (position1 == 'Above') {
                position1 = 'Below';
            } else if (position1 == 'Below') {
                position1 = 'Above'
            } else if (position2 == 'Above') {
                position2 = 'Below'
            } else if (position2 == 'Below') {
                position2 = 'Above'
            }
            done = false;
        }
        
        ++attempts;
    }

    CNL_SetPosition(p_Object, left, top);
}

//****************************************************************************
// Fits the width of an element to the client width of it's parent.
// p_Element - The element whose width to set.
// Works only under IE!
//****************************************************************************
function CNL_FitToParentWidth(p_Element)
{
    var borderWidth = parseInt(p_Element.currentStyle.borderLeftWidth) + parseInt(p_Element.currentStyle.borderRightWidth);
    var paddingWidth = parseInt(p_Element.currentStyle.paddingLeft) + parseInt(p_Element.currentStyle.paddingRight);
    var available = p_Element.parentElement.scrollWidth - parseInt(p_Element.parentElement.currentStyle.paddingLeft) - parseInt(p_Element.parentElement.currentStyle.paddingRight);
    p_Element.style.pixelWidth = available - borderWidth - paddingWidth;
}

//****************************************************************************
// Resizes an iframe to it's content.
// p_IFrame - The iframe to resize.
//****************************************************************************
function CNL_ResizeIFrame(p_IFrame)
{
    var width = p_IFrame.contentWindow.document.documentElement.scrollWidth;
    var height = p_IFrame.contentWindow.document.documentElement.scrollHeight;
    CNL_SetSize(p_IFrame, width, height);
}

//****************************************************************************
// Sets the opacity of an object.
// p_Object  - The object whose opacity should be set.
// p_Opacity - The opacity to set (from 0 to 1).
//****************************************************************************
function CNL_SetOpacity(p_Object, p_Opacity)
{
    if (p_Opacity != 1) {
        if (CNL_IsIE()) {
            p_Object.style.filter = 'alpha(opacity=' + p_Opacity * 100 + ')'; 
        } else {
            p_Object.style.opacity = p_Opacity;
        }
    } else {
        if (CNL_IsIE()) {
            p_Object.style.filter = ''; 
        } else {
            p_Object.style.opacity = '';
        }
    }
}

//****************************************************************************
// Retrieves the position of a mouse click relative to an object.
// p_Event     - The event object.
// p_Reference - The reference element to use to size the iframe.
//****************************************************************************
function CNL_GetMouseClickPosition(p_Event, p_Reference)
{
    var rpos = CNL_GetPosition(p_Reference);

    // First compute the click offset from the page
    var px, py;
    if (CNL_IsIE()) {
        // IE provides the offset from the clicked object.
        var tpos = CNL_GetPosition(p_Event.srcElement);
        px = tpos.m_Left + p_Event.offsetX;
        py = tpos.m_Top + p_Event.offsetY;
    } else {
        // FireFox provides the offset from the page
        px = p_Event.pageX;
        py = p_Event.pageY;
    }

    // Then compute the offset from the reference
    var rpos = CNL_GetPosition(p_Reference);
    var pos = new Object();
    pos.m_Left = px - rpos.m_Left;
    pos.m_Top = py - rpos.m_Top;

    return pos;
}

//****************************************************************************
// Sets the selected range of characters in a textbox.
// p_TextBox - The textbox.
// p_First   - Index of the first character.
// p_Last    - Index of the character after the last one.
//****************************************************************************
function CNL_SetSelectedRange(p_TextBox, p_First, p_Last)
{
    if (CNL_IsIE()) {
        var range = p_TextBox.createTextRange();
        range.moveStart('character', p_First);
        range.moveEnd('character', p_Last - p_TextBox.value.length);
        range.select();
    } else {
        p_TextBox.setSelectionRange(p_First, p_Last);
    }
}

//****************************************************************************
// Copyright (c) 2006, Coveo Solutions Inc.
//****************************************************************************

// This file defines augments the prototypes of various objects with useful
// functions and also tries to make browsers a little more homogenous.

//****************************************************************************
// Trims the content of a string.
// Returns the trimmed string.
//****************************************************************************
String.prototype.trim = function()
{
    return this.replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, "");
}

if (!CNL_IsIE()) {
    //************************************************************************
    // Gets/sets the text inside a tag.
    //************************************************************************
    HTMLElement.prototype.__defineGetter__("innerText", function()
    {
        return this.textContent;
    });
    HTMLElement.prototype.__defineSetter__("innerText", function(p_Text) 
    {
        this.textContent = p_Text;
    });
}

//****************************************************************************
// Copyright (c) 2005, Coveo Solutions Inc.
//****************************************************************************

function CNL_BaseDropDown() {

//****************************************************************************
// Hints the control that the dropdown may soon be shown, and that any preparation
// code that must be executed prior to it may begin to execute.
//****************************************************************************
this.HintDropDownPrepare = function()
{
    if (this.m_PrepareCode != '' && !this.m_Ready && !this.m_Preparing) {
        this.m_Preparing = true;
        eval(this.m_PrepareCode);
    }
}

//****************************************************************************
// Indicates that the dropdown is ready to be shown.
//****************************************************************************
this.DropDownIsReady = function()
{
    this.m_Preparing = false;
    this.m_Ready = true;

    // If we're supposed to be visible but that we aren't, show the dropdown now.
    if (this.m_Show && !this.IsDropDownVisible()) {
        this._DisplayDropDown();
    }
}

//****************************************************************************
// Shows the dropdown box. 
//****************************************************************************
this.ShowDropDown = function()
{
    this.m_Show = true;

    // If the dropdown is async and that it isn't ready, the DropIsReady method
    // will automatically show it when it is called. Otherwise, show it now.
    if (this.m_PrepareCode != '') {
        if (this.m_Ready) {
            this._DisplayDropDown();
        } else if (!this.m_Preparing) {
            this.HintDropDownPrepare();
        }
    } else {
        this._DisplayDropDown();
    }
}

//****************************************************************************
// Hides the dropdown box.
//****************************************************************************
this.HideDropDown = function()
{
    document.getElementById(this.m_DropDownId).style.display = 'none';
    this.m_Show = false;
}

//****************************************************************************
// Returns whether the dropdown should be visible or not.
//****************************************************************************
this.IsDropDownVisible = function()
{
    return this.m_Show;
}

//****************************************************************************
// Really shows the dropdown, when it is ready.
//****************************************************************************
this._DisplayDropDown = function()
{
    var dropDown = document.getElementById(this.m_DropDownId);
    dropDown.style.display = '';
    var size = CNL_GetSize(dropDown);
    if (size.m_Width > 5 && size.m_Height > 5) {
        CNL_PositionObject(dropDown, this, this.m_Position);
    } else {
        dropDown.style.display = 'none';
    }
}

} // Constructor

//****************************************************************************
// Copyright (c) 2005, Coveo Solutions Inc.
//****************************************************************************

function CNL_CustomDropDown() {

var m_IsMouseOver = false;

//****************************************************************************
// Event handler for the onmouseover event of the dropdown.
//****************************************************************************
this.OnMouseOver = function()
{
    if (!this.m_IsMouseOver) {
        if (!this.IsDropDownVisible()) {
            if (Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current() != null) {
                Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current().blockTimer();
            }
        }

        if (this.m_BorderOnHover) {
            this.style.borderColor = this.m_BorderColor;
        }
        if (this.m_ArrowOnHover) {
            document.getElementById(this.m_ArrowId).style.visibility = 'visible';
        }
    }
    
    this.m_IsMouseOver = true;
}

//****************************************************************************
// Event handler for the onmouseoout event of the dropdown.
//****************************************************************************
this.OnMouseOut = function()
{
    if (this.m_IsMouseOver) {
        this.m_IsMouseOver = false;
        this.OnMouseOutBehaviour();
    }
}

//****************************************************************************
// Behaviour of the OnMouseOut event of the dropdown.
// It is extracted from the event handler because the method
// HideAndRestoreHandler use it.
//****************************************************************************
this.OnMouseOutBehaviour = function()
{
    if ((!this.m_IsMouseOver) && (!this.IsDropDownVisible())) {
        if (document.getElementById(this.m_DropDownId).style.visibility != 'visible') {
            if (this.m_BorderOnHover) {
                this.style.borderColor = this.m_BackColor;
            }
            if (this.m_ArrowOnHover) {
                document.getElementById(this.m_ArrowId).style.visibility = 'hidden';
            }
        }

        if (Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current() != null) {
            Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current().unblockTimer();
        }
    }
}

//****************************************************************************
// Event handler for the onclick event of the dropdown button.
//****************************************************************************
this.Arrow_OnClick = function(p_Event)
{
    if (!this.IsDropDownVisible()) {
        var size = CNL_GetSize(this);
        CNL_SetSize(document.getElementById(this.m_DropDownId), size.m_Width, size.m_Height);
        this.ShowDropDown();

        // Fire any old handler, so that any other dropdown on the page may
        // properly close itself before this one opens.
        if (document.onclick) {
            document.onclick(p_Event);
        }

        this.m_OldClickHandler = document.onclick;
        this.m_OldKeyPressHandler = document.onkeypress;
        var myself = this;
        if (CNL_IsIE()) {
            document.onclick = function() { myself.Document_OnClick(event); };
            document.onkeypress = function() { myself.Document_OnKeyPress(event); };
        } else {
            document.onclick = function(event) { myself.Document_OnClick(event); };
            document.onkeydown = function(event) { myself.Document_OnKeyPress(event); };
        }

    } else {
        this.HideAndRestoreHandler();
    }

    CNL_StopPropagation(p_Event);
}

//****************************************************************************
// Event handler for the onclick event of the document.
//****************************************************************************
this.Document_OnClick = function(p_Event)
{
    if (this.m_HideOnClick || !CNL_IsWithin(p_Event.clientX, p_Event.clientY, CNL_GetBoundingRectangle(document.getElementById(this.m_DropDownId)))) {
        this.HideAndRestoreHandler();
    }
}

//****************************************************************************
// Event handler for the onkeypress event.
//****************************************************************************
this.Document_OnKeyPress = function(p_Event)
{
    if (CNL_IsIE()) {
        if (p_Event.keyCode == 27) {
          this.HideAndRestoreHandler();
        }
    } else {
        if (p_Event.which == 27) {
          this.HideAndRestoreHandler();
        }
    }
}

//****************************************************************************
// Hides the dropdown and restore the old event handler.
//****************************************************************************
this.HideAndRestoreHandler = function()
{
    if (this.IsDropDownVisible()) {
        this.HideDropDown();
        document.onclick = this.m_OldClickHandler;
        if (CNL_IsIE()) {
            document.onkeypress = this.m_OldKeyPressHandler;
        } else {
            document.onkeydown = this.m_OldKeyPressHandler;
        }
        this.OnMouseOutBehaviour();
    }
}

} // Constructor

// Script# Browser Compat Layer
// More information at http://projects.nikhilk.net/ScriptSharp
//
function __loadCompatLayer(w){w.Debug=function(){};w.Debug._fail=function(message){throw new Error(message);};w.Debug.writeln=function(text){if(window.console){if(window.console.debug){window.console.debug(text);return;} else if(window.console.log){window.console.log(text);return;}} else if(window.opera&&window.opera.postError){window.opera.postError(text);return;}};w.__getNonTextNode=function(node){try{while(node&&(node.nodeType!=1)){node=node.parentNode;}} catch(ex){node=null;} return node;};w.__getLocation=function(e){var loc={x:0,y:0};while(e){loc.x+=e.offsetLeft;loc.y+=e.offsetTop;e=e.offsetParent;} return loc;};w.navigate=function(url){window.setTimeout('window.location = "'+url+'";',0);};var attachEventProxy=function(eventName,eventHandler){eventHandler._mozillaEventHandler=function(e){window.event=e;eventHandler();if(!e.avoidReturn){return e.returnValue;}};this.addEventListener(eventName.slice(2),eventHandler._mozillaEventHandler,false);};var detachEventProxy=function(eventName,eventHandler){if(eventHandler._mozillaEventHandler){var mozillaEventHandler=eventHandler._mozillaEventHandler;delete eventHandler._mozillaEventHandler;this.removeEventListener(eventName.slice(2),mozillaEventHandler,false);}};w.attachEvent=attachEventProxy;w.detachEvent=detachEventProxy;w.HTMLDocument.prototype.attachEvent=attachEventProxy;w.HTMLDocument.prototype.detachEvent=detachEventProxy;w.HTMLElement.prototype.attachEvent=attachEventProxy;w.HTMLElement.prototype.detachEvent=detachEventProxy;w.Event.prototype.__defineGetter__('srcElement',function(){return __getNonTextNode(this.target)||this.currentTarget;});w.Event.prototype.__defineGetter__('cancelBubble',function(){return this._bubblingCanceled||false;});w.Event.prototype.__defineSetter__('cancelBubble',function(v){if(v){this._bubblingCanceled=true;this.stopPropagation();}});w.Event.prototype.__defineGetter__('returnValue',function(){return!this._cancelDefault;});w.Event.prototype.__defineSetter__('returnValue',function(v){if(!v){this._cancelDefault=true;this.preventDefault();}});w.Event.prototype.__defineGetter__('fromElement',function(){var n;if(this.type=='mouseover'){n=this.relatedTarget;} else if(this.type=='mouseout'){n=this.target;} return __getNonTextNode(n);});w.Event.prototype.__defineGetter__('toElement',function(){var n;if(this.type=='mouseout'){n=this.relatedTarget;} else if(this.type=='mouseover'){n=this.target;} return __getNonTextNode(n);});w.Event.prototype.__defineGetter__('button',function(){return(this.which==1)?1:(this.which==3)?2:0});w.Event.prototype.__defineGetter__('offsetX',function(){return window.pageXOffset+this.clientX-__getLocation(this.srcElement).x;});w.Event.prototype.__defineGetter__('offsetY',function(){return window.pageYOffset+this.clientY-__getLocation(this.srcElement).y;});w.HTMLElement.prototype.__defineGetter__('parentElement',function(){return this.parentNode;});w.HTMLElement.prototype.__defineGetter__('children',function(){var children=[];var childCount=this.childNodes.length;for(var i=0;i<childCount;i++){var childNode=this.childNodes[i];if(childNode.nodeType==1){children.push(childNode);}} return children;});w.HTMLElement.prototype.__defineGetter__('innerText',function(){try{return this.textContent} catch(ex){var text='';for(var i=0;i<this.childNodes.length;i++){if(this.childNodes[i].nodeType==3){text+=this.childNodes[i].textContent;}} return str;}});w.HTMLElement.prototype.__defineSetter__('innerText',function(v){var textNode=document.createTextNode(v);this.innerHTML='';this.appendChild(textNode);});w.HTMLElement.prototype.__defineGetter__('currentStyle',function(){return window.getComputedStyle(this,null);});w.HTMLElement.prototype.__defineGetter__('runtimeStyle',function(){return window.getOverrideStyle(this,null);});w.HTMLElement.prototype.removeNode=function(b){return this.parentNode.removeChild(this)};w.HTMLElement.prototype.contains=function(el){while(el!=null&&el!=this){el=el.parentNode;} return(el!=null)};w.HTMLStyleElement.prototype.__defineGetter__('styleSheet',function(){return this.sheet;});w.CSSStyleSheet.prototype.__defineGetter__('rules',function(){return this.cssRules;});w.CSSStyleSheet.prototype.addRule=function(selector,style,index){this.insertRule(selector+'{'+style+'}',index);};w.CSSStyleSheet.prototype.removeRule=function(index){this.deleteRule(index);};w.CSSStyleDeclaration.prototype.__defineGetter__('styleFloat',function(){return this.cssFloat;});w.CSSStyleDeclaration.prototype.__defineSetter__('styleFloat',function(v){this.cssFloat=v;});DocumentFragment.prototype.getElementById=function(id){var nodeQueue=[];var childNodes=this.childNodes;var node;var c;for(c=0;c<childNodes.length;c++){node=childNodes[c];if(node.nodeType==1){nodeQueue.push(node);}} while(nodeQueue.length){node=nodeQueue.dequeue();if(node.id==id){return node;} childNodes=node.childNodes;if(childNodes.length!=0){for(c=0;c<childNodes.length;c++){node=childNodes[c];if(node.nodeType==1){nodeQueue.push(node);}}}} return null;};DocumentFragment.prototype.getElementsByTagName=function(tagName){var elements=[];var nodeQueue=[];var childNodes=this.childNodes;var node;var c;for(c=0;c<childNodes.length;c++){node=childNodes[c];if(node.nodeType==1){nodeQueue.push(node);}} while(nodeQueue.length){node=nodeQueue.dequeue();if(tagName=='*'||node.tagName==tagName){elements.add(node);} childNodes=node.childNodes;if(childNodes.length!=0){for(c=0;c<childNodes.length;c++){node=childNodes[c];if(node.nodeType==1){nodeQueue.push(node);}}}} return elements;};DocumentFragment.prototype.createElement=function(tagName){return document.createElement(tagName);};var selectNodes=function(doc,path,contextNode){if(!doc.documentElement){return[];} contextNode=contextNode?contextNode:doc;var xpath=new XPathEvaluator();var result=xpath.evaluate(path,contextNode,doc.createNSResolver(doc.documentElement),XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var nodeList=new Array(result.snapshotLength);for(var i=0;i<result.snapshotLength;i++){nodeList[i]=result.snapshotItem(i);} return nodeList;};var selectSingleNode=function(doc,path,contextNode){path+='[1]';var nodes=selectNodes(doc,path,contextNode);if(nodes.length!=0){for(var i=0;i<nodes.length;i++){if(nodes[i]){return nodes[i];}}} return null;};w.XMLDocument.prototype.selectNodes=function(path,contextNode){return selectNodes(this,path,contextNode);};w.XMLDocument.prototype.selectSingleNode=function(path,contextNode){return selectSingleNode(this,path,contextNode);};w.XMLDocument.prototype.transformNode=function(xsl){var xslProcessor=new XSLTProcessor();xslProcessor.importStylesheet(xsl);var ownerDocument=document.implementation.createDocument("","",null);var transformedDoc=xslProcessor.transformToDocument(this);return transformedDoc.xml;};Node.prototype.selectNodes=function(path){var doc=this.ownerDocument;return doc.selectNodes(path,this);};Node.prototype.selectSingleNode=function(path){var doc=this.ownerDocument;return doc.selectSingleNode(path,this);};Node.prototype.__defineGetter__('baseName',function(){return this.localName;});Node.prototype.__defineGetter__('text',function(){return this.textContent;});Node.prototype.__defineSetter__('text',function(value){this.textContent=value;});Node.prototype.__defineGetter__('xml',function(){return(new XMLSerializer()).serializeToString(this);});}
function __supportsCompatLayer(ua){return(ua.indexOf('Gecko')>=0)||(ua.indexOf('AppleWebKit')>=0)||(ua.indexOf('Opera')>=0);}
if(__supportsCompatLayer(window.navigator.userAgent)){try{__loadCompatLayer(window);} catch(e){}}//----------------------------------------------------------
// Copyright (C) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------
// MicrosoftAjax.js
Function.__typeName="Function";Function.__class=true;Function.createCallback=function(b,a){return function(){var e=arguments.length;if(e>0){var d=[];for(var c=0;c<e;c++)d[c]=arguments[c];d[e]=a;return b.apply(this,d)}return b.call(this,a)}};Function.createDelegate=function(a,b){return function(){return b.apply(a,arguments)}};Function.emptyFunction=Function.emptyMethod=function(){};Function._validateParams=function(e,c){var a;a=Function._validateParameterCount(e,c);if(a){a.popStackFrame();return a}for(var b=0;b<e.length;b++){var d=c[Math.min(b,c.length-1)],f=d.name;if(d.parameterArray)f+="["+(b-c.length+1)+"]";a=Function._validateParameter(e[b],d,f);if(a){a.popStackFrame();return a}}return null};Function._validateParameterCount=function(e,a){var c=a.length,d=0;for(var b=0;b<a.length;b++)if(a[b].parameterArray)c=Number.MAX_VALUE;else if(!a[b].optional)d++;if(e.length<d||e.length>c){var f=Error.parameterCount();f.popStackFrame();return f}return null};Function._validateParameter=function(c,a,h){var b,g=a.type,l=!!a.integer,k=!!a.domElement,m=!!a.mayBeNull;b=Function._validateParameterType(c,g,l,k,m,h);if(b){b.popStackFrame();return b}var e=a.elementType,f=!!a.elementMayBeNull;if(g===Array&&typeof c!=="undefined"&&c!==null&&(e||!f)){var j=!!a.elementInteger,i=!!a.elementDomElement;for(var d=0;d<c.length;d++){var n=c[d];b=Function._validateParameterType(n,e,j,i,f,h+"["+d+"]");if(b){b.popStackFrame();return b}}}return null};Function._validateParameterType=function(a,c,n,m,k,d){var b;if(typeof a==="undefined")if(k)return null;else{b=Error.argumentUndefined(d);b.popStackFrame();return b}if(a===null)if(k)return null;else{b=Error.argumentNull(d);b.popStackFrame();return b}if(c&&c.__enum){if(typeof a!=="number"){b=Error.argumentType(d,Object.getType(a),c);b.popStackFrame();return b}if(a%1===0){var e=c.prototype;if(!c.__flags||a===0){for(var i in e)if(e[i]===a)return null}else{var l=a;for(var i in e){var f=e[i];if(f===0)continue;if((f&a)===f)l-=f;if(l===0)return null}}}b=Error.argumentOutOfRange(d,a,String.format(Sys.Res.enumInvalidValue,a,c.getName()));b.popStackFrame();return b}if(m){var h;if(typeof a.nodeType!=="number"){var g=a.ownerDocument||a.document||a;if(g!=a){var j=g.defaultView||g.parentWindow;h=j!=a&&!(j.document&&a.document&&j.document===a.document)}else h=typeof g.body==="undefined"}else h=a.nodeType===3;if(h){b=Error.argument(d,Sys.Res.argumentDomElement);b.popStackFrame();return b}}if(c&&!c.isInstanceOfType(a)){b=Error.argumentType(d,Object.getType(a),c);b.popStackFrame();return b}if(c===Number&&n)if(a%1!==0){b=Error.argumentOutOfRange(d,a,Sys.Res.argumentInteger);b.popStackFrame();return b}return null};Error.__typeName="Error";Error.__class=true;Error.create=function(d,b){var a=new Error(d);a.message=d;if(b)for(var c in b)a[c]=b[c];a.popStackFrame();return a};Error.argument=function(a,c){var b="Sys.ArgumentException: "+(c?c:Sys.Res.argument);if(a)b+="\n"+String.format(Sys.Res.paramName,a);var d=Error.create(b,{name:"Sys.ArgumentException",paramName:a});d.popStackFrame();return d};Error.argumentNull=function(a,c){var b="Sys.ArgumentNullException: "+(c?c:Sys.Res.argumentNull);if(a)b+="\n"+String.format(Sys.Res.paramName,a);var d=Error.create(b,{name:"Sys.ArgumentNullException",paramName:a});d.popStackFrame();return d};Error.argumentOutOfRange=function(c,a,d){var b="Sys.ArgumentOutOfRangeException: "+(d?d:Sys.Res.argumentOutOfRange);if(c)b+="\n"+String.format(Sys.Res.paramName,c);if(typeof a!=="undefined"&&a!==null)b+="\n"+String.format(Sys.Res.actualValue,a);var e=Error.create(b,{name:"Sys.ArgumentOutOfRangeException",paramName:c,actualValue:a});e.popStackFrame();return e};Error.argumentType=function(d,c,b,e){var a="Sys.ArgumentTypeException: ";if(e)a+=e;else if(c&&b)a+=String.format(Sys.Res.argumentTypeWithTypes,c.getName(),b.getName());else a+=Sys.Res.argumentType;if(d)a+="\n"+String.format(Sys.Res.paramName,d);var f=Error.create(a,{name:"Sys.ArgumentTypeException",paramName:d,actualType:c,expectedType:b});f.popStackFrame();return f};Error.argumentUndefined=function(a,c){var b="Sys.ArgumentUndefinedException: "+(c?c:Sys.Res.argumentUndefined);if(a)b+="\n"+String.format(Sys.Res.paramName,a);var d=Error.create(b,{name:"Sys.ArgumentUndefinedException",paramName:a});d.popStackFrame();return d};Error.format=function(a){var c="Sys.FormatException: "+(a?a:Sys.Res.format),b=Error.create(c,{name:"Sys.FormatException"});b.popStackFrame();return b};Error.invalidOperation=function(a){var c="Sys.InvalidOperationException: "+(a?a:Sys.Res.invalidOperation),b=Error.create(c,{name:"Sys.InvalidOperationException"});b.popStackFrame();return b};Error.notImplemented=function(a){var c="Sys.NotImplementedException: "+(a?a:Sys.Res.notImplemented),b=Error.create(c,{name:"Sys.NotImplementedException"});b.popStackFrame();return b};Error.parameterCount=function(a){var c="Sys.ParameterCountException: "+(a?a:Sys.Res.parameterCount),b=Error.create(c,{name:"Sys.ParameterCountException"});b.popStackFrame();return b};Error.prototype.popStackFrame=function(){if(typeof this.stack==="undefined"||this.stack===null||typeof this.fileName==="undefined"||this.fileName===null||typeof this.lineNumber==="undefined"||this.lineNumber===null)return;var a=this.stack.split("\n"),c=a[0],e=this.fileName+":"+this.lineNumber;while(typeof c!=="undefined"&&c!==null&&c.indexOf(e)===-1){a.shift();c=a[0]}var d=a[1];if(typeof d==="undefined"||d===null)return;var b=d.match(/@(.*):(\d+)$/);if(typeof b==="undefined"||b===null)return;this.fileName=b[1];this.lineNumber=parseInt(b[2]);a.shift();this.stack=a.join("\n")};Object.__typeName="Object";Object.__class=true;Object.getType=function(b){var a=b.constructor;if(!a||typeof a!=="function"||!a.__typeName||a.__typeName==="Object")return Object;return a};Object.getTypeName=function(a){return Object.getType(a).getName()};String.__typeName="String";String.__class=true;String.prototype.endsWith=function(a){return this.substr(this.length-a.length)===a};String.prototype.startsWith=function(a){return this.substr(0,a.length)===a};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};String.prototype.trimEnd=function(){return this.replace(/\s+$/,"")};String.prototype.trimStart=function(){return this.replace(/^\s+/,"")};String.format=function(){return String._toFormattedString(false,arguments)};String.localeFormat=function(){return String._toFormattedString(true,arguments)};String._toFormattedString=function(l,j){var c="",e=j[0];for(var a=0;true;){var f=e.indexOf("{",a),d=e.indexOf("}",a);if(f<0&&d<0){c+=e.slice(a);break}if(d>0&&(d<f||f<0)){c+=e.slice(a,d+1);a=d+2;continue}c+=e.slice(a,f);a=f+1;if(e.charAt(a)==="{"){c+="{";a++;continue}if(d<0)break;var h=e.substring(a,d),g=h.indexOf(":"),k=parseInt(g<0?h:h.substring(0,g),10)+1,i=g<0?"":h.substring(g+1),b=j[k];if(typeof b==="undefined"||b===null)b="";if(b.toFormattedString)c+=b.toFormattedString(i);else if(l&&b.localeFormat)c+=b.localeFormat(i);else if(b.format)c+=b.format(i);else c+=b.toString();a=d+1}return c};Boolean.__typeName="Boolean";Boolean.__class=true;Boolean.parse=function(b){var a=b.trim().toLowerCase();if(a==="false")return false;if(a==="true")return true};Date.__typeName="Date";Date.__class=true;Date._appendPreOrPostMatch=function(e,b){var d=0,a=false;for(var c=0,g=e.length;c<g;c++){var f=e.charAt(c);switch(f){case "'":if(a)b.append("'");else d++;a=false;break;case "\\":if(a)b.append("\\");a=!a;break;default:b.append(f);a=false}}return d};Date._expandFormat=function(a,b){if(!b)b="F";if(b.length===1)switch(b){case "d":return a.ShortDatePattern;case "D":return a.LongDatePattern;case "t":return a.ShortTimePattern;case "T":return a.LongTimePattern;case "F":return a.FullDateTimePattern;case "M":case "m":return a.MonthDayPattern;case "s":return a.SortableDateTimePattern;case "Y":case "y":return a.YearMonthPattern;default:throw Error.format(Sys.Res.formatInvalidString)}return b};Date._expandYear=function(c,a){if(a<100){var b=(new Date).getFullYear();a+=b-b%100;if(a>c.Calendar.TwoDigitYearMax)return a-100}return a};Date._getParseRegExp=function(b,e){if(!b._parseRegExp)b._parseRegExp={};else if(b._parseRegExp[e])return b._parseRegExp[e];var c=Date._expandFormat(b,e);c=c.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1");var a=new Sys.StringBuilder("^"),j=[],f=0,i=0,h=Date._getTokenRegExp(),d;while((d=h.exec(c))!==null){var l=c.slice(f,d.index);f=h.lastIndex;i+=Date._appendPreOrPostMatch(l,a);if(i%2===1){a.append(d[0]);continue}switch(d[0]){case "dddd":case "ddd":case "MMMM":case "MMM":a.append("(\\D+)");break;case "tt":case "t":a.append("(\\D*)");break;case "yyyy":a.append("(\\d{4})");break;case "fff":a.append("(\\d{3})");break;case "ff":a.append("(\\d{2})");break;case "f":a.append("(\\d)");break;case "dd":case "d":case "MM":case "M":case "yy":case "y":case "HH":case "H":case "hh":case "h":case "mm":case "m":case "ss":case "s":a.append("(\\d\\d?)");break;case "zzz":a.append("([+-]?\\d\\d?:\\d{2})");break;case "zz":case "z":a.append("([+-]?\\d\\d?)")}Array.add(j,d[0])}Date._appendPreOrPostMatch(c.slice(f),a);a.append("$");var k=a.toString().replace(/\s+/g,"\\s+"),g={"regExp":k,"groups":j};b._parseRegExp[e]=g;return g};Date._getTokenRegExp=function(){return /dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z/g};Date.parseLocale=function(a){return Date._parse(a,Sys.CultureInfo.CurrentCulture,arguments)};Date.parseInvariant=function(a){return Date._parse(a,Sys.CultureInfo.InvariantCulture,arguments)};Date._parse=function(g,c,h){var e=false;for(var a=1,i=h.length;a<i;a++){var f=h[a];if(f){e=true;var b=Date._parseExact(g,f,c);if(b)return b}}if(!e){var d=c._getDateTimeFormats();for(var a=0,i=d.length;a<i;a++){var b=Date._parseExact(g,d[a],c);if(b)return b}}return null};Date._parseExact=function(s,y,j){s=s.trim();var m=j.dateTimeFormat,v=Date._getParseRegExp(m,y),x=(new RegExp(v.regExp)).exec(s);if(x===null)return null;var w=v.groups,f=null,c=null,h=null,g=null,d=0,n=0,o=0,e=0,k=null,r=false;for(var p=0,z=w.length;p<z;p++){var a=x[p+1];if(a)switch(w[p]){case "dd":case "d":h=parseInt(a,10);if(h<1||h>31)return null;break;case "MMMM":c=j._getMonthIndex(a);if(c<0||c>11)return null;break;case "MMM":c=j._getAbbrMonthIndex(a);if(c<0||c>11)return null;break;case "M":case "MM":var c=parseInt(a,10)-1;if(c<0||c>11)return null;break;case "y":case "yy":f=Date._expandYear(m,parseInt(a,10));if(f<0||f>9999)return null;break;case "yyyy":f=parseInt(a,10);if(f<0||f>9999)return null;break;case "h":case "hh":d=parseInt(a,10);if(d===12)d=0;if(d<0||d>11)return null;break;case "H":case "HH":d=parseInt(a,10);if(d<0||d>23)return null;break;case "m":case "mm":n=parseInt(a,10);if(n<0||n>59)return null;break;case "s":case "ss":o=parseInt(a,10);if(o<0||o>59)return null;break;case "tt":case "t":var u=a.toUpperCase();r=u===m.PMDesignator.toUpperCase();if(!r&&u!==m.AMDesignator.toUpperCase())return null;break;case "f":e=parseInt(a,10)*100;if(e<0||e>999)return null;break;case "ff":e=parseInt(a,10)*10;if(e<0||e>999)return null;break;case "fff":e=parseInt(a,10);if(e<0||e>999)return null;break;case "dddd":g=j._getDayIndex(a);if(g<0||g>6)return null;break;case "ddd":g=j._getAbbrDayIndex(a);if(g<0||g>6)return null;break;case "zzz":var q=a.split(/:/);if(q.length!==2)return null;var i=parseInt(q[0],10);if(i<-12||i>13)return null;var l=parseInt(q[1],10);if(l<0||l>59)return null;k=i*60+(a.startsWith("-")?-l:l);break;case "z":case "zz":var i=parseInt(a,10);if(i<-12||i>13)return null;k=i*60}}var b=new Date;if(f===null)f=b.getFullYear();if(c===null)c=b.getMonth();if(h===null)h=b.getDate();b.setFullYear(f,c,h);if(b.getDate()!==h)return null;if(g!==null&&b.getDay()!==g)return null;if(r&&d<12)d+=12;b.setHours(d,n,o,e);if(k!==null){var t=b.getMinutes()-(k+b.getTimezoneOffset());b.setHours(b.getHours()+parseInt(t/60,10),t%60)}return b};Date.prototype.format=function(a){return this._toFormattedString(a,Sys.CultureInfo.InvariantCulture)};Date.prototype.localeFormat=function(a){return this._toFormattedString(a,Sys.CultureInfo.CurrentCulture)};Date.prototype._toFormattedString=function(e,h){if(!e||e.length===0||e==="i")if(h&&h.name.length>0)return this.toLocaleString();else return this.toString();var d=h.dateTimeFormat;e=Date._expandFormat(d,e);var a=new Sys.StringBuilder,b;function c(a){if(a<10)return "0"+a;return a.toString()}function g(a){if(a<10)return "00"+a;if(a<100)return "0"+a;return a.toString()}var j=0,i=Date._getTokenRegExp();for(;true;){var l=i.lastIndex,f=i.exec(e),k=e.slice(l,f?f.index:e.length);j+=Date._appendPreOrPostMatch(k,a);if(!f)break;if(j%2===1){a.append(f[0]);continue}switch(f[0]){case "dddd":a.append(d.DayNames[this.getDay()]);break;case "ddd":a.append(d.AbbreviatedDayNames[this.getDay()]);break;case "dd":a.append(c(this.getDate()));break;case "d":a.append(this.getDate());break;case "MMMM":a.append(d.MonthNames[this.getMonth()]);break;case "MMM":a.append(d.AbbreviatedMonthNames[this.getMonth()]);break;case "MM":a.append(c(this.getMonth()+1));break;case "M":a.append(this.getMonth()+1);break;case "yyyy":a.append(this.getFullYear());break;case "yy":a.append(c(this.getFullYear()%100));break;case "y":a.append(this.getFullYear()%100);break;case "hh":b=this.getHours()%12;if(b===0)b=12;a.append(c(b));break;case "h":b=this.getHours()%12;if(b===0)b=12;a.append(b);break;case "HH":a.append(c(this.getHours()));break;case "H":a.append(this.getHours());break;case "mm":a.append(c(this.getMinutes()));break;case "m":a.append(this.getMinutes());break;case "ss":a.append(c(this.getSeconds()));break;case "s":a.append(this.getSeconds());break;case "tt":a.append(this.getHours()<12?d.AMDesignator:d.PMDesignator);break;case "t":a.append((this.getHours()<12?d.AMDesignator:d.PMDesignator).charAt(0));break;case "f":a.append(g(this.getMilliseconds()).charAt(0));break;case "ff":a.append(g(this.getMilliseconds()).substr(0,2));break;case "fff":a.append(g(this.getMilliseconds()));break;case "z":b=this.getTimezoneOffset()/60;a.append((b<=0?"+":"-")+Math.floor(Math.abs(b)));break;case "zz":b=this.getTimezoneOffset()/60;a.append((b<=0?"+":"-")+c(Math.floor(Math.abs(b))));break;case "zzz":b=this.getTimezoneOffset()/60;a.append((b<=0?"+":"-")+c(Math.floor(Math.abs(b)))+d.TimeSeparator+c(Math.abs(this.getTimezoneOffset()%60)))}}return a.toString()};Number.__typeName="Number";Number.__class=true;Number.parseLocale=function(a){return Number._parse(a,Sys.CultureInfo.CurrentCulture)};Number.parseInvariant=function(a){return Number._parse(a,Sys.CultureInfo.InvariantCulture)};Number._parse=function(b,o){b=b.trim();if(b.match(/^[+-]?infinity$/i))return parseFloat(b);if(b.match(/^0x[a-f0-9]+$/i))return parseInt(b);var a=o.numberFormat,g=Number._parseNumberNegativePattern(b,a,a.NumberNegativePattern),h=g[0],e=g[1];if(h===""&&a.NumberNegativePattern!==1){g=Number._parseNumberNegativePattern(b,a,1);h=g[0];e=g[1]}if(h==="")h="+";var j,d,f=e.indexOf("e");if(f<0)f=e.indexOf("E");if(f<0){d=e;j=null}else{d=e.substr(0,f);j=e.substr(f+1)}var c,k,m=d.indexOf(a.NumberDecimalSeparator);if(m<0){c=d;k=null}else{c=d.substr(0,m);k=d.substr(m+a.NumberDecimalSeparator.length)}c=c.split(a.NumberGroupSeparator).join("");var n=a.NumberGroupSeparator.replace(/\u00A0/g," ");if(a.NumberGroupSeparator!==n)c=c.split(n).join("");var l=h+c;if(k!==null)l+="."+k;if(j!==null){var i=Number._parseNumberNegativePattern(j,a,1);if(i[0]==="")i[0]="+";l+="e"+i[0]+i[1]}if(l.match(/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/))return parseFloat(l);return Number.NaN};Number._parseNumberNegativePattern=function(a,d,e){var b=d.NegativeSign,c=d.PositiveSign;switch(e){case 4:b=" "+b;c=" "+c;case 3:if(a.endsWith(b))return ["-",a.substr(0,a.length-b.length)];else if(a.endsWith(c))return ["+",a.substr(0,a.length-c.length)];break;case 2:b+=" ";c+=" ";case 1:if(a.startsWith(b))return ["-",a.substr(b.length)];else if(a.startsWith(c))return ["+",a.substr(c.length)];break;case 0:if(a.startsWith("(")&&a.endsWith(")"))return ["-",a.substr(1,a.length-2)]}return ["",a]};Number.prototype.format=function(a){return this._toFormattedString(a,Sys.CultureInfo.InvariantCulture)};Number.prototype.localeFormat=function(a){return this._toFormattedString(a,Sys.CultureInfo.CurrentCulture)};Number.prototype._toFormattedString=function(d,j){if(!d||d.length===0||d==="i")if(j&&j.name.length>0)return this.toLocaleString();else return this.toString();var o=["n %","n%","%n"],n=["-n %","-n%","-%n"],p=["(n)","-n","- n","n-","n -"],m=["$n","n$","$ n","n $"],l=["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"];function g(a,c,d){for(var b=a.length;b<c;b++)a=d?"0"+a:a+"0";return a}function i(j,i,l,n,p){var h=l[0],k=1,o=Math.pow(10,i),m=Math.round(j*o)/o;if(!isFinite(m))m=j;j=m;var b=j.toString(),a="",c,e=b.split(/e/i);b=e[0];c=e.length>1?parseInt(e[1]):0;e=b.split(".");b=e[0];a=e.length>1?e[1]:"";var q;if(c>0){a=g(a,c,false);b+=a.slice(0,c);a=a.substr(c)}else if(c<0){c=-c;b=g(b,c+1,true);a=b.slice(-c,b.length)+a;b=b.slice(0,-c)}if(i>0){if(a.length>i)a=a.slice(0,i);else a=g(a,i,false);a=p+a}else a="";var d=b.length-1,f="";while(d>=0){if(h===0||h>d)if(f.length>0)return b.slice(0,d+1)+n+f+a;else return b.slice(0,d+1)+a;if(f.length>0)f=b.slice(d-h+1,d+1)+n+f;else f=b.slice(d-h+1,d+1);d-=h;if(k<l.length){h=l[k];k++}}return b.slice(0,d+1)+n+f+a}var a=j.numberFormat,e=Math.abs(this);if(!d)d="D";var b=-1;if(d.length>1)b=parseInt(d.slice(1),10);var c;switch(d.charAt(0)){case "d":case "D":c="n";if(b!==-1)e=g(""+e,b,true);if(this<0)e=-e;break;case "c":case "C":if(this<0)c=l[a.CurrencyNegativePattern];else c=m[a.CurrencyPositivePattern];if(b===-1)b=a.CurrencyDecimalDigits;e=i(Math.abs(this),b,a.CurrencyGroupSizes,a.CurrencyGroupSeparator,a.CurrencyDecimalSeparator);break;case "n":case "N":if(this<0)c=p[a.NumberNegativePattern];else c="n";if(b===-1)b=a.NumberDecimalDigits;e=i(Math.abs(this),b,a.NumberGroupSizes,a.NumberGroupSeparator,a.NumberDecimalSeparator);break;case "p":case "P":if(this<0)c=n[a.PercentNegativePattern];else c=o[a.PercentPositivePattern];if(b===-1)b=a.PercentDecimalDigits;e=i(Math.abs(this)*100,b,a.PercentGroupSizes,a.PercentGroupSeparator,a.PercentDecimalSeparator);break;default:throw Error.format(Sys.Res.formatBadFormatSpecifier)}var k=/n|\$|-|%/g,f="";for(;true;){var q=k.lastIndex,h=k.exec(c);f+=c.slice(q,h?h.index:c.length);if(!h)break;switch(h[0]){case "n":f+=e;break;case "$":f+=a.CurrencySymbol;break;case "-":f+=a.NegativeSign;break;case "%":f+=a.PercentSymbol}}return f};RegExp.__typeName="RegExp";RegExp.__class=true;Array.__typeName="Array";Array.__class=true;Array.add=Array.enqueue=function(a,b){a[a.length]=b};Array.addRange=function(a,b){a.push.apply(a,b)};Array.clear=function(a){a.length=0};Array.clone=function(a){if(a.length===1)return [a[0]];else return Array.apply(null,a)};Array.contains=function(a,b){return Array.indexOf(a,b)>=0};Array.dequeue=function(a){return a.shift()};Array.forEach=function(b,e,d){for(var a=0,f=b.length;a<f;a++){var c=b[a];if(typeof c!=="undefined")e.call(d,c,a,b)}};Array.indexOf=function(d,e,a){if(typeof e==="undefined")return -1;var c=d.length;if(c!==0){a=a-0;if(isNaN(a))a=0;else{if(isFinite(a))a=a-a%1;if(a<0)a=Math.max(0,c+a)}for(var b=a;b<c;b++)if(typeof d[b]!=="undefined"&&d[b]===e)return b}return -1};Array.insert=function(a,b,c){a.splice(b,0,c)};Array.parse=function(value){if(!value)return [];return eval(value)};Array.remove=function(b,c){var a=Array.indexOf(b,c);if(a>=0)b.splice(a,1);return a>=0};Array.removeAt=function(a,b){a.splice(b,1)};if(!window)this.window=this;window.Type=Function;Type.prototype.callBaseMethod=function(a,d,b){var c=this.getBaseMethod(a,d);if(!b)return c.apply(a);else return c.apply(a,b)};Type.prototype.getBaseMethod=function(d,c){var b=this.getBaseType();if(b){var a=b.prototype[c];return a instanceof Function?a:null}return null};Type.prototype.getBaseType=function(){return typeof this.__baseType==="undefined"?null:this.__baseType};Type.prototype.getInterfaces=function(){var a=[],b=this;while(b){var c=b.__interfaces;if(c)for(var d=0,f=c.length;d<f;d++){var e=c[d];if(!Array.contains(a,e))a[a.length]=e}b=b.__baseType}return a};Type.prototype.getName=function(){return typeof this.__typeName==="undefined"?"":this.__typeName};Type.prototype.implementsInterface=function(d){this.resolveInheritance();var c=d.getName(),a=this.__interfaceCache;if(a){var e=a[c];if(typeof e!=="undefined")return e}else a=this.__interfaceCache={};var b=this;while(b){var f=b.__interfaces;if(f)if(Array.indexOf(f,d)!==-1)return a[c]=true;b=b.__baseType}return a[c]=false};Type.prototype.inheritsFrom=function(b){this.resolveInheritance();var a=this.__baseType;while(a){if(a===b)return true;a=a.__baseType}return false};Type.prototype.initializeBase=function(a,b){this.resolveInheritance();if(this.__baseType)if(!b)this.__baseType.apply(a);else this.__baseType.apply(a,b);return a};Type.prototype.isImplementedBy=function(a){if(typeof a==="undefined"||a===null)return false;var b=Object.getType(a);return !!(b.implementsInterface&&b.implementsInterface(this))};Type.prototype.isInstanceOfType=function(b){if(typeof b==="undefined"||b===null)return false;if(b instanceof this)return true;var a=Object.getType(b);return !!(a===this)||a.inheritsFrom&&a.inheritsFrom(this)||a.implementsInterface&&a.implementsInterface(this)};Type.prototype.registerClass=function(c,b,d){this.prototype.constructor=this;this.__typeName=c;this.__class=true;if(b){this.__baseType=b;this.__basePrototypePending=true}Sys.__upperCaseTypes[c.toUpperCase()]=this;if(d){this.__interfaces=[];for(var a=2,f=arguments.length;a<f;a++){var e=arguments[a];this.__interfaces.push(e)}}return this};Type.prototype.registerInterface=function(a){Sys.__upperCaseTypes[a.toUpperCase()]=this;this.prototype.constructor=this;this.__typeName=a;this.__interface=true;return this};Type.prototype.resolveInheritance=function(){if(this.__basePrototypePending){var b=this.__baseType;b.resolveInheritance();for(var a in b.prototype){var c=b.prototype[a];if(!this.prototype[a])this.prototype[a]=c}delete this.__basePrototypePending}};Type.getRootNamespaces=function(){return Array.clone(Sys.__rootNamespaces)};Type.isClass=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__class};Type.isInterface=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__interface};Type.isNamespace=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__namespace};Type.parse=function(typeName,ns){var fn;if(ns){fn=Sys.__upperCaseTypes[ns.getName().toUpperCase()+"."+typeName.toUpperCase()];return fn||null}if(!typeName)return null;if(!Type.__htClasses)Type.__htClasses={};fn=Type.__htClasses[typeName];if(!fn){fn=eval(typeName);Type.__htClasses[typeName]=fn}return fn};Type.registerNamespace=function(f){var d=window,c=f.split(".");for(var b=0;b<c.length;b++){var e=c[b],a=d[e];if(!a){a=d[e]={__namespace:true,__typeName:c.slice(0,b+1).join(".")};if(b===0)Sys.__rootNamespaces[Sys.__rootNamespaces.length]=a;a.getName=function(){return this.__typeName}}d=a}};window.Sys={__namespace:true,__typeName:"Sys",getName:function(){return "Sys"},__upperCaseTypes:{}};Sys.__rootNamespaces=[Sys];Sys.IDisposable=function(){};Sys.IDisposable.prototype={};Sys.IDisposable.registerInterface("Sys.IDisposable");Sys.StringBuilder=function(a){this._parts=typeof a!=="undefined"&&a!==null&&a!==""?[a.toString()]:[];this._value={};this._len=0};Sys.StringBuilder.prototype={append:function(a){this._parts[this._parts.length]=a},appendLine:function(a){this._parts[this._parts.length]=typeof a==="undefined"||a===null||a===""?"\r\n":a+"\r\n"},clear:function(){this._parts=[];this._value={};this._len=0},isEmpty:function(){if(this._parts.length===0)return true;return this.toString()===""},toString:function(a){a=a||"";var b=this._parts;if(this._len!==b.length){this._value={};this._len=b.length}var d=this._value;if(typeof d[a]==="undefined"){if(a!=="")for(var c=0;c<b.length;)if(typeof b[c]==="undefined"||b[c]===""||b[c]===null)b.splice(c,1);else c++;d[a]=this._parts.join(a)}return d[a]}};Sys.StringBuilder.registerClass("Sys.StringBuilder");if(!window.XMLHttpRequest)window.XMLHttpRequest=function(){var b=["Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP"];for(var a=0,c=b.length;a<c;a++)try{return new ActiveXObject(b[a])}catch(d){}return null};Sys.Browser={};Sys.Browser.InternetExplorer={};Sys.Browser.Firefox={};Sys.Browser.Safari={};Sys.Browser.Opera={};Sys.Browser.agent=null;Sys.Browser.hasDebuggerStatement=false;Sys.Browser.name=navigator.appName;Sys.Browser.version=parseFloat(navigator.appVersion);Sys.Browser.documentMode=0;if(navigator.userAgent.indexOf(" MSIE ")>-1){Sys.Browser.agent=Sys.Browser.InternetExplorer;Sys.Browser.version=parseFloat(navigator.userAgent.match(/MSIE (\d+\.\d+)/)[1]);if(Sys.Browser.version>=8)if(document.documentMode>=7)Sys.Browser.documentMode=document.documentMode;Sys.Browser.hasDebuggerStatement=true}else if(navigator.userAgent.indexOf(" Firefox/")>-1){Sys.Browser.agent=Sys.Browser.Firefox;Sys.Browser.version=parseFloat(navigator.userAgent.match(/Firefox\/(\d+\.\d+)/)[1]);Sys.Browser.name="Firefox";Sys.Browser.hasDebuggerStatement=true}else if(navigator.userAgent.indexOf(" AppleWebKit/")>-1){Sys.Browser.agent=Sys.Browser.Safari;Sys.Browser.version=parseFloat(navigator.userAgent.match(/AppleWebKit\/(\d+(\.\d+)?)/)[1]);Sys.Browser.name="Safari"}else if(navigator.userAgent.indexOf("Opera/")>-1)Sys.Browser.agent=Sys.Browser.Opera;Type.registerNamespace("Sys.UI");Sys._Debug=function(){};Sys._Debug.prototype={_appendConsole:function(a){if(typeof Debug!=="undefined"&&Debug.writeln)Debug.writeln(a);if(window.console&&window.console.log)window.console.log(a);if(window.opera)window.opera.postError(a);if(window.debugService)window.debugService.trace(a)},_appendTrace:function(b){var a=document.getElementById("TraceConsole");if(a&&a.tagName.toUpperCase()==="TEXTAREA")a.value+=b+"\n"},assert:function(c,a,b){if(!c){a=b&&this.assert.caller?String.format(Sys.Res.assertFailedCaller,a,this.assert.caller):String.format(Sys.Res.assertFailed,a);if(confirm(String.format(Sys.Res.breakIntoDebugger,a)))this.fail(a)}},clearTrace:function(){var a=document.getElementById("TraceConsole");if(a&&a.tagName.toUpperCase()==="TEXTAREA")a.value=""},fail:function(message){this._appendConsole(message);if(Sys.Browser.hasDebuggerStatement)eval("debugger")},trace:function(a){this._appendConsole(a);this._appendTrace(a)},traceDump:function(a,b){var c=this._traceDump(a,b,true)},_traceDump:function(a,c,f,b,d){c=c?c:"traceDump";b=b?b:"";if(a===null){this.trace(b+c+": null");return}switch(typeof a){case "undefined":this.trace(b+c+": Undefined");break;case "number":case "string":case "boolean":this.trace(b+c+": "+a);break;default:if(Date.isInstanceOfType(a)||RegExp.isInstanceOfType(a)){this.trace(b+c+": "+a.toString());break}if(!d)d=[];else if(Array.contains(d,a)){this.trace(b+c+": ...");return}Array.add(d,a);if(a==window||a===document||window.HTMLElement&&a instanceof HTMLElement||typeof a.nodeName==="string"){var k=a.tagName?a.tagName:"DomElement";if(a.id)k+=" - "+a.id;this.trace(b+c+" {"+k+"}")}else{var i=Object.getTypeName(a);this.trace(b+c+(typeof i==="string"?" {"+i+"}":""));if(b===""||f){b+="    ";var e,j,l,g,h;if(Array.isInstanceOfType(a)){j=a.length;for(e=0;e<j;e++)this._traceDump(a[e],"["+e+"]",f,b,d)}else for(g in a){h=a[g];if(!Function.isInstanceOfType(h))this._traceDump(h,g,f,b,d)}}}Array.remove(d,a)}}};Sys._Debug.registerClass("Sys._Debug");Sys.Debug=new Sys._Debug;Sys.Debug.isDebug=false;function Sys$Enum$parse(c,e){var a,b,i;if(e){a=this.__lowerCaseValues;if(!a){this.__lowerCaseValues=a={};var g=this.prototype;for(var f in g)a[f.toLowerCase()]=g[f]}}else a=this.prototype;if(!this.__flags){i=e?c.toLowerCase():c;b=a[i.trim()];if(typeof b!=="number")throw Error.argument("value",String.format(Sys.Res.enumInvalidValue,c,this.__typeName));return b}else{var h=(e?c.toLowerCase():c).split(","),j=0;for(var d=h.length-1;d>=0;d--){var k=h[d].trim();b=a[k];if(typeof b!=="number")throw Error.argument("value",String.format(Sys.Res.enumInvalidValue,c.split(",")[d].trim(),this.__typeName));j|=b}return j}}function Sys$Enum$toString(c){if(typeof c==="undefined"||c===null)return this.__string;var d=this.prototype,a;if(!this.__flags||c===0){for(a in d)if(d[a]===c)return a}else{var b=this.__sortedValues;if(!b){b=[];for(a in d)b[b.length]={key:a,value:d[a]};b.sort(function(a,b){return a.value-b.value});this.__sortedValues=b}var e=[],g=c;for(a=b.length-1;a>=0;a--){var h=b[a],f=h.value;if(f===0)continue;if((f&c)===f){e[e.length]=h.key;g-=f;if(g===0)break}}if(e.length&&g===0)return e.reverse().join(", ")}return ""}Type.prototype.registerEnum=function(b,c){Sys.__upperCaseTypes[b.toUpperCase()]=this;for(var a in this.prototype)this[a]=this.prototype[a];this.__typeName=b;this.parse=Sys$Enum$parse;this.__string=this.toString();this.toString=Sys$Enum$toString;this.__flags=c;this.__enum=true};Type.isEnum=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__enum};Type.isFlags=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__flags};Sys.EventHandlerList=function(){this._list={}};Sys.EventHandlerList.prototype={addHandler:function(b,a){Array.add(this._getEvent(b,true),a)},removeHandler:function(c,b){var a=this._getEvent(c);if(!a)return;Array.remove(a,b)},getHandler:function(b){var a=this._getEvent(b);if(!a||a.length===0)return null;a=Array.clone(a);return function(c,d){for(var b=0,e=a.length;b<e;b++)a[b](c,d)}},_getEvent:function(a,b){if(!this._list[a]){if(!b)return null;this._list[a]=[]}return this._list[a]}};Sys.EventHandlerList.registerClass("Sys.EventHandlerList");Sys.EventArgs=function(){};Sys.EventArgs.registerClass("Sys.EventArgs");Sys.EventArgs.Empty=new Sys.EventArgs;Sys.CancelEventArgs=function(){Sys.CancelEventArgs.initializeBase(this);this._cancel=false};Sys.CancelEventArgs.prototype={get_cancel:function(){return this._cancel},set_cancel:function(a){this._cancel=a}};Sys.CancelEventArgs.registerClass("Sys.CancelEventArgs",Sys.EventArgs);Sys.INotifyPropertyChange=function(){};Sys.INotifyPropertyChange.prototype={};Sys.INotifyPropertyChange.registerInterface("Sys.INotifyPropertyChange");Sys.PropertyChangedEventArgs=function(a){Sys.PropertyChangedEventArgs.initializeBase(this);this._propertyName=a};Sys.PropertyChangedEventArgs.prototype={get_propertyName:function(){return this._propertyName}};Sys.PropertyChangedEventArgs.registerClass("Sys.PropertyChangedEventArgs",Sys.EventArgs);Sys.INotifyDisposing=function(){};Sys.INotifyDisposing.prototype={};Sys.INotifyDisposing.registerInterface("Sys.INotifyDisposing");Sys.Component=function(){if(Sys.Application)Sys.Application.registerDisposableObject(this)};Sys.Component.prototype={_id:null,_initialized:false,_updating:false,get_events:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_id:function(){return this._id},set_id:function(a){this._id=a},get_isInitialized:function(){return this._initialized},get_isUpdating:function(){return this._updating},add_disposing:function(a){this.get_events().addHandler("disposing",a)},remove_disposing:function(a){this.get_events().removeHandler("disposing",a)},add_propertyChanged:function(a){this.get_events().addHandler("propertyChanged",a)},remove_propertyChanged:function(a){this.get_events().removeHandler("propertyChanged",a)},beginUpdate:function(){this._updating=true},dispose:function(){if(this._events){var a=this._events.getHandler("disposing");if(a)a(this,Sys.EventArgs.Empty)}delete this._events;Sys.Application.unregisterDisposableObject(this);Sys.Application.removeComponent(this)},endUpdate:function(){this._updating=false;if(!this._initialized)this.initialize();this.updated()},initialize:function(){this._initialized=true},raisePropertyChanged:function(b){if(!this._events)return;var a=this._events.getHandler("propertyChanged");if(a)a(this,new Sys.PropertyChangedEventArgs(b))},updated:function(){}};Sys.Component.registerClass("Sys.Component",null,Sys.IDisposable,Sys.INotifyPropertyChange,Sys.INotifyDisposing);function Sys$Component$_setProperties(a,i){var d,j=Object.getType(a),e=j===Object||j===Sys.UI.DomElement,h=Sys.Component.isInstanceOfType(a)&&!a.get_isUpdating();if(h)a.beginUpdate();for(var c in i){var b=i[c],f=e?null:a["get_"+c];if(e||typeof f!=="function"){var k=a[c];if(!b||typeof b!=="object"||e&&!k)a[c]=b;else Sys$Component$_setProperties(k,b)}else{var l=a["set_"+c];if(typeof l==="function")l.apply(a,[b]);else if(b instanceof Array){d=f.apply(a);for(var g=0,m=d.length,n=b.length;g<n;g++,m++)d[m]=b[g]}else if(typeof b==="object"&&Object.getType(b)===Object){d=f.apply(a);Sys$Component$_setProperties(d,b)}}}if(h)a.endUpdate()}function Sys$Component$_setReferences(c,b){for(var a in b){var e=c["set_"+a],d=$find(b[a]);e.apply(c,[d])}}var $create=Sys.Component.create=function(h,f,d,c,g){var a=g?new h(g):new h,b=Sys.Application,i=b.get_isCreatingComponents();a.beginUpdate();if(f)Sys$Component$_setProperties(a,f);if(d)for(var e in d)a["add_"+e](d[e]);if(a.get_id())b.addComponent(a);if(i){b._createdComponents[b._createdComponents.length]=a;if(c)b._addComponentToSecondPass(a,c);else a.endUpdate()}else{if(c)Sys$Component$_setReferences(a,c);a.endUpdate()}return a};Sys.UI.MouseButton=function(){throw Error.notImplemented()};Sys.UI.MouseButton.prototype={leftButton:0,middleButton:1,rightButton:2};Sys.UI.MouseButton.registerEnum("Sys.UI.MouseButton");Sys.UI.Key=function(){throw Error.notImplemented()};Sys.UI.Key.prototype={backspace:8,tab:9,enter:13,esc:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,del:127};Sys.UI.Key.registerEnum("Sys.UI.Key");Sys.UI.Point=function(a,b){this.x=a;this.y=b};Sys.UI.Point.registerClass("Sys.UI.Point");Sys.UI.Bounds=function(c,d,b,a){this.x=c;this.y=d;this.height=a;this.width=b};Sys.UI.Bounds.registerClass("Sys.UI.Bounds");Sys.UI.DomEvent=function(e){var a=e,b=this.type=a.type.toLowerCase();this.rawEvent=a;this.altKey=a.altKey;if(typeof a.button!=="undefined")this.button=typeof a.which!=="undefined"?a.button:a.button===4?Sys.UI.MouseButton.middleButton:a.button===2?Sys.UI.MouseButton.rightButton:Sys.UI.MouseButton.leftButton;if(b==="keypress")this.charCode=a.charCode||a.keyCode;else if(a.keyCode&&a.keyCode===46)this.keyCode=127;else this.keyCode=a.keyCode;this.clientX=a.clientX;this.clientY=a.clientY;this.ctrlKey=a.ctrlKey;this.target=a.target?a.target:a.srcElement;if(!b.startsWith("key"))if(typeof a.offsetX!=="undefined"&&typeof a.offsetY!=="undefined"){this.offsetX=a.offsetX;this.offsetY=a.offsetY}else if(this.target&&this.target.nodeType!==3&&typeof a.clientX==="number"){var c=Sys.UI.DomElement.getLocation(this.target),d=Sys.UI.DomElement._getWindow(this.target);this.offsetX=(d.pageXOffset||0)+a.clientX-c.x;this.offsetY=(d.pageYOffset||0)+a.clientY-c.y}this.screenX=a.screenX;this.screenY=a.screenY;this.shiftKey=a.shiftKey};Sys.UI.DomEvent.prototype={preventDefault:function(){if(this.rawEvent.preventDefault)this.rawEvent.preventDefault();else if(window.event)this.rawEvent.returnValue=false},stopPropagation:function(){if(this.rawEvent.stopPropagation)this.rawEvent.stopPropagation();else if(window.event)this.rawEvent.cancelBubble=true}};Sys.UI.DomEvent.registerClass("Sys.UI.DomEvent");var $addHandler=Sys.UI.DomEvent.addHandler=function(a,d,e){if(!a._events)a._events={};var c=a._events[d];if(!c)a._events[d]=c=[];var b;if(a.addEventListener){b=function(b){return e.call(a,new Sys.UI.DomEvent(b))};a.addEventListener(d,b,false)}else if(a.attachEvent){b=function(){var b={};try{b=Sys.UI.DomElement._getWindow(a).event}catch(c){}return e.call(a,new Sys.UI.DomEvent(b))};a.attachEvent("on"+d,b)}c[c.length]={handler:e,browserHandler:b}},$addHandlers=Sys.UI.DomEvent.addHandlers=function(e,d,c){for(var b in d){var a=d[b];if(c)a=Function.createDelegate(c,a);$addHandler(e,b,a)}},$clearHandlers=Sys.UI.DomEvent.clearHandlers=function(a){if(a._events){var e=a._events;for(var b in e){var d=e[b];for(var c=d.length-1;c>=0;c--)$removeHandler(a,b,d[c].handler)}a._events=null}},$removeHandler=Sys.UI.DomEvent.removeHandler=function(a,e,f){var d=null,c=a._events[e];for(var b=0,g=c.length;b<g;b++)if(c[b].handler===f){d=c[b].browserHandler;break}if(a.removeEventListener)a.removeEventListener(e,d,false);else if(a.detachEvent)a.detachEvent("on"+e,d);c.splice(b,1)};Sys.UI.DomElement=function(){};Sys.UI.DomElement.registerClass("Sys.UI.DomElement");Sys.UI.DomElement.addCssClass=function(a,b){if(!Sys.UI.DomElement.containsCssClass(a,b))if(a.className==="")a.className=b;else a.className+=" "+b};Sys.UI.DomElement.containsCssClass=function(b,a){return Array.contains(b.className.split(" "),a)};Sys.UI.DomElement.getBounds=function(a){var b=Sys.UI.DomElement.getLocation(a);return new Sys.UI.Bounds(b.x,b.y,a.offsetWidth||0,a.offsetHeight||0)};var $get=Sys.UI.DomElement.getElementById=function(f,e){if(!e)return document.getElementById(f);if(e.getElementById)return e.getElementById(f);var c=[],d=e.childNodes;for(var b=0;b<d.length;b++){var a=d[b];if(a.nodeType==1)c[c.length]=a}while(c.length){a=c.shift();if(a.id==f)return a;d=a.childNodes;for(b=0;b<d.length;b++){a=d[b];if(a.nodeType==1)c[c.length]=a}}return null};switch(Sys.Browser.agent){case Sys.Browser.InternetExplorer:Sys.UI.DomElement.getLocation=function(a){if(a.self||a.nodeType===9)return new Sys.UI.Point(0,0);var b=a.getBoundingClientRect();if(!b)return new Sys.UI.Point(0,0);var d=a.ownerDocument.documentElement,e=b.left-2+d.scrollLeft,f=b.top-2+d.scrollTop;try{var c=a.ownerDocument.parentWindow.frameElement||null;if(c){var g=c.frameBorder==="0"||c.frameBorder==="no"?2:0;e+=g;f+=g}}catch(h){}return new Sys.UI.Point(e,f)};break;case Sys.Browser.Safari:Sys.UI.DomElement.getLocation=function(c){if(c.window&&c.window===c||c.nodeType===9)return new Sys.UI.Point(0,0);var f=0,g=0,j=null,e=null,b;for(var a=c;a;j=a,(e=b,a=a.offsetParent)){b=Sys.UI.DomElement._getCurrentStyle(a);var d=a.tagName?a.tagName.toUpperCase():null;if((a.offsetLeft||a.offsetTop)&&(d!=="BODY"||(!e||e.position!=="absolute"))){f+=a.offsetLeft;g+=a.offsetTop}}b=Sys.UI.DomElement._getCurrentStyle(c);var h=b?b.position:null;if(!h||h!=="absolute")for(var a=c.parentNode;a;a=a.parentNode){d=a.tagName?a.tagName.toUpperCase():null;if(d!=="BODY"&&d!=="HTML"&&(a.scrollLeft||a.scrollTop)){f-=a.scrollLeft||0;g-=a.scrollTop||0}b=Sys.UI.DomElement._getCurrentStyle(a);var i=b?b.position:null;if(i&&i==="absolute")break}return new Sys.UI.Point(f,g)};break;case Sys.Browser.Opera:Sys.UI.DomElement.getLocation=function(b){if(b.window&&b.window===b||b.nodeType===9)return new Sys.UI.Point(0,0);var d=0,e=0,i=null;for(var a=b;a;i=a,a=a.offsetParent){var f=a.tagName;d+=a.offsetLeft||0;e+=a.offsetTop||0}var g=b.style.position,c=g&&g!=="static";for(var a=b.parentNode;a;a=a.parentNode){f=a.tagName?a.tagName.toUpperCase():null;if(f!=="BODY"&&f!=="HTML"&&(a.scrollLeft||a.scrollTop)&&(c&&(a.style.overflow==="scroll"||a.style.overflow==="auto"))){d-=a.scrollLeft||0;e-=a.scrollTop||0}var h=a&&a.style?a.style.position:null;c=c||h&&h!=="static"}return new Sys.UI.Point(d,e)};break;default:Sys.UI.DomElement.getLocation=function(d){if(d.window&&d.window===d||d.nodeType===9)return new Sys.UI.Point(0,0);var e=0,f=0,i=null,g=null,b=null;for(var a=d;a;i=a,(g=b,a=a.offsetParent)){var c=a.tagName?a.tagName.toUpperCase():null;b=Sys.UI.DomElement._getCurrentStyle(a);if((a.offsetLeft||a.offsetTop)&&!(c==="BODY"&&(!g||g.position!=="absolute"))){e+=a.offsetLeft;f+=a.offsetTop}if(i!==null&&b){if(c!=="TABLE"&&c!=="TD"&&c!=="HTML"){e+=parseInt(b.borderLeftWidth)||0;f+=parseInt(b.borderTopWidth)||0}if(c==="TABLE"&&(b.position==="relative"||b.position==="absolute")){e+=parseInt(b.marginLeft)||0;f+=parseInt(b.marginTop)||0}}}b=Sys.UI.DomElement._getCurrentStyle(d);var h=b?b.position:null;if(!h||h!=="absolute")for(var a=d.parentNode;a;a=a.parentNode){c=a.tagName?a.tagName.toUpperCase():null;if(c!=="BODY"&&c!=="HTML"&&(a.scrollLeft||a.scrollTop)){e-=a.scrollLeft||0;f-=a.scrollTop||0;b=Sys.UI.DomElement._getCurrentStyle(a);if(b){e+=parseInt(b.borderLeftWidth)||0;f+=parseInt(b.borderTopWidth)||0}}}return new Sys.UI.Point(e,f)}}Sys.UI.DomElement.removeCssClass=function(d,c){var a=" "+d.className+" ",b=a.indexOf(" "+c+" ");if(b>=0)d.className=(a.substr(0,b)+" "+a.substring(b+c.length+1,a.length)).trim()};Sys.UI.DomElement.setLocation=function(b,c,d){var a=b.style;a.position="absolute";a.left=c+"px";a.top=d+"px"};Sys.UI.DomElement.toggleCssClass=function(b,a){if(Sys.UI.DomElement.containsCssClass(b,a))Sys.UI.DomElement.removeCssClass(b,a);else Sys.UI.DomElement.addCssClass(b,a)};Sys.UI.DomElement.getVisibilityMode=function(a){return a._visibilityMode===Sys.UI.VisibilityMode.hide?Sys.UI.VisibilityMode.hide:Sys.UI.VisibilityMode.collapse};Sys.UI.DomElement.setVisibilityMode=function(a,b){Sys.UI.DomElement._ensureOldDisplayMode(a);if(a._visibilityMode!==b){a._visibilityMode=b;if(Sys.UI.DomElement.getVisible(a)===false)if(a._visibilityMode===Sys.UI.VisibilityMode.hide)a.style.display=a._oldDisplayMode;else a.style.display="none";a._visibilityMode=b}};Sys.UI.DomElement.getVisible=function(b){var a=b.currentStyle||Sys.UI.DomElement._getCurrentStyle(b);if(!a)return true;return a.visibility!=="hidden"&&a.display!=="none"};Sys.UI.DomElement.setVisible=function(a,b){if(b!==Sys.UI.DomElement.getVisible(a)){Sys.UI.DomElement._ensureOldDisplayMode(a);a.style.visibility=b?"visible":"hidden";if(b||a._visibilityMode===Sys.UI.VisibilityMode.hide)a.style.display=a._oldDisplayMode;else a.style.display="none"}};Sys.UI.DomElement._ensureOldDisplayMode=function(a){if(!a._oldDisplayMode){var b=a.currentStyle||Sys.UI.DomElement._getCurrentStyle(a);a._oldDisplayMode=b?b.display:null;if(!a._oldDisplayMode||a._oldDisplayMode==="none")switch(a.tagName.toUpperCase()){case "DIV":case "P":case "ADDRESS":case "BLOCKQUOTE":case "BODY":case "COL":case "COLGROUP":case "DD":case "DL":case "DT":case "FIELDSET":case "FORM":case "H1":case "H2":case "H3":case "H4":case "H5":case "H6":case "HR":case "IFRAME":case "LEGEND":case "OL":case "PRE":case "TABLE":case "TD":case "TH":case "TR":case "UL":a._oldDisplayMode="block";break;case "LI":a._oldDisplayMode="list-item";break;default:a._oldDisplayMode="inline"}}};Sys.UI.DomElement._getWindow=function(a){var b=a.ownerDocument||a.document||a;return b.defaultView||b.parentWindow};Sys.UI.DomElement._getCurrentStyle=function(a){if(a.nodeType===3)return null;var c=Sys.UI.DomElement._getWindow(a);if(a.documentElement)a=a.documentElement;var b=c&&a!==c&&c.getComputedStyle?c.getComputedStyle(a,null):a.currentStyle||a.style;if(!b&&Sys.Browser.agent===Sys.Browser.Safari&&a.style){var g=a.style.display,f=a.style.position;a.style.position="absolute";a.style.display="block";var e=c.getComputedStyle(a,null);a.style.display=g;a.style.position=f;b={};for(var d in e)b[d]=e[d];b.display="none"}return b};Sys.IContainer=function(){};Sys.IContainer.prototype={};Sys.IContainer.registerInterface("Sys.IContainer");Sys._ScriptLoader=function(){this._scriptsToLoad=null;this._sessions=[];this._scriptLoadedDelegate=Function.createDelegate(this,this._scriptLoadedHandler)};Sys._ScriptLoader.prototype={dispose:function(){this._stopSession();this._loading=false;if(this._events)delete this._events;this._sessions=null;this._currentSession=null;this._scriptLoadedDelegate=null},loadScripts:function(d,b,c,a){var e={allScriptsLoadedCallback:b,scriptLoadFailedCallback:c,scriptLoadTimeoutCallback:a,scriptsToLoad:this._scriptsToLoad,scriptTimeout:d};this._scriptsToLoad=null;this._sessions[this._sessions.length]=e;if(!this._loading)this._nextSession()},notifyScriptLoaded:function(){if(!this._loading)return;this._currentTask._notified++;if(Sys.Browser.agent===Sys.Browser.Safari)if(this._currentTask._notified===1)window.setTimeout(Function.createDelegate(this,function(){this._scriptLoadedHandler(this._currentTask.get_scriptElement(),true)}),0)},queueCustomScriptTag:function(a){if(!this._scriptsToLoad)this._scriptsToLoad=[];Array.add(this._scriptsToLoad,a)},queueScriptBlock:function(a){if(!this._scriptsToLoad)this._scriptsToLoad=[];Array.add(this._scriptsToLoad,{text:a})},queueScriptReference:function(a){if(!this._scriptsToLoad)this._scriptsToLoad=[];Array.add(this._scriptsToLoad,{src:a})},_createScriptElement:function(c){var a=document.createElement("script");a.type="text/javascript";for(var b in c)a[b]=c[b];return a},_loadScriptsInternal:function(){var b=this._currentSession;if(b.scriptsToLoad&&b.scriptsToLoad.length>0){var c=Array.dequeue(b.scriptsToLoad),a=this._createScriptElement(c);if(a.text&&Sys.Browser.agent===Sys.Browser.Safari){a.innerHTML=a.text;delete a.text}if(typeof c.src==="string"){this._currentTask=new Sys._ScriptLoaderTask(a,this._scriptLoadedDelegate);this._currentTask.execute()}else{document.getElementsByTagName("head")[0].appendChild(a);Sys._ScriptLoader._clearScript(a);this._loadScriptsInternal()}}else{this._stopSession();var d=b.allScriptsLoadedCallback;if(d)d(this);this._nextSession()}},_nextSession:function(){if(this._sessions.length===0){this._loading=false;this._currentSession=null;return}this._loading=true;var a=Array.dequeue(this._sessions);this._currentSession=a;if(a.scriptTimeout>0)this._timeoutCookie=window.setTimeout(Function.createDelegate(this,this._scriptLoadTimeoutHandler),a.scriptTimeout*1000);this._loadScriptsInternal()},_raiseError:function(a){var c=this._currentSession.scriptLoadFailedCallback,b=this._currentTask.get_scriptElement();this._stopSession();if(c){c(this,b,a);this._nextSession()}else{this._loading=false;throw Sys._ScriptLoader._errorScriptLoadFailed(b.src,a)}},_scriptLoadedHandler:function(a,b){if(b&&this._currentTask._notified)if(this._currentTask._notified>1)this._raiseError(true);else{Array.add(Sys._ScriptLoader._getLoadedScripts(),a.src);this._currentTask.dispose();this._currentTask=null;this._loadScriptsInternal()}else this._raiseError(false)},_scriptLoadTimeoutHandler:function(){var a=this._currentSession.scriptLoadTimeoutCallback;this._stopSession();if(a)a(this);this._nextSession()},_stopSession:function(){if(this._timeoutCookie){window.clearTimeout(this._timeoutCookie);this._timeoutCookie=null}if(this._currentTask){this._currentTask.dispose();this._currentTask=null}}};Sys._ScriptLoader.registerClass("Sys._ScriptLoader",null,Sys.IDisposable);Sys._ScriptLoader.getInstance=function(){var a=Sys._ScriptLoader._activeInstance;if(!a)a=Sys._ScriptLoader._activeInstance=new Sys._ScriptLoader;return a};Sys._ScriptLoader.isScriptLoaded=function(b){var a=document.createElement("script");a.src=b;return Array.contains(Sys._ScriptLoader._getLoadedScripts(),a.src)};Sys._ScriptLoader.readLoadedScripts=function(){if(!Sys._ScriptLoader._referencedScripts){var b=Sys._ScriptLoader._referencedScripts=[],c=document.getElementsByTagName("script");for(i=c.length-1;i>=0;i--){var d=c[i],a=d.src;if(a.length)if(!Array.contains(b,a))Array.add(b,a)}}};Sys._ScriptLoader._clearScript=function(a){if(!Sys.Debug.isDebug)a.parentNode.removeChild(a)};Sys._ScriptLoader._errorScriptLoadFailed=function(b,d){var a;if(d)a=Sys.Res.scriptLoadMultipleCallbacks;else a=Sys.Res.scriptLoadFailed;var e="Sys.ScriptLoadFailedException: "+String.format(a,b),c=Error.create(e,{name:"Sys.ScriptLoadFailedException","scriptUrl":b});c.popStackFrame();return c};Sys._ScriptLoader._getLoadedScripts=function(){if(!Sys._ScriptLoader._referencedScripts){Sys._ScriptLoader._referencedScripts=[];Sys._ScriptLoader.readLoadedScripts()}return Sys._ScriptLoader._referencedScripts};Sys._ScriptLoaderTask=function(b,a){this._scriptElement=b;this._completedCallback=a;this._notified=0};Sys._ScriptLoaderTask.prototype={get_scriptElement:function(){return this._scriptElement},dispose:function(){if(this._disposed)return;this._disposed=true;this._removeScriptElementHandlers();Sys._ScriptLoader._clearScript(this._scriptElement);this._scriptElement=null},execute:function(){this._addScriptElementHandlers();document.getElementsByTagName("head")[0].appendChild(this._scriptElement)},_addScriptElementHandlers:function(){this._scriptLoadDelegate=Function.createDelegate(this,this._scriptLoadHandler);if(Sys.Browser.agent!==Sys.Browser.InternetExplorer){this._scriptElement.readyState="loaded";$addHandler(this._scriptElement,"load",this._scriptLoadDelegate)}else $addHandler(this._scriptElement,"readystatechange",this._scriptLoadDelegate);if(this._scriptElement.addEventListener){this._scriptErrorDelegate=Function.createDelegate(this,this._scriptErrorHandler);this._scriptElement.addEventListener("error",this._scriptErrorDelegate,false)}},_removeScriptElementHandlers:function(){if(this._scriptLoadDelegate){var a=this.get_scriptElement();if(Sys.Browser.agent!==Sys.Browser.InternetExplorer)$removeHandler(a,"load",this._scriptLoadDelegate);else $removeHandler(a,"readystatechange",this._scriptLoadDelegate);if(this._scriptErrorDelegate){this._scriptElement.removeEventListener("error",this._scriptErrorDelegate,false);this._scriptErrorDelegate=null}this._scriptLoadDelegate=null}},_scriptErrorHandler:function(){if(this._disposed)return;this._completedCallback(this.get_scriptElement(),false)},_scriptLoadHandler:function(){if(this._disposed)return;var a=this.get_scriptElement();if(a.readyState!=="loaded"&&a.readyState!=="complete")return;var b=this;window.setTimeout(function(){b._completedCallback(a,true)},0)}};Sys._ScriptLoaderTask.registerClass("Sys._ScriptLoaderTask",null,Sys.IDisposable);Sys.ApplicationLoadEventArgs=function(b,a){Sys.ApplicationLoadEventArgs.initializeBase(this);this._components=b;this._isPartialLoad=a};Sys.ApplicationLoadEventArgs.prototype={get_components:function(){return this._components},get_isPartialLoad:function(){return this._isPartialLoad}};Sys.ApplicationLoadEventArgs.registerClass("Sys.ApplicationLoadEventArgs",Sys.EventArgs);Sys.HistoryEventArgs=function(a){Sys.HistoryEventArgs.initializeBase(this);this._state=a};Sys.HistoryEventArgs.prototype={get_state:function(){return this._state}};Sys.HistoryEventArgs.registerClass("Sys.HistoryEventArgs",Sys.EventArgs);Sys._Application=function(){Sys._Application.initializeBase(this);this._disposableObjects=[];this._components={};this._createdComponents=[];this._secondPassComponents=[];this._appLoadHandler=null;this._beginRequestHandler=null;this._clientId=null;this._currentEntry="";this._endRequestHandler=null;this._history=null;this._enableHistory=false;this._historyFrame=null;this._historyInitialized=false;this._historyInitialLength=0;this._historyLength=0;this._historyPointIsNew=false;this._ignoreTimer=false;this._initialState=null;this._state={};this._timerCookie=0;this._timerHandler=null;this._uniqueId=null;this._unloadHandlerDelegate=Function.createDelegate(this,this._unloadHandler);this._loadHandlerDelegate=Function.createDelegate(this,this._loadHandler);Sys.UI.DomEvent.addHandler(window,"unload",this._unloadHandlerDelegate);Sys.UI.DomEvent.addHandler(window,"load",this._loadHandlerDelegate)};Sys._Application.prototype={_creatingComponents:false,_disposing:false,get_isCreatingComponents:function(){return this._creatingComponents},get_stateString:function(){var a=window.location.hash;if(this._isSafari2()){var b=this._getHistory();if(b)a=b[window.history.length-this._historyInitialLength]}if(a.length>0&&a.charAt(0)==="#")a=a.substring(1);if(Sys.Browser.agent===Sys.Browser.Firefox)a=this._serializeState(this._deserializeState(a,true));return a},get_enableHistory:function(){return this._enableHistory},set_enableHistory:function(a){this._enableHistory=a},add_init:function(a){if(this._initialized)a(this,Sys.EventArgs.Empty);else this.get_events().addHandler("init",a)},remove_init:function(a){this.get_events().removeHandler("init",a)},add_load:function(a){this.get_events().addHandler("load",a)},remove_load:function(a){this.get_events().removeHandler("load",a)},add_navigate:function(a){this.get_events().addHandler("navigate",a)},remove_navigate:function(a){this.get_events().removeHandler("navigate",a)},add_unload:function(a){this.get_events().addHandler("unload",a)},remove_unload:function(a){this.get_events().removeHandler("unload",a)},addComponent:function(a){this._components[a.get_id()]=a},addHistoryPoint:function(c,f){this._ensureHistory();var b=this._state;for(var a in c){var d=c[a];if(d===null){if(typeof b[a]!=="undefined")delete b[a]}else b[a]=d}var e=this._serializeState(b);this._historyPointIsNew=true;this._setState(e,f);this._raiseNavigate()},beginCreateComponents:function(){this._creatingComponents=true},dispose:function(){if(!this._disposing){this._disposing=true;if(this._timerCookie){window.clearTimeout(this._timerCookie);delete this._timerCookie}if(this._endRequestHandler){Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this._endRequestHandler);delete this._endRequestHandler}if(this._beginRequestHandler){Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(this._beginRequestHandler);delete this._beginRequestHandler}if(window.pageUnload)window.pageUnload(this,Sys.EventArgs.Empty);var c=this.get_events().getHandler("unload");if(c)c(this,Sys.EventArgs.Empty);var b=Array.clone(this._disposableObjects);for(var a=0,e=b.length;a<e;a++)b[a].dispose();Array.clear(this._disposableObjects);Sys.UI.DomEvent.removeHandler(window,"unload",this._unloadHandlerDelegate);if(this._loadHandlerDelegate){Sys.UI.DomEvent.removeHandler(window,"load",this._loadHandlerDelegate);this._loadHandlerDelegate=null}var d=Sys._ScriptLoader.getInstance();if(d)d.dispose();Sys._Application.callBaseMethod(this,"dispose")}},endCreateComponents:function(){var b=this._secondPassComponents;for(var a=0,d=b.length;a<d;a++){var c=b[a].component;Sys$Component$_setReferences(c,b[a].references);c.endUpdate()}this._secondPassComponents=[];this._creatingComponents=false},findComponent:function(b,a){return a?Sys.IContainer.isInstanceOfType(a)?a.findComponent(b):a[b]||null:Sys.Application._components[b]||null},getComponents:function(){var a=[],b=this._components;for(var c in b)a[a.length]=b[c];return a},initialize:function(){if(!this._initialized&&!this._initializing){this._initializing=true;window.setTimeout(Function.createDelegate(this,this._doInitialize),0)}},notifyScriptLoaded:function(){var a=Sys._ScriptLoader.getInstance();if(a)a.notifyScriptLoaded()},registerDisposableObject:function(a){if(!this._disposing)this._disposableObjects[this._disposableObjects.length]=a},raiseLoad:function(){var b=this.get_events().getHandler("load"),a=new Sys.ApplicationLoadEventArgs(Array.clone(this._createdComponents),!this._initializing);if(b)b(this,a);if(window.pageLoad)window.pageLoad(this,a);this._createdComponents=[]},removeComponent:function(b){var a=b.get_id();if(a)delete this._components[a]},setServerId:function(a,b){this._clientId=a;this._uniqueId=b},setServerState:function(a){this._ensureHistory();this._state.__s=a;this._updateHiddenField(a)},unregisterDisposableObject:function(a){if(!this._disposing)Array.remove(this._disposableObjects,a)},_addComponentToSecondPass:function(b,a){this._secondPassComponents[this._secondPassComponents.length]={component:b,references:a}},_deserializeState:function(a,i){var e={};a=a||"";var b=a.indexOf("&&");if(b!==-1&&b+2<a.length){e.__s=a.substr(b+2);a=a.substr(0,b)}var g=a.split("&");for(var f=0,k=g.length;f<k;f++){var d=g[f],c=d.indexOf("=");if(c!==-1&&c+1<d.length){var j=d.substr(0,c),h=d.substr(c+1);e[j]=i?h:decodeURIComponent(h)}}return e},_doInitialize:function(){Sys._Application.callBaseMethod(this,"initialize");var b=this.get_events().getHandler("init");if(b){this.beginCreateComponents();b(this,Sys.EventArgs.Empty);this.endCreateComponents()}if(Sys.WebForms){this._beginRequestHandler=Function.createDelegate(this,this._onPageRequestManagerBeginRequest);Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(this._beginRequestHandler);this._endRequestHandler=Function.createDelegate(this,this._onPageRequestManagerEndRequest);Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this._endRequestHandler)}var a=this.get_stateString();if(a!==this._currentEntry)this._navigate(a);this.raiseLoad();this._initializing=false},_enableHistoryInScriptManager:function(){this._enableHistory=true},_ensureHistory:function(){if(!this._historyInitialized&&this._enableHistory){if(Sys.Browser.agent===Sys.Browser.InternetExplorer&&Sys.Browser.documentMode<8){this._historyFrame=document.getElementById("__historyFrame");this._ignoreIFrame=true}if(this._isSafari2()){var a=document.getElementById("__history");this._setHistory([window.location.hash]);this._historyInitialLength=window.history.length}this._timerHandler=Function.createDelegate(this,this._onIdle);this._timerCookie=window.setTimeout(this._timerHandler,100);try{this._initialState=this._deserializeState(this.get_stateString())}catch(b){}this._historyInitialized=true}},_getHistory:function(){var a=document.getElementById("__history");if(!a)return "";var b=a.value;return b?Sys.Serialization.JavaScriptSerializer.deserialize(b,true):""},_isSafari2:function(){return Sys.Browser.agent===Sys.Browser.Safari&&Sys.Browser.version<=419.3},_loadHandler:function(){if(this._loadHandlerDelegate){Sys.UI.DomEvent.removeHandler(window,"load",this._loadHandlerDelegate);this._loadHandlerDelegate=null}this.initialize()},_navigate:function(c){this._ensureHistory();var b=this._deserializeState(c);if(this._uniqueId){var d=this._state.__s||"",a=b.__s||"";if(a!==d){this._updateHiddenField(a);__doPostBack(this._uniqueId,a);this._state=b;return}}this._setState(c);this._state=b;this._raiseNavigate()},_onIdle:function(){delete this._timerCookie;var a=this.get_stateString();if(a!==this._currentEntry){if(!this._ignoreTimer){this._historyPointIsNew=false;this._navigate(a);this._historyLength=window.history.length}}else this._ignoreTimer=false;this._timerCookie=window.setTimeout(this._timerHandler,100)},_onIFrameLoad:function(a){this._ensureHistory();if(!this._ignoreIFrame){this._historyPointIsNew=false;this._navigate(a)}this._ignoreIFrame=false},_onPageRequestManagerBeginRequest:function(){this._ignoreTimer=true},_onPageRequestManagerEndRequest:function(e,d){var b=d.get_dataItems()[this._clientId],a=document.getElementById("__EVENTTARGET");if(a&&a.value===this._uniqueId)a.value="";if(typeof b!=="undefined"){this.setServerState(b);this._historyPointIsNew=true}else this._ignoreTimer=false;var c=this._serializeState(this._state);if(c!==this._currentEntry){this._ignoreTimer=true;this._setState(c);this._raiseNavigate()}},_raiseNavigate:function(){var c=this.get_events().getHandler("navigate"),b={};for(var a in this._state)if(a!=="__s")b[a]=this._state[a];var d=new Sys.HistoryEventArgs(b);if(c)c(this,d)},_serializeState:function(d){var b=[];for(var a in d){var e=d[a];if(a==="__s")var c=e;else b[b.length]=a+"="+encodeURIComponent(e)}return b.join("&")+(c?"&&"+c:"")},_setHistory:function(b){var a=document.getElementById("__history");if(a)a.value=Sys.Serialization.JavaScriptSerializer.serialize(b)},_setState:function(a,c){a=a||"";if(a!==this._currentEntry){if(window.theForm){var e=window.theForm.action,f=e.indexOf("#");window.theForm.action=(f!==-1?e.substring(0,f):e)+"#"+a}if(this._historyFrame&&this._historyPointIsNew){this._ignoreIFrame=true;this._historyPointIsNew=false;var d=this._historyFrame.contentWindow.document;d.open("javascript:'<html></html>'");d.write("<html><head><title>"+(c||document.title)+"</title><scri"+'pt type="text/javascript">parent.Sys.Application._onIFrameLoad(\''+a+"');</scri"+"pt></head><body></body></html>");d.close()}this._ignoreTimer=false;var h=this.get_stateString();this._currentEntry=a;if(a!==h){if(this._isSafari2()){var g=this._getHistory();g[window.history.length-this._historyInitialLength+1]=a;this._setHistory(g);this._historyLength=window.history.length+1;var b=document.createElement("form");b.method="get";b.action="#"+a;document.appendChild(b);b.submit();document.removeChild(b)}else window.location.hash=a;if(typeof c!=="undefined"&&c!==null)document.title=c}}},_unloadHandler:function(){this.dispose()},_updateHiddenField:function(b){if(this._clientId){var a=document.getElementById(this._clientId);if(a)a.value=b}}};Sys._Application.registerClass("Sys._Application",Sys.Component,Sys.IContainer);Sys.Application=new Sys._Application;var $find=Sys.Application.findComponent;Type.registerNamespace("Sys.Net");Sys.Net.WebRequestExecutor=function(){this._webRequest=null;this._resultObject=null};Sys.Net.WebRequestExecutor.prototype={get_webRequest:function(){return this._webRequest},_set_webRequest:function(a){this._webRequest=a},get_started:function(){throw Error.notImplemented()},get_responseAvailable:function(){throw Error.notImplemented()},get_timedOut:function(){throw Error.notImplemented()},get_aborted:function(){throw Error.notImplemented()},get_responseData:function(){throw Error.notImplemented()},get_statusCode:function(){throw Error.notImplemented()},get_statusText:function(){throw Error.notImplemented()},get_xml:function(){throw Error.notImplemented()},get_object:function(){if(!this._resultObject)this._resultObject=Sys.Serialization.JavaScriptSerializer.deserialize(this.get_responseData());return this._resultObject},executeRequest:function(){throw Error.notImplemented()},abort:function(){throw Error.notImplemented()},getResponseHeader:function(){throw Error.notImplemented()},getAllResponseHeaders:function(){throw Error.notImplemented()}};Sys.Net.WebRequestExecutor.registerClass("Sys.Net.WebRequestExecutor");Sys.Net.XMLDOM=function(d){if(!window.DOMParser){var c=["Msxml2.DOMDocument.3.0","Msxml2.DOMDocument"];for(var b=0,f=c.length;b<f;b++)try{var a=new ActiveXObject(c[b]);a.async=false;a.loadXML(d);a.setProperty("SelectionLanguage","XPath");return a}catch(g){}}else try{var e=new window.DOMParser;return e.parseFromString(d,"text/xml")}catch(g){}return null};Sys.Net.XMLHttpExecutor=function(){Sys.Net.XMLHttpExecutor.initializeBase(this);var a=this;this._xmlHttpRequest=null;this._webRequest=null;this._responseAvailable=false;this._timedOut=false;this._timer=null;this._aborted=false;this._started=false;this._onReadyStateChange=function(){if(a._xmlHttpRequest.readyState===4){try{if(typeof a._xmlHttpRequest.status==="undefined")return}catch(b){return}a._clearTimer();a._responseAvailable=true;try{a._webRequest.completed(Sys.EventArgs.Empty)}finally{if(a._xmlHttpRequest!=null){a._xmlHttpRequest.onreadystatechange=Function.emptyMethod;a._xmlHttpRequest=null}}}};this._clearTimer=function(){if(a._timer!=null){window.clearTimeout(a._timer);a._timer=null}};this._onTimeout=function(){if(!a._responseAvailable){a._clearTimer();a._timedOut=true;a._xmlHttpRequest.onreadystatechange=Function.emptyMethod;a._xmlHttpRequest.abort();a._webRequest.completed(Sys.EventArgs.Empty);a._xmlHttpRequest=null}}};Sys.Net.XMLHttpExecutor.prototype={get_timedOut:function(){return this._timedOut},get_started:function(){return this._started},get_responseAvailable:function(){return this._responseAvailable},get_aborted:function(){return this._aborted},executeRequest:function(){this._webRequest=this.get_webRequest();var c=this._webRequest.get_body(),a=this._webRequest.get_headers();this._xmlHttpRequest=new XMLHttpRequest;this._xmlHttpRequest.onreadystatechange=this._onReadyStateChange;var e=this._webRequest.get_httpVerb();this._xmlHttpRequest.open(e,this._webRequest.getResolvedUrl(),true);if(a)for(var b in a){var f=a[b];if(typeof f!=="function")this._xmlHttpRequest.setRequestHeader(b,f)}if(e.toLowerCase()==="post"){if(a===null||!a["Content-Type"])this._xmlHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8");if(!c)c=""}var d=this._webRequest.get_timeout();if(d>0)this._timer=window.setTimeout(Function.createDelegate(this,this._onTimeout),d);this._xmlHttpRequest.send(c);this._started=true},getResponseHeader:function(b){var a;try{a=this._xmlHttpRequest.getResponseHeader(b)}catch(c){}if(!a)a="";return a},getAllResponseHeaders:function(){return this._xmlHttpRequest.getAllResponseHeaders()},get_responseData:function(){return this._xmlHttpRequest.responseText},get_statusCode:function(){var a=0;try{a=this._xmlHttpRequest.status}catch(b){}return a},get_statusText:function(){return this._xmlHttpRequest.statusText},get_xml:function(){var a=this._xmlHttpRequest.responseXML;if(!a||!a.documentElement){a=Sys.Net.XMLDOM(this._xmlHttpRequest.responseText);if(!a||!a.documentElement)return null}else if(navigator.userAgent.indexOf("MSIE")!==-1)a.setProperty("SelectionLanguage","XPath");if(a.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml"&&a.documentElement.tagName==="parsererror")return null;if(a.documentElement.firstChild&&a.documentElement.firstChild.tagName==="parsererror")return null;return a},abort:function(){if(this._aborted||this._responseAvailable||this._timedOut)return;this._aborted=true;this._clearTimer();if(this._xmlHttpRequest&&!this._responseAvailable){this._xmlHttpRequest.onreadystatechange=Function.emptyMethod;this._xmlHttpRequest.abort();this._xmlHttpRequest=null;this._webRequest.completed(Sys.EventArgs.Empty)}}};Sys.Net.XMLHttpExecutor.registerClass("Sys.Net.XMLHttpExecutor",Sys.Net.WebRequestExecutor);Sys.Net._WebRequestManager=function(){this._defaultTimeout=0;this._defaultExecutorType="Sys.Net.XMLHttpExecutor"};Sys.Net._WebRequestManager.prototype={add_invokingRequest:function(a){this._get_eventHandlerList().addHandler("invokingRequest",a)},remove_invokingRequest:function(a){this._get_eventHandlerList().removeHandler("invokingRequest",a)},add_completedRequest:function(a){this._get_eventHandlerList().addHandler("completedRequest",a)},remove_completedRequest:function(a){this._get_eventHandlerList().removeHandler("completedRequest",a)},_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_defaultTimeout:function(){return this._defaultTimeout},set_defaultTimeout:function(a){this._defaultTimeout=a},get_defaultExecutorType:function(){return this._defaultExecutorType},set_defaultExecutorType:function(a){this._defaultExecutorType=a},executeRequest:function(webRequest){var executor=webRequest.get_executor();if(!executor){var failed=false;try{var executorType=eval(this._defaultExecutorType);executor=new executorType}catch(a){failed=true}webRequest.set_executor(executor)}if(executor.get_aborted())return;var evArgs=new Sys.Net.NetworkRequestEventArgs(webRequest),handler=this._get_eventHandlerList().getHandler("invokingRequest");if(handler)handler(this,evArgs);if(!evArgs.get_cancel())executor.executeRequest()}};Sys.Net._WebRequestManager.registerClass("Sys.Net._WebRequestManager");Sys.Net.WebRequestManager=new Sys.Net._WebRequestManager;Sys.Net.NetworkRequestEventArgs=function(a){Sys.Net.NetworkRequestEventArgs.initializeBase(this);this._webRequest=a};Sys.Net.NetworkRequestEventArgs.prototype={get_webRequest:function(){return this._webRequest}};Sys.Net.NetworkRequestEventArgs.registerClass("Sys.Net.NetworkRequestEventArgs",Sys.CancelEventArgs);Sys.Net.WebRequest=function(){this._url="";this._headers={};this._body=null;this._userContext=null;this._httpVerb=null;this._executor=null;this._invokeCalled=false;this._timeout=0};Sys.Net.WebRequest.prototype={add_completed:function(a){this._get_eventHandlerList().addHandler("completed",a)},remove_completed:function(a){this._get_eventHandlerList().removeHandler("completed",a)},completed:function(b){var a=Sys.Net.WebRequestManager._get_eventHandlerList().getHandler("completedRequest");if(a)a(this._executor,b);a=this._get_eventHandlerList().getHandler("completed");if(a)a(this._executor,b)},_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_url:function(){return this._url},set_url:function(a){this._url=a},get_headers:function(){return this._headers},get_httpVerb:function(){if(this._httpVerb===null){if(this._body===null)return "GET";return "POST"}return this._httpVerb},set_httpVerb:function(a){this._httpVerb=a},get_body:function(){return this._body},set_body:function(a){this._body=a},get_userContext:function(){return this._userContext},set_userContext:function(a){this._userContext=a},get_executor:function(){return this._executor},set_executor:function(a){this._executor=a;this._executor._set_webRequest(this)},get_timeout:function(){if(this._timeout===0)return Sys.Net.WebRequestManager.get_defaultTimeout();return this._timeout},set_timeout:function(a){this._timeout=a},getResolvedUrl:function(){return Sys.Net.WebRequest._resolveUrl(this._url)},invoke:function(){Sys.Net.WebRequestManager.executeRequest(this);this._invokeCalled=true}};Sys.Net.WebRequest._resolveUrl=function(b,a){if(b&&b.indexOf("://")!==-1)return b;if(!a||a.length===0){var d=document.getElementsByTagName("base")[0];if(d&&d.href&&d.href.length>0)a=d.href;else a=document.URL}var c=a.indexOf("?");if(c!==-1)a=a.substr(0,c);c=a.indexOf("#");if(c!==-1)a=a.substr(0,c);a=a.substr(0,a.lastIndexOf("/")+1);if(!b||b.length===0)return a;if(b.charAt(0)==="/"){var e=a.indexOf("://"),g=a.indexOf("/",e+3);return a.substr(0,g)+b}else{var f=a.lastIndexOf("/");return a.substr(0,f+1)+b}};Sys.Net.WebRequest._createQueryString=function(d,b){if(!b)b=encodeURIComponent;var a=new Sys.StringBuilder,f=0;for(var c in d){var e=d[c];if(typeof e==="function")continue;var g=Sys.Serialization.JavaScriptSerializer.serialize(e);if(f!==0)a.append("&");a.append(c);a.append("=");a.append(b(g));f++}return a.toString()};Sys.Net.WebRequest._createUrl=function(a,b){if(!b)return a;var d=Sys.Net.WebRequest._createQueryString(b);if(d.length>0){var c="?";if(a&&a.indexOf("?")!==-1)c="&";return a+c+d}else return a};Sys.Net.WebRequest.registerClass("Sys.Net.WebRequest");Sys.Net.WebServiceProxy=function(){};Sys.Net.WebServiceProxy.prototype={get_timeout:function(){return this._timeout},set_timeout:function(a){if(a<0)throw Error.argumentOutOfRange("value",a,Sys.Res.invalidTimeout);this._timeout=a},get_defaultUserContext:function(){return this._userContext},set_defaultUserContext:function(a){this._userContext=a},get_defaultSucceededCallback:function(){return this._succeeded},set_defaultSucceededCallback:function(a){this._succeeded=a},get_defaultFailedCallback:function(){return this._failed},set_defaultFailedCallback:function(a){this._failed=a},get_path:function(){return this._path},set_path:function(a){this._path=a},_invoke:function(d,e,g,f,c,b,a){if(c===null||typeof c==="undefined")c=this.get_defaultSucceededCallback();if(b===null||typeof b==="undefined")b=this.get_defaultFailedCallback();if(a===null||typeof a==="undefined")a=this.get_defaultUserContext();return Sys.Net.WebServiceProxy.invoke(d,e,g,f,c,b,a,this.get_timeout())}};Sys.Net.WebServiceProxy.registerClass("Sys.Net.WebServiceProxy");Sys.Net.WebServiceProxy.invoke=function(k,a,j,d,i,c,f,h){var b=new Sys.Net.WebRequest;b.get_headers()["Content-Type"]="application/json; charset=utf-8";if(!d)d={};var g=d;if(!j||!g)g={};b.set_url(Sys.Net.WebRequest._createUrl(k+"/"+encodeURIComponent(a),g));var e=null;if(!j){e=Sys.Serialization.JavaScriptSerializer.serialize(d);if(e==="{}")e=""}b.set_body(e);b.add_completed(l);if(h&&h>0)b.set_timeout(h);b.invoke();function l(d){if(d.get_responseAvailable()){var g=d.get_statusCode(),b=null;try{var e=d.getResponseHeader("Content-Type");if(e.startsWith("application/json"))b=d.get_object();else if(e.startsWith("text/xml"))b=d.get_xml();else b=d.get_responseData()}catch(m){}var k=d.getResponseHeader("jsonerror"),h=k==="true";if(h){if(b)b=new Sys.Net.WebServiceError(false,b.Message,b.StackTrace,b.ExceptionType)}else if(e.startsWith("application/json"))b=b.d;if(g<200||g>=300||h){if(c){if(!b||!h)b=new Sys.Net.WebServiceError(false,String.format(Sys.Res.webServiceFailedNoMsg,a),"","");b._statusCode=g;c(b,f,a)}}else if(i)i(b,f,a)}else{var j;if(d.get_timedOut())j=String.format(Sys.Res.webServiceTimedOut,a);else j=String.format(Sys.Res.webServiceFailedNoMsg,a);if(c)c(new Sys.Net.WebServiceError(d.get_timedOut(),j,"",""),f,a)}}return b};Sys.Net.WebServiceProxy._generateTypedConstructor=function(a){return function(b){if(b)for(var c in b)this[c]=b[c];this.__type=a}};Sys.Net.WebServiceError=function(c,d,b,a){this._timedOut=c;this._message=d;this._stackTrace=b;this._exceptionType=a;this._statusCode=-1};Sys.Net.WebServiceError.prototype={get_timedOut:function(){return this._timedOut},get_statusCode:function(){return this._statusCode},get_message:function(){return this._message},get_stackTrace:function(){return this._stackTrace},get_exceptionType:function(){return this._exceptionType}};Sys.Net.WebServiceError.registerClass("Sys.Net.WebServiceError");Type.registerNamespace("Sys.Services");Sys.Services._ProfileService=function(){Sys.Services._ProfileService.initializeBase(this);this.properties={}};Sys.Services._ProfileService.DefaultWebServicePath="";Sys.Services._ProfileService.prototype={_defaultLoadCompletedCallback:null,_defaultSaveCompletedCallback:null,_path:"",_timeout:0,get_defaultLoadCompletedCallback:function(){return this._defaultLoadCompletedCallback},set_defaultLoadCompletedCallback:function(a){this._defaultLoadCompletedCallback=a},get_defaultSaveCompletedCallback:function(){return this._defaultSaveCompletedCallback},set_defaultSaveCompletedCallback:function(a){this._defaultSaveCompletedCallback=a},get_path:function(){return this._path||""},load:function(c,d,e,f){var b,a;if(!c){a="GetAllPropertiesForCurrentUser";b={authenticatedUserOnly:false}}else{a="GetPropertiesForCurrentUser";b={properties:this._clonePropertyNames(c),authenticatedUserOnly:false}}this._invoke(this._get_path(),a,false,b,Function.createDelegate(this,this._onLoadComplete),Function.createDelegate(this,this._onLoadFailed),[d,e,f])},save:function(d,b,c,e){var a=this._flattenProperties(d,this.properties);this._invoke(this._get_path(),"SetPropertiesForCurrentUser",false,{values:a.value,authenticatedUserOnly:false},Function.createDelegate(this,this._onSaveComplete),Function.createDelegate(this,this._onSaveFailed),[b,c,e,a.count])},_clonePropertyNames:function(e){var c=[],d={};for(var b=0;b<e.length;b++){var a=e[b];if(!d[a]){Array.add(c,a);d[a]=true}}return c},_flattenProperties:function(a,i,j){var b={},e,d,g=0;if(a&&a.length===0)return {value:b,count:0};for(var c in i){e=i[c];d=j?j+"."+c:c;if(Sys.Services.ProfileGroup.isInstanceOfType(e)){var k=this._flattenProperties(a,e,d),h=k.value;g+=k.count;for(var f in h){var l=h[f];b[f]=l}}else if(!a||Array.indexOf(a,d)!==-1){b[d]=e;g++}}return {value:b,count:g}},_get_path:function(){var a=this.get_path();if(!a.length)a=Sys.Services._ProfileService.DefaultWebServicePath;if(!a||!a.length)throw Error.invalidOperation(Sys.Res.servicePathNotSet);return a},_onLoadComplete:function(a,e,g){if(typeof a!=="object")throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,g,"Object"));var c=this._unflattenProperties(a);for(var b in c)this.properties[b]=c[b];var d=e[0]||this.get_defaultLoadCompletedCallback()||this.get_defaultSucceededCallback();if(d){var f=e[2]||this.get_defaultUserContext();d(a.length,f,"Sys.Services.ProfileService.load")}},_onLoadFailed:function(d,b){var a=b[1]||this.get_defaultFailedCallback();if(a){var c=b[2]||this.get_defaultUserContext();a(d,c,"Sys.Services.ProfileService.load")}},_onSaveComplete:function(a,b,f){var c=b[3];if(a!==null)if(a instanceof Array)c-=a.length;else if(typeof a==="number")c=a;else throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,f,"Array"));var d=b[0]||this.get_defaultSaveCompletedCallback()||this.get_defaultSucceededCallback();if(d){var e=b[2]||this.get_defaultUserContext();d(c,e,"Sys.Services.ProfileService.save")}},_onSaveFailed:function(d,b){var a=b[1]||this.get_defaultFailedCallback();if(a){var c=b[2]||this.get_defaultUserContext();a(d,c,"Sys.Services.ProfileService.save")}},_unflattenProperties:function(e){var c={},d,f,h=0;for(var a in e){h++;f=e[a];d=a.indexOf(".");if(d!==-1){var g=a.substr(0,d);a=a.substr(d+1);var b=c[g];if(!b||!Sys.Services.ProfileGroup.isInstanceOfType(b)){b=new Sys.Services.ProfileGroup;c[g]=b}b[a]=f}else c[a]=f}e.length=h;return c}};Sys.Services._ProfileService.registerClass("Sys.Services._ProfileService",Sys.Net.WebServiceProxy);Sys.Services.ProfileService=new Sys.Services._ProfileService;Sys.Services.ProfileGroup=function(a){if(a)for(var b in a)this[b]=a[b]};Sys.Services.ProfileGroup.registerClass("Sys.Services.ProfileGroup");Sys.Services._AuthenticationService=function(){Sys.Services._AuthenticationService.initializeBase(this)};Sys.Services._AuthenticationService.DefaultWebServicePath="";Sys.Services._AuthenticationService.prototype={_defaultLoginCompletedCallback:null,_defaultLogoutCompletedCallback:null,_path:"",_timeout:0,_authenticated:false,get_defaultLoginCompletedCallback:function(){return this._defaultLoginCompletedCallback},set_defaultLoginCompletedCallback:function(a){this._defaultLoginCompletedCallback=a},get_defaultLogoutCompletedCallback:function(){return this._defaultLogoutCompletedCallback},set_defaultLogoutCompletedCallback:function(a){this._defaultLogoutCompletedCallback=a},get_isLoggedIn:function(){return this._authenticated},get_path:function(){return this._path||""},login:function(c,b,a,h,f,d,e,g){this._invoke(this._get_path(),"Login",false,{userName:c,password:b,createPersistentCookie:a},Function.createDelegate(this,this._onLoginComplete),Function.createDelegate(this,this._onLoginFailed),[c,b,a,h,f,d,e,g])},logout:function(c,a,b,d){this._invoke(this._get_path(),"Logout",false,{},Function.createDelegate(this,this._onLogoutComplete),Function.createDelegate(this,this._onLogoutFailed),[c,a,b,d])},_get_path:function(){var a=this.get_path();if(!a.length)a=Sys.Services._AuthenticationService.DefaultWebServicePath;if(!a||!a.length)throw Error.invalidOperation(Sys.Res.servicePathNotSet);return a},_onLoginComplete:function(e,c,f){if(typeof e!=="boolean")throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,f,"Boolean"));var b=c[4],d=c[7]||this.get_defaultUserContext(),a=c[5]||this.get_defaultLoginCompletedCallback()||this.get_defaultSucceededCallback();if(e){this._authenticated=true;if(a)a(true,d,"Sys.Services.AuthenticationService.login");if(typeof b!=="undefined"&&b!==null)window.location.href=b}else if(a)a(false,d,"Sys.Services.AuthenticationService.login")},_onLoginFailed:function(d,b){var a=b[6]||this.get_defaultFailedCallback();if(a){var c=b[7]||this.get_defaultUserContext();a(d,c,"Sys.Services.AuthenticationService.login")}},_onLogoutComplete:function(f,a,e){if(f!==null)throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,e,"null"));var b=a[0],d=a[3]||this.get_defaultUserContext(),c=a[1]||this.get_defaultLogoutCompletedCallback()||this.get_defaultSucceededCallback();this._authenticated=false;if(c)c(null,d,"Sys.Services.AuthenticationService.logout");if(!b)window.location.reload();else window.location.href=b},_onLogoutFailed:function(c,b){var a=b[2]||this.get_defaultFailedCallback();if(a)a(c,b[3],"Sys.Services.AuthenticationService.logout")},_setAuthenticated:function(a){this._authenticated=a}};Sys.Services._AuthenticationService.registerClass("Sys.Services._AuthenticationService",Sys.Net.WebServiceProxy);Sys.Services.AuthenticationService=new Sys.Services._AuthenticationService;Sys.Services._RoleService=function(){Sys.Services._RoleService.initializeBase(this);this._roles=[]};Sys.Services._RoleService.DefaultWebServicePath="";Sys.Services._RoleService.prototype={_defaultLoadCompletedCallback:null,_rolesIndex:null,_timeout:0,_path:"",get_defaultLoadCompletedCallback:function(){return this._defaultLoadCompletedCallback},set_defaultLoadCompletedCallback:function(a){this._defaultLoadCompletedCallback=a},get_path:function(){return this._path||""},get_roles:function(){return Array.clone(this._roles)},isUserInRole:function(a){var b=this._get_rolesIndex()[a.trim().toLowerCase()];return !!b},load:function(a,b,c){Sys.Net.WebServiceProxy.invoke(this._get_path(),"GetRolesForCurrentUser",false,{},Function.createDelegate(this,this._onLoadComplete),Function.createDelegate(this,this._onLoadFailed),[a,b,c],this.get_timeout())},_get_path:function(){var a=this.get_path();if(!a||!a.length)a=Sys.Services._RoleService.DefaultWebServicePath;if(!a||!a.length)throw Error.invalidOperation(Sys.Res.servicePathNotSet);return a},_get_rolesIndex:function(){if(!this._rolesIndex){var b={};for(var a=0;a<this._roles.length;a++)b[this._roles[a].toLowerCase()]=true;this._rolesIndex=b}return this._rolesIndex},_onLoadComplete:function(a,c,f){if(a&&!(a instanceof Array))throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,f,"Array"));this._roles=a;this._rolesIndex=null;var b=c[0]||this.get_defaultLoadCompletedCallback()||this.get_defaultSucceededCallback();if(b){var e=c[2]||this.get_defaultUserContext(),d=Array.clone(a);b(d,e,"Sys.Services.RoleService.load")}},_onLoadFailed:function(d,b){var a=b[1]||this.get_defaultFailedCallback();if(a){var c=b[2]||this.get_defaultUserContext();a(d,c,"Sys.Services.RoleService.load")}}};Sys.Services._RoleService.registerClass("Sys.Services._RoleService",Sys.Net.WebServiceProxy);Sys.Services.RoleService=new Sys.Services._RoleService;Type.registerNamespace("Sys.Serialization");Sys.Serialization.JavaScriptSerializer=function(){};Sys.Serialization.JavaScriptSerializer.registerClass("Sys.Serialization.JavaScriptSerializer");Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs=[];Sys.Serialization.JavaScriptSerializer._charsToEscape=[];Sys.Serialization.JavaScriptSerializer._dateRegEx=new RegExp('(^|[^\\\\])\\"\\\\/Date\\((-?[0-9]+)(?:[a-zA-Z]|(?:\\+|-)[0-9]{4})?\\)\\\\/\\"',"g");Sys.Serialization.JavaScriptSerializer._escapeChars={};Sys.Serialization.JavaScriptSerializer._escapeRegEx=new RegExp('["\\\\\\x00-\\x1F]',"i");Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal=new RegExp('["\\\\\\x00-\\x1F]',"g");Sys.Serialization.JavaScriptSerializer._jsonRegEx=new RegExp("[^,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t]","g");Sys.Serialization.JavaScriptSerializer._jsonStringRegEx=new RegExp('"(\\\\.|[^"\\\\])*"',"g");Sys.Serialization.JavaScriptSerializer._serverTypeFieldName="__type";Sys.Serialization.JavaScriptSerializer._init=function(){var c=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000b","\\f","\\r","\\u000e","\\u000f","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001a","\\u001b","\\u001c","\\u001d","\\u001e","\\u001f"];Sys.Serialization.JavaScriptSerializer._charsToEscape[0]="\\";Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs["\\"]=new RegExp("\\\\","g");Sys.Serialization.JavaScriptSerializer._escapeChars["\\"]="\\\\";Sys.Serialization.JavaScriptSerializer._charsToEscape[1]='"';Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs['"']=new RegExp('"',"g");Sys.Serialization.JavaScriptSerializer._escapeChars['"']='\\"';for(var a=0;a<32;a++){var b=String.fromCharCode(a);Sys.Serialization.JavaScriptSerializer._charsToEscape[a+2]=b;Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[b]=new RegExp(b,"g");Sys.Serialization.JavaScriptSerializer._escapeChars[b]=c[a]}};Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder=function(b,a){a.append(b.toString())};Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder=function(a,b){if(isFinite(a))b.append(String(a));else throw Error.invalidOperation(Sys.Res.cannotSerializeNonFiniteNumbers)};Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder=function(a,c){c.append('"');if(Sys.Serialization.JavaScriptSerializer._escapeRegEx.test(a)){if(Sys.Serialization.JavaScriptSerializer._charsToEscape.length===0)Sys.Serialization.JavaScriptSerializer._init();if(a.length<128)a=a.replace(Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal,function(a){return Sys.Serialization.JavaScriptSerializer._escapeChars[a]});else for(var d=0;d<34;d++){var b=Sys.Serialization.JavaScriptSerializer._charsToEscape[d];if(a.indexOf(b)!==-1)if(Sys.Browser.agent===Sys.Browser.Opera||Sys.Browser.agent===Sys.Browser.FireFox)a=a.split(b).join(Sys.Serialization.JavaScriptSerializer._escapeChars[b]);else a=a.replace(Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[b],Sys.Serialization.JavaScriptSerializer._escapeChars[b])}}c.append(a);c.append('"')};Sys.Serialization.JavaScriptSerializer._serializeWithBuilder=function(b,a,i,g){var c;switch(typeof b){case "object":if(b)if(Number.isInstanceOfType(b))Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(b,a);else if(Boolean.isInstanceOfType(b))Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(b,a);else if(String.isInstanceOfType(b))Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(b,a);else if(Array.isInstanceOfType(b)){a.append("[");for(c=0;c<b.length;++c){if(c>0)a.append(",");Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(b[c],a,false,g)}a.append("]")}else{if(Date.isInstanceOfType(b)){a.append('"\\/Date(');a.append(b.getTime());a.append(')\\/"');break}var d=[],f=0;for(var e in b){if(e.startsWith("$"))continue;if(e===Sys.Serialization.JavaScriptSerializer._serverTypeFieldName&&f!==0){d[f++]=d[0];d[0]=e}else d[f++]=e}if(i)d.sort();a.append("{");var j=false;for(c=0;c<f;c++){var h=b[d[c]];if(typeof h!=="undefined"&&typeof h!=="function"){if(j)a.append(",");else j=true;Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(d[c],a,i,g);a.append(":");Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(h,a,i,g)}}a.append("}")}else a.append("null");break;case "number":Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(b,a);break;case "string":Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(b,a);break;case "boolean":Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(b,a);break;default:a.append("null")}};Sys.Serialization.JavaScriptSerializer.serialize=function(b){var a=new Sys.StringBuilder;Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(b,a,false);return a.toString()};Sys.Serialization.JavaScriptSerializer.deserialize=function(data,secure){if(data.length===0)throw Error.argument("data",Sys.Res.cannotDeserializeEmptyString);try{var exp=data.replace(Sys.Serialization.JavaScriptSerializer._dateRegEx,"$1new Date($2)");if(secure&&Sys.Serialization.JavaScriptSerializer._jsonRegEx.test(exp.replace(Sys.Serialization.JavaScriptSerializer._jsonStringRegEx,"")))throw null;return eval("("+exp+")")}catch(a){throw Error.argument("data",Sys.Res.cannotDeserializeInvalidJson)}};Sys.CultureInfo=function(c,b,a){this.name=c;this.numberFormat=b;this.dateTimeFormat=a};Sys.CultureInfo.prototype={_getDateTimeFormats:function(){if(!this._dateTimeFormats){var a=this.dateTimeFormat;this._dateTimeFormats=[a.MonthDayPattern,a.YearMonthPattern,a.ShortDatePattern,a.ShortTimePattern,a.LongDatePattern,a.LongTimePattern,a.FullDateTimePattern,a.RFC1123Pattern,a.SortableDateTimePattern,a.UniversalSortableDateTimePattern]}return this._dateTimeFormats},_getMonthIndex:function(a){if(!this._upperMonths)this._upperMonths=this._toUpperArray(this.dateTimeFormat.MonthNames);return Array.indexOf(this._upperMonths,this._toUpper(a))},_getAbbrMonthIndex:function(a){if(!this._upperAbbrMonths)this._upperAbbrMonths=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);return Array.indexOf(this._upperAbbrMonths,this._toUpper(a))},_getDayIndex:function(a){if(!this._upperDays)this._upperDays=this._toUpperArray(this.dateTimeFormat.DayNames);return Array.indexOf(this._upperDays,this._toUpper(a))},_getAbbrDayIndex:function(a){if(!this._upperAbbrDays)this._upperAbbrDays=this._toUpperArray(this.dateTimeFormat.AbbreviatedDayNames);return Array.indexOf(this._upperAbbrDays,this._toUpper(a))},_toUpperArray:function(c){var b=[];for(var a=0,d=c.length;a<d;a++)b[a]=this._toUpper(c[a]);return b},_toUpper:function(a){return a.split("\u00a0").join(" ").toUpperCase()}};Sys.CultureInfo._parse=function(b){var a=Sys.Serialization.JavaScriptSerializer.deserialize(b);return new Sys.CultureInfo(a.name,a.numberFormat,a.dateTimeFormat)};Sys.CultureInfo.registerClass("Sys.CultureInfo");Sys.CultureInfo.InvariantCulture=Sys.CultureInfo._parse('{"name":"","numberFormat":{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":".","IsReadOnly":true,"CurrencyGroupSizes":[3],"NumberGroupSizes":[3],"PercentGroupSizes":[3],"CurrencyGroupSeparator":",","CurrencySymbol":"\u00a4","NaNSymbol":"NaN","CurrencyNegativePattern":0,"NumberNegativePattern":1,"PercentPositivePattern":0,"PercentNegativePattern":0,"NegativeInfinitySymbol":"-Infinity","NegativeSign":"-","NumberDecimalDigits":2,"NumberDecimalSeparator":".","NumberGroupSeparator":",","CurrencyPositivePattern":0,"PositiveInfinitySymbol":"Infinity","PositiveSign":"+","PercentDecimalDigits":2,"PercentDecimalSeparator":".","PercentGroupSeparator":",","PercentSymbol":"%","PerMilleSymbol":"\u2030","NativeDigits":["0","1","2","3","4","5","6","7","8","9"],"DigitSubstitution":1},"dateTimeFormat":{"AMDesignator":"AM","Calendar":{"MinSupportedDateTime":"@-62135568000000@","MaxSupportedDateTime":"@253402300799999@","AlgorithmType":1,"CalendarType":1,"Eras":[1],"TwoDigitYearMax":2029,"IsReadOnly":true},"DateSeparator":"/","FirstDayOfWeek":0,"CalendarWeekRule":0,"FullDateTimePattern":"dddd, dd MMMM yyyy HH:mm:ss","LongDatePattern":"dddd, dd MMMM yyyy","LongTimePattern":"HH:mm:ss","MonthDayPattern":"MMMM dd","PMDesignator":"PM","RFC1123Pattern":"ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'","ShortDatePattern":"MM/dd/yyyy","ShortTimePattern":"HH:mm","SortableDateTimePattern":"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","TimeSeparator":":","UniversalSortableDateTimePattern":"yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'","YearMonthPattern":"yyyy MMMM","AbbreviatedDayNames":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"ShortestDayNames":["Su","Mo","Tu","We","Th","Fr","Sa"],"DayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"AbbreviatedMonthNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"IsReadOnly":true,"NativeCalendarName":"Gregorian Calendar","AbbreviatedMonthGenitiveNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthGenitiveNames":["January","February","March","April","May","June","July","August","September","October","November","December",""]}}');if(typeof __cultureInfo==="undefined")var __cultureInfo='{"name":"en-US","numberFormat":{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":".","IsReadOnly":false,"CurrencyGroupSizes":[3],"NumberGroupSizes":[3],"PercentGroupSizes":[3],"CurrencyGroupSeparator":",","CurrencySymbol":"$","NaNSymbol":"NaN","CurrencyNegativePattern":0,"NumberNegativePattern":1,"PercentPositivePattern":0,"PercentNegativePattern":0,"NegativeInfinitySymbol":"-Infinity","NegativeSign":"-","NumberDecimalDigits":2,"NumberDecimalSeparator":".","NumberGroupSeparator":",","CurrencyPositivePattern":0,"PositiveInfinitySymbol":"Infinity","PositiveSign":"+","PercentDecimalDigits":2,"PercentDecimalSeparator":".","PercentGroupSeparator":",","PercentSymbol":"%","PerMilleSymbol":"\u2030","NativeDigits":["0","1","2","3","4","5","6","7","8","9"],"DigitSubstitution":1},"dateTimeFormat":{"AMDesignator":"AM","Calendar":{"MinSupportedDateTime":"@-62135568000000@","MaxSupportedDateTime":"@253402300799999@","AlgorithmType":1,"CalendarType":1,"Eras":[1],"TwoDigitYearMax":2029,"IsReadOnly":false},"DateSeparator":"/","FirstDayOfWeek":0,"CalendarWeekRule":0,"FullDateTimePattern":"dddd, MMMM dd, yyyy h:mm:ss tt","LongDatePattern":"dddd, MMMM dd, yyyy","LongTimePattern":"h:mm:ss tt","MonthDayPattern":"MMMM dd","PMDesignator":"PM","RFC1123Pattern":"ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'","ShortDatePattern":"M/d/yyyy","ShortTimePattern":"h:mm tt","SortableDateTimePattern":"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","TimeSeparator":":","UniversalSortableDateTimePattern":"yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'","YearMonthPattern":"MMMM, yyyy","AbbreviatedDayNames":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"ShortestDayNames":["Su","Mo","Tu","We","Th","Fr","Sa"],"DayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"AbbreviatedMonthNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"IsReadOnly":false,"NativeCalendarName":"Gregorian Calendar","AbbreviatedMonthGenitiveNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthGenitiveNames":["January","February","March","April","May","June","July","August","September","October","November","December",""]}}';Sys.CultureInfo.CurrentCulture=Sys.CultureInfo._parse(__cultureInfo);delete __cultureInfo;Sys.UI.Behavior=function(b){Sys.UI.Behavior.initializeBase(this);this._element=b;var a=b._behaviors;if(!a)b._behaviors=[this];else a[a.length]=this};Sys.UI.Behavior.prototype={_name:null,get_element:function(){return this._element},get_id:function(){var a=Sys.UI.Behavior.callBaseMethod(this,"get_id");if(a)return a;if(!this._element||!this._element.id)return "";return this._element.id+"$"+this.get_name()},get_name:function(){if(this._name)return this._name;var a=Object.getTypeName(this),b=a.lastIndexOf(".");if(b!=-1)a=a.substr(b+1);if(!this.get_isInitialized())this._name=a;return a},set_name:function(a){this._name=a},initialize:function(){Sys.UI.Behavior.callBaseMethod(this,"initialize");var a=this.get_name();if(a)this._element[a]=this},dispose:function(){Sys.UI.Behavior.callBaseMethod(this,"dispose");if(this._element){var a=this.get_name();if(a)this._element[a]=null;Array.remove(this._element._behaviors,this);delete this._element}}};Sys.UI.Behavior.registerClass("Sys.UI.Behavior",Sys.Component);Sys.UI.Behavior.getBehaviorByName=function(b,c){var a=b[c];return a&&Sys.UI.Behavior.isInstanceOfType(a)?a:null};Sys.UI.Behavior.getBehaviors=function(a){if(!a._behaviors)return [];return Array.clone(a._behaviors)};Sys.UI.Behavior.getBehaviorsByType=function(d,e){var a=d._behaviors,c=[];if(a)for(var b=0,f=a.length;b<f;b++)if(e.isInstanceOfType(a[b]))c[c.length]=a[b];return c};Sys.UI.VisibilityMode=function(){throw Error.notImplemented()};Sys.UI.VisibilityMode.prototype={hide:0,collapse:1};Sys.UI.VisibilityMode.registerEnum("Sys.UI.VisibilityMode");Sys.UI.Control=function(a){Sys.UI.Control.initializeBase(this);this._element=a;a.control=this};Sys.UI.Control.prototype={_parent:null,_visibilityMode:Sys.UI.VisibilityMode.hide,get_element:function(){return this._element},get_id:function(){if(!this._element)return "";return this._element.id},set_id:function(){throw Error.invalidOperation(Sys.Res.cantSetId)},get_parent:function(){if(this._parent)return this._parent;if(!this._element)return null;var a=this._element.parentNode;while(a){if(a.control)return a.control;a=a.parentNode}return null},set_parent:function(a){this._parent=a},get_visibilityMode:function(){return Sys.UI.DomElement.getVisibilityMode(this._element)},set_visibilityMode:function(a){Sys.UI.DomElement.setVisibilityMode(this._element,a)},get_visible:function(){return Sys.UI.DomElement.getVisible(this._element)},set_visible:function(a){Sys.UI.DomElement.setVisible(this._element,a)},addCssClass:function(a){Sys.UI.DomElement.addCssClass(this._element,a)},dispose:function(){Sys.UI.Control.callBaseMethod(this,"dispose");if(this._element){this._element.control=undefined;delete this._element}if(this._parent)delete this._parent},onBubbleEvent:function(){return false},raiseBubbleEvent:function(b,c){var a=this.get_parent();while(a){if(a.onBubbleEvent(b,c))return;a=a.get_parent()}},removeCssClass:function(a){Sys.UI.DomElement.removeCssClass(this._element,a)},toggleCssClass:function(a){Sys.UI.DomElement.toggleCssClass(this._element,a)}};Sys.UI.Control.registerClass("Sys.UI.Control",Sys.Component);
Type.registerNamespace('Sys');Sys.Res={'argumentInteger':'Value must be an integer.','scriptLoadMultipleCallbacks':'The script \'{0}\' contains multiple calls to Sys.Application.notifyScriptLoaded(). Only one is allowed.','invokeCalledTwice':'Cannot call invoke more than once.','webServiceFailed':'The server method \'{0}\' failed with the following error: {1}','webServiceInvalidJsonWrapper':'The server method \'{0}\' returned invalid data. The \'d\' property is missing from the JSON wrapper.','argumentType':'Object cannot be converted to the required type.','argumentNull':'Value cannot be null.','controlCantSetId':'The id property can\'t be set on a control.','formatBadFormatSpecifier':'Format specifier was invalid.','webServiceFailedNoMsg':'The server method \'{0}\' failed.','argumentDomElement':'Value must be a DOM element.','invalidExecutorType':'Could not create a valid Sys.Net.WebRequestExecutor from: {0}.','cannotCallBeforeResponse':'Cannot call {0} when responseAvailable is false.','actualValue':'Actual value was {0}.','enumInvalidValue':'\'{0}\' is not a valid value for enum {1}.','scriptLoadFailed':'The script \'{0}\' could not be loaded.','parameterCount':'Parameter count mismatch.','cannotDeserializeEmptyString':'Cannot deserialize empty string.','formatInvalidString':'Input string was not in a correct format.','invalidTimeout':'Value must be greater than or equal to zero.','cannotAbortBeforeStart':'Cannot abort when executor has not started.','argument':'Value does not fall within the expected range.','cannotDeserializeInvalidJson':'Cannot deserialize. The data does not correspond to valid JSON.','invalidHttpVerb':'httpVerb cannot be set to an empty or null string.','nullWebRequest':'Cannot call executeRequest with a null webRequest.','eventHandlerInvalid':'Handler was not added through the Sys.UI.DomEvent.addHandler method.','cannotSerializeNonFiniteNumbers':'Cannot serialize non finite numbers.','argumentUndefined':'Value cannot be undefined.','webServiceInvalidReturnType':'The server method \'{0}\' returned an invalid type. Expected type: {1}','servicePathNotSet':'The path to the web service has not been set.','argumentTypeWithTypes':'Object of type \'{0}\' cannot be converted to type \'{1}\'.','cannotCallOnceStarted':'Cannot call {0} once started.','badBaseUrl1':'Base URL does not contain ://.','badBaseUrl2':'Base URL does not contain another /.','badBaseUrl3':'Cannot find last / in base URL.','setExecutorAfterActive':'Cannot set executor after it has become active.','paramName':'Parameter name: {0}','cannotCallOutsideHandler':'Cannot call {0} outside of a completed event handler.','cannotSerializeObjectWithCycle':'Cannot serialize object with cyclic reference within child properties.','format':'One of the identified items was in an invalid format.','assertFailedCaller':'Assertion Failed: {0}\r\nat {1}','argumentOutOfRange':'Specified argument was out of the range of valid values.','webServiceTimedOut':'The server method \'{0}\' timed out.','notImplemented':'The method or operation is not implemented.','assertFailed':'Assertion Failed: {0}','invalidOperation':'Operation is not valid due to the current state of the object.','breakIntoDebugger':'{0}\r\n\r\nBreak into debugger?'};
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
Type.registerNamespace('Coveo.CNL.Web.Scripts.Ajax');

////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.IContentFlipper

Coveo.CNL.Web.Scripts.Ajax.IContentFlipper = function() { 
    /// <summary>
    /// Interface for objects that flip content.
    /// </summary>
};
Coveo.CNL.Web.Scripts.Ajax.IContentFlipper.prototype = {
    get_newContent : null,
    flip : null
}
Coveo.CNL.Web.Scripts.Ajax.IContentFlipper.registerInterface('Coveo.CNL.Web.Scripts.Ajax.IContentFlipper');


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcess

Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcess = function Coveo_CNL_Web_Scripts_Ajax_AsynchronousProcess() {
    /// <summary>
    /// Base class for asynchronous processes.
    /// </summary>
    /// <field name="_m_Manager" type="Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager">
    /// </field>
}
Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcess.prototype = {
    _m_Manager: null,
    
    get_manager: function Coveo_CNL_Web_Scripts_Ajax_AsynchronousProcess$get_manager() {
        /// <summary>
        /// The AsynchronousProcessManager that manages us.
        /// </summary>
        /// <value type="Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager"></value>
        return this._m_Manager;
    },
    set_manager: function Coveo_CNL_Web_Scripts_Ajax_AsynchronousProcess$set_manager(value) {
        /// <summary>
        /// The AsynchronousProcessManager that manages us.
        /// </summary>
        /// <value type="Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager"></value>
        this._m_Manager = value;
        return value;
    },
    
    start: function Coveo_CNL_Web_Scripts_Ajax_AsynchronousProcess$start() {
        /// <summary>
        /// Starts the asynchronous process.
        /// </summary>
        this.beginProcess();
    },
    
    terminate: function Coveo_CNL_Web_Scripts_Ajax_AsynchronousProcess$terminate() {
        /// <summary>
        /// Forces the asynchronous process to terminate.
        /// </summary>
        this.endProcess();
        if (this._m_Manager != null) {
            this._m_Manager.processIsDone(this);
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.ControlFlipper

Coveo.CNL.Web.Scripts.Ajax.ControlFlipper = function Coveo_CNL_Web_Scripts_Ajax_ControlFlipper(p_Old, p_Html) {
    /// <summary>
    /// Implementation of <see cref="T:Coveo.CNL.Web.Scripts.Ajax.IContentFlipper" /> for flipping the whole
    /// html for a control (including the outer tag).
    /// </summary>
    /// <param name="p_Old" type="Object" domElement="true">
    /// The old element that is being replaced.
    /// </param>
    /// <param name="p_Html" type="String">
    /// The updated html to replace with.
    /// </param>
    /// <field name="_m_Old" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Html" type="String">
    /// </field>
    /// <field name="_m_New" type="Object" domElement="true">
    /// </field>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Old);
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Html);
    this._m_Old = p_Old;
    this._m_Html = p_Html;
    this._m_New = document.createElement('div');
    this._m_New.style.display = 'none';
    document.body.appendChild(this._m_New);
    this._m_New.innerHTML = this._m_Html;
    Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_New.children.length === 1);
}
Coveo.CNL.Web.Scripts.Ajax.ControlFlipper.prototype = {
    _m_Old: null,
    _m_Html: null,
    _m_New: null,
    
    get_newContent: function Coveo_CNL_Web_Scripts_Ajax_ControlFlipper$get_newContent() {
        /// <value type="Object" domElement="true"></value>
        return this._m_New.firstChild;
    },
    
    flip: function Coveo_CNL_Web_Scripts_Ajax_ControlFlipper$flip() {
        /// <returns type="Object" domElement="true"></returns>
        var child = this._m_New.firstChild;
        this._m_Old.parentNode.insertBefore(child, this._m_Old);
        this._m_Old.parentNode.removeChild(this._m_Old);
        this._m_New.parentNode.removeChild(this._m_New);
        return child;
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.CollapseTransition

Coveo.CNL.Web.Scripts.Ajax.CollapseTransition = function Coveo_CNL_Web_Scripts_Ajax_CollapseTransition(p_Element, p_Flipper) {
    /// <summary>
    /// Transition effect that collapses a tag from it's normal size to nothing.
    /// </summary>
    /// <param name="p_Element" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> that we collapse.
    /// </param>
    /// <param name="p_Flipper" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// The <see cref="T:Coveo.CNL.Web.Scripts.Ajax.IContentFlipper" /> that flips the content.
    /// </param>
    /// <field name="_framE_DELAY$2" type="Number" integer="true" static="true">
    /// </field>
    /// <field name="_m_Flipper$2" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// </field>
    /// <field name="_m_Element$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_InitialHeight$2" type="Number" integer="true">
    /// </field>
    /// <field name="_m_Margins$2" type="Coveo.CNL.Web.Scripts.TransferMargin">
    /// </field>
    /// <field name="_m_Container$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Timeout$2" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    /// <field name="_m_Percent$2" type="Coveo.CNL.Web.Scripts.Ajax.PercentTimer">
    /// </field>
    Coveo.CNL.Web.Scripts.Ajax.CollapseTransition.initializeBase(this);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper);
    this._m_Element$2 = p_Element;
    this._m_Flipper$2 = p_Flipper;
}
Coveo.CNL.Web.Scripts.Ajax.CollapseTransition.prototype = {
    _m_Flipper$2: null,
    _m_Element$2: null,
    _m_InitialHeight$2: 0,
    _m_Margins$2: null,
    _m_Container$2: null,
    _m_Timeout$2: null,
    _m_Percent$2: null,
    
    beginTransition: function Coveo_CNL_Web_Scripts_Ajax_CollapseTransition$beginTransition() {
        this._m_InitialHeight$2 = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this._m_Element$2).height;
        this._m_Container$2 = document.createElement('div');
        this._m_Container$2.style.overflow = 'hidden';
        this._m_Container$2.style.height = this._m_InitialHeight$2 + 'px';
        this._m_Margins$2 = new Coveo.CNL.Web.Scripts.TransferMargin(this._m_Element$2, this._m_Container$2);
        this._m_Element$2.parentNode.replaceChild(this._m_Container$2, this._m_Element$2);
        this._m_Container$2.appendChild(this._m_Element$2);
        this._m_Percent$2 = new Coveo.CNL.Web.Scripts.Ajax.PercentTimer(300);
        this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), 0);
    },
    
    endTransition: function Coveo_CNL_Web_Scripts_Ajax_CollapseTransition$endTransition() {
        if (this._m_Timeout$2 != null) {
            this._m_Timeout$2.cancel();
            this._m_Timeout$2 = null;
        }
        this._m_Element$2.style.display = 'none';
        this._m_Margins$2.restore();
        this._m_Container$2.parentNode.replaceChild(this._m_Flipper$2.flip(), this._m_Container$2);
    },
    
    _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_CollapseTransition$_timerCallback$2() {
        /// <summary>
        /// Callback for the timer we use.
        /// </summary>
        this._m_Percent$2.ensureStarted();
        this._m_Container$2.style.height = ((this._m_InitialHeight$2 * Math.cos(Math.PI * this._m_Percent$2.getPercentage() / 2))).toString() + 'px';
        if (!this._m_Percent$2.isFinished()) {
            this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.CollapseTransition._framE_DELAY$2);
        }
        else {
            this.terminate();
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.AdjustTransition

Coveo.CNL.Web.Scripts.Ajax.AdjustTransition = function Coveo_CNL_Web_Scripts_Ajax_AdjustTransition(p_Element, p_Flipper) {
    /// <summary>
    /// Transition effect that gradually adjusts the size of an element.
    /// </summary>
    /// <param name="p_Element" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> that we adjust.
    /// </param>
    /// <param name="p_Flipper" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// The <see cref="T:Coveo.CNL.Web.Scripts.Ajax.IContentFlipper" /> that flips the content.
    /// </param>
    /// <field name="_framE_DELAY$2" type="Number" integer="true" static="true">
    /// </field>
    /// <field name="_m_Flipper$2" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// </field>
    /// <field name="_m_Element$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_InitialHeight$2" type="Number" integer="true">
    /// </field>
    /// <field name="_m_Offset$2" type="Number" integer="true">
    /// </field>
    /// <field name="_m_Margins$2" type="Coveo.CNL.Web.Scripts.TransferMargin">
    /// </field>
    /// <field name="_m_Container$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Timeout$2" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    /// <field name="_m_Percent$2" type="Coveo.CNL.Web.Scripts.Ajax.PercentTimer">
    /// </field>
    Coveo.CNL.Web.Scripts.Ajax.AdjustTransition.initializeBase(this);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper);
    this._m_Element$2 = p_Element;
    this._m_Flipper$2 = p_Flipper;
}
Coveo.CNL.Web.Scripts.Ajax.AdjustTransition.prototype = {
    _m_Flipper$2: null,
    _m_Element$2: null,
    _m_InitialHeight$2: 0,
    _m_Offset$2: 0,
    _m_Margins$2: null,
    _m_Container$2: null,
    _m_Timeout$2: null,
    _m_Percent$2: null,
    
    beginTransition: function Coveo_CNL_Web_Scripts_Ajax_AdjustTransition$beginTransition() {
        this._m_InitialHeight$2 = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this._m_Element$2).height;
        this._m_Element$2 = this._m_Flipper$2.flip();
        this._m_Offset$2 = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this._m_Element$2).height - this._m_InitialHeight$2;
        this._m_Container$2 = document.createElement('div');
        this._m_Container$2.style.overflow = 'hidden';
        this._m_Container$2.style.height = this._m_InitialHeight$2 + 'px';
        this._m_Margins$2 = new Coveo.CNL.Web.Scripts.TransferMargin(this._m_Element$2, this._m_Container$2);
        this._m_Element$2.parentNode.replaceChild(this._m_Container$2, this._m_Element$2);
        this._m_Container$2.appendChild(this._m_Element$2);
        this._m_Percent$2 = new Coveo.CNL.Web.Scripts.Ajax.PercentTimer(300);
        this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), 0);
    },
    
    endTransition: function Coveo_CNL_Web_Scripts_Ajax_AdjustTransition$endTransition() {
        if (this._m_Timeout$2 != null) {
            this._m_Timeout$2.cancel();
            this._m_Timeout$2 = null;
        }
        this._m_Margins$2.restore();
        this._m_Container$2.parentNode.replaceChild(this._m_Element$2, this._m_Container$2);
    },
    
    _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_AdjustTransition$_timerCallback$2() {
        /// <summary>
        /// Callback for the timer we use.
        /// </summary>
        this._m_Percent$2.ensureStarted();
        this._m_Container$2.style.height = ((this._m_InitialHeight$2 + this._m_Offset$2 * Math.sin(Math.PI * this._m_Percent$2.getPercentage() / 2))).toString() + 'px';
        if (!this._m_Percent$2.isFinished()) {
            this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.AdjustTransition._framE_DELAY$2);
        }
        else {
            this.terminate();
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.Console

Coveo.CNL.Web.Scripts.Ajax.Console = function Coveo_CNL_Web_Scripts_Ajax_Console() {
    /// <summary>
    /// Implements a console on the client side for debugging purposes.
    /// </summary>
    /// <field name="_s_Console" type="Coveo.CNL.Web.Scripts.Ajax.Console" static="true">
    /// </field>
    /// <field name="_m_Frame" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Content" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Visible" type="Boolean">
    /// </field>
    Coveo.CNL.Web.Scripts.CNLAssert.isNull(Coveo.CNL.Web.Scripts.Ajax.Console._s_Console);
    Coveo.CNL.Web.Scripts.Ajax.Console._s_Console = this;
    this._m_Frame = document.createElement('div');
    this._m_Frame.style.position = 'absolute';
    this._m_Frame.style.left = '5%';
    this._m_Frame.style.top = '5%';
    this._m_Frame.style.width = '90%';
    this._m_Frame.style.height = '90%';
    this._m_Frame.style.border = '2px solid silver';
    this._m_Frame.style.backgroundColor = 'whitesmoke';
    document.body.appendChild(this._m_Frame);
    this._m_Content = document.createElement('div');
    this._m_Content.style.fontFamily = 'Consolas';
    this._m_Content.style.fontSize = '10pt';
    this._m_Content.style.padding = '10px';
    this._m_Frame.appendChild(this._m_Content);
    this._m_Frame.style.display = 'none';
    document.body.attachEvent('onkeypress', Function.createDelegate(this, this._body_KeyPress));
    Coveo.CNL.Web.Scripts.Ajax.Console.writeLine('allo');
    Coveo.CNL.Web.Scripts.Ajax.Console.writeLine('toi');
}
Coveo.CNL.Web.Scripts.Ajax.Console.writeLine = function Coveo_CNL_Web_Scripts_Ajax_Console$writeLine(p_Text) {
    /// <summary>
    /// Writes a line of text to the console.
    /// </summary>
    /// <param name="p_Text" type="String">
    /// The text to write to the console.
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Text);
    if (Coveo.CNL.Web.Scripts.Ajax.Console._s_Console != null) {
        Coveo.CNL.Web.Scripts.Ajax.Console._s_Console.outputLineOfText(p_Text);
    }
}
Coveo.CNL.Web.Scripts.Ajax.Console.writeHtmlLine = function Coveo_CNL_Web_Scripts_Ajax_Console$writeHtmlLine(p_Html) {
    /// <summary>
    /// Writes a line of html to the console.
    /// </summary>
    /// <param name="p_Html" type="String">
    /// The html to write to the console.
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Html);
    if (Coveo.CNL.Web.Scripts.Ajax.Console._s_Console != null) {
        Coveo.CNL.Web.Scripts.Ajax.Console._s_Console.outputLineOfHtml(p_Html);
    }
}
Coveo.CNL.Web.Scripts.Ajax.Console.prototype = {
    _m_Frame: null,
    _m_Content: null,
    _m_Visible: false,
    
    outputLineOfText: function Coveo_CNL_Web_Scripts_Ajax_Console$outputLineOfText(p_Text) {
        /// <summary>
        /// Writes a line of text to the console.
        /// </summary>
        /// <param name="p_Text" type="String">
        /// The text to write to the console.
        /// </param>
        var line = document.createElement('div');
        line.innerText = p_Text;
        this._m_Content.appendChild(line);
    },
    
    outputLineOfHtml: function Coveo_CNL_Web_Scripts_Ajax_Console$outputLineOfHtml(p_Html) {
        /// <summary>
        /// Writes a line of html to the console.
        /// </summary>
        /// <param name="p_Html" type="String">
        /// The html to write to the console.
        /// </param>
        var line = document.createElement('div');
        line.innerHTML = p_Html;
        this._m_Content.appendChild(line);
    },
    
    _body_KeyPress: function Coveo_CNL_Web_Scripts_Ajax_Console$_body_KeyPress() {
        if (window.event.keyCode === 126) {
            if (!this._m_Visible) {
                this._m_Frame.style.display = 'block';
                this._m_Visible = true;
            }
            else {
                this._m_Frame.style.display = 'none';
                this._m_Visible = false;
            }
            window.event.cancelBubble = true;
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript

Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript = function Coveo_CNL_Web_Scripts_Ajax_AjaxObjectScript() {
    /// <summary>
    /// Base class for client objects created using the AjaxObject class.
    /// </summary>
    /// <field name="_m_OwnerId" type="String">
    /// </field>
}
Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript.prototype = {
    _m_OwnerId: null,
    
    get_ownerId: function Coveo_CNL_Web_Scripts_Ajax_AjaxObjectScript$get_ownerId() {
        /// <summary>
        /// The id of the control that owns the object.
        /// </summary>
        /// <value type="String"></value>
        return this._m_OwnerId;
    },
    set_ownerId: function Coveo_CNL_Web_Scripts_Ajax_AjaxObjectScript$set_ownerId(value) {
        /// <summary>
        /// The id of the control that owns the object.
        /// </summary>
        /// <value type="String"></value>
        this._m_OwnerId = value;
        return value;
    },
    
    initialize: function Coveo_CNL_Web_Scripts_Ajax_AjaxObjectScript$initialize() {
        /// <summary>
        /// Initializes the object after initialization from the server data is done.
        /// </summary>
    },
    
    tearDown: function Coveo_CNL_Web_Scripts_Ajax_AjaxObjectScript$tearDown() {
        /// <summary>
        /// Tears down the object when his associated region of the DOM is removed or replaced.
        /// </summary>
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.BlankFeedback

Coveo.CNL.Web.Scripts.Ajax.BlankFeedback = function Coveo_CNL_Web_Scripts_Ajax_BlankFeedback(p_Element, p_Fullscreen, p_Image) {
    /// <summary>
    /// Feedback that blanks the area to be updated until the postback finishes.
    /// </summary>
    /// <param name="p_Element" type="Object" domElement="true">
    /// The element to which the feedback is associated.
    /// </param>
    /// <param name="p_Fullscreen" type="Boolean">
    /// Whether to display the feedback in fullscreen mode.
    /// </param>
    /// <param name="p_Image" type="String">
    /// The uri of the image to display.
    /// </param>
    /// <field name="_m_Element$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Overlay$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Fullscreen$2" type="Boolean">
    /// </field>
    /// <field name="_m_Image$2" type="String">
    /// </field>
    Coveo.CNL.Web.Scripts.Ajax.BlankFeedback.initializeBase(this);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element);
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Image);
    this._m_Element$2 = p_Element;
    this._m_Fullscreen$2 = p_Fullscreen;
    this._m_Image$2 = p_Image;
}
Coveo.CNL.Web.Scripts.Ajax.BlankFeedback.prototype = {
    _m_Element$2: null,
    _m_Overlay$2: null,
    _m_Fullscreen$2: false,
    _m_Image$2: null,
    
    beginFeedback: function Coveo_CNL_Web_Scripts_Ajax_BlankFeedback$beginFeedback() {
        var bounds;
        if (this._m_Fullscreen$2) {
            bounds = Coveo.CNL.Web.Scripts.DOMUtilities.getVisibleRectangle();
        }
        else {
            bounds = Coveo.CNL.Web.Scripts.DOMUtilities.getElementBounds(this._m_Element$2.parentNode);
            bounds = Coveo.CNL.Web.Scripts.DOMUtilities.getIntersection(bounds, Coveo.CNL.Web.Scripts.DOMUtilities.getVisibleRectangle());
        }
        this._m_Overlay$2 = document.createElement('div');
        this._m_Overlay$2.style.backgroundColor = 'white';
        this._m_Overlay$2.style.position = 'absolute';
        this._m_Overlay$2.style.zIndex = Coveo.CNL.Web.Scripts.DOMUtilities.getNextHighestZindex();
        Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Overlay$2, 0.75);
        document.body.appendChild(this._m_Overlay$2);
        Coveo.CNL.Web.Scripts.DOMUtilities.setElementBounds(this._m_Overlay$2, bounds);
        this._m_Overlay$2.innerHTML = '<table width=100% height=100%><tr><td align=\"center\"><img src=\"' + this._m_Image$2 + '\"/></tr></td></table>';
    },
    
    endFeedback: function Coveo_CNL_Web_Scripts_Ajax_BlankFeedback$endFeedback() {
        document.body.removeChild(this._m_Overlay$2);
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.Bootstrap

Coveo.CNL.Web.Scripts.Ajax.Bootstrap = function Coveo_CNL_Web_Scripts_Ajax_Bootstrap() {
    /// <summary>
    /// Provides methods for inserting an ASP.NET page form into a non-ASP.NET page.
    /// </summary>
    /// <field name="_s_Element" type="Object" domElement="true" static="true">
    /// </field>
    /// <field name="_s_Request" type="XMLHttpRequest" static="true">
    /// </field>
}
Coveo.CNL.Web.Scripts.Ajax.Bootstrap.insertAjaxAspNetPage = function Coveo_CNL_Web_Scripts_Ajax_Bootstrap$insertAjaxAspNetPage(p_Path, p_Element, p_ForwardQueryString) {
    /// <summary>
    /// Inserts an Ajax ASP.NET page under a specified <see cref="T:System.DHTML.DOMElement" />.
    /// </summary>
    /// <param name="p_Path" type="String">
    /// The path on the local server from which to load the page.
    /// </param>
    /// <param name="p_Element" type="Object" domElement="true">
    /// The element under which to insert the page.
    /// </param>
    /// <param name="p_ForwardQueryString" type="Boolean">
    /// Whether to forward the content of the query string.
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Path);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element);
    if (p_Path.startsWith('http://') || p_Path.startsWith('https://')) {
        alert('The Path argument must not include a server name.');
    }
    var target = p_Path;
    if (p_ForwardQueryString && !Coveo.CNL.Web.Scripts.Utilities.isNullOrEmpty(window.location.search)) {
        if (target.indexOf('?') === -1) {
            target += '?';
        }
        else {
            target += '&';
        }
        target += window.location.search.substr(1);
    }
    Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Element = p_Element;
    Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request = new XMLHttpRequest();
    Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request.open('GET', target, true);
    Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request.setRequestHeader(Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.headeR_PARTIAL_POSTBACK, '1');
    Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request.setRequestHeader(Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.headeR_BOOTSTRAP, '1');
    if (!Coveo.CNL.Web.Scripts.Utilities.isNullOrEmpty(window.location.hash)) {
        Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request.setRequestHeader(Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.headeR_HISTORY_STATE, window.location.hash.substr(3));
    }
    Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request.onreadystatechange = Function.createDelegate(null, function() {
        Coveo.CNL.Web.Scripts.Ajax.Bootstrap._requestCallback(p_Path);
    });
    Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request.send('');
}
Coveo.CNL.Web.Scripts.Ajax.Bootstrap._requestCallback = function Coveo_CNL_Web_Scripts_Ajax_Bootstrap$_requestCallback(p_Uri) {
    /// <summary>
    /// Callback for request events.
    /// </summary>
    /// <param name="p_Uri" type="String">
    /// The uri of the page that is being bootstrapped.
    /// </param>
    if (Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request.readyState === 4) {
        if (Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request.status === 200) {
            Coveo.CNL.Web.Scripts.Ajax.Bootstrap._doBootstrapFromXml(p_Uri, Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request.responseXML);
        }
        else {
            Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Element.innerText = 'Cannot load the interface: ' + Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request.statusText;
        }
        Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request = null;
    }
}
Coveo.CNL.Web.Scripts.Ajax.Bootstrap._doBootstrapFromXml = function Coveo_CNL_Web_Scripts_Ajax_Bootstrap$_doBootstrapFromXml(p_Uri, p_Xml) {
    /// <summary>
    /// Performs the bootstraping using the xml returned by the server.
    /// </summary>
    /// <param name="p_Uri" type="String">
    /// The uri of the page that is being bootstrapped.
    /// </param>
    /// <param name="p_Xml" type="XMLDocument">
    /// The <see cref="T:System.XML.XMLDocument" /> from which to bootstrap.
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Uri);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Xml);
    var bootstrap = p_Xml.selectSingleNode('/AjaxManager/Bootstrap');
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(bootstrap);
    Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Element.innerHTML = bootstrap.text;
    var form = Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Element.getElementsByTagName('form')[0];
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(form);
    form.action = p_Uri;
    var viewstate = null;
    var inputs = form.getElementsByTagName('input');
    for (var i = 0; i < inputs.length; ++i) {
        var input = inputs[i];
        if (input.name === Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_VIEW_STATE) {
            viewstate = input.value;
            break;
        }
    }
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(viewstate);
    var id = (bootstrap.attributes.getNamedItem('Id')).value;
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(id);
    var mgr = new Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript();
    eval('_aM = mgr;');
    mgr.set_bootstrap(true);
    mgr.set_initialViewState(viewstate);
    mgr.set_enableHistory(true);
    mgr.initialize(id, form, Function.createDelegate(null, Coveo.CNL.Web.Scripts.Ajax.Bootstrap._dummyDoPostBack), p_Xml, true);
    eval('__doPostBack = function(t, a) { _aM.doPostBack(t, a); };');
}
Coveo.CNL.Web.Scripts.Ajax.Bootstrap._dummyDoPostBack = function Coveo_CNL_Web_Scripts_Ajax_Bootstrap$_dummyDoPostBack(p_Target, p_Argument) {
    /// <summary>
    /// Dummy implementation of the framework's __doPostBack function.
    /// </summary>
    /// <param name="p_Target" type="String">
    /// </param>
    /// <param name="p_Argument" type="String">
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.fail();
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.AjaxProgressScript

Coveo.CNL.Web.Scripts.Ajax.AjaxProgressScript = function Coveo_CNL_Web_Scripts_Ajax_AjaxProgressScript(p_Manager, p_PostBack) {
    /// <summary>
    /// Client side code for the AjaxProgress control.
    /// </summary>
    /// <param name="p_Manager" type="Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript">
    /// The <see cref="T:Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript" /> object.
    /// </param>
    /// <param name="p_PostBack" type="Coveo.CNL.Web.Scripts.Ajax.PartialPostBack">
    /// The <see cref="T:Coveo.CNL.Web.Scripts.Ajax.PartialPostBack" /> object.
    /// </param>
    /// <field name="_initiaL_DELAY$1" type="Number" integer="true" static="true">
    /// </field>
    /// <field name="_polL_DELAY$1" type="Number" integer="true" static="true">
    /// </field>
    /// <field name="_m_Manager$1" type="Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript">
    /// </field>
    /// <field name="_m_PostBack$1" type="Coveo.CNL.Web.Scripts.Ajax.PartialPostBack">
    /// </field>
    /// <field name="_m_Timeout$1" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    /// <field name="_m_Request$1" type="XMLHttpRequest">
    /// </field>
    /// <field name="_m_Element$1" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Cancelled$1" type="Boolean">
    /// </field>
    Coveo.CNL.Web.Scripts.Ajax.AjaxProgressScript.initializeBase(this);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Manager);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_PostBack);
    this._m_Manager$1 = p_Manager;
    this._m_PostBack$1 = p_PostBack;
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(this._m_Manager$1.get_progressPageUri());
}
Coveo.CNL.Web.Scripts.Ajax.AjaxProgressScript.prototype = {
    _m_Manager$1: null,
    _m_PostBack$1: null,
    _m_Timeout$1: null,
    _m_Request$1: null,
    _m_Element$1: null,
    _m_Cancelled$1: false,
    
    beginProcess: function Coveo_CNL_Web_Scripts_Ajax_AjaxProgressScript$beginProcess() {
        this._m_Timeout$1 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._progressCallback$1), Coveo.CNL.Web.Scripts.Ajax.AjaxProgressScript._initiaL_DELAY$1);
    },
    
    endProcess: function Coveo_CNL_Web_Scripts_Ajax_AjaxProgressScript$endProcess() {
        if (this._m_Timeout$1 != null) {
            this._m_Timeout$1.cancel();
            this._m_Timeout$1 = null;
        }
        if (this._m_Request$1 != null) {
            this._m_Request$1.abort();
            this._m_Request$1 = null;
        }
        if (this._m_Element$1 != null) {
            this._m_Element$1.parentNode.removeChild(this._m_Element$1);
            this._m_Element$1 = null;
        }
        this._m_Cancelled$1 = true;
    },
    
    _progressCallback$1: function Coveo_CNL_Web_Scripts_Ajax_AjaxProgressScript$_progressCallback$1() {
        /// <summary>
        /// Callback for the progress timeout.
        /// </summary>
        Coveo.CNL.Web.Scripts.CNLAssert.isNull(this._m_Request$1);
        this._m_Request$1 = new XMLHttpRequest();
        this._m_Request$1.open('GET', this._m_Manager$1.get_progressPageUri() + '&rqid=' + this._m_PostBack$1.get_uniqueID(), true);
        this._m_Request$1.onreadystatechange = Function.createDelegate(this, this._requestCallback$1);
        this._m_Request$1.send(null);
    },
    
    _requestCallback$1: function Coveo_CNL_Web_Scripts_Ajax_AjaxProgressScript$_requestCallback$1() {
        /// <summary>
        /// Callback for request events.
        /// </summary>
        if (this._m_Request$1.readyState === 4) {
            if (this._m_Element$1 != null) {
                this._m_Element$1.parentNode.removeChild(this._m_Element$1);
                this._m_Element$1 = null;
            }
            if (this._m_Request$1.status === 200 && this._m_Request$1.responseText !== '') {
                this._m_Element$1 = document.createElement('div');
                this._m_Element$1.style.zIndex = Coveo.CNL.Web.Scripts.DOMUtilities.getNextHighestZindex();
                Coveo.CNL.Web.Scripts.DOMUtilities.coverAllWindow(this._m_Element$1);
                document.body.appendChild(this._m_Element$1);
                var table = document.createElement('table');
                table.style.width = '100%';
                table.style.height = '100%';
                var row = table.insertRow(0);
                var cell = row.insertCell(0);
                cell.align = 'center';
                cell.valign = 'middle';
                this._m_Element$1.appendChild(table);
                var div = document.createElement('div');
                div.innerHTML = this._m_Request$1.responseText;
                cell.appendChild(div);
            }
            else if (this._m_Request$1.status === 200) {
            }
            else {
                Coveo.CNL.Web.Scripts.CNLAssert.fail();
            }
            this._m_Request$1 = null;
            if (!this._m_Cancelled$1) {
                this._m_Timeout$1 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._progressCallback$1), Coveo.CNL.Web.Scripts.Ajax.AjaxProgressScript._polL_DELAY$1);
            }
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.DropDownContentController

Coveo.CNL.Web.Scripts.Ajax.DropDownContentController = function Coveo_CNL_Web_Scripts_Ajax_DropDownContentController() {
    /// <summary>
    /// Client side code for a drop down content controler control.
    /// </summary>
    /// <field name="_m_OnLeaveManyEvent$1" type="Coveo.CNL.Web.Scripts.OnLeaveManyEvent">
    /// </field>
    /// <field name="m_DropDown" type="Object" domElement="true">
    /// The drop down element.
    /// </field>
    /// <field name="m_HotSpot" type="Object" domElement="true">
    /// The hot spot element.
    /// </field>
    /// <field name="m_DisplayOnHotSpotOver" type="Object" domElement="true">
    /// The element to display on hot spot.
    /// </field>
    Coveo.CNL.Web.Scripts.Ajax.DropDownContentController.initializeBase(this);
}
Coveo.CNL.Web.Scripts.Ajax.DropDownContentController.prototype = {
    _m_OnLeaveManyEvent$1: null,
    m_DropDown: null,
    m_HotSpot: null,
    m_DisplayOnHotSpotOver: null,
    
    initialize: function Coveo_CNL_Web_Scripts_Ajax_DropDownContentController$initialize() {
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_HotSpot);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_DropDown);
        this.m_HotSpot.attachEvent('onclick', Function.createDelegate(this, this._hotSpot_OnClick$1));
        this.m_DropDown.attachEvent('onclick', Function.createDelegate(this, this._dropDown_OnClick$1));
        if (this.m_DisplayOnHotSpotOver != null) {
            this.m_HotSpot.attachEvent('onmouseover', Function.createDelegate(this, this._hotSpot_OnMouseOver$1));
            this.m_HotSpot.attachEvent('onmouseout', Function.createDelegate(this, this._hotSpot_OnMouseOut$1));
        }
    },
    
    tearDown: function Coveo_CNL_Web_Scripts_Ajax_DropDownContentController$tearDown() {
        this.m_HotSpot.detachEvent('onclick', Function.createDelegate(this, this._hotSpot_OnClick$1));
        this.m_DropDown.detachEvent('onclick', Function.createDelegate(this, this._dropDown_OnClick$1));
        if (this.m_DisplayOnHotSpotOver != null) {
            this.m_HotSpot.detachEvent('onmouseover', Function.createDelegate(this, this._hotSpot_OnMouseOver$1));
            this.m_HotSpot.detachEvent('onmouseout', Function.createDelegate(this, this._hotSpot_OnMouseOut$1));
        }
        this.m_DropDown = null;
        this.m_HotSpot = null;
        this.m_DisplayOnHotSpotOver = null;
    },
    
    _hotSpot_OnMouseOver$1: function Coveo_CNL_Web_Scripts_Ajax_DropDownContentController$_hotSpot_OnMouseOver$1() {
        /// <summary>
        /// Called when the hot spot has a mouse over.
        /// </summary>
        this.m_DisplayOnHotSpotOver.style.display = 'inline';
        Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current().blockTimer();
    },
    
    _hotSpot_OnMouseOut$1: function Coveo_CNL_Web_Scripts_Ajax_DropDownContentController$_hotSpot_OnMouseOut$1() {
        /// <summary>
        /// Called when the hot spot has a mouse out.
        /// </summary>
        this.m_DisplayOnHotSpotOver.style.display = 'none';
        Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current().unblockTimer();
    },
    
    _hotSpot_OnClick$1: function Coveo_CNL_Web_Scripts_Ajax_DropDownContentController$_hotSpot_OnClick$1() {
        /// <summary>
        /// Called when the hot spot is clicked.
        /// </summary>
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_HotSpot);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_DropDown);
        if (this.m_DropDown.style.display === 'none') {
            if (this._m_OnLeaveManyEvent$1 == null) {
                this._m_OnLeaveManyEvent$1 = new Coveo.CNL.Web.Scripts.OnLeaveManyEvent([ this.m_HotSpot, this.m_DropDown ], 200, Function.createDelegate(this, this._hide$1));
            }
            else {
                this._m_OnLeaveManyEvent$1.attach([ this.m_HotSpot, this.m_DropDown ], 200, Function.createDelegate(this, this._hide$1));
            }
            this._display$1();
        }
        else {
            this._hide$1();
        }
    },
    
    _dropDown_OnClick$1: function Coveo_CNL_Web_Scripts_Ajax_DropDownContentController$_dropDown_OnClick$1() {
        /// <summary>
        /// Called when the drop down is clicked.
        /// </summary>
        if (window.event.srcElement !== this.m_DropDown) {
            this._hide$1();
        }
    },
    
    _display$1: function Coveo_CNL_Web_Scripts_Ajax_DropDownContentController$_display$1() {
        /// <summary>
        /// Displays the drop down.
        /// </summary>
        this.m_DropDown.style.position = 'absolute';
        this.m_DropDown.style.zIndex = Coveo.CNL.Web.Scripts.DOMUtilities.getNextHighestZindex();
        this.m_DropDown.style.display = 'block';
        Coveo.CNL.Web.Scripts.DOMUtilities.positionElement(this.m_DropDown, this.m_HotSpot, Coveo.CNL.Web.Scripts.PositionEnum.belowLeft);
        Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current().blockTimer();
    },
    
    _hide$1: function Coveo_CNL_Web_Scripts_Ajax_DropDownContentController$_hide$1() {
        /// <summary>
        /// Hides the drop down.
        /// </summary>
        if (this.m_DropDown.style.display === 'block') {
            this.m_DropDown.style.display = 'none';
            this._m_OnLeaveManyEvent$1.dispose();
            Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current().unblockTimer();
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.DropDownMenuControler

Coveo.CNL.Web.Scripts.Ajax.DropDownMenuControler = function Coveo_CNL_Web_Scripts_Ajax_DropDownMenuControler() {
    /// <summary>
    /// Client side code for a menu controler control.
    /// </summary>
    /// <field name="_m_OnLeaveManyEvent$1" type="Coveo.CNL.Web.Scripts.OnLeaveManyEvent">
    /// </field>
    /// <field name="_m_DropDownsByHotSpotID$1" type="Object">
    /// </field>
    /// <field name="_m_LastMenuDisplayed$1" type="Object" domElement="true">
    /// </field>
    this._m_DropDownsByHotSpotID$1 = {};
    Coveo.CNL.Web.Scripts.Ajax.DropDownMenuControler.initializeBase(this);
}
Coveo.CNL.Web.Scripts.Ajax.DropDownMenuControler.prototype = {
    _m_OnLeaveManyEvent$1: null,
    _m_LastMenuDisplayed$1: null,
    
    initialize: function Coveo_CNL_Web_Scripts_Ajax_DropDownMenuControler$initialize() {
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_DropDownsByHotSpotID$1);
    },
    
    tearDown: function Coveo_CNL_Web_Scripts_Ajax_DropDownMenuControler$tearDown() {
        this._m_DropDownsByHotSpotID$1 = null;
    },
    
    addMenuDropdown: function Coveo_CNL_Web_Scripts_Ajax_DropDownMenuControler$addMenuDropdown(p_HotSpotID, p_DropDownID) {
        /// <param name="p_HotSpotID" type="String">
        /// </param>
        /// <param name="p_DropDownID" type="String">
        /// </param>
        this._m_DropDownsByHotSpotID$1[p_HotSpotID] = p_DropDownID;
        var hotSpot = document.getElementById(p_HotSpotID);
        var dropDown = document.getElementById(p_DropDownID);
        hotSpot.attachEvent('onmouseover', Function.createDelegate(this, this._hotSpot_MouseOver$1));
    },
    
    _hotSpot_MouseOver$1: function Coveo_CNL_Web_Scripts_Ajax_DropDownMenuControler$_hotSpot_MouseOver$1() {
        var hotSpot = null;
        var dropDown = null;
        var $dict1 = this._m_DropDownsByHotSpotID$1;
        for (var $key2 in $dict1) {
            var entry = { key: $key2, value: $dict1[$key2] };
            hotSpot = document.getElementById(entry.key);
            if (hotSpot.contains(window.event.srcElement)) {
                break;
            }
        }
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(hotSpot);
        dropDown = document.getElementById(this._m_DropDownsByHotSpotID$1[hotSpot.id].toString());
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(dropDown);
        if (this._m_LastMenuDisplayed$1 !== dropDown) {
            if (this._m_OnLeaveManyEvent$1 == null) {
                this._m_OnLeaveManyEvent$1 = new Coveo.CNL.Web.Scripts.OnLeaveManyEvent([ hotSpot, dropDown ], 300, Function.createDelegate(this, this._onTimeout$1));
            }
            else {
                this._m_OnLeaveManyEvent$1.dispose();
                this._m_OnLeaveManyEvent$1.attach([ hotSpot, dropDown ], 300, Function.createDelegate(this, this._onTimeout$1));
            }
            this._display$1(hotSpot, dropDown);
        }
    },
    
    _onTimeout$1: function Coveo_CNL_Web_Scripts_Ajax_DropDownMenuControler$_onTimeout$1() {
        var $dict1 = this._m_DropDownsByHotSpotID$1;
        for (var $key2 in $dict1) {
            var entry = { key: $key2, value: $dict1[$key2] };
            var dropDown = document.getElementById(entry.value.toString());
            dropDown.style.display = 'none';
        }
        this._m_LastMenuDisplayed$1 = null;
    },
    
    _display$1: function Coveo_CNL_Web_Scripts_Ajax_DropDownMenuControler$_display$1(p_HotSpot, p_DropDown) {
        /// <param name="p_HotSpot" type="Object" domElement="true">
        /// </param>
        /// <param name="p_DropDown" type="Object" domElement="true">
        /// </param>
        if (this._m_LastMenuDisplayed$1 != null) {
            this._m_LastMenuDisplayed$1.style.display = 'none';
        }
        p_DropDown.style.position = 'absolute';
        p_DropDown.style.zIndex = Coveo.CNL.Web.Scripts.DOMUtilities.getNextHighestZindex();
        p_DropDown.style.display = 'block';
        Coveo.CNL.Web.Scripts.DOMUtilities.positionElement(p_DropDown, p_HotSpot, Coveo.CNL.Web.Scripts.PositionEnum.belowLeft);
        this._m_LastMenuDisplayed$1 = p_DropDown;
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.PostbackOptionsScript

Coveo.CNL.Web.Scripts.Ajax.PostbackOptionsScript = function Coveo_CNL_Web_Scripts_Ajax_PostbackOptionsScript(p_Data) {
    /// <summary>
    /// Allows specifying options on how a partial postback should be performed.
    /// </summary>
    /// <param name="p_Data" type="String">
    /// Postback options serialized by the server.
    /// </param>
    /// <field name="_m_ForcePartialPostback" type="Boolean">
    /// </field>
    /// <field name="_m_SendControlData" type="Boolean">
    /// </field>
    /// <field name="_m_TriggerFeedbacks" type="Boolean">
    /// </field>
    /// <field name="_m_IgnoreResults" type="Boolean">
    /// </field>
    var deserializer = new Coveo.CNL.Web.Scripts.StringDeserializer(p_Data);
    this._m_ForcePartialPostback = deserializer.getBool();
    this._m_SendControlData = deserializer.getBool();
    this._m_TriggerFeedbacks = deserializer.getBool();
    this._m_IgnoreResults = deserializer.getBool();
}
Coveo.CNL.Web.Scripts.Ajax.PostbackOptionsScript.prototype = {
    _m_ForcePartialPostback: false,
    _m_SendControlData: true,
    _m_TriggerFeedbacks: true,
    _m_IgnoreResults: false,
    
    get_forcePartialPostback: function Coveo_CNL_Web_Scripts_Ajax_PostbackOptionsScript$get_forcePartialPostback() {
        /// <summary>
        /// Whether to force a partial postback.
        /// </summary>
        /// <value type="Boolean"></value>
        return this._m_ForcePartialPostback;
    },
    
    get_sendControlData: function Coveo_CNL_Web_Scripts_Ajax_PostbackOptionsScript$get_sendControlData() {
        /// <summary>
        /// Whether control data should be sent along with the postback.
        /// </summary>
        /// <value type="Boolean"></value>
        return this._m_SendControlData;
    },
    
    get_triggerFeedbacks: function Coveo_CNL_Web_Scripts_Ajax_PostbackOptionsScript$get_triggerFeedbacks() {
        /// <summary>
        /// Whether applicable feedbacks should be triggered.
        /// </summary>
        /// <value type="Boolean"></value>
        return this._m_TriggerFeedbacks;
    },
    
    get_ignoreResults: function Coveo_CNL_Web_Scripts_Ajax_PostbackOptionsScript$get_ignoreResults() {
        /// <summary>
        /// Whether to ignore the results of the request.
        /// </summary>
        /// <value type="Boolean"></value>
        return this._m_IgnoreResults;
    },
    set_ignoreResults: function Coveo_CNL_Web_Scripts_Ajax_PostbackOptionsScript$set_ignoreResults(value) {
        /// <summary>
        /// Whether to ignore the results of the request.
        /// </summary>
        /// <value type="Boolean"></value>
        this._m_IgnoreResults = value;
        return value;
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack

Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack = function Coveo_CNL_Web_Scripts_Ajax_ProcessingFeedBack(p_Target, p_Text) {
    /// <summary>
    /// Feedback that is triggered when some job is processing.
    /// Used for links, it changes the link text for "Processing ..."
    /// </summary>
    /// <param name="p_Target" type="Object" domElement="true">
    /// The target control of the feedback.
    /// </param>
    /// <param name="p_Text" type="String">
    /// The text to display.
    /// </param>
    /// <field name="_framE_DELAY$2" type="Number" integer="true" static="true">
    /// </field>
    /// <field name="_m_Target$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Text$2" type="String">
    /// </field>
    /// <field name="_m_ProcessingElement$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Timeout$2" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    /// <field name="_m_state$2" type="Number" integer="true">
    /// </field>
    /// <field name="_m_displaySetting$2" type="String">
    /// </field>
    Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack.initializeBase(this);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Target);
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Text);
    this._m_Target$2 = p_Target;
    this._m_Text$2 = p_Text;
}
Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack.prototype = {
    _m_Target$2: null,
    _m_Text$2: null,
    _m_ProcessingElement$2: null,
    _m_Timeout$2: null,
    _m_state$2: 0,
    _m_displaySetting$2: null,
    
    beginFeedback: function Coveo_CNL_Web_Scripts_Ajax_ProcessingFeedBack$beginFeedback() {
        this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), 0);
        this._m_displaySetting$2 = this._m_Target$2.style.display;
        this._m_Target$2.style.display = 'none';
        this._m_ProcessingElement$2 = document.createElement('span');
        this._m_ProcessingElement$2.innerText = this._m_Text$2 + ' .  ';
        this._m_Target$2.parentNode.insertBefore(this._m_ProcessingElement$2, this._m_Target$2);
    },
    
    endFeedback: function Coveo_CNL_Web_Scripts_Ajax_ProcessingFeedBack$endFeedback() {
        this._m_Timeout$2.cancel();
        this._m_Target$2.parentNode.removeChild(this._m_ProcessingElement$2);
        this._m_Target$2.style.display = this._m_displaySetting$2;
    },
    
    _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_ProcessingFeedBack$_timerCallback$2() {
        /// <summary>
        /// Callback for the timer we use.
        /// </summary>
        switch (this._m_state$2) {
            case 0:
                this._m_ProcessingElement$2.innerText = this._m_Text$2 + ' .  ';
                ++this._m_state$2;
                break;
            case 1:
                this._m_ProcessingElement$2.innerText = this._m_Text$2 + ' .. ';
                ++this._m_state$2;
                break;
            case 2:
                this._m_ProcessingElement$2.innerText = this._m_Text$2 + ' ...';
                this._m_state$2 = 0;
                break;
            default:
                Coveo.CNL.Web.Scripts.CNLAssert.fail();
                break;
        }
        this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack._framE_DELAY$2);
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.Profiler

Coveo.CNL.Web.Scripts.Ajax.Profiler = function Coveo_CNL_Web_Scripts_Ajax_Profiler() {
    /// <summary>
    /// Allows profiling client side operations.
    /// </summary>
    /// <field name="_s_Current" type="Coveo.CNL.Web.Scripts.Ajax.Profiler" static="true">
    /// </field>
    /// <field name="_s_Results" type="Object" domElement="true" static="true">
    /// </field>
    /// <field name="_m_Start" type="Date">
    /// </field>
    /// <field name="_m_Messages" type="Array">
    /// </field>
    this._m_Start = new Date();
    this._m_Messages = [];
    Coveo.CNL.Web.Scripts.Ajax.Profiler._s_Current = this;
}
Coveo.CNL.Web.Scripts.Ajax.Profiler.log = function Coveo_CNL_Web_Scripts_Ajax_Profiler$log(p_Message) {
    /// <summary>
    /// Logs an event to the current instance of <see cref="T:Coveo.CNL.Web.Scripts.Ajax.Profiler" />.
    /// </summary>
    /// <param name="p_Message" type="String">
    /// The message of the event to log.
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Message);
    if (Coveo.CNL.Web.Scripts.Ajax.Profiler._s_Current != null) {
        Coveo.CNL.Web.Scripts.Ajax.Profiler._s_Current._logInternal(p_Message);
    }
}
Coveo.CNL.Web.Scripts.Ajax.Profiler.prototype = {
    
    stop: function Coveo_CNL_Web_Scripts_Ajax_Profiler$stop() {
        /// <summary>
        /// Stops the profiling and displays the results.
        /// </summary>
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Profiling stopped.');
        if (Coveo.CNL.Web.Scripts.Ajax.Profiler._s_Results != null) {
            Coveo.CNL.Web.Scripts.Ajax.Profiler._s_Results.parentNode.removeChild(Coveo.CNL.Web.Scripts.Ajax.Profiler._s_Results);
        }
        var results = document.createElement('div');
        results.style.position = 'absolute';
        results.style.left = '10px';
        results.style.top = '10px';
        results.style.padding = '5px';
        results.style.border = '1px solid black';
        results.style.backgroundColor = 'white';
        results.style.zIndex = 999;
        results.style.fontFamily = 'Tahoma';
        results.style.fontSize = '8pt';
        for (var i = 0; i < this._m_Messages.length; i++) {
            var msg = this._m_Messages[i];
            var div = document.createElement('div');
            div.innerHTML = msg;
            results.appendChild(div);
        }
        document.body.appendChild(results);
        Coveo.CNL.Web.Scripts.Ajax.Profiler._s_Results = results;
        Coveo.CNL.Web.Scripts.Ajax.Profiler._s_Current = null;
    },
    
    _logInternal: function Coveo_CNL_Web_Scripts_Ajax_Profiler$_logInternal(p_Message) {
        /// <summary>
        /// Logs an event.
        /// </summary>
        /// <param name="p_Message" type="String">
        /// The message of the event to log.
        /// </param>
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Message);
        var delta = new Date().getTime() - this._m_Start.getTime();
        Array.add(this._m_Messages, '+' + delta.toString() + ' - ' + p_Message);
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.PercentTimer

Coveo.CNL.Web.Scripts.Ajax.PercentTimer = function Coveo_CNL_Web_Scripts_Ajax_PercentTimer(p_Duration) {
    /// <summary>
    /// Allows computing the percentage of a process that must last a specific amount of time.
    /// </summary>
    /// <param name="p_Duration" type="Number" integer="true">
    /// The duration of the process (in milliseconds).
    /// </param>
    /// <field name="_m_Duration" type="Number" integer="true">
    /// </field>
    /// <field name="_m_Start" type="Date">
    /// </field>
    /// <field name="_m_Started" type="Boolean">
    /// </field>
    Coveo.CNL.Web.Scripts.CNLAssert.check(p_Duration > 0);
    this._m_Duration = p_Duration;
}
Coveo.CNL.Web.Scripts.Ajax.PercentTimer.prototype = {
    _m_Duration: 0,
    _m_Start: null,
    _m_Started: false,
    
    ensureStarted: function Coveo_CNL_Web_Scripts_Ajax_PercentTimer$ensureStarted() {
        /// <summary>
        /// Ensures that the timer is started.
        /// </summary>
        if (!this._m_Started) {
            this._m_Start = new Date();
            this._m_Started = true;
        }
    },
    
    getPercentage: function Coveo_CNL_Web_Scripts_Ajax_PercentTimer$getPercentage() {
        /// <summary>
        /// Computes the current percentage.
        /// </summary>
        /// <returns type="Number"></returns>
        Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_Started);
        var delta = new Date().getTime() - this._m_Start.getTime();
        return (delta < this._m_Duration) ? delta / this._m_Duration : 1;
    },
    
    isFinished: function Coveo_CNL_Web_Scripts_Ajax_PercentTimer$isFinished() {
        /// <summary>
        /// Checks if the process should be finished.
        /// </summary>
        /// <returns type="Boolean"></returns>
        Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_Started);
        return this.getPercentage() >= 1;
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.UpdateDebugger

Coveo.CNL.Web.Scripts.Ajax.UpdateDebugger = function Coveo_CNL_Web_Scripts_Ajax_UpdateDebugger(p_Flipper, p_Info) {
    /// <summary>
    /// Pseudo transition effect that displays why a control or region is being updated.
    /// </summary>
    /// <param name="p_Flipper" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// The <see cref="T:Coveo.CNL.Web.Scripts.Ajax.IContentFlipper" /> that flips the content.
    /// </param>
    /// <param name="p_Info" type="String">
    /// The information to display on the content.
    /// </param>
    /// <field name="_displaY_DELAY$2" type="Number" integer="true" static="true">
    /// </field>
    /// <field name="_m_Flipper$2" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// </field>
    /// <field name="_m_Info$2" type="String">
    /// </field>
    /// <field name="_m_Overlay$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Timeout$2" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    Coveo.CNL.Web.Scripts.Ajax.UpdateDebugger.initializeBase(this);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Info);
    this._m_Flipper$2 = p_Flipper;
    this._m_Info$2 = p_Info;
}
Coveo.CNL.Web.Scripts.Ajax.UpdateDebugger.prototype = {
    _m_Flipper$2: null,
    _m_Info$2: null,
    _m_Overlay$2: null,
    _m_Timeout$2: null,
    
    beginTransition: function Coveo_CNL_Web_Scripts_Ajax_UpdateDebugger$beginTransition() {
        var elem = this._m_Flipper$2.flip();
        this._m_Overlay$2 = document.createElement('div');
        this._m_Overlay$2.style.position = 'absolute';
        this._m_Overlay$2.style.zIndex = 999;
        this._m_Overlay$2.style.border = '2px solid red';
        this._m_Overlay$2.style.padding = '5px';
        document.body.appendChild(this._m_Overlay$2);
        Coveo.CNL.Web.Scripts.DOMUtilities.setElementBounds(this._m_Overlay$2, Coveo.CNL.Web.Scripts.DOMUtilities.getElementBounds(elem));
        var info = document.createElement('span');
        info.style.fontFamily = 'verdana';
        info.style.fontWeight = 'bold';
        info.style.fontSize = '8pt';
        info.style.color = 'white';
        info.style.backgroundColor = 'black';
        info.innerText = this._m_Info$2;
        this._m_Overlay$2.appendChild(info);
        this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.UpdateDebugger._displaY_DELAY$2);
    },
    
    endTransition: function Coveo_CNL_Web_Scripts_Ajax_UpdateDebugger$endTransition() {
        if (this._m_Timeout$2 != null) {
            this._m_Timeout$2.cancel();
            this._m_Timeout$2 = null;
        }
        this._m_Overlay$2.parentNode.removeChild(this._m_Overlay$2);
    },
    
    _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_UpdateDebugger$_timerCallback$2() {
        /// <summary>
        /// Callback for the timer we use.
        /// </summary>
        this._m_Timeout$2 = null;
        this.terminate();
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.FlipFadeTransition

Coveo.CNL.Web.Scripts.Ajax.FlipFadeTransition = function Coveo_CNL_Web_Scripts_Ajax_FlipFadeTransition(p_Element, p_Flipper) {
    /// <summary>
    /// Transition effect that flips in the new content and gradually fades it in.
    /// </summary>
    /// <param name="p_Element" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> that we flip.
    /// </param>
    /// <param name="p_Flipper" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// The <see cref="T:Coveo.CNL.Web.Scripts.Ajax.IContentFlipper" /> that flips the content.
    /// </param>
    /// <field name="_framE_DELAY$2" type="Number" integer="true" static="true">
    /// </field>
    /// <field name="_m_Flipper$2" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// </field>
    /// <field name="_m_Element$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Overlay$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Timeout$2" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    /// <field name="_m_Percent$2" type="Coveo.CNL.Web.Scripts.Ajax.PercentTimer">
    /// </field>
    Coveo.CNL.Web.Scripts.Ajax.FlipFadeTransition.initializeBase(this);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper);
    this._m_Element$2 = p_Element;
    this._m_Flipper$2 = p_Flipper;
}
Coveo.CNL.Web.Scripts.Ajax.FlipFadeTransition.prototype = {
    _m_Flipper$2: null,
    _m_Element$2: null,
    _m_Overlay$2: null,
    _m_Timeout$2: null,
    _m_Percent$2: null,
    
    beginTransition: function Coveo_CNL_Web_Scripts_Ajax_FlipFadeTransition$beginTransition() {
        if (!Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE()) {
            Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Flipper$2.get_newContent(), 0);
        }
        this._m_Element$2 = this._m_Flipper$2.flip();
        if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE()) {
            this._m_Overlay$2 = document.createElement('div');
            this._m_Overlay$2.style.backgroundColor = 'white';
            this._m_Overlay$2.style.position = 'absolute';
            this._m_Overlay$2.style.zIndex = 999;
            document.body.appendChild(this._m_Overlay$2);
            Coveo.CNL.Web.Scripts.DOMUtilities.setElementBounds(this._m_Overlay$2, Coveo.CNL.Web.Scripts.DOMUtilities.getElementBounds(this._m_Element$2));
        }
        this._m_Percent$2 = new Coveo.CNL.Web.Scripts.Ajax.PercentTimer(100);
        this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), 0);
    },
    
    endTransition: function Coveo_CNL_Web_Scripts_Ajax_FlipFadeTransition$endTransition() {
        if (this._m_Timeout$2 != null) {
            this._m_Timeout$2.cancel();
            this._m_Timeout$2 = null;
        }
        if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE()) {
            document.body.removeChild(this._m_Overlay$2);
        }
        else {
            this._m_Element$2.style.opacity = '';
        }
    },
    
    _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_FlipFadeTransition$_timerCallback$2() {
        /// <summary>
        /// Callback for the timer we use.
        /// </summary>
        this._m_Percent$2.ensureStarted();
        if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE()) {
            Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Overlay$2, 1 - this._m_Percent$2.getPercentage());
        }
        else {
            Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Element$2, this._m_Percent$2.getPercentage());
        }
        if (!this._m_Percent$2.isFinished()) {
            this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.FlipFadeTransition._framE_DELAY$2);
        }
        else {
            this.terminate();
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.IdMappings

Coveo.CNL.Web.Scripts.Ajax.IdMappings = function Coveo_CNL_Web_Scripts_Ajax_IdMappings() {
    /// <summary>
    /// Implements a dictionary of mappings from a control id (and it's childs) to an object.
    /// </summary>
    /// <field name="_m_Mappings" type="Object">
    /// </field>
    this._m_Mappings = {};
}
Coveo.CNL.Web.Scripts.Ajax.IdMappings.prototype = {
    
    add: function Coveo_CNL_Web_Scripts_Ajax_IdMappings$add(p_Id, p_Value) {
        /// <summary>
        /// Adds a mapping to the list.
        /// </summary>
        /// <param name="p_Id" type="String">
        /// The id for the mapping.
        /// </param>
        /// <param name="p_Value" type="Object">
        /// The object to which it is mapped.
        /// </param>
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Id);
        this._m_Mappings[p_Id] = p_Value;
    },
    
    remove: function Coveo_CNL_Web_Scripts_Ajax_IdMappings$remove(p_Id) {
        /// <summary>
        /// Remvoes a mapping from the list.
        /// </summary>
        /// <param name="p_Id" type="String">
        /// The id for the mapping.
        /// </param>
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Id);
        delete this._m_Mappings[p_Id];
    },
    
    get: function Coveo_CNL_Web_Scripts_Ajax_IdMappings$get(p_Id) {
        /// <summary>
        /// Gets the mapped value for an id.
        /// </summary>
        /// <param name="p_Id" type="String">
        /// The id for which to retrieve the mapped value.
        /// </param>
        /// <returns type="Object"></returns>
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Id);
        var value = null;
        var matched = null;
        var $dict1 = this._m_Mappings;
        for (var $key2 in $dict1) {
            var entry = { key: $key2, value: $dict1[$key2] };
            if ((matched == null || entry.key.length > matched.length) && p_Id.startsWith(entry.key)) {
                value = entry.value;
            }
        }
        return value;
    },
    
    clear: function Coveo_CNL_Web_Scripts_Ajax_IdMappings$clear() {
        /// <summary>
        /// Clears the mappings.
        /// </summary>
        this._m_Mappings = {};
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.Feedback

Coveo.CNL.Web.Scripts.Ajax.Feedback = function Coveo_CNL_Web_Scripts_Ajax_Feedback() {
    /// <summary>
    /// Base class for all feedbacks.
    /// </summary>
    /// <field name="_initiaL_DELAY$1" type="Number" integer="true" static="true">
    /// </field>
    /// <field name="_m_Timeout$1" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    Coveo.CNL.Web.Scripts.Ajax.Feedback.initializeBase(this);
}
Coveo.CNL.Web.Scripts.Ajax.Feedback.create = function Coveo_CNL_Web_Scripts_Ajax_Feedback$create(p_Id, p_Type, p_Target, p_Fullscreen, p_Text, p_Image) {
    /// <summary>
    /// Creates a <see cref="T:Coveo.CNL.Web.Scripts.Ajax.Feedback" /> object.
    /// </summary>
    /// <param name="p_Id" type="String">
    /// The id of the element.
    /// </param>
    /// <param name="p_Type" type="String">
    /// The type of the feedback.
    /// </param>
    /// <param name="p_Target" type="String">
    /// The target control of the feedback.
    /// </param>
    /// <param name="p_Fullscreen" type="Boolean">
    /// Whether to display the feedback in fullscreen mode.
    /// </param>
    /// <param name="p_Text" type="String">
    /// The optional text to display.
    /// </param>
    /// <param name="p_Image" type="String">
    /// The optional uri of the image to use.
    /// </param>
    /// <returns type="Coveo.CNL.Web.Scripts.Ajax.Feedback"></returns>
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Id);
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Type);
    var feedback;
    switch (p_Type) {
        case 'Blank':
            Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Image);
            feedback = new Coveo.CNL.Web.Scripts.Ajax.BlankFeedback(document.getElementById(p_Id), p_Fullscreen, p_Image);
            break;
        case 'Processing':
            Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Target);
            Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Text);
            feedback = new Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack(document.getElementById(p_Target), p_Text);
            break;
        default:
            Coveo.CNL.Web.Scripts.CNLAssert.fail();
            Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Image);
            feedback = new Coveo.CNL.Web.Scripts.Ajax.BlankFeedback(document.getElementById(p_Id), p_Fullscreen, p_Image);
            break;
    }
    return feedback;
}
Coveo.CNL.Web.Scripts.Ajax.Feedback.prototype = {
    _m_Timeout$1: null,
    
    beginProcess: function Coveo_CNL_Web_Scripts_Ajax_Feedback$beginProcess() {
        this._m_Timeout$1 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$1), Coveo.CNL.Web.Scripts.Ajax.Feedback._initiaL_DELAY$1);
    },
    
    endProcess: function Coveo_CNL_Web_Scripts_Ajax_Feedback$endProcess() {
        if (this._m_Timeout$1 != null) {
            this._m_Timeout$1.cancel();
            this._m_Timeout$1 = null;
        }
        else {
            this.endFeedback();
        }
    },
    
    _timerCallback$1: function Coveo_CNL_Web_Scripts_Ajax_Feedback$_timerCallback$1() {
        /// <summary>
        /// Callback for the timer we use.
        /// </summary>
        this._m_Timeout$1 = null;
        this.beginFeedback();
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.FadeInTransition

Coveo.CNL.Web.Scripts.Ajax.FadeInTransition = function Coveo_CNL_Web_Scripts_Ajax_FadeInTransition(p_Element, p_Flipper) {
    /// <summary>
    /// Transition effect that fades in the new content.
    /// </summary>
    /// <param name="p_Element" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> that we flip.
    /// </param>
    /// <param name="p_Flipper" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// The <see cref="T:Coveo.CNL.Web.Scripts.Ajax.IContentFlipper" /> that flips the content.
    /// </param>
    /// <field name="_framE_DELAY$2" type="Number" integer="true" static="true">
    /// </field>
    /// <field name="_m_Flipper$2" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// </field>
    /// <field name="_m_Element$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Timeout$2" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    /// <field name="_m_Percent$2" type="Coveo.CNL.Web.Scripts.Ajax.PercentTimer">
    /// </field>
    Coveo.CNL.Web.Scripts.Ajax.FadeInTransition.initializeBase(this);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper);
    this._m_Element$2 = p_Element;
    this._m_Flipper$2 = p_Flipper;
}
Coveo.CNL.Web.Scripts.Ajax.FadeInTransition.prototype = {
    _m_Flipper$2: null,
    _m_Element$2: null,
    _m_Timeout$2: null,
    _m_Percent$2: null,
    
    beginTransition: function Coveo_CNL_Web_Scripts_Ajax_FadeInTransition$beginTransition() {
        this._m_Percent$2 = new Coveo.CNL.Web.Scripts.Ajax.PercentTimer(650);
        this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), 0);
    },
    
    endTransition: function Coveo_CNL_Web_Scripts_Ajax_FadeInTransition$endTransition() {
        if (this._m_Timeout$2 != null) {
            this._m_Timeout$2.cancel();
            this._m_Timeout$2 = null;
        }
        Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Element$2, 1);
    },
    
    _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_FadeInTransition$_timerCallback$2() {
        /// <summary>
        /// Callback for the timer we use.
        /// </summary>
        this._m_Percent$2.ensureStarted();
        if (!this._m_Percent$2.isFinished()) {
            Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Element$2, this._m_Percent$2.getPercentage());
            this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.FadeInTransition._framE_DELAY$2);
        }
        else {
            this.terminate();
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.TransitionEffect

Coveo.CNL.Web.Scripts.Ajax.TransitionEffect = function Coveo_CNL_Web_Scripts_Ajax_TransitionEffect() {
    /// <summary>
    /// Base class for all transition effects.
    /// </summary>
    Coveo.CNL.Web.Scripts.Ajax.TransitionEffect.initializeBase(this);
}
Coveo.CNL.Web.Scripts.Ajax.TransitionEffect.create = function Coveo_CNL_Web_Scripts_Ajax_TransitionEffect$create(p_Content, p_Flipper, p_Effect) {
    /// <summary>
    /// Creates a <see cref="T:Coveo.CNL.Web.Scripts.Ajax.TransitionEffect" /> object.
    /// </summary>
    /// <param name="p_Content" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> object to flip.
    /// </param>
    /// <param name="p_Flipper" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// The <see cref="T:Coveo.CNL.Web.Scripts.Ajax.IContentFlipper" /> object to that performs the flip.
    /// </param>
    /// <param name="p_Effect" type="String">
    /// The name of the effect to create.
    /// </param>
    /// <returns type="Coveo.CNL.Web.Scripts.Ajax.TransitionEffect"></returns>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Content);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper);
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Effect);
    var effect;
    switch (p_Effect) {
        case 'None':
            effect = new Coveo.CNL.Web.Scripts.Ajax.FlipTransition(p_Flipper);
            break;
        case 'Expand':
            effect = new Coveo.CNL.Web.Scripts.Ajax.ExpandTransition(p_Flipper);
            break;
        case 'HExpand':
            effect = new Coveo.CNL.Web.Scripts.Ajax.HExpandTransition(p_Flipper);
            break;
        case 'Collapse':
            effect = new Coveo.CNL.Web.Scripts.Ajax.CollapseTransition(p_Content, p_Flipper);
            break;
        case 'HCollapse':
            effect = new Coveo.CNL.Web.Scripts.Ajax.HCollapseTransition(p_Content, p_Flipper);
            break;
        case 'Adjust':
            effect = new Coveo.CNL.Web.Scripts.Ajax.AdjustTransition(p_Content, p_Flipper);
            break;
        case 'HAdjust':
            effect = new Coveo.CNL.Web.Scripts.Ajax.HAdjustTransition(p_Content, p_Flipper);
            break;
        case 'FadeIn':
            effect = new Coveo.CNL.Web.Scripts.Ajax.FadeInTransition(p_Content, p_Flipper);
            break;
        case 'FadeFlip':
            effect = new Coveo.CNL.Web.Scripts.Ajax.FadeFlipTransition(p_Content, p_Flipper);
            break;
        case 'FlipFade':
            effect = new Coveo.CNL.Web.Scripts.Ajax.FlipFadeTransition(p_Content, p_Flipper);
            break;
        default:
            Coveo.CNL.Web.Scripts.CNLAssert.fail();
            effect = new Coveo.CNL.Web.Scripts.Ajax.FlipTransition(p_Flipper);
            break;
    }
    return effect;
}
Coveo.CNL.Web.Scripts.Ajax.TransitionEffect.prototype = {
    
    beginProcess: function Coveo_CNL_Web_Scripts_Ajax_TransitionEffect$beginProcess() {
        this.beginTransition();
    },
    
    endProcess: function Coveo_CNL_Web_Scripts_Ajax_TransitionEffect$endProcess() {
        this.endTransition();
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.GradualFadeInEffect

Coveo.CNL.Web.Scripts.Ajax.GradualFadeInEffect = function Coveo_CNL_Web_Scripts_Ajax_GradualFadeInEffect(p_Element) {
    /// <summary>
    /// Effect that gradually fades in an element.
    /// </summary>
    /// <param name="p_Element" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> that we fade in.
    /// </param>
    /// <field name="_framE_DELAY$2" type="Number" integer="true" static="true">
    /// </field>
    /// <field name="_m_Element$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Duration$2" type="Number" integer="true">
    /// </field>
    /// <field name="_m_TargetOpacity$2" type="Number">
    /// </field>
    /// <field name="_m_Timeout$2" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    /// <field name="_m_Percent$2" type="Coveo.CNL.Web.Scripts.Ajax.PercentTimer">
    /// </field>
    Coveo.CNL.Web.Scripts.Ajax.GradualFadeInEffect.initializeBase(this);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element);
    this._m_Element$2 = p_Element;
}
Coveo.CNL.Web.Scripts.Ajax.GradualFadeInEffect.prototype = {
    _m_Element$2: null,
    _m_Duration$2: 200,
    _m_TargetOpacity$2: 1,
    _m_Timeout$2: null,
    _m_Percent$2: null,
    
    get_duration: function Coveo_CNL_Web_Scripts_Ajax_GradualFadeInEffect$get_duration() {
        /// <summary>
        /// The duration of the effect in milliseconds.
        /// </summary>
        /// <value type="Number" integer="true"></value>
        return this._m_Duration$2;
    },
    set_duration: function Coveo_CNL_Web_Scripts_Ajax_GradualFadeInEffect$set_duration(value) {
        /// <summary>
        /// The duration of the effect in milliseconds.
        /// </summary>
        /// <value type="Number" integer="true"></value>
        this._m_Duration$2 = value;
        return value;
    },
    
    get_targetOpacity: function Coveo_CNL_Web_Scripts_Ajax_GradualFadeInEffect$get_targetOpacity() {
        /// <summary>
        /// The target opacity of the element.
        /// </summary>
        /// <value type="Number"></value>
        return this._m_TargetOpacity$2;
    },
    set_targetOpacity: function Coveo_CNL_Web_Scripts_Ajax_GradualFadeInEffect$set_targetOpacity(value) {
        /// <summary>
        /// The target opacity of the element.
        /// </summary>
        /// <value type="Number"></value>
        this._m_TargetOpacity$2 = value;
        return value;
    },
    
    beginTransition: function Coveo_CNL_Web_Scripts_Ajax_GradualFadeInEffect$beginTransition() {
        this._m_Percent$2 = new Coveo.CNL.Web.Scripts.Ajax.PercentTimer(this._m_Duration$2);
        this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), 0);
    },
    
    endTransition: function Coveo_CNL_Web_Scripts_Ajax_GradualFadeInEffect$endTransition() {
        if (this._m_Timeout$2 != null) {
            this._m_Timeout$2.cancel();
            this._m_Timeout$2 = null;
        }
        Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Element$2, this._m_TargetOpacity$2);
    },
    
    _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_GradualFadeInEffect$_timerCallback$2() {
        /// <summary>
        /// Callback for the timer we use.
        /// </summary>
        this._m_Percent$2.ensureStarted();
        Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Element$2, this._m_Percent$2.getPercentage() * this._m_TargetOpacity$2);
        if (!this._m_Percent$2.isFinished()) {
            this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.GradualFadeInEffect._framE_DELAY$2);
        }
        else {
            this.terminate();
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.ScriptLoaderWrapper

Coveo.CNL.Web.Scripts.Ajax.ScriptLoaderWrapper = function Coveo_CNL_Web_Scripts_Ajax_ScriptLoaderWrapper() {
    /// <summary>
    /// Wraps a <see cref="T:Coveo.CNL.Web.Scripts.ScriptLoader" /> object to make it an <see cref="T:Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcess" />.
    /// </summary>
    /// <field name="_m_Uris$1" type="Array">
    /// </field>
    /// <field name="_m_Loader$1" type="Coveo.CNL.Web.Scripts.ScriptLoader">
    /// </field>
    this._m_Uris$1 = [];
    Coveo.CNL.Web.Scripts.Ajax.ScriptLoaderWrapper.initializeBase(this);
}
Coveo.CNL.Web.Scripts.Ajax.ScriptLoaderWrapper.prototype = {
    _m_Loader$1: null,
    
    add: function Coveo_CNL_Web_Scripts_Ajax_ScriptLoaderWrapper$add(p_Uri) {
        /// <summary>
        /// Adds the uri of a script to load.
        /// </summary>
        /// <param name="p_Uri" type="String">
        /// The uri of the script to load.
        /// </param>
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Uri);
        Array.add(this._m_Uris$1, p_Uri);
    },
    
    beginProcess: function Coveo_CNL_Web_Scripts_Ajax_ScriptLoaderWrapper$beginProcess() {
        Coveo.CNL.Web.Scripts.CNLAssert.isNull(this._m_Loader$1);
        var uris = new Array(this._m_Uris$1.length);
        for (var i = 0; i < this._m_Uris$1.length; ++i) {
            uris[i] = this._m_Uris$1[i];
        }
        this._m_Loader$1 = new Coveo.CNL.Web.Scripts.ScriptLoader(uris);
        this._m_Loader$1.load(false, 0, Function.createDelegate(this, this._scriptsLoadedCallback$1), Function.createDelegate(this, this._scriptsLoadedCallback$1));
    },
    
    endProcess: function Coveo_CNL_Web_Scripts_Ajax_ScriptLoaderWrapper$endProcess() {
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_Loader$1);
        this._m_Loader$1.dispose();
        this._m_Loader$1 = null;
    },
    
    _scriptsLoadedCallback$1: function Coveo_CNL_Web_Scripts_Ajax_ScriptLoaderWrapper$_scriptsLoadedCallback$1() {
        /// <summary>
        /// Callback for when all scripts are loaded.
        /// </summary>
        this.terminate();
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.ModalBox

Coveo.CNL.Web.Scripts.Ajax.ModalBox = function Coveo_CNL_Web_Scripts_Ajax_ModalBox(p_Manager, p_Id, p_Content, p_Width, p_Height, p_HorizontalMargin, p_VerticalMargin, p_EnableOutsideClick) {
    /// <summary>
    /// Encapsulates modal dialog box displayed on the page.
    /// </summary>
    /// <param name="p_Manager" type="Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript">
    /// The <see cref="T:Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript" /> object.
    /// </param>
    /// <param name="p_Id" type="String">
    /// The unique identifier of the modal box.
    /// </param>
    /// <param name="p_Content" type="String">
    /// The html content of the box.
    /// </param>
    /// <param name="p_Width" type="Number" integer="true">
    /// The width of the box.
    /// </param>
    /// <param name="p_Height" type="Number" integer="true">
    /// The height of the box.
    /// </param>
    /// <param name="p_HorizontalMargin" type="Number" integer="true">
    /// The horizontal margin from the border of the window.
    /// </param>
    /// <param name="p_VerticalMargin" type="Number" integer="true">
    /// The vertical margin from the border of the window.
    /// </param>
    /// <param name="p_EnableOutsideClick" type="Boolean">
    /// Whether the OutsideClick event should be fiered.
    /// </param>
    /// <field name="_m_Manager" type="Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript">
    /// </field>
    /// <field name="_m_Id" type="String">
    /// </field>
    /// <field name="_m_Content" type="String">
    /// </field>
    /// <field name="_m_Width" type="Number" integer="true">
    /// </field>
    /// <field name="_m_Height" type="Number" integer="true">
    /// </field>
    /// <field name="_m_HorizontalMargin" type="Number" integer="true">
    /// </field>
    /// <field name="_m_VerticalMargin" type="Number" integer="true">
    /// </field>
    /// <field name="_m_Dimmer" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Container" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Frame" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_InitialOverflow" type="String">
    /// </field>
    /// <field name="_m_EnableOutsideClick" type="Boolean">
    /// </field>
    /// <field name="_m_IFrame" type="Object" domElement="true">
    /// </field>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Manager);
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Id);
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Content);
    Coveo.CNL.Web.Scripts.CNLAssert.check(p_Width !== 0 || (p_HorizontalMargin + p_VerticalMargin) !== 0);
    Coveo.CNL.Web.Scripts.CNLAssert.check(!(p_Height !== 0 && (p_HorizontalMargin + p_VerticalMargin) !== 0));
    this._m_Manager = p_Manager;
    this._m_Id = p_Id;
    this._m_Content = p_Content;
    this._m_Width = p_Width;
    this._m_Height = p_Height;
    this._m_HorizontalMargin = p_HorizontalMargin;
    this._m_VerticalMargin = p_VerticalMargin;
    this._m_EnableOutsideClick = p_EnableOutsideClick;
}
Coveo.CNL.Web.Scripts.Ajax.ModalBox.prototype = {
    _m_Manager: null,
    _m_Id: null,
    _m_Content: null,
    _m_Width: 0,
    _m_Height: 0,
    _m_HorizontalMargin: 0,
    _m_VerticalMargin: 0,
    _m_Dimmer: null,
    _m_Container: null,
    _m_Frame: null,
    _m_InitialOverflow: null,
    _m_EnableOutsideClick: false,
    _m_IFrame: null,
    
    get_id: function Coveo_CNL_Web_Scripts_Ajax_ModalBox$get_id() {
        /// <summary>
        /// The unique identifier for the modal box.
        /// </summary>
        /// <value type="String"></value>
        return this._m_Id;
    },
    
    get_visible: function Coveo_CNL_Web_Scripts_Ajax_ModalBox$get_visible() {
        /// <summary>
        /// This property is true when the box is visible.
        /// </summary>
        /// <value type="Boolean"></value>
        return this._m_Frame != null;
    },
    
    show: function Coveo_CNL_Web_Scripts_Ajax_ModalBox$show() {
        /// <summary>
        /// Shows the modal box.
        /// </summary>
        Coveo.CNL.Web.Scripts.CNLAssert.check(!this.get_visible());
        if (Coveo.CNL.Web.Scripts.BrowserHelper.get_standardMode()) {
            var scroll = Coveo.CNL.Web.Scripts.DOMUtilities.getScrollingAmount();
            this._m_InitialOverflow = document.documentElement.style.overflow;
            document.documentElement.style.overflow = 'hidden';
            document.documentElement.scrollLeft = scroll.width;
            document.documentElement.scrollTop = scroll.height;
        }
        else {
            var scroll = Coveo.CNL.Web.Scripts.DOMUtilities.getScrollingAmount();
            this._m_InitialOverflow = document.body.style.overflow;
            document.body.style.overflow = 'hidden';
            document.body.scrollLeft = scroll.width;
            document.body.scrollTop = scroll.height;
        }
        if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE6()) {
            this._m_IFrame = document.createElement('iframe');
            this._m_IFrame.getAttributeNode('src').value = 'javascript:false;';
            this._m_IFrame.getAttributeNode('scrolling').value = 'no';
            this._m_IFrame.style.position = 'absolute';
            this._m_IFrame.style.zIndex = Coveo.CNL.Web.Scripts.DOMUtilities.getNextHighestZindex();
            this._m_IFrame.style.display = 'none';
            this._m_IFrame.style.border = '0';
            this._m_IFrame.style.display = 'block';
            this._m_IFrame.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';
            Coveo.CNL.Web.Scripts.DOMUtilities.coverAllWindow(this._m_IFrame);
            document.body.appendChild(this._m_IFrame);
        }
        this._m_Dimmer = document.createElement('div');
        Coveo.CNL.Web.Scripts.DOMUtilities.coverAllWindow(this._m_Dimmer);
        this._m_Dimmer.style.backgroundColor = 'silver';
        this._m_Dimmer.style.zIndex = Coveo.CNL.Web.Scripts.DOMUtilities.getNextHighestZindex();
        Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Dimmer, 0.75);
        document.body.appendChild(this._m_Dimmer);
        this._m_Container = document.createElement('div');
        Coveo.CNL.Web.Scripts.DOMUtilities.coverAllWindow(this._m_Container);
        this._m_Container.style.zIndex = (Coveo.CNL.Web.Scripts.DOMUtilities.getNextHighestZindex() + 1);
        this._m_Manager.get_form().appendChild(this._m_Container);
        var table = document.createElement('table');
        table.style.width = '100%';
        table.style.height = '100%';
        var row = table.insertRow(0);
        var cell = row.insertCell(0);
        cell.align = 'center';
        this._m_Container.appendChild(table);
        if (this._m_EnableOutsideClick) {
            this._m_Container.attachEvent('onclick', Function.createDelegate(this, this._container_Click));
            this._m_Container.style.cursor = 'pointer';
        }
        this._m_Frame = document.createElement('div');
        if (this._m_Width !== 0) {
            this._m_Frame.style.width = this._m_Width + 'px';
            if (this._m_Height !== 0) {
                this._m_Frame.style.height = this._m_Height + 'px';
            }
        }
        else {
            var size = Coveo.CNL.Web.Scripts.DOMUtilities.getWindowSize();
            this._m_Frame.style.width = (size.width - this._m_HorizontalMargin * 2) + 'px';
            this._m_Frame.style.height = (size.height - this._m_VerticalMargin * 2) + 'px';
        }
        this._m_Frame.style.textAlign = 'left';
        this._m_Frame.style.border = '3px solid gray';
        this._m_Frame.style.backgroundColor = 'white';
        this._m_Frame.style.cursor = 'auto';
        cell.appendChild(this._m_Frame);
        this._m_Frame.innerHTML = this._m_Content;
    },
    
    close: function Coveo_CNL_Web_Scripts_Ajax_ModalBox$close() {
        /// <summary>
        /// Closes the modal box.
        /// </summary>
        Coveo.CNL.Web.Scripts.CNLAssert.check(this.get_visible());
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_Dimmer);
        if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE6()) {
            Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_IFrame);
            this._m_IFrame.parentNode.removeChild(this._m_IFrame);
            this._m_IFrame = null;
        }
        this._m_Dimmer.parentNode.removeChild(this._m_Dimmer);
        this._m_Dimmer = null;
        if (this._m_Container != null) {
            this._m_Container.parentNode.removeChild(this._m_Container);
            this._m_Container = null;
            this._m_Frame = null;
        }
        if (Coveo.CNL.Web.Scripts.BrowserHelper.get_standardMode()) {
            document.documentElement.style.overflow = this._m_InitialOverflow;
        }
        else {
            document.body.style.overflow = this._m_InitialOverflow;
        }
        Coveo.CNL.Web.Scripts.CNLAssert.check(!this.get_visible());
    },
    
    _container_Click: function Coveo_CNL_Web_Scripts_Ajax_ModalBox$_container_Click() {
        if (!this._m_Frame.contains(window.event.srcElement)) {
            this._m_Manager.DPB(this._m_Id, '', false);
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.FlipTransition

Coveo.CNL.Web.Scripts.Ajax.FlipTransition = function Coveo_CNL_Web_Scripts_Ajax_FlipTransition(p_Flipper) {
    /// <summary>
    /// Transition effect that only flips the content.
    /// </summary>
    /// <param name="p_Flipper" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// The <see cref="T:Coveo.CNL.Web.Scripts.Ajax.IContentFlipper" /> that flips the content.
    /// </param>
    /// <field name="_m_Flipper$2" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// </field>
    Coveo.CNL.Web.Scripts.Ajax.FlipTransition.initializeBase(this);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper);
    this._m_Flipper$2 = p_Flipper;
}
Coveo.CNL.Web.Scripts.Ajax.FlipTransition.prototype = {
    _m_Flipper$2: null,
    
    beginTransition: function Coveo_CNL_Web_Scripts_Ajax_FlipTransition$beginTransition() {
        this._m_Flipper$2.flip();
        this.terminate();
    },
    
    endTransition: function Coveo_CNL_Web_Scripts_Ajax_FlipTransition$endTransition() {
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager

Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager = function Coveo_CNL_Web_Scripts_Ajax_AsynchronousProcessManager() {
    /// <summary>
    /// Runs a list of asynchronous processes, and provides a notification when they are done.
    /// </summary>
    /// <field name="_m_Processes" type="Array">
    /// </field>
    /// <field name="_m_Callback" type="Sys.EventHandler">
    /// </field>
    this._m_Processes = [];
}
Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager.prototype = {
    _m_Callback: null,
    
    add: function Coveo_CNL_Web_Scripts_Ajax_AsynchronousProcessManager$add(p_Process) {
        /// <summary>
        /// Adds a process to the list.
        /// </summary>
        /// <param name="p_Process" type="Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcess">
        /// The <see cref="T:Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcess" /> to add.
        /// </param>
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Process);
        p_Process.set_manager(this);
        Array.add(this._m_Processes, p_Process);
    },
    
    startAll: function Coveo_CNL_Web_Scripts_Ajax_AsynchronousProcessManager$startAll(p_Callback) {
        /// <summary>
        /// Starts running the asynchronous processes.
        /// </summary>
        /// <param name="p_Callback" type="Sys.EventHandler">
        /// Callback function to call when done.
        /// </param>
        this._m_Callback = p_Callback;
        if (this._m_Processes.length > 0) {
            var processes = Array.clone(this._m_Processes);
            for (var i = 0; i < processes.length; i++) {
                var process = processes[i];
                process.start();
            }
        }
        else {
            if (this._m_Callback != null) {
                this._m_Callback(this, new Sys.EventArgs());
            }
        }
    },
    
    terminateAll: function Coveo_CNL_Web_Scripts_Ajax_AsynchronousProcessManager$terminateAll() {
        /// <summary>
        /// Stops all the processes.
        /// </summary>
        var processes = Array.clone(this._m_Processes);
        for (var i = 0; i < processes.length; i++) {
            var process = processes[i];
            process.terminate();
        }
        Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_Processes.length === 0);
    },
    
    processIsDone: function Coveo_CNL_Web_Scripts_Ajax_AsynchronousProcessManager$processIsDone(p_Process) {
        /// <summary>
        /// Called whenever a process finishes.
        /// </summary>
        /// <param name="p_Process" type="Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcess">
        /// The process that signals it is done.
        /// </param>
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Process);
        Coveo.CNL.Web.Scripts.CNLAssert.check(Array.contains(this._m_Processes, p_Process));
        Array.remove(this._m_Processes, p_Process);
        if (this._m_Processes.length === 0 && this._m_Callback != null) {
            this._m_Callback(this, new Sys.EventArgs());
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.FadeFlipTransition

Coveo.CNL.Web.Scripts.Ajax.FadeFlipTransition = function Coveo_CNL_Web_Scripts_Ajax_FadeFlipTransition(p_Element, p_Flipper) {
    /// <summary>
    /// Transition effect that fades out the old content and then flips in the new one.
    /// </summary>
    /// <param name="p_Element" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> that we flip.
    /// </param>
    /// <param name="p_Flipper" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// The <see cref="T:Coveo.CNL.Web.Scripts.Ajax.IContentFlipper" /> that flips the content.
    /// </param>
    /// <field name="_framE_DELAY$2" type="Number" integer="true" static="true">
    /// </field>
    /// <field name="_m_Flipper$2" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// </field>
    /// <field name="_m_Element$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Overlay$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Timeout$2" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    /// <field name="_m_Percent$2" type="Coveo.CNL.Web.Scripts.Ajax.PercentTimer">
    /// </field>
    Coveo.CNL.Web.Scripts.Ajax.FadeFlipTransition.initializeBase(this);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper);
    this._m_Element$2 = p_Element;
    this._m_Flipper$2 = p_Flipper;
}
Coveo.CNL.Web.Scripts.Ajax.FadeFlipTransition.prototype = {
    _m_Flipper$2: null,
    _m_Element$2: null,
    _m_Overlay$2: null,
    _m_Timeout$2: null,
    _m_Percent$2: null,
    
    beginTransition: function Coveo_CNL_Web_Scripts_Ajax_FadeFlipTransition$beginTransition() {
        if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE()) {
            this._m_Overlay$2 = document.createElement('div');
            this._m_Overlay$2.style.backgroundColor = 'white';
            this._m_Overlay$2.style.position = 'absolute';
            this._m_Overlay$2.style.zIndex = 999;
            document.body.appendChild(this._m_Overlay$2);
            Coveo.CNL.Web.Scripts.DOMUtilities.setElementBounds(this._m_Overlay$2, Coveo.CNL.Web.Scripts.DOMUtilities.getElementBounds(this._m_Element$2));
        }
        this._m_Percent$2 = new Coveo.CNL.Web.Scripts.Ajax.PercentTimer(150);
        this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), 0);
    },
    
    endTransition: function Coveo_CNL_Web_Scripts_Ajax_FadeFlipTransition$endTransition() {
        if (this._m_Timeout$2 != null) {
            this._m_Timeout$2.cancel();
            this._m_Timeout$2 = null;
        }
        if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE()) {
            this._m_Element$2 = this._m_Flipper$2.flip();
            document.body.removeChild(this._m_Overlay$2);
        }
        else {
            this._m_Element$2 = this._m_Flipper$2.flip();
            this._m_Element$2.style.opacity = '';
        }
    },
    
    _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_FadeFlipTransition$_timerCallback$2() {
        /// <summary>
        /// Callback for the timer we use.
        /// </summary>
        this._m_Percent$2.ensureStarted();
        if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE()) {
            Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Overlay$2, this._m_Percent$2.getPercentage());
        }
        else {
            Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Element$2, 1 - this._m_Percent$2.getPercentage());
        }
        if (!this._m_Percent$2.isFinished()) {
            this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.FadeFlipTransition._framE_DELAY$2);
        }
        else {
            this.terminate();
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.HAdjustTransition

Coveo.CNL.Web.Scripts.Ajax.HAdjustTransition = function Coveo_CNL_Web_Scripts_Ajax_HAdjustTransition(p_Element, p_Flipper) {
    /// <summary>
    /// Transition effect that gradually adjusts the size of an element horizontally.
    /// </summary>
    /// <param name="p_Element" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> that we adjust.
    /// </param>
    /// <param name="p_Flipper" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// The <see cref="T:Coveo.CNL.Web.Scripts.Ajax.IContentFlipper" /> that flips the content.
    /// </param>
    /// <field name="_framE_DELAY$2" type="Number" integer="true" static="true">
    /// </field>
    /// <field name="_m_Flipper$2" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// </field>
    /// <field name="_m_Element$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_InitialWidth$2" type="Number" integer="true">
    /// </field>
    /// <field name="_m_Offset$2" type="Number" integer="true">
    /// </field>
    /// <field name="_m_Margins$2" type="Coveo.CNL.Web.Scripts.TransferMargin">
    /// </field>
    /// <field name="_m_Container$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Timeout$2" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    /// <field name="_m_Percent$2" type="Coveo.CNL.Web.Scripts.Ajax.PercentTimer">
    /// </field>
    Coveo.CNL.Web.Scripts.Ajax.HAdjustTransition.initializeBase(this);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper);
    this._m_Element$2 = p_Element;
    this._m_Flipper$2 = p_Flipper;
}
Coveo.CNL.Web.Scripts.Ajax.HAdjustTransition.prototype = {
    _m_Flipper$2: null,
    _m_Element$2: null,
    _m_InitialWidth$2: 0,
    _m_Offset$2: 0,
    _m_Margins$2: null,
    _m_Container$2: null,
    _m_Timeout$2: null,
    _m_Percent$2: null,
    
    beginTransition: function Coveo_CNL_Web_Scripts_Ajax_HAdjustTransition$beginTransition() {
        this._m_InitialWidth$2 = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this._m_Element$2).width;
        this._m_Element$2 = this._m_Flipper$2.flip();
        this._m_Offset$2 = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this._m_Element$2).width - this._m_InitialWidth$2;
        this._m_Container$2 = document.createElement('div');
        this._m_Container$2.style.overflow = 'hidden';
        this._m_Container$2.style.width = this._m_InitialWidth$2 + 'px';
        this._m_Margins$2 = new Coveo.CNL.Web.Scripts.TransferMargin(this._m_Element$2, this._m_Container$2);
        this._m_Element$2.parentNode.replaceChild(this._m_Container$2, this._m_Element$2);
        this._m_Container$2.appendChild(this._m_Element$2);
        this._m_Percent$2 = new Coveo.CNL.Web.Scripts.Ajax.PercentTimer(300);
        this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), 0);
    },
    
    endTransition: function Coveo_CNL_Web_Scripts_Ajax_HAdjustTransition$endTransition() {
        if (this._m_Timeout$2 != null) {
            this._m_Timeout$2.cancel();
            this._m_Timeout$2 = null;
        }
        this._m_Margins$2.restore();
        this._m_Container$2.parentNode.replaceChild(this._m_Element$2, this._m_Container$2);
    },
    
    _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_HAdjustTransition$_timerCallback$2() {
        /// <summary>
        /// Callback for the timer we use.
        /// </summary>
        this._m_Percent$2.ensureStarted();
        this._m_Container$2.style.width = ((this._m_InitialWidth$2 + this._m_Offset$2 * Math.sin(Math.PI * this._m_Percent$2.getPercentage() / 2))).toString() + 'px';
        if (!this._m_Percent$2.isFinished()) {
            this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.HAdjustTransition._framE_DELAY$2);
        }
        else {
            this.terminate();
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.HCollapseTransition

Coveo.CNL.Web.Scripts.Ajax.HCollapseTransition = function Coveo_CNL_Web_Scripts_Ajax_HCollapseTransition(p_Element, p_Flipper) {
    /// <summary>
    /// Transition effect that collapses a tag horizontally from it's normal size to nothing.
    /// </summary>
    /// <param name="p_Element" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> that we collapse.
    /// </param>
    /// <param name="p_Flipper" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// The <see cref="T:Coveo.CNL.Web.Scripts.Ajax.IContentFlipper" /> that flips the content.
    /// </param>
    /// <field name="_framE_DELAY$2" type="Number" integer="true" static="true">
    /// </field>
    /// <field name="_m_Flipper$2" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// </field>
    /// <field name="_m_Element$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_InitialWidth$2" type="Number" integer="true">
    /// </field>
    /// <field name="_m_Margins$2" type="Coveo.CNL.Web.Scripts.TransferMargin">
    /// </field>
    /// <field name="_m_Container$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Timeout$2" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    /// <field name="_m_Percent$2" type="Coveo.CNL.Web.Scripts.Ajax.PercentTimer">
    /// </field>
    Coveo.CNL.Web.Scripts.Ajax.HCollapseTransition.initializeBase(this);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper);
    this._m_Element$2 = p_Element;
    this._m_Flipper$2 = p_Flipper;
}
Coveo.CNL.Web.Scripts.Ajax.HCollapseTransition.prototype = {
    _m_Flipper$2: null,
    _m_Element$2: null,
    _m_InitialWidth$2: 0,
    _m_Margins$2: null,
    _m_Container$2: null,
    _m_Timeout$2: null,
    _m_Percent$2: null,
    
    beginTransition: function Coveo_CNL_Web_Scripts_Ajax_HCollapseTransition$beginTransition() {
        this._m_InitialWidth$2 = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this._m_Element$2).width;
        this._m_Container$2 = document.createElement('div');
        this._m_Container$2.style.overflow = 'hidden';
        this._m_Container$2.style.width = this._m_InitialWidth$2 + 'px';
        this._m_Margins$2 = new Coveo.CNL.Web.Scripts.TransferMargin(this._m_Element$2, this._m_Container$2);
        this._m_Element$2.parentNode.replaceChild(this._m_Container$2, this._m_Element$2);
        this._m_Container$2.appendChild(this._m_Element$2);
        this._m_Percent$2 = new Coveo.CNL.Web.Scripts.Ajax.PercentTimer(300);
        this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), 0);
    },
    
    endTransition: function Coveo_CNL_Web_Scripts_Ajax_HCollapseTransition$endTransition() {
        if (this._m_Timeout$2 != null) {
            this._m_Timeout$2.cancel();
            this._m_Timeout$2 = null;
        }
        this._m_Margins$2.restore();
        this._m_Container$2.parentNode.replaceChild(this._m_Flipper$2.flip(), this._m_Container$2);
    },
    
    _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_HCollapseTransition$_timerCallback$2() {
        /// <summary>
        /// Callback for the timer we use.
        /// </summary>
        this._m_Percent$2.ensureStarted();
        this._m_Container$2.style.width = ((this._m_InitialWidth$2 * Math.cos(Math.PI * this._m_Percent$2.getPercentage() / 2))).toString() + 'px';
        if (!this._m_Percent$2.isFinished()) {
            this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.HCollapseTransition._framE_DELAY$2);
        }
        else {
            this.terminate();
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.HExpandTransition

Coveo.CNL.Web.Scripts.Ajax.HExpandTransition = function Coveo_CNL_Web_Scripts_Ajax_HExpandTransition(p_Flipper) {
    /// <summary>
    /// Transition effect that expands a tag horizontally from nothing to it's normal size.
    /// </summary>
    /// <param name="p_Flipper" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// The <see cref="T:Coveo.CNL.Web.Scripts.Ajax.IContentFlipper" /> that flips the content.
    /// </param>
    /// <field name="_framE_DELAY$2" type="Number" integer="true" static="true">
    /// </field>
    /// <field name="_m_Flipper$2" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// </field>
    /// <field name="_m_Element$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_TargetWidth$2" type="Number" integer="true">
    /// </field>
    /// <field name="_m_Margins$2" type="Coveo.CNL.Web.Scripts.TransferMargin">
    /// </field>
    /// <field name="_m_Container$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Timeout$2" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    /// <field name="_m_Percent$2" type="Coveo.CNL.Web.Scripts.Ajax.PercentTimer">
    /// </field>
    Coveo.CNL.Web.Scripts.Ajax.HExpandTransition.initializeBase(this);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper);
    this._m_Flipper$2 = p_Flipper;
}
Coveo.CNL.Web.Scripts.Ajax.HExpandTransition.prototype = {
    _m_Flipper$2: null,
    _m_Element$2: null,
    _m_TargetWidth$2: 0,
    _m_Margins$2: null,
    _m_Container$2: null,
    _m_Timeout$2: null,
    _m_Percent$2: null,
    
    beginTransition: function Coveo_CNL_Web_Scripts_Ajax_HExpandTransition$beginTransition() {
        this._m_Element$2 = this._m_Flipper$2.flip();
        this._m_TargetWidth$2 = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this._m_Element$2).width;
        this._m_Container$2 = document.createElement('div');
        this._m_Container$2.style.overflow = 'hidden';
        this._m_Container$2.style.width = '0px';
        this._m_Margins$2 = new Coveo.CNL.Web.Scripts.TransferMargin(this._m_Element$2, this._m_Container$2);
        this._m_Element$2.parentNode.replaceChild(this._m_Container$2, this._m_Element$2);
        this._m_Container$2.appendChild(this._m_Element$2);
        this._m_Percent$2 = new Coveo.CNL.Web.Scripts.Ajax.PercentTimer(300);
        this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), 0);
    },
    
    endTransition: function Coveo_CNL_Web_Scripts_Ajax_HExpandTransition$endTransition() {
        if (this._m_Timeout$2 != null) {
            this._m_Timeout$2.cancel();
            this._m_Timeout$2 = null;
        }
        this._m_Margins$2.restore();
        this._m_Container$2.parentNode.replaceChild(this._m_Element$2, this._m_Container$2);
    },
    
    _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_HExpandTransition$_timerCallback$2() {
        /// <summary>
        /// Callback for the timer we use.
        /// </summary>
        this._m_Percent$2.ensureStarted();
        this._m_Container$2.style.width = ((this._m_TargetWidth$2 * Math.sin(Math.PI * this._m_Percent$2.getPercentage() / 2))).toString() + 'px';
        if (!this._m_Percent$2.isFinished()) {
            this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.HExpandTransition._framE_DELAY$2);
        }
        else {
            this.terminate();
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.ExpandTransition

Coveo.CNL.Web.Scripts.Ajax.ExpandTransition = function Coveo_CNL_Web_Scripts_Ajax_ExpandTransition(p_Flipper) {
    /// <summary>
    /// Transition effect that expands a tag from nothing to it's normal size.
    /// </summary>
    /// <param name="p_Flipper" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// The <see cref="T:Coveo.CNL.Web.Scripts.Ajax.IContentFlipper" /> that flips the content.
    /// </param>
    /// <field name="_framE_DELAY$2" type="Number" integer="true" static="true">
    /// </field>
    /// <field name="_m_Flipper$2" type="Coveo.CNL.Web.Scripts.Ajax.IContentFlipper">
    /// </field>
    /// <field name="_m_Element$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_TargetHeight$2" type="Number" integer="true">
    /// </field>
    /// <field name="_m_Margins$2" type="Coveo.CNL.Web.Scripts.TransferMargin">
    /// </field>
    /// <field name="_m_Container$2" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Timeout$2" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    /// <field name="_m_Percent$2" type="Coveo.CNL.Web.Scripts.Ajax.PercentTimer">
    /// </field>
    Coveo.CNL.Web.Scripts.Ajax.ExpandTransition.initializeBase(this);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper);
    this._m_Flipper$2 = p_Flipper;
}
Coveo.CNL.Web.Scripts.Ajax.ExpandTransition.prototype = {
    _m_Flipper$2: null,
    _m_Element$2: null,
    _m_TargetHeight$2: 0,
    _m_Margins$2: null,
    _m_Container$2: null,
    _m_Timeout$2: null,
    _m_Percent$2: null,
    
    beginTransition: function Coveo_CNL_Web_Scripts_Ajax_ExpandTransition$beginTransition() {
        this._m_Element$2 = this._m_Flipper$2.flip();
        this._m_Element$2.style.display = 'block';
        this._m_TargetHeight$2 = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this._m_Element$2).height;
        this._m_Container$2 = document.createElement('div');
        this._m_Container$2.style.overflow = 'hidden';
        this._m_Container$2.style.height = '0px';
        this._m_Margins$2 = new Coveo.CNL.Web.Scripts.TransferMargin(this._m_Element$2, this._m_Container$2);
        this._m_Element$2.parentNode.replaceChild(this._m_Container$2, this._m_Element$2);
        this._m_Container$2.appendChild(this._m_Element$2);
        this._m_Percent$2 = new Coveo.CNL.Web.Scripts.Ajax.PercentTimer(300);
        this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), 0);
    },
    
    endTransition: function Coveo_CNL_Web_Scripts_Ajax_ExpandTransition$endTransition() {
        if (this._m_Timeout$2 != null) {
            this._m_Timeout$2.cancel();
            this._m_Timeout$2 = null;
        }
        this._m_Margins$2.restore();
        this._m_Container$2.parentNode.replaceChild(this._m_Element$2, this._m_Container$2);
    },
    
    _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_ExpandTransition$_timerCallback$2() {
        /// <summary>
        /// Callback for the timer we use.
        /// </summary>
        this._m_Percent$2.ensureStarted();
        this._m_Container$2.style.height = ((this._m_TargetHeight$2 * Math.sin(Math.PI * this._m_Percent$2.getPercentage() / 2))).toString() + 'px';
        if (!this._m_Percent$2.isFinished()) {
            this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.ExpandTransition._framE_DELAY$2);
        }
        else {
            this.terminate();
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.RegionFlipper

Coveo.CNL.Web.Scripts.Ajax.RegionFlipper = function Coveo_CNL_Web_Scripts_Ajax_RegionFlipper(p_Region, p_Content) {
    /// <summary>
    /// Implementation of <see cref="T:Coveo.CNL.Web.Scripts.Ajax.IContentFlipper" /> for flipping regions.
    /// </summary>
    /// <param name="p_Region" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> of the region to flip.
    /// </param>
    /// <param name="p_Content" type="String">
    /// The new content of the region.
    /// </param>
    /// <field name="_m_Region" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Content" type="String">
    /// </field>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Region);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Content);
    this._m_Region = p_Region;
    this._m_Content = p_Content;
}
Coveo.CNL.Web.Scripts.Ajax.RegionFlipper.prototype = {
    _m_Region: null,
    _m_Content: null,
    
    get_newContent: function Coveo_CNL_Web_Scripts_Ajax_RegionFlipper$get_newContent() {
        /// <value type="Object" domElement="true"></value>
        return this._m_Region;
    },
    
    flip: function Coveo_CNL_Web_Scripts_Ajax_RegionFlipper$flip() {
        /// <returns type="Object" domElement="true"></returns>
        this._m_Region.innerHTML = this._m_Content;
        return this._m_Region;
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.PartialPostBack

Coveo.CNL.Web.Scripts.Ajax.PartialPostBack = function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack(p_Manager, p_Target, p_Argument, p_Feedbacks, p_Timer, p_Preemptive) {
    /// <summary>
    /// Encapsulates a partial postback to the server.
    /// </summary>
    /// <param name="p_Manager" type="Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript">
    /// The <see cref="T:Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript" /> object.
    /// </param>
    /// <param name="p_Target" type="String">
    /// The id of the target control.
    /// </param>
    /// <param name="p_Argument" type="String">
    /// The postback arguments.
    /// </param>
    /// <param name="p_Feedbacks" type="Array">
    /// The feedbacks to display.
    /// </param>
    /// <param name="p_Timer" type="Boolean">
    /// Whether this is a timer postback.
    /// </param>
    /// <param name="p_Preemptive" type="Boolean">
    /// Whether this is a preemptive postback.
    /// </param>
    /// <field name="_s_FirstPartialPostBack" type="Boolean" static="true">
    /// </field>
    /// <field name="_m_Manager" type="Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript">
    /// </field>
    /// <field name="_m_Target" type="String">
    /// </field>
    /// <field name="_m_Argument" type="String">
    /// </field>
    /// <field name="_m_Feedbacks" type="Array">
    /// </field>
    /// <field name="_m_Timer" type="Boolean">
    /// </field>
    /// <field name="_m_Preemptive" type="Boolean">
    /// </field>
    /// <field name="_m_SendControlData" type="Boolean">
    /// </field>
    /// <field name="_m_Callback" type="Coveo.CNL.Web.Scripts.Ajax.PostBackCallback">
    /// </field>
    /// <field name="_m_IgnoreResults" type="Boolean">
    /// </field>
    /// <field name="_m_EnableProgress" type="Boolean">
    /// </field>
    /// <field name="_m_UniqueID" type="String">
    /// </field>
    /// <field name="_m_Request" type="XMLHttpRequest">
    /// </field>
    /// <field name="_m_Response" type="XMLDocument">
    /// </field>
    /// <field name="_m_ReturnValue" type="Object">
    /// </field>
    /// <field name="_m_RequestCompleted" type="Boolean">
    /// </field>
    /// <field name="_m_Cancelling" type="Boolean">
    /// </field>
    /// <field name="_m_PreRequestProcesses" type="Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager">
    /// </field>
    /// <field name="_m_PostRequestProcesses" type="Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager">
    /// </field>
    /// <field name="_m_Profiler" type="Coveo.CNL.Web.Scripts.Ajax.Profiler">
    /// </field>
    /// <field name="headeR_PARTIAL_POSTBACK" type="String" static="true">
    /// The name of the http header sent to identify partial postbacks.
    /// </field>
    /// <field name="headeR_BOOTSTRAP" type="String" static="true">
    /// The name of the http header sent to identify postbacks made from a bootstraped interface.
    /// </field>
    /// <field name="headeR_HISTORY_STATE" type="String" static="true">
    /// The name of the http header sent to identify history state value.
    /// </field>
    /// <field name="headeR_NO_CONTROL_DATA" type="String" static="true">
    /// The name of the http header sent to signal that the page control data hasn't been sent.
    /// </field>
    /// <field name="forM_EVENT_TARGET" type="String" static="true">
    /// The name of the hidden input holding the event target.
    /// </field>
    /// <field name="forM_EVENT_ARGUMENT" type="String" static="true">
    /// The name of the hidden input holding the event argument.
    /// </field>
    /// <field name="forM_VIEW_STATE" type="String" static="true">
    /// The name of the hidden input holding the viewstate.
    /// </field>
    /// <field name="forM_VIEW_STATE_ENCRYPTED" type="String" static="true">
    /// The name of the hidden input indicating that the viewstate is encrypted.
    /// </field>
    /// <field name="forM_REQUEST_DIGEST" type="String" static="true">
    /// The name of the hidden input holding the form request digest.
    /// </field>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Manager);
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Target);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Argument);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Feedbacks);
    this._m_Manager = p_Manager;
    this._m_Target = p_Target;
    this._m_Argument = p_Argument;
    this._m_Feedbacks = p_Feedbacks;
    this._m_Timer = p_Timer;
    this._m_Preemptive = p_Preemptive;
    this._m_UniqueID = (Math.random() * 1000000000).toString(16);
    if (this._m_Manager.get_enableProfiling()) {
        this._m_Profiler = new Coveo.CNL.Web.Scripts.Ajax.Profiler();
    }
}
Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.prototype = {
    _m_Manager: null,
    _m_Target: null,
    _m_Argument: null,
    _m_Feedbacks: null,
    _m_Timer: false,
    _m_Preemptive: false,
    _m_SendControlData: true,
    _m_Callback: null,
    _m_IgnoreResults: false,
    _m_EnableProgress: true,
    _m_UniqueID: null,
    _m_Request: null,
    _m_Response: null,
    _m_ReturnValue: null,
    _m_RequestCompleted: false,
    _m_Cancelling: false,
    _m_PreRequestProcesses: null,
    _m_PostRequestProcesses: null,
    _m_Profiler: null,
    
    get_sendControlData: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$get_sendControlData() {
        /// <summary>
        /// Whether to send the form's control data.
        /// </summary>
        /// <value type="Boolean"></value>
        return this._m_SendControlData;
    },
    set_sendControlData: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$set_sendControlData(value) {
        /// <summary>
        /// Whether to send the form's control data.
        /// </summary>
        /// <value type="Boolean"></value>
        this._m_SendControlData = value;
        return value;
    },
    
    get_callback: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$get_callback() {
        /// <summary>
        /// The callback for the postback.
        /// </summary>
        /// <value type="Coveo.CNL.Web.Scripts.Ajax.PostBackCallback"></value>
        return this._m_Callback;
    },
    set_callback: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$set_callback(value) {
        /// <summary>
        /// The callback for the postback.
        /// </summary>
        /// <value type="Coveo.CNL.Web.Scripts.Ajax.PostBackCallback"></value>
        this._m_Callback = value;
        return value;
    },
    
    get_ignoreResults: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$get_ignoreResults() {
        /// <summary>
        /// Whether to ignore the results of the postback.
        /// </summary>
        /// <value type="Boolean"></value>
        return this._m_IgnoreResults;
    },
    set_ignoreResults: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$set_ignoreResults(value) {
        /// <summary>
        /// Whether to ignore the results of the postback.
        /// </summary>
        /// <value type="Boolean"></value>
        this._m_IgnoreResults = value;
        return value;
    },
    
    get_enableProgress: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$get_enableProgress() {
        /// <summary>
        /// Whether postback progress tracking is enabled.
        /// </summary>
        /// <value type="Boolean"></value>
        return this._m_EnableProgress;
    },
    set_enableProgress: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$set_enableProgress(value) {
        /// <summary>
        /// Whether postback progress tracking is enabled.
        /// </summary>
        /// <value type="Boolean"></value>
        this._m_EnableProgress = value;
        return value;
    },
    
    get_uniqueID: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$get_uniqueID() {
        /// <summary>
        /// Gets the generated unique ID for the request.
        /// </summary>
        /// <value type="String"></value>
        return this._m_UniqueID;
    },
    
    execute: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$execute() {
        /// <summary>
        /// Starts the partial postback.
        /// </summary>
        Coveo.CNL.Web.Scripts.CNLAssert.isNull(this._m_Request);
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Preparing request...');
        if (Coveo.CNL.Web.Scripts.Ajax.PartialPostBack._s_FirstPartialPostBack) {
            (this._m_Manager.get_form()[Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_VIEW_STATE]).value = this._m_Manager.get_initialViewState();
            Coveo.CNL.Web.Scripts.Ajax.PartialPostBack._s_FirstPartialPostBack = false;
        }
        (this._m_Manager.get_form()[Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_EVENT_TARGET]).value = this._m_Target;
        (this._m_Manager.get_form()[Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_EVENT_ARGUMENT]).value = this._m_Argument;
        var postBackUrl = this._m_Manager.get_form().action;
        var hashPos = postBackUrl.indexOf('#');
        if (hashPos !== -1) {
            postBackUrl = postBackUrl.substring(0, hashPos);
        }
        this._m_Request = new XMLHttpRequest();
        this._m_Request.open('POST', postBackUrl, true);
        this._m_Request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        this._m_Request.setRequestHeader(Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.headeR_PARTIAL_POSTBACK, this._m_UniqueID);
        if (this._m_Manager.get_bootstrap()) {
            this._m_Request.setRequestHeader(Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.headeR_BOOTSTRAP, '1');
        }
        if (!this._m_SendControlData) {
            this._m_Request.setRequestHeader(Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.headeR_NO_CONTROL_DATA, '1');
        }
        this._m_Request.onreadystatechange = Function.createDelegate(this, this._requestCallback);
        this._m_Request.send(this._buildPostData());
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Request is sent.');
        this._m_PreRequestProcesses = new Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager();
        for (var i = 0; i < this._m_Feedbacks.length; i++) {
            var feedback = this._m_Feedbacks[i];
            this._m_PreRequestProcesses.add(feedback);
        }
        if (this._m_EnableProgress && this._m_Manager.get_enableProgress()) {
            this._m_PreRequestProcesses.add(new Coveo.CNL.Web.Scripts.Ajax.AjaxProgressScript(this._m_Manager, this));
        }
        Coveo.CNL.Web.Scripts.DOMUtilities.setOperationPendingCursor();
        if (!this._m_IgnoreResults) {
            Coveo.CNL.Web.Scripts.DOMUtilities.incrementBusyCounter();
        }
        this._m_PreRequestProcesses.startAll(null);
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Pre-request processes started.');
    },
    
    cancel: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$cancel() {
        /// <summary>
        /// Cancels the partial postback.
        /// </summary>
        if (!this._m_RequestCompleted) {
            this._m_Cancelling = true;
            this._m_PreRequestProcesses.terminateAll();
            this._m_Request.abort();
            this._m_Request = null;
            Coveo.CNL.Web.Scripts.DOMUtilities.removeOperationPendingCursor();
            if (!this._m_IgnoreResults) {
                Coveo.CNL.Web.Scripts.DOMUtilities.decrementBusyCounter();
            }
        }
        else {
            if (this._m_PostRequestProcesses != null) {
                this._m_PostRequestProcesses.terminateAll();
                this._m_PostRequestProcesses = null;
            }
        }
    },
    
    applyPreemptivePostback: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$applyPreemptivePostback() {
        /// <summary>
        /// Causes a preemptive postback to apply it's result if the response has
        /// already been obtained, or to apply them right away when they are received.
        /// </summary>
        if (this._m_Response != null) {
            this._applyResults();
        }
        else {
            this._m_Preemptive = false;
        }
    },
    
    _buildPostData: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$_buildPostData() {
        /// <summary>
        /// Builds the form data for the postback.
        /// </summary>
        /// <returns type="String"></returns>
        var data = '';
        var elements = this._m_Manager.get_form().elements;
        for (var i = 0; i < elements.length; ++i) {
            var elem = elements[i];
            var name = elem.getAttribute('name');
            if (Coveo.CNL.Web.Scripts.Utilities.isNullOrUndefined(name)) {
                continue;
            }
            if (!this._m_SendControlData && name !== Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_EVENT_TARGET && name !== Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_EVENT_ARGUMENT && name !== Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_VIEW_STATE && name !== Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_VIEW_STATE_ENCRYPTED && name !== Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_REQUEST_DIGEST && !this._m_Manager.shouldAlwaysBeSent(name)) {
                continue;
            }
            if (Coveo.CNL.Web.Scripts.Utilities.equals(elem.tagName, 'input', true)) {
                var value = null;
                var type = elem.getAttribute('type');
                if (!Coveo.CNL.Web.Scripts.Utilities.isNullOrUndefined(type)) {
                    switch (type) {
                        case 'checkbox':
                            if (elem.checked) {
                                value = 'on';
                            }
                            break;
                        case 'radio':
                            if (elem.checked) {
                                value = elem.getAttribute('value');
                            }
                            break;
                        case 'submit':
                        case 'button':
                            break;
                        default:
                            value = elem.value;
                            break;
                    }
                }
                if (!Coveo.CNL.Web.Scripts.Utilities.isNullOrUndefined(value)) {
                    data += '&' + name + '=' + encodeURIComponent(value);
                }
            }
            else if (Coveo.CNL.Web.Scripts.Utilities.equals(elem.tagName, 'select', true)) {
                var select = elem;
                for (var j = 0; j < select.options.length; ++j) {
                    var option = select.options[j];
                    if (option.selected) {
                        var value = (option.value != null) ? option.value : option.innerText;
                        data += '&' + name + '=' + encodeURIComponent(option.value);
                    }
                }
            }
            else if (Coveo.CNL.Web.Scripts.Utilities.equals(elem.tagName, 'textarea', true)) {
                var textArea = elem;
                data += '&' + name + '=' + encodeURIComponent(textArea.value);
            }
        }
        return data;
    },
    
    _requestCallback: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$_requestCallback() {
        /// <summary>
        /// Callback for request events.
        /// </summary>
        if (!this._m_Cancelling && this._m_Request.readyState === 4) {
            Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Response has been received.');
            if (!this._m_IgnoreResults) {
                if (this._m_Request.status === 200) {
                    this._m_Response = this._m_Request.responseXML;
                    if (!this._m_Preemptive) {
                        this._applyResults();
                    }
                }
                else {
                    this._displayAjaxError();
                }
            }
            this._m_PreRequestProcesses.terminateAll();
            this._m_PreRequestProcesses = null;
            Coveo.CNL.Web.Scripts.DOMUtilities.removeOperationPendingCursor();
            Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Pre-request processes terminated.');
            this._m_Request = null;
            this._m_RequestCompleted = true;
        }
    },
    
    _displayAjaxError: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$_displayAjaxError() {
        /// <summary>
        /// Displays an error returned by the server and disables the page completely.
        /// </summary>
        var display;
        var wellKnownError = '';
        var unknownError = '';
        var errorDetails = '';
        if (this._m_Request.status === 500) {
            unknownError = 'An unexpected error occurred. Please reload the page.';
            display = true;
            if (this._m_Request.responseText !== '') {
                errorDetails = this._m_Request.responseText;
            }
            else if (this._m_Request.statusText !== '') {
                errorDetails = 'HTTP ' + this._m_Request.status.toString() + ' ' + this._m_Request.statusText;
            }
            else {
                errorDetails = 'HTTP ' + this._m_Request.status.toString() + ' Unspecified error.';
            }
        }
        else {
            wellKnownError = 'The server is unavailable at the moment.<br/><br/>Reload the page for more information.';
            display = !this._m_Timer;
        }
        if (display) {
            var wellKnown = wellKnownError !== '';
            Coveo.CNL.Web.Scripts.DOMUtilities.scrollAllTheWayUp();
            document.body.style.overflow = 'hidden';
            document.documentElement.style.overflow = 'hidden';
            var fader = document.createElement('div');
            fader.style.backgroundColor = 'silver';
            Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(fader, 0.5);
            fader.style.position = 'absolute';
            fader.style.left = '0px';
            fader.style.top = '0px';
            fader.style.width = '100%';
            fader.style.height = '100%';
            fader.style.zIndex = 9999;
            document.body.appendChild(fader);
            var panel = document.createElement('div');
            panel.style.fontFamily = 'Arial';
            panel.style.fontSize = '12pt';
            panel.style.padding = '15px';
            panel.style.position = 'absolute';
            if (wellKnown) {
                panel.style.border = '3px solid gray';
                panel.style.backgroundColor = 'whitesmoke';
                panel.style.left = '25%';
                panel.style.top = '30%';
                panel.style.width = '50%';
                panel.style.height = '20%';
            }
            else {
                panel.style.border = '3px solid red';
                panel.style.backgroundColor = 'white';
                panel.style.left = '25%';
                panel.style.top = '25%';
                panel.style.width = '50%';
                panel.style.height = '50%';
            }
            panel.style.zIndex = 10000;
            document.body.appendChild(panel);
            var insidePanel = document.createElement('div');
            insidePanel.style.width = '100%';
            insidePanel.style.height = '100%';
            insidePanel.style.overflow = 'auto';
            panel.appendChild(insidePanel);
            var friendlyError = document.createElement('div');
            friendlyError.style.fontWeight = 'bold';
            if (!wellKnown) {
                friendlyError.style.paddingBottom = '5px';
                friendlyError.style.borderBottom = '1px solid gray';
            }
            friendlyError.style.position = 'relative';
            if (!Coveo.CNL.Web.Scripts.BrowserHelper.get_isFirefox()) {
                var friendlyErrorIcon = document.createElement('span');
                friendlyErrorIcon.style.fontFamily = 'Wingdings';
                friendlyErrorIcon.style.fontSize = '2.3em';
                if (!wellKnown) {
                    friendlyErrorIcon.innerHTML = 'M';
                    friendlyErrorIcon.style.color = 'Red';
                }
                else {
                    friendlyErrorIcon.innerHTML = '&#253;';
                    friendlyErrorIcon.style.color = 'Gray';
                }
                friendlyError.appendChild(friendlyErrorIcon);
            }
            var friendlyErrorText = document.createElement('div');
            if (!Coveo.CNL.Web.Scripts.BrowserHelper.get_isFirefox()) {
                friendlyErrorText.style.position = 'absolute';
                friendlyErrorText.style.top = '11px';
                friendlyErrorText.style.left = '45px';
            }
            friendlyErrorText.innerHTML = (wellKnown) ? wellKnownError : unknownError;
            friendlyError.appendChild(friendlyErrorText);
            insidePanel.appendChild(friendlyError);
            if (!wellKnown) {
                var fullError = document.createElement('div');
                fullError.innerHTML = errorDetails;
                fullError.style.marginTop = '20px';
                fullError.style.display = 'none';
                fullError.style.fontSize = '0.8em';
                insidePanel.appendChild(fullError);
                var toggle = document.createElement('div');
                toggle.innerHTML = 'Click here to display the full error returned by the server.';
                toggle.style.marginTop = '20px';
                toggle.style.cursor = 'pointer';
                insidePanel.style.fontSize = '0.9em';
                toggle.attachEvent('onclick', Function.createDelegate(this, function() {
                    fullError.style.display = 'block';
                    toggle.style.display = 'none';
                    panel.style.width = '90%';
                    panel.style.height = '90%';
                    panel.style.top = '10px';
                    panel.style.left = '5%';
                }));
                insidePanel.appendChild(toggle);
            }
            eval('if (window.external && window.external.PostBackErrorHandler) { window.external.PostBackErrorHandler(); }');
        }
    },
    
    _applyResults: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$_applyResults() {
        /// <summary>
        /// Applies the result of the postback.
        /// </summary>
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_Response);
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Calling ProcessXmlFromServer...');
        this._processXmlFromServer();
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('ProcessXmlFromServer finished.');
    },
    
    _processXmlFromServer: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$_processXmlFromServer() {
        /// <summary>
        /// Processes the xml sent by the server.
        /// </summary>
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_Response);
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Calling ProcessXmlFromServer on AjaxManagerScript...');
        this._m_PostRequestProcesses = new Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager();
        this._m_Manager._processXmlFromServer(this._m_Response, this._m_PostRequestProcesses);
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('ProcessXmlFromServer on AjaxManagerScript finished.');
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Updating view state...');
        var viewstate = this._m_Response.selectSingleNode('/AjaxManager/ViewState');
        if (viewstate != null) {
            (this._m_Manager.get_form()[Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_VIEW_STATE]).value = viewstate.text;
        }
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing updated controls...');
        var nodes = this._m_Response.selectNodes('/AjaxManager/Updated/Control');
        for (var i = 0; i < nodes.length; ++i) {
            var node = nodes[i];
            var id = (node.attributes.getNamedItem('Id')).value;
            var effect = (node.attributes.getNamedItem('Effect')).value;
            var scope = (node.attributes.getNamedItem('Scope')).value;
            var reason = (node.attributes.getNamedItem('Reason')).value;
            this._m_Manager._tearDownObjectsBelow(scope);
            var target = document.getElementById(id);
            var flipper = new Coveo.CNL.Web.Scripts.Ajax.ControlFlipper(target, node.text);
            if (!this._m_Manager.get_enableUpdateDebugging()) {
                this._m_PostRequestProcesses.add(Coveo.CNL.Web.Scripts.Ajax.TransitionEffect.create(target, flipper, effect));
            }
            else {
                this._m_PostRequestProcesses.add(new Coveo.CNL.Web.Scripts.Ajax.UpdateDebugger(flipper, reason));
            }
            Coveo.CNL.Web.Scripts.Ajax.Profiler.log('    Control ' + id + ' was updated.');
        }
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing updated regions...');
        nodes = this._m_Response.selectNodes('/AjaxManager/Updated/Region');
        for (var i = 0; i < nodes.length; ++i) {
            var node = nodes[i];
            var id = (node.attributes.getNamedItem('Id')).value;
            var effect = (node.attributes.getNamedItem('Effect')).value;
            var scope = (node.attributes.getNamedItem('Scope')).value;
            var reason = (node.attributes.getNamedItem('Reason')).value;
            if (scope !== '') {
                this._m_Manager._tearDownObjectsBelow(scope);
            }
            var target = document.getElementById(id);
            var flipper = new Coveo.CNL.Web.Scripts.Ajax.RegionFlipper(target, node.text);
            if (!this._m_Manager.get_enableUpdateDebugging()) {
                this._m_PostRequestProcesses.add(Coveo.CNL.Web.Scripts.Ajax.TransitionEffect.create(target, new Coveo.CNL.Web.Scripts.Ajax.RegionFlipper(target, node.text), effect));
            }
            else {
                this._m_PostRequestProcesses.add(new Coveo.CNL.Web.Scripts.Ajax.UpdateDebugger(flipper, reason));
            }
            Coveo.CNL.Web.Scripts.Ajax.Profiler.log('    Region ' + id + ' was updated.');
        }
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing modal boxes...');
        nodes = this._m_Response.selectNodes('/AjaxManager/Close/Box');
        for (var i = 0; i < nodes.length; ++i) {
            var node = nodes[i];
            var boxId = (node.attributes.getNamedItem('BoxId')).value;
            this._m_Manager._tearDownObjectsBelow(boxId);
            this._m_Manager.closeModalBox(boxId);
            Coveo.CNL.Web.Scripts.Ajax.Profiler.log('    Modal box ' + boxId + ' was closed.');
        }
        nodes = this._m_Response.selectNodes('/AjaxManager/ModalBoxes/Box');
        for (var i = 0; i < nodes.length; ++i) {
            var node = nodes[i];
            var boxId = (node.attributes.getNamedItem('BoxId')).value;
            var width = Number.parseInvariant((node.attributes.getNamedItem('Width')).value);
            var height = Number.parseInvariant((node.attributes.getNamedItem('Height')).value);
            var horizontalMargin = Number.parseInvariant((node.attributes.getNamedItem('HorizontalMargin')).value);
            var verticalMargin = Number.parseInvariant((node.attributes.getNamedItem('VerticalMargin')).value);
            var EnableOutsideClick = Boolean.parse((node.attributes.getNamedItem('EnableOutsideClick')).value);
            var box = new Coveo.CNL.Web.Scripts.Ajax.ModalBox(this._m_Manager, boxId, node.text, width, height, horizontalMargin, verticalMargin, EnableOutsideClick);
            this._m_Manager.addModalBox(box);
            box.show();
            Coveo.CNL.Web.Scripts.Ajax.Profiler.log('    Modal box ' + boxId + ' was shown.');
        }
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing postback return value...');
        var retval = this._m_Response.selectSingleNode('/AjaxManager/Return');
        var retvalHtml = this._m_Response.selectSingleNode('/AjaxManager/ReturnHtml');
        var retvalXml = this._m_Response.selectSingleNode('/AjaxManager/ReturnXml');
        if (retval != null) {
            var type = (retval.attributes.getNamedItem('Type')).value;
            this._m_ReturnValue = Coveo.CNL.Web.Scripts.MarshalUtilities.unmarshalValue(type, retval.text);
        }
        else if (retvalHtml != null) {
            var elem = document.createElement('div');
            elem.innerHTML = retvalHtml.text;
            this._m_ReturnValue = elem;
        }
        else if (retvalXml != null) {
            this._m_ReturnValue = retvalXml;
        }
        var resetTimerCount = this._m_Response.selectSingleNode('/AjaxManager/ResetTimerCount');
        if (resetTimerCount != null) {
            this._m_Manager.resetTimer();
        }
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Starting Post-request processes...');
        this._m_PostRequestProcesses.startAll(Function.createDelegate(this, this._postOperationsAreDoneCallback));
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Post-request processes started.');
        if (this._m_Response.selectSingleNode('/AjaxManager/ScrollBackUp') != null) {
            Coveo.CNL.Web.Scripts.DOMUtilities.scrollAllTheWayUp();
        }
    },
    
    _postOperationsAreDoneCallback: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$_postOperationsAreDoneCallback(p_Sender, p_Args) {
        /// <summary>
        /// Callback for when all post request operations are done.
        /// </summary>
        /// <param name="p_Sender" type="Object">
        /// </param>
        /// <param name="p_Args" type="Sys.EventArgs">
        /// </param>
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Post-request operations are done.');
        this._m_PostRequestProcesses = null;
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing updated regions to update after everything...');
        var nodes = this._m_Response.selectNodes('/AjaxManager/Updated/RegionAtEnd');
        for (var i = 0; i < nodes.length; ++i) {
            var node = nodes[i];
            var id = (node.attributes.getNamedItem('Id')).value;
            var target = document.getElementById(id);
            target.innerHTML = node.text;
            Coveo.CNL.Web.Scripts.Ajax.Profiler.log('    Region ' + id + ' was updated.');
        }
        this._m_Manager._processXmlForAfterScriptsAreLoaded(this._m_Response);
        this._m_Manager._hookButtonControls();
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('ProcessXmlForAjaxObjects done.');
        if (this._m_Callback != null) {
            this._m_Callback(this._m_ReturnValue);
            Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Postback callback function called.');
        }
        if (!this._m_IgnoreResults) {
            Coveo.CNL.Web.Scripts.DOMUtilities.decrementBusyCounter();
        }
        this._m_Manager.postBackIsFinished();
        if (this._m_Profiler != null) {
            this._m_Profiler.stop();
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax._feedbackInfo

Coveo.CNL.Web.Scripts.Ajax._feedbackInfo = function Coveo_CNL_Web_Scripts_Ajax__feedbackInfo() {
    /// <summary>
    /// Holds information about a feedback
    /// </summary>
    /// <field name="m_Id" type="String">
    /// </field>
    /// <field name="m_Name" type="String">
    /// </field>
    /// <field name="m_Type" type="String">
    /// </field>
    /// <field name="m_Target" type="String">
    /// </field>
    /// <field name="m_Fullscreen" type="Boolean">
    /// </field>
    /// <field name="m_Text" type="String">
    /// </field>
    /// <field name="m_Image" type="String">
    /// </field>
}
Coveo.CNL.Web.Scripts.Ajax._feedbackInfo.prototype = {
    m_Id: null,
    m_Name: null,
    m_Type: null,
    m_Target: null,
    m_Fullscreen: false,
    m_Text: null,
    m_Image: null
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript

Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript = function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript() {
    /// <summary>
    /// Client side code for the AjaxManager class.
    /// </summary>
    /// <field name="_s_Instance" type="Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript" static="true">
    /// </field>
    /// <field name="_s_InitialHistoryEventArgs" type="Sys.HistoryEventArgs" static="true">
    /// </field>
    /// <field name="_m_Id" type="String">
    /// </field>
    /// <field name="_m_Form" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Bootstrap" type="Boolean">
    /// </field>
    /// <field name="_m_FrameworkDoPostBack" type="Coveo.CNL.Web.Scripts.Ajax.PostBackMethod">
    /// </field>
    /// <field name="_m_InitialViewState" type="String">
    /// </field>
    /// <field name="_m_IdSubstitutions" type="Object">
    /// </field>
    /// <field name="_m_PartialOrFullMappings" type="Coveo.CNL.Web.Scripts.Ajax.IdMappings">
    /// </field>
    /// <field name="_m_AlwaysSend" type="Array">
    /// </field>
    /// <field name="_m_Feedbacks" type="Array">
    /// </field>
    /// <field name="_m_FeedbackMappings" type="Coveo.CNL.Web.Scripts.Ajax.IdMappings">
    /// </field>
    /// <field name="_m_FeedbackNameMappings" type="Coveo.CNL.Web.Scripts.Ajax.IdMappings">
    /// </field>
    /// <field name="_m_BlankOnHistory" type="Array">
    /// </field>
    /// <field name="_m_LoadedScripts" type="Object">
    /// </field>
    /// <field name="_m_LoadedStyleSheets" type="Object">
    /// </field>
    /// <field name="_m_AjaxObjects" type="Array">
    /// </field>
    /// <field name="_m_CurrentPostBack" type="Coveo.CNL.Web.Scripts.Ajax.PartialPostBack">
    /// </field>
    /// <field name="_m_ModalBoxes" type="Array">
    /// </field>
    /// <field name="_m_EnableProgress" type="Boolean">
    /// </field>
    /// <field name="_m_ProgressPageUri" type="String">
    /// </field>
    /// <field name="_m_EnableUpdateDebugging" type="Boolean">
    /// </field>
    /// <field name="_m_EnableProfiling" type="Boolean">
    /// </field>
    /// <field name="_m_EnableHistory" type="Boolean">
    /// </field>
    /// <field name="_m_CurrentState" type="String">
    /// </field>
    /// <field name="_m_TimerEnabled" type="Boolean">
    /// </field>
    /// <field name="_m_TimerId" type="Number" integer="true">
    /// </field>
    /// <field name="_m_TimerInterval" type="Number" integer="true">
    /// </field>
    /// <field name="_m_TimerTickedCount" type="Number" integer="true">
    /// </field>
    /// <field name="_m_TimerHardStop" type="Number" integer="true">
    /// </field>
    /// <field name="_m_NbTimerBlockingControls" type="Number" integer="true">
    /// </field>
    /// <field name="_m_ControlToFocus" type="String">
    /// </field>
    /// <field name="_m_MaxNumberOfFocusAttemps" type="Number" integer="true">
    /// </field>
    /// <field name="_m_CurrentNumberOfFocusAttemps" type="Number" integer="true">
    /// </field>
    /// <field name="_m_AsynchronousCalls" type="XMLNodeList">
    /// </field>
    this._m_IdSubstitutions = {};
    this._m_PartialOrFullMappings = new Coveo.CNL.Web.Scripts.Ajax.IdMappings();
    this._m_AlwaysSend = [];
    this._m_Feedbacks = [];
    this._m_FeedbackMappings = new Coveo.CNL.Web.Scripts.Ajax.IdMappings();
    this._m_FeedbackNameMappings = new Coveo.CNL.Web.Scripts.Ajax.IdMappings();
    this._m_BlankOnHistory = [];
    this._m_LoadedScripts = {};
    this._m_LoadedStyleSheets = {};
    this._m_AjaxObjects = [];
    this._m_ModalBoxes = [];
    this._m_TimerId = -1;
}
Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current = function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$get_current() {
    /// <summary>
    /// The current instance of <see cref="T:Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript" />.
    /// </summary>
    /// <value type="Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript"></value>
    return Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript._s_Instance;
}
Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript._initial_History_Navigated = function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_initial_History_Navigated(p_Sender, p_Args) {
    /// <param name="p_Sender" type="Object">
    /// </param>
    /// <param name="p_Args" type="Sys.HistoryEventArgs">
    /// </param>
    var hash = window.location.hash;
    if (p_Args.get_state()['s'] == null && (hash.length > 0) && (hash.charAt(0) === '#') && !hash.startsWith('#s=')) {
        p_Args.get_state()['s'] = window.location.hash.substr(1);
        window.location.hash = 's=' + p_Args.get_state()['s'];
    }
    Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript._s_InitialHistoryEventArgs = p_Args;
}
Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.prototype = {
    _m_Id: null,
    _m_Form: null,
    _m_Bootstrap: false,
    _m_FrameworkDoPostBack: null,
    _m_InitialViewState: null,
    _m_CurrentPostBack: null,
    _m_EnableProgress: false,
    _m_ProgressPageUri: null,
    _m_EnableUpdateDebugging: false,
    _m_EnableProfiling: false,
    _m_EnableHistory: false,
    _m_CurrentState: '',
    _m_TimerEnabled: true,
    _m_TimerInterval: 0,
    _m_TimerTickedCount: 0,
    _m_TimerHardStop: 0,
    _m_NbTimerBlockingControls: 0,
    _m_ControlToFocus: null,
    _m_MaxNumberOfFocusAttemps: 10,
    _m_CurrentNumberOfFocusAttemps: 0,
    _m_AsynchronousCalls: null,
    
    get_form: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$get_form() {
        /// <summary>
        /// The ASP.NET form inside the page.
        /// </summary>
        /// <value type="Object" domElement="true"></value>
        return this._m_Form;
    },
    
    get_bootstrap: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$get_bootstrap() {
        /// <summary>
        /// Gets or sets whether the interface has been bootstrapped.
        /// </summary>
        /// <value type="Boolean"></value>
        return this._m_Bootstrap;
    },
    set_bootstrap: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$set_bootstrap(value) {
        /// <summary>
        /// Gets or sets whether the interface has been bootstrapped.
        /// </summary>
        /// <value type="Boolean"></value>
        this._m_Bootstrap = value;
        return value;
    },
    
    get_initialViewState: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$get_initialViewState() {
        /// <summary>
        /// The initial value of the viewstate.
        /// </summary>
        /// <value type="String"></value>
        return this._m_InitialViewState;
    },
    set_initialViewState: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$set_initialViewState(value) {
        /// <summary>
        /// The initial value of the viewstate.
        /// </summary>
        /// <value type="String"></value>
        this._m_InitialViewState = value;
        return value;
    },
    
    get_enableProgress: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$get_enableProgress() {
        /// <summary>
        /// Whether postback progress tracking is enabled.
        /// </summary>
        /// <value type="Boolean"></value>
        return this._m_EnableProgress;
    },
    set_enableProgress: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$set_enableProgress(value) {
        /// <summary>
        /// Whether postback progress tracking is enabled.
        /// </summary>
        /// <value type="Boolean"></value>
        this._m_EnableProgress = value;
        return value;
    },
    
    get_progressPageUri: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$get_progressPageUri() {
        /// <summary>
        /// Gets or sets the uri of the page used to fetch progress information.
        /// </summary>
        /// <value type="String"></value>
        return this._m_ProgressPageUri;
    },
    set_progressPageUri: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$set_progressPageUri(value) {
        /// <summary>
        /// Gets or sets the uri of the page used to fetch progress information.
        /// </summary>
        /// <value type="String"></value>
        this._m_ProgressPageUri = value;
        return value;
    },
    
    get_enableUpdateDebugging: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$get_enableUpdateDebugging() {
        /// <summary>
        /// Whether update debugging is enabled.
        /// </summary>
        /// <value type="Boolean"></value>
        return this._m_EnableUpdateDebugging;
    },
    set_enableUpdateDebugging: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$set_enableUpdateDebugging(value) {
        /// <summary>
        /// Whether update debugging is enabled.
        /// </summary>
        /// <value type="Boolean"></value>
        this._m_EnableUpdateDebugging = value;
        return value;
    },
    
    get_enableProfiling: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$get_enableProfiling() {
        /// <summary>
        /// Whether profiling is enabled.
        /// </summary>
        /// <value type="Boolean"></value>
        return this._m_EnableProfiling;
    },
    set_enableProfiling: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$set_enableProfiling(value) {
        /// <summary>
        /// Whether profiling is enabled.
        /// </summary>
        /// <value type="Boolean"></value>
        this._m_EnableProfiling = value;
        return value;
    },
    
    get_enableHistory: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$get_enableHistory() {
        /// <summary>
        /// Whether history is enabled.
        /// </summary>
        /// <value type="Boolean"></value>
        return this._m_EnableHistory;
    },
    set_enableHistory: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$set_enableHistory(value) {
        /// <summary>
        /// Whether history is enabled.
        /// </summary>
        /// <value type="Boolean"></value>
        this._m_EnableHistory = value;
        return value;
    },
    
    get_currentPostBack: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$get_currentPostBack() {
        /// <summary>
        /// The currently pending <see cref="T:Coveo.CNL.Web.Scripts.Ajax.PartialPostBack" />.
        /// </summary>
        /// <value type="Coveo.CNL.Web.Scripts.Ajax.PartialPostBack"></value>
        return this._m_CurrentPostBack;
    },
    
    initialize: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$initialize(p_Id, p_Form, p_DoPostBack, p_Xml, p_SkipInitialHistoryState) {
        /// <summary>
        /// Initializes a new instance of <see cref="T:Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript" />.
        /// </summary>
        /// <param name="p_Id" type="String">
        /// The id of the AjaxManager control.
        /// </param>
        /// <param name="p_Form" type="Object" domElement="true">
        /// The ASP.NET form element.
        /// </param>
        /// <param name="p_DoPostBack" type="Coveo.CNL.Web.Scripts.Ajax.PostBackMethod">
        /// The framework's __doPostBack function.
        /// </param>
        /// <param name="p_Xml" type="XMLDocument">
        /// The initialization xml.
        /// </param>
        /// <param name="p_SkipInitialHistoryState" type="Boolean">
        /// Whether to skip the initial history state.
        /// </param>
        Coveo.CNL.Web.Scripts.CNLAssert.isNull(Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript._s_Instance);
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Id);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Form);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_DoPostBack);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Xml);
        this._m_Id = p_Id;
        this._m_Form = p_Form;
        this._m_FrameworkDoPostBack = p_DoPostBack;
        this._m_TimerTickedCount = 0;
        var scripts = document.getElementsByTagName('script');
        for (var i = 0; i < scripts.length; ++i) {
            var script = scripts[i];
            var src = script.getAttribute('src');
            if (!Coveo.CNL.Web.Scripts.Utilities.isNullOrEmpty(src)) {
                this.registerScript(src);
            }
        }
        var links = document.getElementsByTagName('link');
        for (var i = 0; i < links.length; ++i) {
            var link = links[i];
            var rel = link.getAttribute('rel');
            var href = link.getAttribute('href');
            if (Coveo.CNL.Web.Scripts.Utilities.equals(rel, 'stylesheet', true)) {
                this._m_LoadedStyleSheets[href] = link;
            }
        }
        if (this._m_EnableHistory) {
            Sys.Application.remove_navigate(Function.createDelegate(null, Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript._initial_History_Navigated));
            Sys.Application.add_navigate(Function.createDelegate(this, this._history_Navigated));
        }
        if (p_SkipInitialHistoryState) {
            this._m_CurrentState = window.location.hash.substr(1);
        }
        var async = new Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager();
        this._processXmlFromServer(p_Xml, async);
        async.startAll(Function.createDelegate(this, function(p_Sender, p_Args) {
            this._processXmlForAfterScriptsAreLoaded(p_Xml);
            this._hookButtonControls();
            Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript._s_Instance = this;
        }));
        if (Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript._s_InitialHistoryEventArgs != null) {
            this._history_Navigated(this, Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript._s_InitialHistoryEventArgs);
        }
    },
    
    DPB: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$DPB(p_Target, p_Argument, p_Preemptive) {
        /// <summary>
        /// Replacement for the framework's __doPostBack function.
        /// </summary>
        /// <param name="p_Target" type="String">
        /// The id of the target control.
        /// </param>
        /// <param name="p_Argument" type="String">
        /// The postback arguments.
        /// </param>
        /// <param name="p_Preemptive" type="Boolean">
        /// Whether this is a preemptive postback.
        /// </param>
        /// <returns type="Coveo.CNL.Web.Scripts.Ajax.PartialPostBack"></returns>
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Target);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Argument);
        this.cancelPendingOperations();
        var substituted = this._getSubstitutedId(p_Target);
        if (this._isPartialPostbackTarget(substituted)) {
            var feedbacks = (!p_Preemptive) ? this._getFeedbacksForTarget(substituted) : [];
            this._m_CurrentPostBack = new Coveo.CNL.Web.Scripts.Ajax.PartialPostBack(this, p_Target, p_Argument, feedbacks, false, p_Preemptive);
            this._m_CurrentPostBack.execute();
        }
        else {
            this._m_FrameworkDoPostBack(p_Target, p_Argument);
        }
        return this._m_CurrentPostBack;
    },
    
    doPostBack: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$doPostBack(p_Target, p_Argument, p_Preemptive) {
        /// <summary>
        /// Replacement for the framework's __doPostBack function.
        /// </summary>
        /// <param name="p_Target" type="String">
        /// The id of the target control.
        /// </param>
        /// <param name="p_Argument" type="String">
        /// The postback arguments.
        /// </param>
        /// <param name="p_Preemptive" type="Boolean">
        /// Whether this is a preemptive postback.
        /// </param>
        /// <returns type="Coveo.CNL.Web.Scripts.Ajax.PartialPostBack"></returns>
        return this.DPB(p_Target, p_Argument, p_Preemptive);
    },
    
    DMC: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$DMC(p_Target, p_Method, p_Options, p_Callback, p_Args) {
        /// <summary>
        /// Performs a server-side method call.
        /// </summary>
        /// <param name="p_Target" type="String">
        /// The id of the target control.
        /// </param>
        /// <param name="p_Method" type="String">
        /// The method to call.
        /// </param>
        /// <param name="p_Options" type="String">
        /// The string that holds the postback options.
        /// </param>
        /// <param name="p_Callback" type="Coveo.CNL.Web.Scripts.Ajax.PostBackCallback">
        /// The callback for the method call.
        /// </param>
        /// <param name="p_Args" type="Array" elementType="Object">
        /// The arguments to pass to the method.
        /// </param>
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Target);
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Method);
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Options);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Args);
        this.cancelPendingOperations();
        var options = new Coveo.CNL.Web.Scripts.Ajax.PostbackOptionsScript(p_Options);
        var args = 'M:' + encodeURIComponent(p_Target);
        args += '&' + encodeURIComponent(p_Method);
        for (var i = 0; i < p_Args.length - 1; ++i) {
            args += '&' + encodeURIComponent(Coveo.CNL.Web.Scripts.MarshalUtilities.marshalValue(p_Args[i]));
        }
        var substituted = this._getSubstitutedId(p_Target);
        if (options.get_forcePartialPostback() || this._isPartialPostbackTarget(substituted)) {
            var feedbacks = (options.get_triggerFeedbacks()) ? this._getFeedbacksForTarget(substituted) : [];
            this._m_CurrentPostBack = new Coveo.CNL.Web.Scripts.Ajax.PartialPostBack(this, this._m_Id, args, feedbacks, false, false);
            this._m_CurrentPostBack.set_callback(p_Callback);
            this._m_CurrentPostBack.set_sendControlData(options.get_sendControlData());
            this._m_CurrentPostBack.set_ignoreResults(options.get_ignoreResults());
            this._m_CurrentPostBack.execute();
        }
        else {
            this._m_FrameworkDoPostBack(this._m_Id, args);
        }
    },
    
    doMethodCall: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$doMethodCall(p_Target, p_Method, p_Options, p_Callback, p_Args) {
        /// <summary>
        /// Performs a server-side method call.
        /// </summary>
        /// <param name="p_Target" type="String">
        /// The id of the target control.
        /// </param>
        /// <param name="p_Method" type="String">
        /// The method to call.
        /// </param>
        /// <param name="p_Options" type="String">
        /// The string that holds the postback options.
        /// </param>
        /// <param name="p_Callback" type="Coveo.CNL.Web.Scripts.Ajax.PostBackCallback">
        /// The callback for the method call.
        /// </param>
        /// <param name="p_Args" type="Array" elementType="Object">
        /// The arguments to pass to the method.
        /// </param>
        this.DMC(p_Target, p_Method, p_Options, p_Callback, p_Args);
    },
    
    cancelPendingOperations: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$cancelPendingOperations() {
        /// <summary>
        /// Cancels any currently pending operation.
        /// </summary>
        if (this._m_CurrentPostBack != null) {
            this._m_CurrentPostBack.cancel();
            this._m_CurrentPostBack = null;
        }
    },
    
    shouldAlwaysBeSent: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$shouldAlwaysBeSent(p_Id) {
        /// <summary>
        /// Checks if a form field should always be sent to the server.
        /// </summary>
        /// <param name="p_Id" type="String">
        /// The id of the form field.
        /// </param>
        /// <returns type="Boolean"></returns>
        var always = false;
        for (var i = 0; i < this._m_AlwaysSend.length; i++) {
            var id = this._m_AlwaysSend[i];
            if (Coveo.CNL.Web.Scripts.Utilities.equals(id, p_Id, true)) {
                always = true;
                break;
            }
        }
        return always;
    },
    
    isScriptLoaded: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$isScriptLoaded(p_Uri) {
        /// <summary>
        /// Checks if a script is already loaded.
        /// </summary>
        /// <param name="p_Uri" type="String">
        /// The uri of the script.
        /// </param>
        /// <returns type="Boolean"></returns>
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Uri);
        var cleaned = this._cleanupScriptUri(p_Uri);
        return this._m_LoadedScripts[cleaned] != null || cleaned.indexOf('k=embedding') !== -1 || cleaned.indexOf('k=ccs') !== -1;
    },
    
    registerScript: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$registerScript(p_Uri) {
        /// <summary>
        /// Registers a new loaded script.
        /// </summary>
        /// <param name="p_Uri" type="String">
        /// The uri of the script.
        /// </param>
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Uri);
        var cleaned = this._cleanupScriptUri(p_Uri);
        this._m_LoadedScripts[cleaned] = 1;
    },
    
    addModalBox: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$addModalBox(p_Box) {
        /// <summary>
        /// Adds a modal dialog box to the list.
        /// </summary>
        /// <param name="p_Box" type="Coveo.CNL.Web.Scripts.Ajax.ModalBox">
        /// The <see cref="T:Coveo.CNL.Web.Scripts.Ajax.ModalBox" /> to push.
        /// </param>
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Box);
        Array.add(this._m_ModalBoxes, p_Box);
    },
    
    closeModalBox: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$closeModalBox(p_BoxId) {
        /// <summary>
        /// Closes a modal box.
        /// </summary>
        /// <param name="p_BoxId" type="String">
        /// The unique identifier of the box to close.
        /// </param>
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_BoxId);
        var found = null;
        for (var i = 0; i < this._m_ModalBoxes.length; i++) {
            var box = this._m_ModalBoxes[i];
            if (box.get_id() === p_BoxId) {
                found = box;
                break;
            }
        }
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(found);
        if (found.get_visible()) {
            found.close();
        }
        Array.remove(this._m_ModalBoxes, found);
    },
    
    postBackIsFinished: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$postBackIsFinished() {
        /// <summary>
        /// Called when a PostBack is finished.
        /// </summary>
        this._m_CurrentPostBack = null;
    },
    
    blockTimer: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$blockTimer() {
        /// <summary>
        /// Block the timer.
        /// </summary>
        this._m_NbTimerBlockingControls += 1;
    },
    
    unblockTimer: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$unblockTimer() {
        /// <summary>
        /// Unblock and start the timer.
        /// </summary>
        this._m_NbTimerBlockingControls -= 1;
        Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_NbTimerBlockingControls >= 0);
        if (this._m_NbTimerBlockingControls === 0) {
            this._startTimer();
        }
    },
    
    resetTimer: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$resetTimer() {
        /// <summary>
        /// Reset the timer count.
        /// </summary>
        this._m_TimerTickedCount = 0;
    },
    
    _processXmlFromServer: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_processXmlFromServer(p_Xml, p_Async) {
        /// <summary>
        /// Processes xml sent by the server.
        /// </summary>
        /// <param name="p_Xml" type="XMLDocument">
        /// The <see cref="T:System.XML.XMLDocument" /> to process.
        /// </param>
        /// <param name="p_Async" type="Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager">
        /// The <see cref="T:Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager" /> in which to register any required asynchronous process.
        /// </param>
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Xml);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Async);
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing redirect uri...');
        var redirectUri = (p_Xml).selectSingleNode('/AjaxManager/Redirect/Uri');
        if (redirectUri != null) {
            var newWindow = p_Xml.selectSingleNode('/AjaxManager/Redirect/NewWindow');
            if (newWindow != null && Boolean.parse(newWindow.text)) {
                window.open(redirectUri.text, '_blank');
            }
            else {
                window.navigate(redirectUri.text);
            }
        }
        var pageTitle = p_Xml.selectSingleNode('/AjaxManager/PageTitle');
        if (pageTitle != null) {
            document.title = pageTitle.text;
        }
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing history state...');
        var history = p_Xml.selectSingleNode('/AjaxManager/History');
        if (history != null && this.get_enableHistory()) {
            this._m_CurrentState = history.text;
            var dic = {};
            dic['s'] = this._m_CurrentState;
            Sys.Application.addHistoryPoint(dic);
            Coveo.CNL.Web.Scripts.Ajax.Profiler.log('    History state ' + this._m_CurrentState + ' was added.');
        }
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing id substitutions...');
        this._m_IdSubstitutions = {};
        var nodes = p_Xml.selectNodes('/AjaxManager/Substitutions/Substitution');
        for (var i = 0; i < nodes.length; ++i) {
            var node = nodes[i];
            this._m_IdSubstitutions[(node.attributes.getNamedItem('Target')).value] = (node.attributes.getNamedItem('Substitute')).value;
        }
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing list of partial postback controls...');
        this._m_PartialOrFullMappings.clear();
        nodes = p_Xml.selectNodes('/AjaxManager/Partial/Control');
        for (var i = 0; i < nodes.length; ++i) {
            var node = nodes[i];
            var id = (node.attributes.getNamedItem('Id')).value;
            this._m_PartialOrFullMappings.add(this._getSubstitutedId(id), true);
        }
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing list of full postback controls...');
        nodes = p_Xml.selectNodes('/AjaxManager/Full/Control');
        for (var i = 0; i < nodes.length; ++i) {
            var node = nodes[i];
            var id = (node.attributes.getNamedItem('Id')).value;
            this._m_PartialOrFullMappings.add(this._getSubstitutedId(id), false);
        }
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing list always sent form fields...');
        Array.clear(this._m_AlwaysSend);
        nodes = p_Xml.selectNodes('/AjaxManager/AlwaysSend/AlwaysSend');
        for (var i = 0; i < nodes.length; ++i) {
            var node = nodes[i];
            var id = (node.attributes.getNamedItem('Id')).value;
            Array.add(this._m_AlwaysSend, id);
        }
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing list of panel feedbacks...');
        Array.clear(this._m_Feedbacks);
        nodes = p_Xml.selectNodes('/AjaxManager/Feedbacks/PanelFeedback');
        for (var i = 0; i < nodes.length; ++i) {
            var node = nodes[i];
            var info = new Coveo.CNL.Web.Scripts.Ajax._feedbackInfo();
            info.m_Id = (node.attributes.getNamedItem('Id')).value;
            info.m_Type = (node.attributes.getNamedItem('Type')).value;
            info.m_Fullscreen = Boolean.parse((node.attributes.getNamedItem('Fullscreen')).value);
            info.m_Text = (node.attributes.getNamedItem('Text')).value;
            info.m_Image = (node.attributes.getNamedItem('Image')).value;
            var panel = this._getSubstitutedId((node.attributes.getNamedItem('Panel')).value);
            Array.add(this._m_Feedbacks, info);
            this._m_FeedbackMappings.add(panel, info);
        }
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing list of named feedbacks...');
        nodes = p_Xml.selectNodes('/AjaxManager/Feedbacks/NamedFeedback');
        for (var i = 0; i < nodes.length; ++i) {
            var node = nodes[i];
            var info = new Coveo.CNL.Web.Scripts.Ajax._feedbackInfo();
            info.m_Id = (node.attributes.getNamedItem('Id')).value;
            info.m_Name = (node.attributes.getNamedItem('Name')).value;
            info.m_Type = (node.attributes.getNamedItem('Type')).value;
            info.m_Fullscreen = Boolean.parse((node.attributes.getNamedItem('Fullscreen')).value);
            info.m_Text = (node.attributes.getNamedItem('Text')).value;
            info.m_Image = (node.attributes.getNamedItem('Image')).value;
            Array.add(this._m_Feedbacks, info);
        }
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing list of targeted feedbacks...');
        nodes = p_Xml.selectNodes('/AjaxManager/Feedbacks/TargetFeedback');
        for (var i = 0; i < nodes.length; ++i) {
            var node = nodes[i];
            var info = new Coveo.CNL.Web.Scripts.Ajax._feedbackInfo();
            info.m_Id = (node.attributes.getNamedItem('Id')).value;
            info.m_Target = (node.attributes.getNamedItem('TargetClientID')).value;
            info.m_Type = (node.attributes.getNamedItem('Type')).value;
            info.m_Fullscreen = Boolean.parse((node.attributes.getNamedItem('Fullscreen')).value);
            info.m_Text = (node.attributes.getNamedItem('Text')).value;
            info.m_Image = (node.attributes.getNamedItem('Image')).value;
            var target = this._getSubstitutedId((node.attributes.getNamedItem('TargetUniqueID')).value);
            Array.add(this._m_Feedbacks, info);
            this._m_FeedbackMappings.add(target, info);
        }
        nodes = p_Xml.selectNodes('/AjaxManager/Feedbacks/NamedFeedbackMapping');
        for (var i = 0; i < nodes.length; ++i) {
            var node = nodes[i];
            var info = new Coveo.CNL.Web.Scripts.Ajax._feedbackInfo();
            info.m_Id = this._getSubstitutedId((node.attributes.getNamedItem('Id')).value);
            info.m_Name = (node.attributes.getNamedItem('Name')).value;
            this._m_FeedbackNameMappings.add(info.m_Id, info.m_Name);
        }
        Array.clear(this._m_BlankOnHistory);
        nodes = p_Xml.selectNodes('/AjaxManager/BlankOnHistory/BlankOnHistory');
        for (var i = 0; i < nodes.length; ++i) {
            var node = nodes[i];
            var id = (node.attributes.getNamedItem('Id')).value;
            Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(id);
            Array.add(this._m_BlankOnHistory, id);
        }
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing stylesheets...');
        nodes = p_Xml.selectNodes('/AjaxManager/StyleSheets/StyleSheet');
        for (var i = 0; i < nodes.length; ++i) {
            var node = nodes[i];
            var uri = node.text;
            if (this._m_LoadedStyleSheets[uri] == null) {
                var link = document.createElement('link');
                if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE()) {
                    link.attachEvent('onload', Function.createDelegate(this, function() {
                        document.body.click();
                    }));
                    document.body.appendChild(link);
                }
                else {
                    document.getElementsByTagName('head')[0].appendChild(link);
                }
                link.rel = 'stylesheet';
                link.type = 'text/css';
                link.href = uri;
                this._m_LoadedStyleSheets[uri] = link;
                Coveo.CNL.Web.Scripts.Ajax.Profiler.log('    Stylesheet ' + uri + ' was added to the DOM.');
            }
        }
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing stylesheets to unload...');
        nodes = p_Xml.selectNodes('/AjaxManager/StyleSheets/Remove');
        for (var i = 0; i < nodes.length; ++i) {
            var node = nodes[i];
            var uri = node.text;
            if (this._m_LoadedStyleSheets[uri] != null) {
                var link = this._m_LoadedStyleSheets[uri];
                Coveo.CNL.Web.Scripts.DOMUtilities.removeLinkAndStylesheet(link);
                this._m_LoadedStyleSheets[uri] = null;
                Coveo.CNL.Web.Scripts.Ajax.Profiler.log('    Stylesheet ' + uri + ' was removed from the DOM.');
            }
        }
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing hidden fields...');
        nodes = p_Xml.selectNodes('/AjaxManager/HiddenFields/HiddenField');
        for (var i = 0; i < nodes.length; ++i) {
            var node = nodes[i];
            var name = (node.attributes.getNamedItem('Name')).value;
            var toDelete = Boolean.parse((node.attributes.getNamedItem('Delete')).value);
            var value = node.text;
            var input = document.getElementById(name);
            if (toDelete) {
                if (input != null) {
                    input.parentNode.removeChild(input);
                    Coveo.CNL.Web.Scripts.Ajax.Profiler.log('    Field ' + name + ' was deleted.');
                }
            }
            else {
                if (input == null) {
                    input = document.createElement('input');
                    input.type = 'hidden';
                    input.id = name;
                    input.name = name;
                    var elements = this._m_Form.elements;
                    elements[0].parentNode.appendChild(input);
                    Coveo.CNL.Web.Scripts.Ajax.Profiler.log('    Field ' + name + ' was created.');
                }
                input.value = value;
            }
        }
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing images to update...');
        nodes = p_Xml.selectNodes('/AjaxManager/ImagesToUpdate/ImageToUpdate');
        for (var i = 0; i < nodes.length; ++i) {
            var node = nodes[i];
            var id = (node.attributes.getNamedItem('Id')).value;
            var value = node.text;
            var elem = document.getElementById(id);
            if (elem != null) {
                elem.src = value;
                Coveo.CNL.Web.Scripts.Ajax.Profiler.log('    The url of control ' + id + ' was set to ' + value);
            }
        }
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing control values...');
        nodes = p_Xml.selectNodes('/AjaxManager/ControlValues/ControlValue');
        for (var i = 0; i < nodes.length; ++i) {
            var node = nodes[i];
            var id = (node.attributes.getNamedItem('Id')).value;
            var value = node.text;
            var input = document.getElementById(id);
            if (input != null) {
                input.value = value;
                Coveo.CNL.Web.Scripts.Ajax.Profiler.log('    Value of control ' + id + ' was set to ' + value);
            }
        }
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing timer stuff...');
        var globalTimer = p_Xml.selectSingleNode('/AjaxManager/GlobalTimer');
        if (globalTimer != null) {
            this._m_TimerInterval = parseInt((globalTimer.attributes.getNamedItem('Delay')).value);
            this._m_TimerHardStop = parseInt((globalTimer.attributes.getNamedItem('HardStop')).value);
        }
        else {
            this._m_TimerInterval = 0;
            this._m_TimerHardStop = 0;
        }
        if (this._m_TimerInterval > 0) {
            this._m_TimerEnabled = true;
            this._startTimer();
        }
        else {
            this._m_TimerEnabled = false;
            window.clearTimeout(this._m_TimerId);
            this._m_TimerId = -1;
        }
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing external scripts...');
        nodes = p_Xml.selectNodes('/AjaxManager/ExternalScripts/Script');
        if (nodes.length > 0) {
            var loader = null;
            for (var i = 0; i < nodes.length; ++i) {
                var node = nodes[i];
                var uri = (node.attributes.getNamedItem('Uri')).value;
                if (!this.isScriptLoaded(uri)) {
                    Coveo.CNL.Web.Scripts.CNLAssert.fail();
                    if (loader == null) {
                        loader = new Coveo.CNL.Web.Scripts.Ajax.ScriptLoaderWrapper();
                    }
                    loader.add(uri);
                    this.registerScript(uri);
                    Coveo.CNL.Web.Scripts.Ajax.Profiler.log('    Script ' + uri + ' queued to be loaded.');
                }
            }
            if (loader != null) {
                p_Async.add(loader);
            }
        }
    },
    
    _processXmlForAfterScriptsAreLoaded: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_processXmlForAfterScriptsAreLoaded(p_Xml) {
        /// <summary>
        /// Processes the xml for the <see cref="T:Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript" /> objects from the server.
        /// </summary>
        /// <param name="p_Xml" type="XMLDocument">
        /// The <see cref="T:System.XML.XMLDocument" /> to process.
        /// </param>
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Xml);
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing constants...');
        var nodes = p_Xml.selectNodes('/AjaxManager/Consts/Const');
        for (var i = 0; i < nodes.length; ++i) {
            var node = nodes[i];
            var cls = (node.attributes.getNamedItem('Class')).value;
            var name = (node.attributes.getNamedItem('Name')).value;
            var kind = (node.attributes.getNamedItem('Type')).value;
            var value = Coveo.CNL.Web.Scripts.MarshalUtilities.unmarshalValue(kind, node.text);
            eval(cls)[name] = value;
            Coveo.CNL.Web.Scripts.Ajax.Profiler.log('    Constant ' + cls + '.' + name + ' was set to ' + value);
        }
        var count = 0;
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing inline scripts...');
        nodes = p_Xml.selectNodes('/AjaxManager/InlineScripts/Script');
        for (var i = 0; i < nodes.length; ++i) {
            var node = nodes[i];
            eval(node.text);
            ++count;
        }
        Coveo.CNL.Web.Scripts.Ajax.Profiler.log(count.toString() + ' inline scripts have been executed.');
        nodes = p_Xml.selectNodes('/AjaxManager/AjaxObjects/AjaxObject');
        for (var i = 0; i < nodes.length; ++i) {
            var node = nodes[i];
            var type = (node.attributes.getNamedItem('Type')).value;
            var ownerId = (node.attributes.getNamedItem('OwnerId')).value;
            var obj = eval('new ' + type + '()');
            obj.set_ownerId(this._getSubstitutedId(ownerId));
            var subs = node.selectNodes('ProtectedField');
            for (var j = 0; j < subs.length; ++j) {
                var sub = subs[j];
                var name = (sub.attributes.getNamedItem('Name')).value;
                var kind = (sub.attributes.getNamedItem('Type')).value;
                var value = Coveo.CNL.Web.Scripts.MarshalUtilities.unmarshalValue(kind, sub.text);
                obj[name] = value;
            }
            subs = node.selectNodes('ProtectedDomElement');
            for (var j = 0; j < subs.length; ++j) {
                var sub = subs[j];
                var name = (sub.attributes.getNamedItem('Name')).value;
                var id = (sub.attributes.getNamedItem('Id')).value;
                var elem = document.getElementById(id);
                Coveo.CNL.Web.Scripts.CNLAssert.notNull(elem);
                obj[name] = elem;
            }
            subs = node.selectNodes('ProtectedMethods');
            for (var j = 0; j < subs.length; ++j) {
                var sub = subs[j];
                var name = (sub.attributes.getNamedItem('Name')).value;
                eval('obj.' + name + ' = ' + sub.text + ';');
            }
            subs = node.selectNodes('PublicProperty');
            for (var j = 0; j < subs.length; ++j) {
                var sub = subs[j];
                var name = (sub.attributes.getNamedItem('Name')).value;
                var kind = (sub.attributes.getNamedItem('Type')).value;
                var value = Coveo.CNL.Web.Scripts.MarshalUtilities.unmarshalValue(kind, sub.text);
                obj['set_' + name](value);
            }
            Array.add(this._m_AjaxObjects, obj);
            obj.initialize();
            subs = node.selectNodes('Method');
            for (var j = 0; j < subs.length; j++) {
                var sub = subs[j];
                var name = (sub.attributes.getNamedItem('Name')).value;
                eval('obj.' + name + '(' + sub.text + ');');
            }
        }
        this._m_AsynchronousCalls = p_Xml.selectNodes('/AjaxManager/AsynchronousCalls/AsynchronousCall');
        if (this._m_AsynchronousCalls.length > 0) {
            if (!Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE() || eval('document.readyState') === 'complete') {
                this._runAsynchronousCalls();
            }
            else {
                var runCalls = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._runAsynchronousCalls), 0);
            }
        }
        var focus = p_Xml.selectSingleNode('/AjaxManager/SetFocus');
        if (focus != null) {
            this._m_ControlToFocus = focus.text;
            this._m_CurrentNumberOfFocusAttemps = 0;
            var timer = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._setFocus), 0);
        }
        else {
            this._m_ControlToFocus = '';
        }
    },
    
    _hookButtonControls: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_hookButtonControls() {
        /// <summary>
        /// Hooks the OnClick event of all button controls within the form.
        /// </summary>
        var elems = this._m_Form.getElementsByTagName('input');
        for (var i = 0; i < elems.length; ++i) {
            var elem = elems[i];
            if ((elem.type === 'submit' || elem.type === 'button' || elem.type === 'image') && elem.onclick == null) {
                var name = elem.name;
                var d = this._createOnClickDelegateForButton(name);
                elem.onclick = d;
            }
        }
    },
    
    _tearDownObjectsBelow: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_tearDownObjectsBelow(p_Scope) {
        /// <summary>
        /// Removes all objects registered under a given scope.
        /// </summary>
        /// <param name="p_Scope" type="String">
        /// The scope at which to remove objects.
        /// </param>
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Scope);
        var scope = this._getSubstitutedId(p_Scope);
        var toRemove = [];
        for (var i = 0; i < this._m_AjaxObjects.length; i++) {
            var obj = this._m_AjaxObjects[i];
            if (obj.get_ownerId().startsWith(scope)) {
                Array.add(toRemove, obj);
            }
        }
        for (var i = 0; i < toRemove.length; i++) {
            var obj = toRemove[i];
            obj.tearDown();
            Array.remove(this._m_AjaxObjects, obj);
        }
    },
    
    _setFocus: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_setFocus() {
        /// <summary>
        /// Sets the focus on the element to focus.
        /// </summary>
        this._m_CurrentNumberOfFocusAttemps++;
        if (!Coveo.CNL.Web.Scripts.Utilities.isNullOrEmpty(this._m_ControlToFocus)) {
            var elem = document.getElementById(this._m_ControlToFocus);
            try {
                elem.focus();
                if (document.activeElement !== elem && this._m_CurrentNumberOfFocusAttemps < this._m_MaxNumberOfFocusAttemps) {
                    var timer = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._setFocus), 0);
                }
            }
            catch ($e1) {
            }
        }
    },
    
    _isPartialPostbackTarget: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_isPartialPostbackTarget(p_Target) {
        /// <summary>
        /// Checks if postbacks to a target control should be partial.
        /// </summary>
        /// <param name="p_Target" type="String">
        /// The target control.
        /// </param>
        /// <returns type="Boolean"></returns>
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Target);
        var partial;
        var mapping = this._m_PartialOrFullMappings.get(p_Target);
        if (mapping != null) {
            partial = mapping;
        }
        else {
            partial = false;
        }
        return partial;
    },
    
    _getFeedbacksForTarget: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_getFeedbacksForTarget(p_Target) {
        /// <summary>
        /// Retrieves the list of <see cref="T:Coveo.CNL.Web.Scripts.Ajax.Feedback" /> objects for a given postback target.
        /// </summary>
        /// <param name="p_Target" type="String">
        /// The target of the postback..
        /// </param>
        /// <returns type="Array"></returns>
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Target);
        var toCreate = [];
        var feedback = this._m_FeedbackMappings.get(p_Target);
        if (feedback != null) {
            Array.add(toCreate, feedback);
        }
        var name = this._m_FeedbackNameMappings.get(p_Target);
        if (name != null) {
            for (var i = 0; i < this._m_Feedbacks.length; i++) {
                var fb = this._m_Feedbacks[i];
                if (Coveo.CNL.Web.Scripts.Utilities.equals(fb.m_Name, name, true)) {
                    Array.add(toCreate, fb);
                }
            }
        }
        var feedbacks = [];
        for (var i = 0; i < toCreate.length; i++) {
            var fb = toCreate[i];
            Array.add(feedbacks, Coveo.CNL.Web.Scripts.Ajax.Feedback.create(fb.m_Id, fb.m_Type, fb.m_Target, fb.m_Fullscreen, fb.m_Text, fb.m_Image));
        }
        return feedbacks;
    },
    
    _getSubstitutedId: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_getSubstitutedId(p_Id) {
        /// <summary>
        /// Apply any registered substitution to a control id.
        /// </summary>
        /// <param name="p_Id" type="String">
        /// The id to substitute.
        /// </param>
        /// <returns type="String"></returns>
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Id);
        var substituted = p_Id;
        var $dict1 = this._m_IdSubstitutions;
        for (var $key2 in $dict1) {
            var entry = { key: $key2, value: $dict1[$key2] };
            if (substituted.startsWith(entry.key)) {
                substituted = entry.value + substituted.substring(entry.key.length, substituted.length);
            }
        }
        return substituted;
    },
    
    _cleanupScriptUri: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_cleanupScriptUri(p_Uri) {
        /// <summary>
        /// Cleans up a script uri, removing the changing part that may differ on
        /// multiple servers member of the same NLB cluster.
        /// </summary>
        /// <param name="p_Uri" type="String">
        /// The uri of the script to clean up.
        /// </param>
        /// <returns type="String"></returns>
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Uri);
        var cleaned = p_Uri;
        var beg = cleaned.indexOf('&z=');
        if (beg !== -1) {
            var end = cleaned.indexOf('&', beg + 1);
            cleaned = cleaned.substring(0, beg);
            if (end !== -1) {
                cleaned += cleaned.substring(end - beg, cleaned.length);
            }
        }
        return cleaned;
    },
    
    _createOnClickDelegateForButton: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_createOnClickDelegateForButton(p_Name) {
        /// <summary>
        /// Creates a delegate for hooking up the onclick event of a button.
        /// </summary>
        /// <param name="p_Name" type="String">
        /// The name of the button to hook.
        /// </param>
        /// <returns type="Coveo.CNL.Web.Scripts.Ajax._buttonClickDelegate"></returns>
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Name);
        return Function.createDelegate(this, function() {
            this.DPB(p_Name, '', false);
            return false;
        });
    },
    
    _history_Navigated: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_history_Navigated(p_Sender, p_Args) {
        /// <param name="p_Sender" type="Object">
        /// </param>
        /// <param name="p_Args" type="Sys.HistoryEventArgs">
        /// </param>
        var decoded = '';
        if (!Coveo.CNL.Web.Scripts.Utilities.isNullOrUndefined(p_Args.get_state()['s'])) {
            decoded = (p_Args.get_state()['s']);
            if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isChrome()) {
                decoded = decodeURIComponent(decoded);
            }
        }
        if (decoded !== this._m_CurrentState) {
            var blank = [];
            for (var i = 0; i < this._m_BlankOnHistory.length; i++) {
                var id = this._m_BlankOnHistory[i];
                var elem = document.getElementById(id);
                Coveo.CNL.Web.Scripts.CNLAssert.notNull(elem);
                elem.style.visibility = 'hidden';
                Array.add(blank, elem);
            }
            this._m_CurrentState = decoded;
            this.cancelPendingOperations();
            this._m_CurrentPostBack = new Coveo.CNL.Web.Scripts.Ajax.PartialPostBack(this, this._m_Id, 'R:' + this._m_CurrentState, [], false, false);
            this._m_CurrentPostBack.set_sendControlData(false);
            this._m_CurrentPostBack.set_callback(Function.createDelegate(this, function(p_Return) {
                for (var i = 0; i < blank.length; i++) {
                    var elem = blank[i];
                    elem.style.visibility = 'visible';
                }
            }));
            this._m_CurrentPostBack.execute();
        }
    },
    
    _timerTick: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_timerTick() {
        this._m_TimerId = -1;
        this._m_TimerTickedCount += 1;
        if (this._m_NbTimerBlockingControls === 0) {
            if (this._m_CurrentPostBack == null) {
                this._m_CurrentPostBack = new Coveo.CNL.Web.Scripts.Ajax.PartialPostBack(this, this._m_Id, 'T:', [], true, false);
                this._m_CurrentPostBack.set_sendControlData(false);
                this._m_CurrentPostBack.set_enableProgress(false);
                this._m_CurrentPostBack.execute();
            }
            else {
                this._startTimer();
            }
        }
    },
    
    _startTimer: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_startTimer() {
        /// <summary>
        /// Start the timer if it is enabled, no controls are blocking it, it is
        /// not already started and the interval is valid.
        /// </summary>
        if (this._m_TimerEnabled) {
            if (this._m_TimerHardStop === 0 || this._m_TimerTickedCount < this._m_TimerHardStop) {
                if (this._m_NbTimerBlockingControls === 0) {
                    if (this._m_TimerId === -1) {
                        if (this._m_TimerInterval > 0) {
                            this._m_TimerId = window.setTimeout(Function.createDelegate(this, this._timerTick), this._m_TimerInterval);
                        }
                    }
                }
            }
        }
    },
    
    _runAsynchronousCalls: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_runAsynchronousCalls() {
        /// <summary>
        /// Executes the asynchronous calls if any.
        /// </summary>
        if (this._m_AsynchronousCalls != null) {
            for (var i = 0; i < this._m_AsynchronousCalls.length; ++i) {
                var node = this._m_AsynchronousCalls[i];
                Coveo.CNL.Web.Scripts.DOMUtilities.incrementBusyCounter();
                eval(node.text);
            }
            this._m_AsynchronousCalls = null;
        }
    }
}


Type.registerNamespace('Coveo.CNL.Web.Scripts.BetterControls');

////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.BetterControls.BetterButtonScript

Coveo.CNL.Web.Scripts.BetterControls.BetterButtonScript = function Coveo_CNL_Web_Scripts_BetterControls_BetterButtonScript() {
    /// <summary>
    /// Client side code for the BetterButton control.
    /// </summary>
    /// <field name="m_Button" type="Object" domElement="true">
    /// </field>
    /// <field name="m_DisableOnClick" type="Boolean">
    /// </field>
    /// <field name="m_DisableAlso" type="String">
    /// </field>
    /// <field name="_m_ButtonClickDomEventHandler$1" type="DOMEventHandler">
    /// </field>
    Coveo.CNL.Web.Scripts.BetterControls.BetterButtonScript.initializeBase(this);
}
Coveo.CNL.Web.Scripts.BetterControls.BetterButtonScript.prototype = {
    m_Button: null,
    m_DisableOnClick: false,
    m_DisableAlso: null,
    _m_ButtonClickDomEventHandler$1: null,
    
    initialize: function Coveo_CNL_Web_Scripts_BetterControls_BetterButtonScript$initialize() {
        this._m_ButtonClickDomEventHandler$1 = Function.createDelegate(this, this._button_OnClick$1);
        this.m_Button.attachEvent('onclick', this._m_ButtonClickDomEventHandler$1);
    },
    
    tearDown: function Coveo_CNL_Web_Scripts_BetterControls_BetterButtonScript$tearDown() {
        if (this._m_ButtonClickDomEventHandler$1 != null) {
            this.m_Button.detachEvent('onclick', this._m_ButtonClickDomEventHandler$1);
            this._m_ButtonClickDomEventHandler$1 = null;
        }
    },
    
    _button_OnClick$1: function Coveo_CNL_Web_Scripts_BetterControls_BetterButtonScript$_button_OnClick$1() {
        if (this.m_DisableOnClick) {
            this.m_Button.disabled = true;
            if (!Coveo.CNL.Web.Scripts.Utilities.isNullOrEmpty(this.m_DisableAlso)) {
                var deserializer = new Coveo.CNL.Web.Scripts.StringDeserializer(this.m_DisableAlso);
                var names = deserializer.getStringArray();
                for (var i = 0; i < names.length; i++) {
                    var name = names[i];
                    var element = document.getElementById(name);
                    if (element != null) {
                        element.disabled = true;
                    }
                }
            }
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.BetterControls.BetterLinkButtonScript

Coveo.CNL.Web.Scripts.BetterControls.BetterLinkButtonScript = function Coveo_CNL_Web_Scripts_BetterControls_BetterLinkButtonScript() {
    /// <summary>
    /// Client side code for the BetterLinkButton control.
    /// </summary>
    /// <field name="m_Button" type="Object" domElement="true">
    /// </field>
    /// <field name="m_DisableOnClick" type="Boolean">
    /// </field>
    /// <field name="_m_ButtonClickDomEventHandler$1" type="DOMEventHandler">
    /// </field>
    Coveo.CNL.Web.Scripts.BetterControls.BetterLinkButtonScript.initializeBase(this);
}
Coveo.CNL.Web.Scripts.BetterControls.BetterLinkButtonScript.prototype = {
    m_Button: null,
    m_DisableOnClick: false,
    _m_ButtonClickDomEventHandler$1: null,
    
    initialize: function Coveo_CNL_Web_Scripts_BetterControls_BetterLinkButtonScript$initialize() {
        this._m_ButtonClickDomEventHandler$1 = Function.createDelegate(this, this._button_OnClick$1);
        this.m_Button.attachEvent('onclick', this._m_ButtonClickDomEventHandler$1);
    },
    
    tearDown: function Coveo_CNL_Web_Scripts_BetterControls_BetterLinkButtonScript$tearDown() {
        if (this._m_ButtonClickDomEventHandler$1 != null) {
            this.m_Button.detachEvent('onclick', this._m_ButtonClickDomEventHandler$1);
            this._m_ButtonClickDomEventHandler$1 = null;
        }
    },
    
    _button_OnClick$1: function Coveo_CNL_Web_Scripts_BetterControls_BetterLinkButtonScript$_button_OnClick$1() {
        if (this.m_DisableOnClick) {
            this.m_Button.disabled = true;
        }
    }
}


Type.registerNamespace('Coveo.CNL.Web.Scripts');

////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.PositionEnum

Coveo.CNL.Web.Scripts.PositionEnum = function() { 
    /// <summary>
    /// This enumeration lists the positions (relative to another object) where
    /// a box can be dynamically placed.
    /// </summary>
    /// <field name="leftAbove" type="Number" integer="true" static="true">
    /// Left of the reference object, and going up.
    /// </field>
    /// <field name="leftBelow" type="Number" integer="true" static="true">
    /// Left of the reference object, and going down.
    /// </field>
    /// <field name="rightAbove" type="Number" integer="true" static="true">
    /// Right of the reference object, and going up.
    /// </field>
    /// <field name="rightBelow" type="Number" integer="true" static="true">
    /// Right of the reference object, and goind down.
    /// </field>
    /// <field name="aboveLeft" type="Number" integer="true" static="true">
    /// Above the reference object, and left aligned.
    /// </field>
    /// <field name="aboveRight" type="Number" integer="true" static="true">
    /// Above the reference object, and right aligned
    /// </field>
    /// <field name="belowLeft" type="Number" integer="true" static="true">
    /// Below the reference object, and left aligned
    /// </field>
    /// <field name="belowRight" type="Number" integer="true" static="true">
    /// Below the reference object, and right aligned
    /// </field>
};
Coveo.CNL.Web.Scripts.PositionEnum.prototype = {
    leftAbove: 0, 
    leftBelow: 1, 
    rightAbove: 2, 
    rightBelow: 3, 
    aboveLeft: 4, 
    aboveRight: 5, 
    belowLeft: 6, 
    belowRight: 7
}
Coveo.CNL.Web.Scripts.PositionEnum.registerEnum('Coveo.CNL.Web.Scripts.PositionEnum', false);


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.MulticastEventHandler

Coveo.CNL.Web.Scripts.MulticastEventHandler = function Coveo_CNL_Web_Scripts_MulticastEventHandler() {
    /// <summary>
    /// Class that siulates a MulticastDelegate.
    /// </summary>
    /// <field name="_m_EventHandlers" type="Array">
    /// </field>
    this._m_EventHandlers = [];
}
Coveo.CNL.Web.Scripts.MulticastEventHandler.prototype = {
    _m_EventHandlers: null,
    
    add: function Coveo_CNL_Web_Scripts_MulticastEventHandler$add(p_Handler) {
        /// <summary>
        /// Add a new EventHandler to the list.
        /// </summary>
        /// <param name="p_Handler" type="Object">
        /// The EventHandler to add.
        /// </param>
        Array.remove(this._m_EventHandlers, p_Handler);
    },
    
    remove: function Coveo_CNL_Web_Scripts_MulticastEventHandler$remove(p_Handler) {
        /// <summary>
        /// Removes an existing EventHandler from the list.
        /// </summary>
        /// <param name="p_Handler" type="Object">
        /// The EventHandler to remove.
        /// </param>
        Array.remove(this._m_EventHandlers, p_Handler);
    },
    
    invoke: function Coveo_CNL_Web_Scripts_MulticastEventHandler$invoke(p_Sender, p_Args) {
        /// <summary>
        /// Invoke the list of EventHandlers
        /// </summary>
        /// <param name="p_Sender" type="Object">
        /// The sender.
        /// </param>
        /// <param name="p_Args" type="Object">
        /// The arguments.
        /// </param>
        for (var i = 0; i < this._m_EventHandlers.length; i++) {
            var handler = this._m_EventHandlers[i];
            handler.invoke(p_Sender, p_Args);
        }
    },
    
    isDefined: function Coveo_CNL_Web_Scripts_MulticastEventHandler$isDefined() {
        /// <summary>
        /// Whether at least one event handler is defined or not.
        /// </summary>
        /// <returns type="Boolean"></returns>
        return this._m_EventHandlers.length > 0;
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.OnClickElsewhereEvent

Coveo.CNL.Web.Scripts.OnClickElsewhereEvent = function Coveo_CNL_Web_Scripts_OnClickElsewhereEvent(p_Elements, p_Handler, p_EscapeToo) {
    /// <summary>
    /// Implements an event that fires when the user clicks somewhere else than on a given set of elements.
    /// </summary>
    /// <param name="p_Elements" type="Array" elementType="Object" elementDomElement="true">
    /// The elements outside of which a click must occur.
    /// </param>
    /// <param name="p_Handler" type="DOMEventHandler">
    /// The <see cref="T:System.DHTML.DOMEventHandler" /> that handles the event.
    /// </param>
    /// <param name="p_EscapeToo" type="Boolean">
    /// Whether to trigger the event when the user presses Escape.
    /// </param>
    /// <field name="_m_Elements" type="Array" elementType="Object" elementDomElement="true">
    /// </field>
    /// <field name="_m_Handler" type="DOMEventHandler">
    /// </field>
    /// <field name="_m_ClickDomEventHandler" type="DOMEventHandler">
    /// </field>
    /// <field name="_m_KeyDownEventHandler" type="DOMEventHandler">
    /// </field>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Elements);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Handler);
    this._m_Elements = p_Elements;
    this._m_Handler = p_Handler;
    this._m_ClickDomEventHandler = Function.createDelegate(this, this._body_Click);
    document.body.attachEvent('onclick', this._m_ClickDomEventHandler);
    if (p_EscapeToo) {
        this._m_KeyDownEventHandler = Function.createDelegate(this, this._body_KeyDown);
        document.body.attachEvent('onkeydown', this._m_KeyDownEventHandler);
    }
}
Coveo.CNL.Web.Scripts.OnClickElsewhereEvent.prototype = {
    _m_Elements: null,
    _m_Handler: null,
    _m_ClickDomEventHandler: null,
    _m_KeyDownEventHandler: null,
    
    dispose: function Coveo_CNL_Web_Scripts_OnClickElsewhereEvent$dispose() {
        /// <summary>
        /// Detaches the event handler.
        /// </summary>
        if (this._m_ClickDomEventHandler != null) {
            document.body.detachEvent('onclick', this._m_ClickDomEventHandler);
            this._m_ClickDomEventHandler = null;
        }
        if (this._m_KeyDownEventHandler != null) {
            document.body.detachEvent('onkeydown', this._m_KeyDownEventHandler);
            this._m_KeyDownEventHandler = null;
        }
    },
    
    _body_Click: function Coveo_CNL_Web_Scripts_OnClickElsewhereEvent$_body_Click() {
        var contains = false;
        for (var i = 0; i < this._m_Elements.length; i++) {
            var elem = this._m_Elements[i];
            if (elem.contains(window.event.srcElement)) {
                contains = true;
                break;
            }
        }
        if (!contains) {
            this._m_Handler();
        }
    },
    
    _body_KeyDown: function Coveo_CNL_Web_Scripts_OnClickElsewhereEvent$_body_KeyDown() {
        if (window.event.keyCode === 27) {
            this._m_Handler();
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.ScriptLoader

Coveo.CNL.Web.Scripts.ScriptLoader = function Coveo_CNL_Web_Scripts_ScriptLoader(p_URLs) {
    /// <summary>
    /// Allows to load script in an HTML page.
    /// </summary>
    /// <param name="p_URLs" type="Array" elementType="String">
    /// The List of Script Url to be loaded.
    /// </param>
    /// <field name="_m_ScriptURLs" type="Array" elementType="String">
    /// </field>
    /// <field name="_m_LoadedHandler" type="DOMEventHandler">
    /// </field>
    /// <field name="_m_ErrorHandler" type="DOMEventHandler">
    /// </field>
    /// <field name="_m_IsIE" type="Boolean">
    /// </field>
    /// <field name="_m_OnLoadHandler" type="DOMEventHandler">
    /// </field>
    /// <field name="_m_OnErrorHandler" type="DOMEventHandler">
    /// </field>
    /// <field name="_m_ScriptLoadedIndex" type="Number" integer="true">
    /// </field>
    /// <field name="_m_ScriptElements" type="Array">
    /// </field>
    /// <field name="_m_LoadedScripts" type="Number" integer="true">
    /// </field>
    /// <field name="_m_InError" type="Boolean">
    /// </field>
    /// <field name="_m_Loaded" type="Boolean">
    /// </field>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_URLs);
    Coveo.CNL.Web.Scripts.CNLAssert.check(p_URLs.length > 0);
    this._m_ScriptURLs = p_URLs;
    this._m_ScriptLoadedIndex = -1;
}
Coveo.CNL.Web.Scripts.ScriptLoader.prototype = {
    _m_ScriptURLs: null,
    _m_LoadedHandler: null,
    _m_ErrorHandler: null,
    _m_IsIE: false,
    _m_OnLoadHandler: null,
    _m_OnErrorHandler: null,
    _m_ScriptLoadedIndex: 0,
    _m_ScriptElements: null,
    _m_LoadedScripts: 0,
    _m_InError: false,
    _m_Loaded: false,
    
    dispose: function Coveo_CNL_Web_Scripts_ScriptLoader$dispose() {
        if (this._m_ScriptElements != null) {
            for (var i = 0; i < this._m_ScriptElements.length; i++) {
                var scriptElement = this._m_ScriptElements[i];
                if (this._m_IsIE) {
                    scriptElement.detachEvent('onreadystatechange', this._m_OnLoadHandler);
                }
                else {
                    scriptElement.detachEvent('onload', this._m_OnLoadHandler);
                    scriptElement.detachEvent('onerror', this._m_OnErrorHandler);
                }
            }
            this._m_ScriptElements = null;
        }
    },
    
    load: function Coveo_CNL_Web_Scripts_ScriptLoader$load(p_LoadInParallel, p_TimeOut, p_LoadedHandler, p_ErrorHandler) {
        /// <summary>
        /// Load the sript(s) in the current page.
        /// </summary>
        /// <param name="p_LoadInParallel" type="Boolean">
        /// Whether scripts should be loaded in parallel or not.
        /// </param>
        /// <param name="p_TimeOut" type="Number" integer="true">
        /// Time allowed to load a script.
        /// </param>
        /// <param name="p_LoadedHandler" type="DOMEventHandler">
        /// An event to fire when the script(s) will be loaded.
        /// </param>
        /// <param name="p_ErrorHandler" type="DOMEventHandler">
        /// An event to fire if an error occurs.
        /// </param>
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_ErrorHandler);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_ErrorHandler);
        this._m_LoadedHandler = p_LoadedHandler;
        this._m_ErrorHandler = p_ErrorHandler;
        this._m_OnLoadHandler = Function.createDelegate(this, this.onScriptError);
        this._m_IsIE = window.navigator.userAgent.indexOf('MSIE') >= 0;
        if (this._m_IsIE) {
            this._m_OnErrorHandler = Function.createDelegate(this, this.onScriptError);
        }
        this._m_ScriptElements = [];
        if (p_LoadInParallel) {
            for (var i = 0; i < this._m_ScriptURLs.length; i++) {
                this.loadScript(this._m_ScriptURLs[i]);
            }
        }
        else {
            this._m_ScriptLoadedIndex++;
            this.loadScript(this._m_ScriptURLs[this._m_ScriptLoadedIndex]);
        }
        if (p_TimeOut > 0) {
            window.setTimeout(Function.createDelegate(this, this.onScriptError), p_TimeOut);
        }
    },
    
    loadScript: function Coveo_CNL_Web_Scripts_ScriptLoader$loadScript(p_ScriptURL) {
        /// <summary>
        /// Load a script into the head of the current page.
        /// </summary>
        /// <param name="p_ScriptURL" type="String">
        /// the url of the script to load.
        /// </param>
        var scriptElement = document.createElement('SCRIPT');
        if (this._m_IsIE) {
            scriptElement.attachEvent('onreadystatechange', this._m_OnLoadHandler);
        }
        else {
            scriptElement.readyState = 'complete';
            scriptElement.attachEvent('onload', this._m_OnLoadHandler);
            scriptElement.attachEvent('onerror', this._m_OnErrorHandler);
        }
        scriptElement.type = 'text/javascript';
        scriptElement.src = p_ScriptURL;
        Array.add(this._m_ScriptElements, scriptElement);
        document.getElementsByTagName('HEAD')[0].appendChild(scriptElement);
    },
    
    onScriptError: function Coveo_CNL_Web_Scripts_ScriptLoader$onScriptError() {
        if (!this._m_InError && !this._m_Loaded) {
            this._m_InError = true;
            this._m_ErrorHandler.invoke();
        }
    },
    
    onScriptLoad: function Coveo_CNL_Web_Scripts_ScriptLoader$onScriptLoad() {
        if (this._m_InError) {
            return;
        }
        var scriptElement = window.event.srcElement;
        if (scriptElement.readyState !== 'complete' && scriptElement.readyState !== 'loaded') {
            return;
        }
        if (this._m_ScriptLoadedIndex !== -1) {
            this._m_ScriptLoadedIndex++;
            if (this._m_ScriptLoadedIndex !== this._m_ScriptURLs.length) {
                this.loadScript(this._m_ScriptURLs[this._m_ScriptLoadedIndex]);
                return;
            }
        }
        else {
            this._m_LoadedScripts++;
            if (this._m_LoadedScripts !== this._m_ScriptURLs.length) {
                return;
            }
        }
        this._m_Loaded = true;
        this._m_LoadedHandler.invoke();
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.StringDeserializer

Coveo.CNL.Web.Scripts.StringDeserializer = function Coveo_CNL_Web_Scripts_StringDeserializer(p_String) {
    /// <summary>
    /// Allows data to be deserialized from a string built by StringSerializer.
    /// </summary>
    /// <param name="p_String" type="String">
    /// The string that contains the serialized data.
    /// </param>
    /// <field name="_m_String" type="String">
    /// </field>
    /// <field name="_m_Separator" type="String">
    /// </field>
    /// <field name="_m_Special" type="Array" elementType="String">
    /// </field>
    /// <field name="_m_Current" type="Number" integer="true">
    /// </field>
    /// <field name="_m_Builder" type="Sys.StringBuilder">
    /// </field>
    /// <field name="defaulT_SEPARATOR" type="String" static="true">
    /// The separator used to delimitate fields.
    /// </field>
    /// <field name="escapE_CHARACTER" type="String" static="true">
    /// The character used for character escapes.
    /// </field>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_String);
    this._m_String = p_String;
    this._m_Separator = Coveo.CNL.Web.Scripts.StringDeserializer.defaulT_SEPARATOR;
    this._m_Special = [ Coveo.CNL.Web.Scripts.StringDeserializer.escapE_CHARACTER, Coveo.CNL.Web.Scripts.StringDeserializer.defaulT_SEPARATOR ];
}
Coveo.CNL.Web.Scripts.StringDeserializer.prototype = {
    _m_String: null,
    _m_Separator: null,
    _m_Special: null,
    _m_Current: 0,
    _m_Builder: null,
    
    get_EOF: function Coveo_CNL_Web_Scripts_StringDeserializer$get_EOF() {
        /// <summary>
        /// This property will return true whenever end of file has been reached.
        /// </summary>
        /// <value type="Boolean"></value>
        return this._m_Current === this._m_String.length;
    },
    
    getInt: function Coveo_CNL_Web_Scripts_StringDeserializer$getInt() {
        /// <summary>
        /// Deserializes an integer.
        /// </summary>
        /// <returns type="Number" integer="true"></returns>
        return Number.parseInvariant(this._getNextValue());
    },
    
    getDouble: function Coveo_CNL_Web_Scripts_StringDeserializer$getDouble() {
        /// <summary>
        /// Deserializes a double.
        /// </summary>
        /// <returns type="Number"></returns>
        return parseFloat(this._getNextValue());
    },
    
    getBool: function Coveo_CNL_Web_Scripts_StringDeserializer$getBool() {
        /// <summary>
        /// Deserializes a boolean.
        /// </summary>
        /// <returns type="Boolean"></returns>
        return (this._getNextValue() === '0') ? false : true;
    },
    
    getString: function Coveo_CNL_Web_Scripts_StringDeserializer$getString() {
        /// <summary>
        /// Deserializes a string.
        /// </summary>
        /// <returns type="String"></returns>
        var value = this._getNextValue();
        var pos = value.indexOf(Coveo.CNL.Web.Scripts.StringDeserializer.escapE_CHARACTER);
        if (pos !== -1) {
            if (this._m_Builder == null) {
                this._m_Builder = new Sys.StringBuilder();
            }
            else {
                this._m_Builder.clear();
            }
            var last = 0;
            do {
                this._m_Builder.append(value.substring(last, pos));
                if (value.charAt(pos + 1) === Coveo.CNL.Web.Scripts.StringDeserializer.escapE_CHARACTER) {
                    this._m_Builder.append(Coveo.CNL.Web.Scripts.StringDeserializer.escapE_CHARACTER.toString());
                }
                else {
                    this._m_Builder.append(this._m_Separator.toString());
                }
                last = pos + 2;
                pos = value.indexOf(Coveo.CNL.Web.Scripts.StringDeserializer.escapE_CHARACTER, last);
            } while (pos !== -1);
            this._m_Builder.append(value.substring(last, value.length));
            value = this._m_Builder.toString();
        }
        return value;
    },
    
    getStringArray: function Coveo_CNL_Web_Scripts_StringDeserializer$getStringArray() {
        /// <summary>
        /// Deserializes an array of strings.
        /// </summary>
        /// <returns type="Array" elementType="String"></returns>
        var length = this.getInt();
        var array = new Array(length);
        for (var i = 0; i < length; ++i) {
            array[i] = this.getString();
        }
        return array;
    },
    
    _getNextValue: function Coveo_CNL_Web_Scripts_StringDeserializer$_getNextValue() {
        /// <summary>
        /// Retrieves the next value in the serialized string.
        /// </summary>
        /// <returns type="String"></returns>
        Coveo.CNL.Web.Scripts.CNLAssert.check(!this.get_EOF());
        var pos = Coveo.CNL.Web.Scripts.Utilities.indexOfAny(this._m_String, this._m_Special, this._m_Current);
        while (pos !== -1) {
            var cur = this._m_String.charAt(pos);
            if (cur === Coveo.CNL.Web.Scripts.StringDeserializer.escapE_CHARACTER) {
                Coveo.CNL.Web.Scripts.CNLAssert.check(pos < this._m_String.length - 1);
                pos += 2;
            }
            else if (cur === this._m_Separator) {
                break;
            }
            pos = Coveo.CNL.Web.Scripts.Utilities.indexOfAny(this._m_String, this._m_Special, pos);
        }
        var value;
        if (pos !== -1) {
            value = this._m_String.substring(this._m_Current, pos);
            this._m_Current = pos + 1;
        }
        else {
            value = this._m_String.substring(this._m_Current, this._m_String.length);
            this._m_Current = this._m_String.length;
        }
        return value;
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Utilities

Coveo.CNL.Web.Scripts.Utilities = function Coveo_CNL_Web_Scripts_Utilities() {
    /// <summary>
    /// Various utility methods.
    /// </summary>
}
Coveo.CNL.Web.Scripts.Utilities.fromChar = function Coveo_CNL_Web_Scripts_Utilities$fromChar(p_Char, p_Length) {
    /// <param name="p_Char" type="String">
    /// </param>
    /// <param name="p_Length" type="Number" integer="true">
    /// </param>
    /// <returns type="String"></returns>
    var result = p_Char.toString();
    for (var i = 1; i < p_Length; i++) {
        result += p_Char;
    }
    return result;
}
Coveo.CNL.Web.Scripts.Utilities.padLeft = function Coveo_CNL_Web_Scripts_Utilities$padLeft(p_String, p_TotalWidth, p_Char) {
    /// <param name="p_String" type="String">
    /// </param>
    /// <param name="p_TotalWidth" type="Number" integer="true">
    /// </param>
    /// <param name="p_Char" type="String">
    /// </param>
    /// <returns type="String"></returns>
    if (p_String.length < p_TotalWidth) {
        return Coveo.CNL.Web.Scripts.Utilities.fromChar(p_Char, p_TotalWidth - p_String.length) + p_String;
    }
    return p_String;
}
Coveo.CNL.Web.Scripts.Utilities.padRight = function Coveo_CNL_Web_Scripts_Utilities$padRight(p_String, p_TotalWidth, p_Char) {
    /// <param name="p_String" type="String">
    /// </param>
    /// <param name="p_TotalWidth" type="Number" integer="true">
    /// </param>
    /// <param name="p_Char" type="String">
    /// </param>
    /// <returns type="String"></returns>
    if (p_String.length < p_TotalWidth) {
        return p_String + Coveo.CNL.Web.Scripts.Utilities.fromChar(p_Char, p_TotalWidth - p_String.length);
    }
    return p_String;
}
Coveo.CNL.Web.Scripts.Utilities.isNullOrEmpty = function Coveo_CNL_Web_Scripts_Utilities$isNullOrEmpty(p_String) {
    /// <summary>
    /// Check if a string is null or empty.
    /// </summary>
    /// <param name="p_String" type="String">
    /// The string to look at.
    /// </param>
    /// <returns type="Boolean"></returns>
    return p_String == null || p_String === '';
}
Coveo.CNL.Web.Scripts.Utilities.equals = function Coveo_CNL_Web_Scripts_Utilities$equals(p_String1, p_String2, p_IgnoreCase) {
    /// <summary>
    /// Check if two strings are equals.
    /// </summary>
    /// <param name="p_String1" type="String">
    /// The first string to look at.
    /// </param>
    /// <param name="p_String2" type="String">
    /// The second string to look at.
    /// </param>
    /// <param name="p_IgnoreCase" type="Boolean">
    /// Whether casing should be ignored or not.
    /// </param>
    /// <returns type="Boolean"></returns>
    if (p_IgnoreCase) {
        return (p_String1.toLowerCase() === p_String2.toLowerCase());
    }
    else {
        return (p_String1 === p_String2);
    }
}
Coveo.CNL.Web.Scripts.Utilities.indexOfAny = function Coveo_CNL_Web_Scripts_Utilities$indexOfAny(p_String, p_Chars, p_StartIndex) {
    /// <param name="p_String" type="String">
    /// </param>
    /// <param name="p_Chars" type="Array" elementType="String">
    /// </param>
    /// <param name="p_StartIndex" type="Number" integer="true">
    /// </param>
    /// <returns type="Number" integer="true"></returns>
    var result = -1;
    for (var i = 0; i < p_Chars.length; i++) {
        var index = p_String.indexOf(p_Chars[i], p_StartIndex);
        if (index !== -1 && (result === -1 || index < result)) {
            result = index;
        }
    }
    return result;
}
Coveo.CNL.Web.Scripts.Utilities.isNull = function Coveo_CNL_Web_Scripts_Utilities$isNull(p_Object) {
    /// <summary>
    /// Whether or not an object is null.
    /// </summary>
    /// <param name="p_Object" type="Object">
    /// The object to look at.
    /// </param>
    /// <returns type="Boolean"></returns>
    return Boolean.parse(eval('p_Object === null').toString());
}
Coveo.CNL.Web.Scripts.Utilities.isUndefined = function Coveo_CNL_Web_Scripts_Utilities$isUndefined(p_Object) {
    /// <summary>
    /// Whether or not an object is undefined.
    /// </summary>
    /// <param name="p_Object" type="Object">
    /// The object to look at.
    /// </param>
    /// <returns type="Boolean"></returns>
    return Boolean.parse(eval('p_Object === undefined').toString());
}
Coveo.CNL.Web.Scripts.Utilities.isNullOrUndefined = function Coveo_CNL_Web_Scripts_Utilities$isNullOrUndefined(p_Object) {
    /// <summary>
    /// Whether or not an object is null or undefined.
    /// </summary>
    /// <param name="p_Object" type="Object">
    /// The object to look at.
    /// </param>
    /// <returns type="Boolean"></returns>
    return (Coveo.CNL.Web.Scripts.Utilities.isNull(p_Object) || Coveo.CNL.Web.Scripts.Utilities.isUndefined(p_Object));
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.TransferMargin

Coveo.CNL.Web.Scripts.TransferMargin = function Coveo_CNL_Web_Scripts_TransferMargin(p_From, p_To) {
    /// <summary>
    /// Allows transfering the margins of a <see cref="T:System.DHTML.DOMElement" /> to another element.
    /// </summary>
    /// <param name="p_From" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> whose margins to transfer.
    /// </param>
    /// <param name="p_To" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> to which to transfer margins.
    /// </param>
    /// <field name="_m_From" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Left" type="String">
    /// </field>
    /// <field name="_m_Top" type="String">
    /// </field>
    /// <field name="_m_Right" type="String">
    /// </field>
    /// <field name="_m_Bottom" type="String">
    /// </field>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_From);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_To);
    this._m_From = p_From;
    p_To.style.marginLeft = p_From.currentStyle.marginLeft;
    p_To.style.marginTop = p_From.currentStyle.marginTop;
    p_To.style.marginRight = p_From.currentStyle.marginRight;
    p_To.style.marginBottom = p_From.currentStyle.marginBottom;
    this._m_Left = p_From.style.marginLeft;
    p_From.style.marginLeft = '0px';
    this._m_Top = p_From.style.marginTop;
    p_From.style.marginTop = '0px';
    this._m_Right = p_From.style.marginRight;
    p_From.style.marginRight = '0px';
    this._m_Bottom = p_From.style.marginBottom;
    p_From.style.marginBottom = '0px';
}
Coveo.CNL.Web.Scripts.TransferMargin.prototype = {
    _m_From: null,
    _m_Left: null,
    _m_Top: null,
    _m_Right: null,
    _m_Bottom: null,
    
    restore: function Coveo_CNL_Web_Scripts_TransferMargin$restore() {
        /// <summary>
        /// Restores the margins to their initial state.
        /// </summary>
        this._m_From.style.marginLeft = this._m_Left;
        this._m_From.style.marginTop = this._m_Top;
        this._m_From.style.marginRight = this._m_Right;
        this._m_From.style.marginBottom = this._m_Bottom;
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Timeout

Coveo.CNL.Web.Scripts.Timeout = function Coveo_CNL_Web_Scripts_Timeout(p_Callback, p_Delay) {
    /// <summary>
    /// Encapsulates usage of Window.SetTimeout/&gt; and Window.ClearTimeout.
    /// </summary>
    /// <param name="p_Callback" type="Callback">
    /// The <see cref="T:System.Callback" /> to call when the timeout fires..
    /// </param>
    /// <param name="p_Delay" type="Number" integer="true">
    /// The delay after which to call the callback (in milliseconds).
    /// </param>
    /// <field name="_m_Timer" type="Number" integer="true">
    /// </field>
    /// <field name="_m_Callback" type="Callback">
    /// </field>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Callback != null);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Delay >= 0);
    this._m_Callback = p_Callback;
    this._m_Timer = window.setTimeout(Function.createDelegate(this, this._timerCallback), p_Delay);
}
Coveo.CNL.Web.Scripts.Timeout.prototype = {
    _m_Timer: 0,
    _m_Callback: null,
    
    cancel: function Coveo_CNL_Web_Scripts_Timeout$cancel() {
        /// <summary>
        /// Cancels the timeout, preventing it from firing.
        /// </summary>
        if (this._m_Timer !== 0) {
            window.clearTimeout(this._m_Timer);
            this._m_Timer = 0;
        }
    },
    
    _timerCallback: function Coveo_CNL_Web_Scripts_Timeout$_timerCallback() {
        /// <summary>
        /// Callback for when the timeout fires.
        /// </summary>
        if (this._m_Timer !== 0) {
            this._m_Callback();
            this._m_Timer = 0;
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.OnLeaveManyEvent

Coveo.CNL.Web.Scripts.OnLeaveManyEvent = function Coveo_CNL_Web_Scripts_OnLeaveManyEvent(p_Elements, p_Delay, p_Handler) {
    /// <summary>
    /// Implements an event that fires when the mouse leaves a list of <see cref="T:System.DHTML.DOMElement" /> objects for long enough.
    /// </summary>
    /// <param name="p_Elements" type="Array" elementType="Object" elementDomElement="true">
    /// The elements on which to hook the event.
    /// </param>
    /// <param name="p_Delay" type="Number" integer="true">
    /// The delay during which the mouse must have been outside the elements for the event to fire.
    /// </param>
    /// <param name="p_Handler" type="DOMEventHandler">
    /// The <see cref="T:System.DHTML.DOMEventHandler" /> that handles the event.
    /// </param>
    /// <field name="_m_Elements" type="Array" elementType="Object" elementDomElement="true">
    /// </field>
    /// <field name="_m_Delay" type="Number" integer="true">
    /// </field>
    /// <field name="_m_Handler" type="DOMEventHandler">
    /// </field>
    /// <field name="_m_OnMouseOverHandler" type="DOMEventHandler">
    /// </field>
    /// <field name="_m_OnMouseOutHandler" type="DOMEventHandler">
    /// </field>
    /// <field name="_m_Timeout" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Elements);
    Coveo.CNL.Web.Scripts.CNLAssert.check(p_Delay > 0);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Handler);
    this.attach(p_Elements, p_Delay, p_Handler);
}
Coveo.CNL.Web.Scripts.OnLeaveManyEvent.prototype = {
    _m_Elements: null,
    _m_Delay: 0,
    _m_Handler: null,
    _m_OnMouseOverHandler: null,
    _m_OnMouseOutHandler: null,
    _m_Timeout: null,
    
    dispose: function Coveo_CNL_Web_Scripts_OnLeaveManyEvent$dispose() {
        /// <summary>
        /// Detaches the event handler.
        /// </summary>
        if (this._m_Timeout != null) {
            this._m_Timeout.cancel();
            this._m_Timeout = null;
        }
        for (var i = 0; i < this._m_Elements.length; i++) {
            var elem = this._m_Elements[i];
            elem.detachEvent('onmouseover', this._m_OnMouseOverHandler);
            elem.detachEvent('onmouseout', this._m_OnMouseOutHandler);
        }
    },
    
    attach: function Coveo_CNL_Web_Scripts_OnLeaveManyEvent$attach(p_Elements, p_Delay, p_Handler) {
        /// <summary>
        /// Ataches the event handler.
        /// </summary>
        /// <param name="p_Elements" type="Array" elementType="Object" elementDomElement="true">
        /// The elements on which to hook the event.
        /// </param>
        /// <param name="p_Delay" type="Number" integer="true">
        /// The delay during which the mouse must have been outside the elements for the event to fire.
        /// </param>
        /// <param name="p_Handler" type="DOMEventHandler">
        /// The <see cref="T:System.DHTML.DOMEventHandler" /> that handles the event.
        /// </param>
        this._m_Elements = p_Elements;
        this._m_Delay = p_Delay;
        this._m_Handler = p_Handler;
        this._m_OnMouseOverHandler = Function.createDelegate(this, this._element_OnMouseOver);
        this._m_OnMouseOutHandler = Function.createDelegate(this, this._element_OnMouseOut);
        for (var i = 0; i < this._m_Elements.length; i++) {
            var elem = this._m_Elements[i];
            elem.attachEvent('onmouseover', this._m_OnMouseOverHandler);
            elem.attachEvent('onmouseout', this._m_OnMouseOutHandler);
        }
    },
    
    _fireRealHandler: function Coveo_CNL_Web_Scripts_OnLeaveManyEvent$_fireRealHandler() {
        /// <summary>
        /// Called when the mouse has left the elements for long enough.
        /// </summary>
        this._m_Timeout = null;
        this._m_Handler();
    },
    
    _element_OnMouseOver: function Coveo_CNL_Web_Scripts_OnLeaveManyEvent$_element_OnMouseOver() {
        var outside = true;
        for (var i = 0; i < this._m_Elements.length; i++) {
            var elem = this._m_Elements[i];
            if (elem.contains(window.event.fromElement)) {
                outside = false;
                break;
            }
        }
        if (outside) {
            if (this._m_Timeout != null) {
                this._m_Timeout.cancel();
                this._m_Timeout = null;
            }
        }
    },
    
    _element_OnMouseOut: function Coveo_CNL_Web_Scripts_OnLeaveManyEvent$_element_OnMouseOut() {
        var outside = true;
        for (var i = 0; i < this._m_Elements.length; i++) {
            var elem = this._m_Elements[i];
            if (elem.contains(window.event.toElement)) {
                outside = false;
                break;
            }
        }
        if (outside) {
            if (this._m_Timeout == null) {
                this._m_Timeout = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._fireRealHandler), this._m_Delay);
            }
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.OnDwellEvent

Coveo.CNL.Web.Scripts.OnDwellEvent = function Coveo_CNL_Web_Scripts_OnDwellEvent(p_Element, p_Delay, p_Handler) {
    /// <summary>
    /// Implements an event that fires when the mouse dwells over a <see cref="T:System.DHTML.DOMElement" />.
    /// </summary>
    /// <param name="p_Element" type="Object" domElement="true">
    /// The element on which to hook the event.
    /// </param>
    /// <param name="p_Delay" type="Number" integer="true">
    /// The delay during which the mouse must hover the element for the event to fire.
    /// </param>
    /// <param name="p_Handler" type="DOMEventHandler">
    /// The <see cref="T:System.DHTML.DOMEventHandler" /> that handles the event.
    /// </param>
    /// <field name="_m_Element" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Delay" type="Number" integer="true">
    /// </field>
    /// <field name="_m_Handler" type="DOMEventHandler">
    /// </field>
    /// <field name="_m_Timeout" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    /// <field name="_m_MouseOverDomEventHandler" type="DOMEventHandler">
    /// </field>
    /// <field name="_m_MouseOutDomEventHandler" type="DOMEventHandler">
    /// </field>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element);
    Coveo.CNL.Web.Scripts.CNLAssert.check(p_Delay > 0);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Handler);
    this._m_Element = p_Element;
    this._m_Delay = p_Delay;
    this._m_Handler = p_Handler;
    this._m_MouseOverDomEventHandler = Function.createDelegate(this, this._element_OnMouseOver);
    this._m_Element.attachEvent('onmouseover', this._m_MouseOverDomEventHandler);
    this._m_MouseOutDomEventHandler = Function.createDelegate(this, this._element_OnMouseOut);
    this._m_Element.attachEvent('onmouseout', this._m_MouseOutDomEventHandler);
}
Coveo.CNL.Web.Scripts.OnDwellEvent.prototype = {
    _m_Element: null,
    _m_Delay: 0,
    _m_Handler: null,
    _m_Timeout: null,
    _m_MouseOverDomEventHandler: null,
    _m_MouseOutDomEventHandler: null,
    
    dispose: function Coveo_CNL_Web_Scripts_OnDwellEvent$dispose() {
        /// <summary>
        /// Detaches the event handler.
        /// </summary>
        if (this._m_Timeout != null) {
            this._m_Timeout.cancel();
            this._m_Timeout = null;
        }
        if (this._m_MouseOverDomEventHandler != null) {
            this._m_Element.detachEvent('onmouseover', this._m_MouseOverDomEventHandler);
            this._m_MouseOverDomEventHandler = null;
        }
        if (this._m_MouseOutDomEventHandler != null) {
            this._m_Element.detachEvent('onmouseout', this._m_MouseOutDomEventHandler);
            this._m_MouseOutDomEventHandler = null;
        }
    },
    
    _fireRealHandler: function Coveo_CNL_Web_Scripts_OnDwellEvent$_fireRealHandler() {
        /// <summary>
        /// Called when the mouse has dwelt long enough over the element.
        /// </summary>
        this._m_Timeout = null;
        this._m_Handler();
    },
    
    _element_OnMouseOver: function Coveo_CNL_Web_Scripts_OnDwellEvent$_element_OnMouseOver() {
        if (window.event.fromElement != null && !this._m_Element.contains(window.event.fromElement)) {
            Coveo.CNL.Web.Scripts.CNLAssert.isNull(this._m_Timeout);
            this._m_Timeout = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._fireRealHandler), this._m_Delay);
        }
    },
    
    _element_OnMouseOut: function Coveo_CNL_Web_Scripts_OnDwellEvent$_element_OnMouseOut() {
        if (!this._m_Element.contains(window.event.toElement)) {
            if (this._m_Timeout != null) {
                this._m_Timeout.cancel();
                this._m_Timeout = null;
            }
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.ElementPosition

Coveo.CNL.Web.Scripts.ElementPosition = function Coveo_CNL_Web_Scripts_ElementPosition(p_Left, p_Top) {
    /// <summary>
    /// Holds the position of an element.
    /// </summary>
    /// <param name="p_Left" type="Number" integer="true">
    /// The left position of the element.
    /// </param>
    /// <param name="p_Top" type="Number" integer="true">
    /// The top position of the element.
    /// </param>
    /// <field name="left" type="Number" integer="true">
    /// The left position of the element, in pixels.
    /// </field>
    /// <field name="top" type="Number" integer="true">
    /// The top position of the element, in pixels.
    /// </field>
    this.left = p_Left;
    this.top = p_Top;
}
Coveo.CNL.Web.Scripts.ElementPosition.prototype = {
    left: 0,
    top: 0
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.ElementBounds

Coveo.CNL.Web.Scripts.ElementBounds = function Coveo_CNL_Web_Scripts_ElementBounds(p_Left, p_Top, p_Right, p_Bottom) {
    /// <summary>
    /// Holds the bounds of an element.
    /// </summary>
    /// <param name="p_Left" type="Number" integer="true">
    /// The left position of the element.
    /// </param>
    /// <param name="p_Top" type="Number" integer="true">
    /// The top position of the element.
    /// </param>
    /// <param name="p_Right" type="Number" integer="true">
    /// The right position of the element.
    /// </param>
    /// <param name="p_Bottom" type="Number" integer="true">
    /// The bottom position of the element.
    /// </param>
    /// <field name="left" type="Number" integer="true">
    /// The left position of the element, in pixels.
    /// </field>
    /// <field name="top" type="Number" integer="true">
    /// The top position of the element, in pixels.
    /// </field>
    /// <field name="right" type="Number" integer="true">
    /// The right position of the element, in pixels.
    /// </field>
    /// <field name="bottom" type="Number" integer="true">
    /// The bottom position of the element, in pixels.
    /// </field>
    Coveo.CNL.Web.Scripts.CNLAssert.check(p_Left >= 0);
    Coveo.CNL.Web.Scripts.CNLAssert.check(p_Top >= 0);
    Coveo.CNL.Web.Scripts.CNLAssert.check(p_Right >= p_Left);
    Coveo.CNL.Web.Scripts.CNLAssert.check(p_Bottom >= p_Top);
    this.left = p_Left;
    this.top = p_Top;
    this.right = p_Right;
    this.bottom = p_Bottom;
}
Coveo.CNL.Web.Scripts.ElementBounds.prototype = {
    left: 0,
    top: 0,
    right: 0,
    bottom: 0,
    
    get_width: function Coveo_CNL_Web_Scripts_ElementBounds$get_width() {
        /// <summary>
        /// The width of the element.
        /// </summary>
        /// <value type="Number" integer="true"></value>
        return this.right - this.left;
    },
    
    get_height: function Coveo_CNL_Web_Scripts_ElementBounds$get_height() {
        /// <summary>
        /// The height of the element.
        /// </summary>
        /// <value type="Number" integer="true"></value>
        return this.bottom - this.top;
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.BrowserHelper

Coveo.CNL.Web.Scripts.BrowserHelper = function Coveo_CNL_Web_Scripts_BrowserHelper() {
    /// <summary>
    /// Provides various general javascript utilities.
    /// </summary>
}
Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE = function Coveo_CNL_Web_Scripts_BrowserHelper$get_isIE() {
    /// <summary>
    /// This property is true if the browser is Internet Explorer.
    /// </summary>
    /// <value type="Boolean"></value>
    return window.navigator.userAgent.indexOf('MSIE') !== -1;
}
Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE6 = function Coveo_CNL_Web_Scripts_BrowserHelper$get_isIE6() {
    /// <summary>
    /// This property is true if the browser is Internet Explorer 6.
    /// </summary>
    /// <value type="Boolean"></value>
    return window.navigator.userAgent.indexOf('MSIE 6') !== -1;
}
Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE7 = function Coveo_CNL_Web_Scripts_BrowserHelper$get_isIE7() {
    /// <summary>
    /// This property is true if the browser is Internet Explorer 7.
    /// </summary>
    /// <value type="Boolean"></value>
    return window.navigator.userAgent.indexOf('MSIE 7') !== -1;
}
Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE8 = function Coveo_CNL_Web_Scripts_BrowserHelper$get_isIE8() {
    /// <summary>
    /// This property is true if the browser is Internet Explorer 8.
    /// </summary>
    /// <value type="Boolean"></value>
    return window.navigator.userAgent.indexOf('MSIE 8') !== -1;
}
Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE8Compat = function Coveo_CNL_Web_Scripts_BrowserHelper$get_isIE8Compat() {
    /// <summary>
    /// True if the browser is Internet Explorer 8 in Compatibility Mode.
    /// </summary>
    /// <value type="Boolean"></value>
    return Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE7() && window.navigator.userAgent.indexOf('Trident/4.0') !== -1;
}
Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE7Plus = function Coveo_CNL_Web_Scripts_BrowserHelper$get_isIE7Plus() {
    /// <summary>
    /// This property is true if the browser is Internet Explorer 7 or better.
    /// </summary>
    /// <value type="Boolean"></value>
    return Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE7() || Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE8();
}
Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE8Plus = function Coveo_CNL_Web_Scripts_BrowserHelper$get_isIE8Plus() {
    /// <summary>
    /// This property is true if the browser is Internet Explorer 8 or better.
    /// </summary>
    /// <value type="Boolean"></value>
    return Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE8();
}
Coveo.CNL.Web.Scripts.BrowserHelper.get_isFirefox = function Coveo_CNL_Web_Scripts_BrowserHelper$get_isFirefox() {
    /// <summary>
    /// This property is true if the browser is Firefox.
    /// </summary>
    /// <value type="Boolean"></value>
    return window.navigator.userAgent.indexOf('Firefox') !== -1;
}
Coveo.CNL.Web.Scripts.BrowserHelper.get_isChrome = function Coveo_CNL_Web_Scripts_BrowserHelper$get_isChrome() {
    /// <summary>
    /// This property is true if the browser is Google Chrome.
    /// </summary>
    /// <value type="Boolean"></value>
    return window.navigator.userAgent.indexOf('Chrome') !== -1;
}
Coveo.CNL.Web.Scripts.BrowserHelper.get_standardMode = function Coveo_CNL_Web_Scripts_BrowserHelper$get_standardMode() {
    /// <summary>
    /// This property is true if the current document is in standard mode.
    /// </summary>
    /// <value type="Boolean"></value>
    return eval('document.compatMode') !== 'BackCompat';
}
Coveo.CNL.Web.Scripts.BrowserHelper.get_quirksMode = function Coveo_CNL_Web_Scripts_BrowserHelper$get_quirksMode() {
    /// <summary>
    /// This property is true if the current document is in quirks mode.
    /// </summary>
    /// <value type="Boolean"></value>
    return !Coveo.CNL.Web.Scripts.BrowserHelper.get_standardMode();
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.ElementSize

Coveo.CNL.Web.Scripts.ElementSize = function Coveo_CNL_Web_Scripts_ElementSize(p_Width, p_Height) {
    /// <summary>
    /// Holds the size of an element.
    /// </summary>
    /// <param name="p_Width" type="Number" integer="true">
    /// The width of the element.
    /// </param>
    /// <param name="p_Height" type="Number" integer="true">
    /// The height of the element.
    /// </param>
    /// <field name="width" type="Number" integer="true">
    /// The width of the element, in pixels.
    /// </field>
    /// <field name="height" type="Number" integer="true">
    /// The heigh of the element, in pixels.
    /// </field>
    Coveo.CNL.Web.Scripts.CNLAssert.check(p_Width >= 0);
    Coveo.CNL.Web.Scripts.CNLAssert.check(p_Height >= 0);
    this.width = p_Width;
    this.height = p_Height;
}
Coveo.CNL.Web.Scripts.ElementSize.prototype = {
    width: 0,
    height: 0
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.DOMUtilities

Coveo.CNL.Web.Scripts.DOMUtilities = function Coveo_CNL_Web_Scripts_DOMUtilities() {
    /// <summary>
    /// Provides various utilities for marshalling data with the server.
    /// </summary>
    /// <field name="_s_BusyCounter" type="Number" integer="true" static="true">
    /// </field>
    /// <field name="_s_BusyMarker" type="Object" domElement="true" static="true">
    /// </field>
}
Coveo.CNL.Web.Scripts.DOMUtilities.getWindowSize = function Coveo_CNL_Web_Scripts_DOMUtilities$getWindowSize() {
    /// <summary>
    /// Computes the size of the display window, in pixels.
    /// </summary>
    /// <returns type="Coveo.CNL.Web.Scripts.ElementSize"></returns>
    var size;
    if (Coveo.CNL.Web.Scripts.BrowserHelper.get_standardMode()) {
        size = new Coveo.CNL.Web.Scripts.ElementSize(document.documentElement.clientWidth, document.documentElement.clientHeight);
    }
    else {
        size = new Coveo.CNL.Web.Scripts.ElementSize(document.body.clientWidth, document.body.clientHeight);
    }
    return size;
}
Coveo.CNL.Web.Scripts.DOMUtilities.getScrollingAmount = function Coveo_CNL_Web_Scripts_DOMUtilities$getScrollingAmount() {
    /// <summary>
    /// Computes the current scrolling amount of the window.
    /// </summary>
    /// <returns type="Coveo.CNL.Web.Scripts.ElementSize"></returns>
    var x, y;
    if (Coveo.CNL.Web.Scripts.BrowserHelper.get_standardMode()) {
        x = document.documentElement.scrollLeft;
        y = document.documentElement.scrollTop;
    }
    else {
        x = document.body.scrollLeft;
        y = document.body.scrollTop;
    }
    return new Coveo.CNL.Web.Scripts.ElementSize(x, y);
}
Coveo.CNL.Web.Scripts.DOMUtilities.getElementPosition = function Coveo_CNL_Web_Scripts_DOMUtilities$getElementPosition(p_Element) {
    /// <summary>
    /// Computes the position of an element, in pixels, relative to the top of the document.
    /// </summary>
    /// <param name="p_Element" type="Object" domElement="true">
    /// The element whose position to compute.
    /// </param>
    /// <returns type="Coveo.CNL.Web.Scripts.ElementPosition"></returns>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element);
    var left = 0;
    var top = 0;
    if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE() && !Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE8Plus()) {
        var rects = p_Element.getClientRects();
        var rect = rects.item(0);
        left = rect.left;
        top = rect.top;
        if (!Coveo.CNL.Web.Scripts.Utilities.equals(p_Element.tagName, 'html', true) && !Coveo.CNL.Web.Scripts.Utilities.equals(p_Element.tagName, 'body', true)) {
            var scroll = Coveo.CNL.Web.Scripts.DOMUtilities.getScrollingAmount();
            left += scroll.width;
            top += scroll.height;
        }
        left -= 2;
        top -= 2;
    }
    else if (Coveo.CNL.Web.Scripts.BrowserHelper.get_standardMode()) {
        var elem = p_Element;
        while (elem != null) {
            left += elem.offsetLeft - elem.scrollLeft;
            top += elem.offsetTop - elem.scrollTop;
            if (elem.style.position === 'fixed') {
                var scroll = Coveo.CNL.Web.Scripts.DOMUtilities.getScrollingAmount();
                left += scroll.width;
                top += scroll.height;
                break;
            }
            elem = elem.offsetParent;
        }
    }
    else {
        var elem = p_Element;
        while (!Coveo.CNL.Web.Scripts.Utilities.equals(elem.tagName, 'body', true)) {
            left += elem.offsetLeft - elem.scrollLeft;
            top += elem.offsetTop - elem.scrollTop;
            if (elem.style.position === 'fixed') {
                var scroll = Coveo.CNL.Web.Scripts.DOMUtilities.getScrollingAmount();
                left += scroll.width;
                top += scroll.height;
                break;
            }
            elem = elem.offsetParent;
        }
    }
    return new Coveo.CNL.Web.Scripts.ElementPosition(left, top);
}
Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize = function Coveo_CNL_Web_Scripts_DOMUtilities$getElementSize(p_Element) {
    /// <summary>
    /// Computes the size of an element, in pixels.
    /// </summary>
    /// <param name="p_Element" type="Object" domElement="true">
    /// The element whose size to compute.
    /// </param>
    /// <returns type="Coveo.CNL.Web.Scripts.ElementSize"></returns>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element);
    return new Coveo.CNL.Web.Scripts.ElementSize(p_Element.offsetWidth, p_Element.offsetHeight);
}
Coveo.CNL.Web.Scripts.DOMUtilities.setElementSize = function Coveo_CNL_Web_Scripts_DOMUtilities$setElementSize(p_Element, p_Size) {
    /// <summary>
    /// Sets the size of an element.
    /// </summary>
    /// <param name="p_Element" type="Object" domElement="true">
    /// The element whose size to set.
    /// </param>
    /// <param name="p_Size" type="Coveo.CNL.Web.Scripts.ElementSize">
    /// The new size of the element.
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Size);
    p_Element.style.width = p_Size.width + 'px';
    p_Element.style.height = p_Size.height + 'px';
}
Coveo.CNL.Web.Scripts.DOMUtilities.getElementBounds = function Coveo_CNL_Web_Scripts_DOMUtilities$getElementBounds(p_Element) {
    /// <summary>
    /// Computes the bounds of an element, in pixels.
    /// </summary>
    /// <param name="p_Element" type="Object" domElement="true">
    /// The element whose bounds to compute.
    /// </param>
    /// <returns type="Coveo.CNL.Web.Scripts.ElementBounds"></returns>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element);
    var pos = Coveo.CNL.Web.Scripts.DOMUtilities.getElementPosition(p_Element);
    var size = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(p_Element);
    return new Coveo.CNL.Web.Scripts.ElementBounds(pos.left, pos.top, pos.left + size.width, pos.top + size.height);
}
Coveo.CNL.Web.Scripts.DOMUtilities.setElementBounds = function Coveo_CNL_Web_Scripts_DOMUtilities$setElementBounds(p_Element, p_Bounds) {
    /// <summary>
    /// Sets the bounds of an absolutely positioned element.
    /// </summary>
    /// <param name="p_Element" type="Object" domElement="true">
    /// The element whose bounds to set.
    /// </param>
    /// <param name="p_Bounds" type="Coveo.CNL.Web.Scripts.ElementBounds">
    /// The new bounds of the element.
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Bounds);
    Coveo.CNL.Web.Scripts.CNLAssert.check(p_Element.style.position === 'absolute');
    p_Element.style.left = p_Bounds.left + 'px';
    p_Element.style.top = p_Bounds.top + 'px';
    p_Element.style.width = p_Bounds.get_width() + 'px';
    p_Element.style.height = p_Bounds.get_height() + 'px';
}
Coveo.CNL.Web.Scripts.DOMUtilities.getVisibleRectangle = function Coveo_CNL_Web_Scripts_DOMUtilities$getVisibleRectangle() {
    /// <summary>
    /// Retrieves the bounding of the region that is visible in the window (in pixels).
    /// </summary>
    /// <returns type="Coveo.CNL.Web.Scripts.ElementBounds"></returns>
    var left, top;
    var scroll = Coveo.CNL.Web.Scripts.DOMUtilities.getScrollingAmount();
    left = scroll.width;
    top = scroll.height;
    var right, bottom;
    if (Coveo.CNL.Web.Scripts.BrowserHelper.get_standardMode()) {
        right = left + document.documentElement.clientWidth;
        bottom = top + document.documentElement.clientHeight;
    }
    else {
        right = left + document.body.clientWidth;
        bottom = top + document.body.clientHeight;
    }
    return new Coveo.CNL.Web.Scripts.ElementBounds(left, top, right, bottom);
}
Coveo.CNL.Web.Scripts.DOMUtilities.getIntersection = function Coveo_CNL_Web_Scripts_DOMUtilities$getIntersection(p_First, p_Second) {
    /// <summary>
    /// Computes the intersection of two rectangles.
    /// </summary>
    /// <param name="p_First" type="Coveo.CNL.Web.Scripts.ElementBounds">
    /// The first rectangle.
    /// </param>
    /// <param name="p_Second" type="Coveo.CNL.Web.Scripts.ElementBounds">
    /// The first rectangle.
    /// </param>
    /// <returns type="Coveo.CNL.Web.Scripts.ElementBounds"></returns>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_First);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Second);
    var left = Math.max(p_First.left, p_Second.left);
    var top = Math.max(p_First.top, p_Second.top);
    var right = Math.min(p_First.right, p_Second.right);
    var bottom = Math.min(p_First.bottom, p_Second.bottom);
    return new Coveo.CNL.Web.Scripts.ElementBounds(left, top, right, bottom);
}
Coveo.CNL.Web.Scripts.DOMUtilities.positionElement = function Coveo_CNL_Web_Scripts_DOMUtilities$positionElement(p_Element, p_Reference, p_Position) {
    /// <summary>
    /// Positions an element relative to another.
    /// </summary>
    /// <param name="p_Element" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> to position.
    /// </param>
    /// <param name="p_Reference" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> to position relatively to.
    /// </param>
    /// <param name="p_Position" type="Coveo.CNL.Web.Scripts.PositionEnum">
    /// Where to place the element from the other.
    /// </param>
    var position1;
    var position2;
    switch (p_Position) {
        case Coveo.CNL.Web.Scripts.PositionEnum.leftBelow:
            position1 = 'Left';
            position2 = 'Below';
            break;
        case Coveo.CNL.Web.Scripts.PositionEnum.leftAbove:
            position1 = 'Left';
            position2 = 'Above';
            break;
        case Coveo.CNL.Web.Scripts.PositionEnum.aboveLeft:
            position1 = 'Above';
            position2 = 'Left';
            break;
        case Coveo.CNL.Web.Scripts.PositionEnum.aboveRight:
            position1 = 'Above';
            position2 = 'Right';
            break;
        case Coveo.CNL.Web.Scripts.PositionEnum.rightBelow:
            position1 = 'Right';
            position2 = 'Below';
            break;
        case Coveo.CNL.Web.Scripts.PositionEnum.rightAbove:
            position1 = 'Right';
            position2 = 'Above';
            break;
        case Coveo.CNL.Web.Scripts.PositionEnum.belowLeft:
            position1 = 'Below';
            position2 = 'Left';
            break;
        case Coveo.CNL.Web.Scripts.PositionEnum.belowRight:
            position1 = 'Below';
            position2 = 'Right';
            break;
        default:
            Coveo.CNL.Web.Scripts.CNLAssert.fail();
            position1 = 'Left';
            position2 = 'Below';
            break;
    }
    var left = 0;
    var top = 0;
    var reqLeft = 0;
    var reqTop = 0;
    var done = false;
    var attempts = 0;
    var osize = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(p_Element);
    var rrect = Coveo.CNL.Web.Scripts.DOMUtilities.getElementBounds(p_Reference);
    var vrect = Coveo.CNL.Web.Scripts.DOMUtilities.getVisibleRectangle();
    while (!done && attempts < 3) {
        if (position1 === 'Left') {
            left = rrect.left - osize.width;
        }
        else if (position1 === 'Right') {
            left = rrect.right - 1;
        }
        else if (position1 === 'Above') {
            top = rrect.top - osize.height;
        }
        else if (position1 === 'Below') {
            top = rrect.bottom - 1;
        }
        if (position2 === 'Left') {
            left = rrect.left;
        }
        else if (position2 === 'Right') {
            left = rrect.right - osize.width;
        }
        else if (position2 === 'Above') {
            top = rrect.bottom - osize.height;
        }
        else if (position2 === 'Below') {
            top = rrect.top;
        }
        if (attempts === 0) {
            reqLeft = left;
            reqTop = top;
        }
        done = true;
        var right = left + osize.width;
        var bottom = top + osize.height;
        if (left < vrect.left || right >= vrect.right) {
            if (position1 === 'Left') {
                position1 = 'Right';
            }
            else if (position1 === 'Right') {
                position1 = 'Left';
            }
            else if (position2 === 'Left') {
                position2 = 'Right';
            }
            else if (position2 === 'Right') {
                position2 = 'Left';
            }
            done = false;
        }
        if (top < vrect.top || bottom >= vrect.bottom) {
            if (position1 === 'Above') {
                position1 = 'Below';
            }
            else if (position1 === 'Below') {
                position1 = 'Above';
            }
            else if (position2 === 'Above') {
                position2 = 'Below';
            }
            else if (position2 === 'Below') {
                position2 = 'Above';
            }
            done = false;
        }
        ++attempts;
    }
    if (!done) {
        left = reqLeft;
        top = reqTop;
    }
    Coveo.CNL.Web.Scripts.DOMUtilities.setElementPosition(p_Element, new Coveo.CNL.Web.Scripts.ElementPosition(left, top));
}
Coveo.CNL.Web.Scripts.DOMUtilities.setElementPosition = function Coveo_CNL_Web_Scripts_DOMUtilities$setElementPosition(p_Element, p_Position) {
    /// <summary>
    /// Sets the position of an element.
    /// </summary>
    /// <param name="p_Element" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> to position.
    /// </param>
    /// <param name="p_Position" type="Coveo.CNL.Web.Scripts.ElementPosition">
    /// The position where to place the element.
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Position);
    Coveo.CNL.Web.Scripts.CNLAssert.check(p_Element.currentStyle.position === 'absolute');
    var offsetParent = p_Element.offsetParent;
    if (offsetParent != null) {
        var position = Coveo.CNL.Web.Scripts.DOMUtilities.getElementPosition(offsetParent);
        p_Element.style.left = p_Position.left - position.left + 'px';
        p_Element.style.top = p_Position.top - position.top + 'px';
    }
    else {
        p_Element.style.left = p_Position.left + 'px';
        p_Element.style.top = p_Position.top + 'px';
    }
}
Coveo.CNL.Web.Scripts.DOMUtilities.setFixedPosition = function Coveo_CNL_Web_Scripts_DOMUtilities$setFixedPosition(p_Element, p_Left, p_Top) {
    /// <summary>
    /// Configures an element so that it uses fixed positioning, even on IE6.
    /// </summary>
    /// <param name="p_Element" type="Object" domElement="true">
    /// The element to configure.
    /// </param>
    /// <param name="p_Left" type="Number" integer="true">
    /// The fixed left position of the element.
    /// </param>
    /// <param name="p_Top" type="Number" integer="true">
    /// The fixed top position of the element.
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element);
    Coveo.CNL.Web.Scripts.CNLAssert.check(p_Left >= 0);
    Coveo.CNL.Web.Scripts.CNLAssert.check(p_Top >= 0);
    if ((Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE7Plus() && Coveo.CNL.Web.Scripts.BrowserHelper.get_standardMode()) || !Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE()) {
        p_Element.style.position = 'fixed';
        p_Element.style.left = p_Left + 'px';
        p_Element.style.top = p_Top + 'px';
    }
    else {
        var doc = (Coveo.CNL.Web.Scripts.BrowserHelper.get_standardMode()) ? 'documentElement' : 'body';
        p_Element.style.position = 'absolute';
        p_Element.style.setExpression('left', '(dummy = document.' + doc + '.scrollLeft + ' + p_Left + ') + \'px\'');
        p_Element.style.setExpression('top', '(dummy = document.' + doc + '.scrollTop + ' + p_Top + ') + \'px\'');
    }
}
Coveo.CNL.Web.Scripts.DOMUtilities.consumeRemainingHeight = function Coveo_CNL_Web_Scripts_DOMUtilities$consumeRemainingHeight(p_Parent, p_Header, p_Body, p_Footer, p_Continuous) {
    /// <summary>
    /// Arranges for a <see cref="T:System.DHTML.DOMElement" /> to consume the remaining height
    /// left by a header and a footer inside a parent.
    /// </summary>
    /// <param name="p_Parent" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> for the parent.
    /// </param>
    /// <param name="p_Header" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> for the header.
    /// </param>
    /// <param name="p_Body" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> for the body.
    /// </param>
    /// <param name="p_Footer" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> for the footer.
    /// </param>
    /// <param name="p_Continuous" type="Boolean">
    /// Whether to continuously update the height.
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Parent);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Body);
    Coveo.CNL.Web.Scripts.DOMUtilities._consumeRemainingHeightInternal(p_Parent, p_Header, p_Body, p_Footer, 0, 0, 0, p_Continuous);
}
Coveo.CNL.Web.Scripts.DOMUtilities.coverAllWindow = function Coveo_CNL_Web_Scripts_DOMUtilities$coverAllWindow(p_Element) {
    /// <summary>
    /// Configures an element so that it covers all the screen.
    /// </summary>
    /// <param name="p_Element" type="Object" domElement="true">
    /// The element to configure.
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element);
    Coveo.CNL.Web.Scripts.DOMUtilities.setFixedPosition(p_Element, 0, 0);
    if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE() && !Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE8Plus()) {
        var doc = (Coveo.CNL.Web.Scripts.BrowserHelper.get_standardMode()) ? 'documentElement' : 'body';
        p_Element.style.setExpression('width', '(dummy = window.document.' + doc + '.clientWidth) + \'px\'');
        p_Element.style.setExpression('height', '(dummy = window.document.' + doc + '.clientHeight) + \'px\'');
    }
    else {
        p_Element.style.width = '100%';
        p_Element.style.height = '100%';
    }
}
Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity = function Coveo_CNL_Web_Scripts_DOMUtilities$setOpacity(p_Element, p_Opacity) {
    /// <summary>
    /// Sets the opacity of an element in a cross browser way.
    /// </summary>
    /// <param name="p_Element" type="Object" domElement="true">
    /// The element whose opacity to set.
    /// </param>
    /// <param name="p_Opacity" type="Number">
    /// The opacity of the element (from 0 to 1).
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element);
    Coveo.CNL.Web.Scripts.CNLAssert.check(p_Opacity >= 0 && p_Opacity <= 1);
    if (Math.abs(p_Opacity - 1) > 0.1) {
        if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE()) {
            p_Element.style.filter = 'alpha(opacity=' + (p_Opacity * 100) + ')';
        }
        else {
            p_Element.style.opacity = p_Opacity.toString();
        }
    }
    else {
        if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE()) {
            p_Element.style.filter = '';
        }
        else {
            p_Element.style.opacity = '';
        }
    }
}
Coveo.CNL.Web.Scripts.DOMUtilities.scrollAllTheWayUp = function Coveo_CNL_Web_Scripts_DOMUtilities$scrollAllTheWayUp() {
    /// <summary>
    /// Scrolls the browser window all the way up.
    /// </summary>
    if (Coveo.CNL.Web.Scripts.BrowserHelper.get_standardMode()) {
        document.documentElement.scrollTop = 0;
    }
    else {
        document.body.scrollTop = 0;
    }
}
Coveo.CNL.Web.Scripts.DOMUtilities.scrollIntoViewIfNotAlready = function Coveo_CNL_Web_Scripts_DOMUtilities$scrollIntoViewIfNotAlready(p_Element) {
    /// <summary>
    /// Scrolls an element into view if it's not already being displayed.
    /// </summary>
    /// <param name="p_Element" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> to scroll into view.
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element);
    var visible = Coveo.CNL.Web.Scripts.DOMUtilities.getVisibleRectangle();
    var bounds = Coveo.CNL.Web.Scripts.DOMUtilities.getElementBounds(p_Element);
    if (visible.left > bounds.left || visible.top > bounds.top || visible.right < bounds.right || visible.bottom < bounds.bottom) {
        p_Element.scrollIntoView();
    }
}
Coveo.CNL.Web.Scripts.DOMUtilities.resizeIFrameHeight = function Coveo_CNL_Web_Scripts_DOMUtilities$resizeIFrameHeight(p_IFrame, p_AdditionalHeight) {
    /// <summary>
    /// Resizes an iframe to it's content height.
    /// </summary>
    /// <param name="p_IFrame" type="Object" domElement="true">
    /// The iframe to resize.
    /// </param>
    /// <param name="p_AdditionalHeight" type="Number" integer="true">
    /// Additional height to provide for.
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_IFrame);
    var height;
    if (!Coveo.CNL.Web.Scripts.Utilities.equals(p_IFrame.contentWindow.document.compatMode, 'BackCompat', true)) {
        height = p_IFrame.contentWindow.document.documentElement.scrollHeight;
    }
    else {
        height = p_IFrame.contentWindow.document.body.scrollHeight;
    }
    p_IFrame.style.height = (height + p_AdditionalHeight) + 'px';
}
Coveo.CNL.Web.Scripts.DOMUtilities.removeLinkAndStylesheet = function Coveo_CNL_Web_Scripts_DOMUtilities$removeLinkAndStylesheet(p_Link) {
    /// <summary>
    /// Removes a link element from the DOM, and removes it's associated stylesheet as well.
    /// </summary>
    /// <param name="p_Link" type="Object" domElement="true">
    /// The link element to remove.
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Link);
    var stylesheets = window.document.styleSheets;
    for (var i = 0; i < stylesheets.length; ++i) {
        var stylesheet = stylesheets[i];
        var owner = stylesheet[(Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE()) ? 'owningElement' : 'ownerNode'];
        if (owner === p_Link) {
            stylesheet.disabled = true;
            break;
        }
    }
    p_Link.parentNode.removeChild(p_Link);
}
Coveo.CNL.Web.Scripts.DOMUtilities.setOperationPendingCursor = function Coveo_CNL_Web_Scripts_DOMUtilities$setOperationPendingCursor() {
    /// <summary>
    /// Changes the global mouse cursor to one that signals that an operation is pending.
    /// </summary>
    document.body.style.cursor = 'progress';
}
Coveo.CNL.Web.Scripts.DOMUtilities.removeOperationPendingCursor = function Coveo_CNL_Web_Scripts_DOMUtilities$removeOperationPendingCursor() {
    /// <summary>
    /// Removes the global mouse cursor set by <see cref="M:Coveo.CNL.Web.Scripts.DOMUtilities.SetOperationPendingCursor" />.
    /// </summary>
    document.body.style.cursor = '';
}
Coveo.CNL.Web.Scripts.DOMUtilities.incrementBusyCounter = function Coveo_CNL_Web_Scripts_DOMUtilities$incrementBusyCounter() {
    /// <summary>
    /// Increments the counter that registers if the browser is busy.
    /// </summary>
    if (++Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyCounter === 1) {
        Coveo.CNL.Web.Scripts.CNLAssert.isNull(Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyMarker);
        Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyMarker = document.createElement('div');
        Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyMarker.id = 'CoveoBusyMarker';
        Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyMarker.style.display = 'none';
        document.body.appendChild(Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyMarker);
    }
}
Coveo.CNL.Web.Scripts.DOMUtilities.decrementBusyCounter = function Coveo_CNL_Web_Scripts_DOMUtilities$decrementBusyCounter() {
    /// <summary>
    /// Decrements the counter that registers if the browser is busy.
    /// </summary>
    Coveo.CNL.Web.Scripts.CNLAssert.check(Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyCounter > 0);
    if (--Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyCounter === 0) {
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyMarker);
        document.body.removeChild(Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyMarker);
        Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyMarker = null;
    }
}
Coveo.CNL.Web.Scripts.DOMUtilities.getNextHighestZindex = function Coveo_CNL_Web_Scripts_DOMUtilities$getNextHighestZindex() {
    /// <summary>
    /// Gets the next highest Z-Index available.
    /// </summary>
    /// <returns type="Number" integer="true"></returns>
    var highestIndex = 0;
    var currentIndex = 0;
    var elements = document.getElementsByTagName('*');
    for (var i = 0; i < elements.length; ++i) {
        currentIndex = elements[i].currentStyle.zIndex;
        if (!isNaN(currentIndex)) {
            var current = parseInt(currentIndex);
            if (current < 16777271 && current > highestIndex) {
                highestIndex = current;
            }
        }
    }
    return (highestIndex + 1);
}
Coveo.CNL.Web.Scripts.DOMUtilities._consumeRemainingHeightInternal = function Coveo_CNL_Web_Scripts_DOMUtilities$_consumeRemainingHeightInternal(p_Parent, p_Header, p_Body, p_Footer, p_PreviousParentHeight, p_PreviousHeaderHeight, p_PreviousFooterHeight, p_Continuous) {
    /// <summary>
    /// Arranges for a <see cref="T:System.DHTML.DOMElement" /> to consume the remaining height
    /// left by a header and a footer inside a parent.
    /// </summary>
    /// <param name="p_Parent" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> for the parent.
    /// </param>
    /// <param name="p_Header" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> for the header.
    /// </param>
    /// <param name="p_Body" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> for the body.
    /// </param>
    /// <param name="p_Footer" type="Object" domElement="true">
    /// The <see cref="T:System.DHTML.DOMElement" /> for the footer.
    /// </param>
    /// <param name="p_PreviousParentHeight" type="Number" integer="true">
    /// The previous height of the parent.
    /// </param>
    /// <param name="p_PreviousHeaderHeight" type="Number" integer="true">
    /// The previous height of the header.
    /// </param>
    /// <param name="p_PreviousFooterHeight" type="Number" integer="true">
    /// The previous height of the footer.
    /// </param>
    /// <param name="p_Continuous" type="Boolean">
    /// Whether to continuously update the height.
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Parent);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Body);
    if (p_Parent.parentNode != null) {
        var parentHeight = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(p_Parent).height;
        var headerHeight = (p_Header != null) ? Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(p_Header).height : 0;
        var footerHeight = (p_Footer != null) ? Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(p_Footer).height : 0;
        if (parentHeight !== p_PreviousParentHeight || headerHeight !== p_PreviousHeaderHeight || footerHeight !== p_PreviousFooterHeight) {
            p_Body.style.height = '25px';
            var borderHeight = p_Body.clientTop * 2;
            p_Body.style.display = 'none';
            parentHeight = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(p_Parent).height;
            p_Body.style.height = Math.max(parentHeight - headerHeight - footerHeight - borderHeight, 0) + 'px';
            p_Body.style.display = 'block';
            parentHeight = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(p_Parent).height;
        }
        if (p_Continuous) {
            window.setTimeout(Function.createDelegate(null, function() {
                Coveo.CNL.Web.Scripts.DOMUtilities._consumeRemainingHeightInternal(p_Parent, p_Header, p_Body, p_Footer, parentHeight, headerHeight, footerHeight, p_Continuous);
            }), 500);
        }
    }
    else {
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.MarshalUtilities

Coveo.CNL.Web.Scripts.MarshalUtilities = function Coveo_CNL_Web_Scripts_MarshalUtilities() {
    /// <summary>
    /// Provides various utilities for marshalling data with the server.
    /// </summary>
}
Coveo.CNL.Web.Scripts.MarshalUtilities.marshalValue = function Coveo_CNL_Web_Scripts_MarshalUtilities$marshalValue(p_Value) {
    /// <summary>
    /// Marshals a value to send it to the server.
    /// </summary>
    /// <param name="p_Value" type="Object">
    /// The value to marshal.
    /// </param>
    /// <returns type="String"></returns>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Value);
    return p_Value.toString();
}
Coveo.CNL.Web.Scripts.MarshalUtilities.unmarshalValue = function Coveo_CNL_Web_Scripts_MarshalUtilities$unmarshalValue(p_Type, p_Value) {
    /// <summary>
    /// Unmarshals a value sent by the server.
    /// </summary>
    /// <param name="p_Type" type="String">
    /// The type of the value to unmarshall.
    /// </param>
    /// <param name="p_Value" type="String">
    /// The string representation of the value.
    /// </param>
    /// <returns type="Object"></returns>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Type);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Value);
    var value;
    switch (p_Type.toLowerCase()) {
        case 'string':
            value = p_Value;
            break;
        case 'int32':
            value = parseInt(p_Value);
            break;
        case 'double':
            value = parseFloat(p_Value);
            break;
        case 'boolean':
            value = Boolean.parse(p_Value);
            break;
        case 'none':
            value = null;
            break;
        default:
            Coveo.CNL.Web.Scripts.CNLAssert.fail();
            value = null;
            break;
    }
    return value;
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.CNLAssert

Coveo.CNL.Web.Scripts.CNLAssert = function Coveo_CNL_Web_Scripts_CNLAssert() {
    /// <summary>
    /// Provides various assertions for client code.
    /// </summary>
}
Coveo.CNL.Web.Scripts.CNLAssert.fail = function Coveo_CNL_Web_Scripts_CNLAssert$fail() {
    /// <summary>
    /// Call when an assertion fails.
    /// </summary>
}
Coveo.CNL.Web.Scripts.CNLAssert.failWithMessage = function Coveo_CNL_Web_Scripts_CNLAssert$failWithMessage(p_Message) {
    /// <summary>
    /// Call when an assertion fails.
    /// </summary>
    /// <param name="p_Message" type="String">
    /// The message to display with the assert.
    /// </param>
}
Coveo.CNL.Web.Scripts.CNLAssert.check = function Coveo_CNL_Web_Scripts_CNLAssert$check(p_Condition) {
    /// <summary>
    /// Checks that a condition is true.
    /// </summary>
    /// <param name="p_Condition" type="Boolean">
    /// The condition to check.
    /// </param>
    if (!p_Condition) {
        Coveo.CNL.Web.Scripts.CNLAssert.fail();
    }
}
Coveo.CNL.Web.Scripts.CNLAssert.notNull = function Coveo_CNL_Web_Scripts_CNLAssert$notNull(p_Object) {
    /// <summary>
    /// Asserts that an object is not null.
    /// </summary>
    /// <param name="p_Object" type="Object">
    /// The object to check.
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.check(!Coveo.CNL.Web.Scripts.Utilities.isNullOrUndefined(p_Object));
}
Coveo.CNL.Web.Scripts.CNLAssert.isNull = function Coveo_CNL_Web_Scripts_CNLAssert$isNull(p_Object) {
    /// <summary>
    /// Asserts that an object is null.
    /// </summary>
    /// <param name="p_Object" type="Object">
    /// The object to check.
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.check(Coveo.CNL.Web.Scripts.Utilities.isNullOrUndefined(p_Object));
}
Coveo.CNL.Web.Scripts.CNLAssert.notEmpty = function Coveo_CNL_Web_Scripts_CNLAssert$notEmpty(p_String) {
    /// <summary>
    /// Asserts that a string is not null and not empty.
    /// </summary>
    /// <param name="p_String" type="String">
    /// The string to check.
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_String);
    Coveo.CNL.Web.Scripts.CNLAssert.check(p_String !== '');
}
Coveo.CNL.Web.Scripts.CNLAssert.isEmpty = function Coveo_CNL_Web_Scripts_CNLAssert$isEmpty(p_String) {
    /// <summary>
    /// Asserts that a string is not null and empty.
    /// </summary>
    /// <param name="p_String" type="String">
    /// The string to check.
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_String);
    Coveo.CNL.Web.Scripts.CNLAssert.check(p_String === '');
}


Type.registerNamespace('Coveo.CNL.Web.Scripts.Misc');

////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Misc.TextChangedEventScript

Coveo.CNL.Web.Scripts.Misc.TextChangedEventScript = function Coveo_CNL_Web_Scripts_Misc_TextChangedEventScript() {
    /// <summary>
    /// Client side code for a textbox control who postbacks everytime the user stops typing.
    /// </summary>
    /// <field name="_postbacK_DELAY$1" type="Number" integer="true" static="true">
    /// </field>
    /// <field name="_m_KeyDownEventHandler$1" type="DOMEventHandler">
    /// </field>
    /// <field name="_m_KeyUpEventHandler$1" type="DOMEventHandler">
    /// </field>
    /// <field name="m_TextBox" type="Object" domElement="true">
    /// </field>
    /// <field name="m_PostbackTimeout" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    Coveo.CNL.Web.Scripts.Misc.TextChangedEventScript.initializeBase(this);
}
Coveo.CNL.Web.Scripts.Misc.TextChangedEventScript.prototype = {
    _m_KeyDownEventHandler$1: null,
    _m_KeyUpEventHandler$1: null,
    m_TextBox: null,
    m_PostbackTimeout: null,
    
    initialize: function Coveo_CNL_Web_Scripts_Misc_TextChangedEventScript$initialize() {
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_TextBox);
        this._m_KeyDownEventHandler$1 = Function.createDelegate(this, this._textBox_KeyDown$1);
        this._m_KeyUpEventHandler$1 = Function.createDelegate(this, this._textBox_KeyUp$1);
        this.m_TextBox.attachEvent('onkeydown', this._m_KeyDownEventHandler$1);
        this.m_TextBox.attachEvent('onkeyup', this._m_KeyUpEventHandler$1);
    },
    
    tearDown: function Coveo_CNL_Web_Scripts_Misc_TextChangedEventScript$tearDown() {
        if (this._m_KeyDownEventHandler$1 != null) {
            this.m_TextBox.detachEvent('onkeydown', this._m_KeyDownEventHandler$1);
            this._m_KeyDownEventHandler$1 = null;
        }
        if (this._m_KeyUpEventHandler$1 != null) {
            this.m_TextBox.detachEvent('onkeyup', this._m_KeyUpEventHandler$1);
            this._m_KeyUpEventHandler$1 = null;
        }
        this.m_TextBox = null;
    },
    
    fireTextChanged: function Coveo_CNL_Web_Scripts_Misc_TextChangedEventScript$fireTextChanged(p_Text, p_Callback) {
        /// <param name="p_Text" type="String">
        /// </param>
        /// <param name="p_Callback" type="Coveo.CNL.Web.Scripts.Ajax.PostBackCallback">
        /// </param>
    },
    
    fireEscapePressed: function Coveo_CNL_Web_Scripts_Misc_TextChangedEventScript$fireEscapePressed() {
    },
    
    _textBox_KeyDown$1: function Coveo_CNL_Web_Scripts_Misc_TextChangedEventScript$_textBox_KeyDown$1() {
        if (window.event.keyCode === 27) {
            window.event.cancelBubble = true;
            window.event.returnValue = false;
            this._cancelPendingTimeout$1();
            this.fireEscapePressed();
        }
    },
    
    _textBox_KeyUp$1: function Coveo_CNL_Web_Scripts_Misc_TextChangedEventScript$_textBox_KeyUp$1() {
        var keyCode = window.event.keyCode;
        if (keyCode === 13 || keyCode === 9) {
            this._cancelPendingTimeout$1();
            this._startTextChanged$1();
        }
        else if (keyCode === 16 || keyCode === 17 || keyCode === 19 || keyCode === 20 || keyCode === 27 || keyCode === 33 || keyCode === 34 || keyCode === 35 || keyCode === 36 || keyCode === 144 || keyCode === 145) {
        }
        else if (keyCode >= 37 && keyCode <= 40) {
        }
        else if (keyCode >= 112 && keyCode <= 123) {
        }
        else {
            this._cancelPendingTimeout$1();
            this._scheduleTextChanged$1();
        }
    },
    
    _scheduleTextChanged$1: function Coveo_CNL_Web_Scripts_Misc_TextChangedEventScript$_scheduleTextChanged$1() {
        /// <summary>
        /// Schedules a TextChanged event.
        /// </summary>
        Coveo.CNL.Web.Scripts.CNLAssert.isNull(this.m_PostbackTimeout);
        this.m_PostbackTimeout = new Coveo.CNL.Web.Scripts.Timeout(Function.createDelegate(this, this._startTextChanged$1), Coveo.CNL.Web.Scripts.Misc.TextChangedEventScript._postbacK_DELAY$1);
    },
    
    _cancelPendingTimeout$1: function Coveo_CNL_Web_Scripts_Misc_TextChangedEventScript$_cancelPendingTimeout$1() {
        /// <summary>
        /// Cancels any pending TextChanged event.
        /// </summary>
        if (this.m_PostbackTimeout != null) {
            this.m_PostbackTimeout.cancel();
            this.m_PostbackTimeout = null;
        }
    },
    
    _startTextChanged$1: function Coveo_CNL_Web_Scripts_Misc_TextChangedEventScript$_startTextChanged$1() {
        /// <summary>
        /// Launches a TextChanged event on the server.
        /// </summary>
        this.m_PostbackTimeout = null;
        if (this.m_TextBox != null) {
            this.fireTextChanged(this.m_TextBox.value, Function.createDelegate(this, this._textChangedCallback$1));
        }
    },
    
    _textChangedCallback$1: function Coveo_CNL_Web_Scripts_Misc_TextChangedEventScript$_textChangedCallback$1(p_Return) {
        /// <summary>
        /// Callback for when the server has handled the TextChanged event.
        /// </summary>
        /// <param name="p_Return" type="Object">
        /// The return of the call to the server.
        /// </param>
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CNL.Web.Scripts.Misc.ToolTipScript

Coveo.CNL.Web.Scripts.Misc.ToolTipScript = function Coveo_CNL_Web_Scripts_Misc_ToolTipScript() {
    /// <summary>
    /// Client side code for the Tooltip control.
    /// </summary>
    /// <field name="m_HotSpot" type="Object" domElement="true">
    /// </field>
    /// <field name="m_PopupParent" type="Object" domElement="true">
    /// </field>
    /// <field name="m_Position" type="Coveo.CNL.Web.Scripts.PositionEnum">
    /// </field>
    /// <field name="m_MaxWidth" type="Number" integer="true">
    /// </field>
    /// <field name="m_ShowOnHover" type="Boolean">
    /// </field>
    /// <field name="m_ShowDelay" type="Number" integer="true">
    /// </field>
    /// <field name="m_HideDelay" type="Number" integer="true">
    /// </field>
    /// <field name="m_ShowOnClick" type="Boolean">
    /// </field>
    /// <field name="m_HideOnClick" type="Boolean">
    /// </field>
    /// <field name="m_FadeIn" type="Boolean">
    /// </field>
    /// <field name="_m_OnDwellEvent$1" type="Coveo.CNL.Web.Scripts.OnDwellEvent">
    /// </field>
    /// <field name="_m_OnLeaveManyEvent$1" type="Coveo.CNL.Web.Scripts.OnLeaveManyEvent">
    /// </field>
    /// <field name="_m_Popup$1" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_PostShowProcesses$1" type="Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager">
    /// </field>
    /// <field name="_m_HotSpotClickDomEventHandler$1" type="DOMEventHandler">
    /// </field>
    /// <field name="_m_ToolTipClickDomEventHandler$1" type="DOMEventHandler">
    /// </field>
    Coveo.CNL.Web.Scripts.Misc.ToolTipScript.initializeBase(this);
}
Coveo.CNL.Web.Scripts.Misc.ToolTipScript.prototype = {
    m_HotSpot: null,
    m_PopupParent: null,
    m_Position: 0,
    m_MaxWidth: 0,
    m_ShowOnHover: false,
    m_ShowDelay: 0,
    m_HideDelay: 0,
    m_ShowOnClick: false,
    m_HideOnClick: false,
    m_FadeIn: false,
    _m_OnDwellEvent$1: null,
    _m_OnLeaveManyEvent$1: null,
    _m_Popup$1: null,
    _m_PostShowProcesses$1: null,
    _m_HotSpotClickDomEventHandler$1: null,
    _m_ToolTipClickDomEventHandler$1: null,
    
    initialize: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$initialize() {
        this._registerProperEvents$1();
    },
    
    tearDown: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$tearDown() {
        this._getRidOfEverything$1();
    },
    
    fetchToolTipContent: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$fetchToolTipContent(p_Callback) {
        /// <summary>
        /// Placeholder for the server call that fetches the tooltip.
        /// </summary>
        /// <param name="p_Callback" type="Coveo.CNL.Web.Scripts.Ajax.PostBackCallback">
        /// </param>
        Coveo.CNL.Web.Scripts.CNLAssert.fail();
    },
    
    _showToolTipIfNotVisible$1: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$_showToolTipIfNotVisible$1() {
        /// <summary>
        /// Begins showing the tooltip.
        /// </summary>
        if (this._m_Popup$1 == null) {
            if (Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current() != null) {
                Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current().blockTimer();
            }
            this.fetchToolTipContent(Function.createDelegate(this, this._fetchToolTipCallback$1));
        }
    },
    
    _hideToolTipIfVisible$1: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$_hideToolTipIfVisible$1() {
        /// <summary>
        /// Hides the tooltip if it is visible.
        /// </summary>
        if (this._m_Popup$1 != null) {
            this._getRidOfEverything$1();
            this._m_Popup$1.parentNode.removeChild(this._m_Popup$1);
            this._m_Popup$1 = null;
            this._registerProperEvents$1();
            if (Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current() != null) {
                Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current().unblockTimer();
            }
        }
    },
    
    _fetchToolTipCallback$1: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$_fetchToolTipCallback$1(p_Return) {
        /// <summary>
        /// Handles the return value of the call to fetch the tooltip content.
        /// </summary>
        /// <param name="p_Return" type="Object">
        /// </param>
        this._getRidOfEverything$1();
        var content = p_Return;
        this._m_Popup$1 = document.createElement('div');
        this._m_Popup$1.appendChild(content);
        this._m_Popup$1.style.position = 'absolute';
        this._m_Popup$1.style.zIndex = Coveo.CNL.Web.Scripts.DOMUtilities.getNextHighestZindex();
        if (this.m_FadeIn) {
            Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Popup$1, 0);
        }
        this.m_PopupParent.appendChild(this._m_Popup$1);
        if (this.m_MaxWidth !== 0 && Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this._m_Popup$1).width > this.m_MaxWidth) {
            this._m_Popup$1.style.width = this.m_MaxWidth + 'px';
        }
        Coveo.CNL.Web.Scripts.DOMUtilities.positionElement(this._m_Popup$1, this.m_HotSpot, this.m_Position);
        this._registerProperEvents$1();
        if (this.m_FadeIn) {
            this._m_PostShowProcesses$1 = new Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager();
            this._m_PostShowProcesses$1.add(new Coveo.CNL.Web.Scripts.Ajax.GradualFadeInEffect(this._m_Popup$1));
            this._m_PostShowProcesses$1.startAll(null);
        }
    },
    
    _registerProperEvents$1: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$_registerProperEvents$1() {
        /// <summary>
        /// Registers the events depending on the state.
        /// </summary>
        if (this._m_Popup$1 == null) {
            if (this.m_ShowOnHover) {
                this._m_OnDwellEvent$1 = new Coveo.CNL.Web.Scripts.OnDwellEvent(this.m_HotSpot, this.m_ShowDelay, Function.createDelegate(this, this._hotSpot_OnDwell$1));
            }
            if (this.m_ShowOnClick) {
                this._m_HotSpotClickDomEventHandler$1 = Function.createDelegate(this, this._hotSpot_OnClick$1);
                this.m_HotSpot.attachEvent('onclick', this._m_HotSpotClickDomEventHandler$1);
            }
        }
        else {
            if (this.m_ShowOnHover) {
                this._m_OnLeaveManyEvent$1 = new Coveo.CNL.Web.Scripts.OnLeaveManyEvent([ this.m_HotSpot, this.m_PopupParent, this._m_Popup$1 ], this.m_HideDelay, Function.createDelegate(this, this._toolTip_OnLeave$1));
            }
            if (this.m_HideOnClick) {
                this._m_ToolTipClickDomEventHandler$1 = Function.createDelegate(this, this._toolTip_OnClick$1);
                this._m_Popup$1.attachEvent('onclick', this._m_ToolTipClickDomEventHandler$1);
            }
        }
    },
    
    _getRidOfEverything$1: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$_getRidOfEverything$1() {
        /// <summary>
        /// Unregisters all events, stops all async processes, etc.
        /// </summary>
        if (this._m_PostShowProcesses$1 != null) {
            this._m_PostShowProcesses$1.terminateAll();
            this._m_PostShowProcesses$1 = null;
        }
        if (this._m_OnDwellEvent$1 != null) {
            this._m_OnDwellEvent$1.dispose();
            this._m_OnDwellEvent$1 = null;
        }
        if (this._m_OnLeaveManyEvent$1 != null) {
            this._m_OnLeaveManyEvent$1.dispose();
            this._m_OnLeaveManyEvent$1 = null;
        }
        if (this.m_ShowOnClick) {
            if (this._m_HotSpotClickDomEventHandler$1 != null) {
                this.m_HotSpot.detachEvent('onclick', this._m_HotSpotClickDomEventHandler$1);
                this._m_HotSpotClickDomEventHandler$1 = null;
            }
        }
        if (this._m_Popup$1 != null && this.m_HideOnClick) {
            if (this._m_ToolTipClickDomEventHandler$1 != null) {
                this._m_Popup$1.detachEvent('onclick', this._m_ToolTipClickDomEventHandler$1);
                this._m_ToolTipClickDomEventHandler$1 = null;
            }
        }
    },
    
    _hotSpot_OnDwell$1: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$_hotSpot_OnDwell$1() {
        this._showToolTipIfNotVisible$1();
    },
    
    _hotSpot_OnClick$1: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$_hotSpot_OnClick$1() {
        this._showToolTipIfNotVisible$1();
    },
    
    _toolTip_OnLeave$1: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$_toolTip_OnLeave$1() {
        this._hideToolTipIfVisible$1();
    },
    
    _toolTip_OnClick$1: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$_toolTip_OnClick$1() {
        this._hideToolTipIfVisible$1();
    }
}


Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcess.registerClass('Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcess');
Coveo.CNL.Web.Scripts.Ajax.ControlFlipper.registerClass('Coveo.CNL.Web.Scripts.Ajax.ControlFlipper', null, Coveo.CNL.Web.Scripts.Ajax.IContentFlipper);
Coveo.CNL.Web.Scripts.Ajax.TransitionEffect.registerClass('Coveo.CNL.Web.Scripts.Ajax.TransitionEffect', Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcess);
Coveo.CNL.Web.Scripts.Ajax.CollapseTransition.registerClass('Coveo.CNL.Web.Scripts.Ajax.CollapseTransition', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect);
Coveo.CNL.Web.Scripts.Ajax.AdjustTransition.registerClass('Coveo.CNL.Web.Scripts.Ajax.AdjustTransition', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect);
Coveo.CNL.Web.Scripts.Ajax.Console.registerClass('Coveo.CNL.Web.Scripts.Ajax.Console');
Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript.registerClass('Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript');
Coveo.CNL.Web.Scripts.Ajax.Feedback.registerClass('Coveo.CNL.Web.Scripts.Ajax.Feedback', Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcess);
Coveo.CNL.Web.Scripts.Ajax.BlankFeedback.registerClass('Coveo.CNL.Web.Scripts.Ajax.BlankFeedback', Coveo.CNL.Web.Scripts.Ajax.Feedback);
Coveo.CNL.Web.Scripts.Ajax.Bootstrap.registerClass('Coveo.CNL.Web.Scripts.Ajax.Bootstrap');
Coveo.CNL.Web.Scripts.Ajax.AjaxProgressScript.registerClass('Coveo.CNL.Web.Scripts.Ajax.AjaxProgressScript', Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcess);
Coveo.CNL.Web.Scripts.Ajax.DropDownContentController.registerClass('Coveo.CNL.Web.Scripts.Ajax.DropDownContentController', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CNL.Web.Scripts.Ajax.DropDownMenuControler.registerClass('Coveo.CNL.Web.Scripts.Ajax.DropDownMenuControler', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CNL.Web.Scripts.Ajax.PostbackOptionsScript.registerClass('Coveo.CNL.Web.Scripts.Ajax.PostbackOptionsScript');
Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack.registerClass('Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack', Coveo.CNL.Web.Scripts.Ajax.Feedback);
Coveo.CNL.Web.Scripts.Ajax.Profiler.registerClass('Coveo.CNL.Web.Scripts.Ajax.Profiler');
Coveo.CNL.Web.Scripts.Ajax.PercentTimer.registerClass('Coveo.CNL.Web.Scripts.Ajax.PercentTimer');
Coveo.CNL.Web.Scripts.Ajax.UpdateDebugger.registerClass('Coveo.CNL.Web.Scripts.Ajax.UpdateDebugger', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect);
Coveo.CNL.Web.Scripts.Ajax.FlipFadeTransition.registerClass('Coveo.CNL.Web.Scripts.Ajax.FlipFadeTransition', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect);
Coveo.CNL.Web.Scripts.Ajax.IdMappings.registerClass('Coveo.CNL.Web.Scripts.Ajax.IdMappings');
Coveo.CNL.Web.Scripts.Ajax.FadeInTransition.registerClass('Coveo.CNL.Web.Scripts.Ajax.FadeInTransition', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect);
Coveo.CNL.Web.Scripts.Ajax.GradualFadeInEffect.registerClass('Coveo.CNL.Web.Scripts.Ajax.GradualFadeInEffect', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect);
Coveo.CNL.Web.Scripts.Ajax.ScriptLoaderWrapper.registerClass('Coveo.CNL.Web.Scripts.Ajax.ScriptLoaderWrapper', Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcess);
Coveo.CNL.Web.Scripts.Ajax.ModalBox.registerClass('Coveo.CNL.Web.Scripts.Ajax.ModalBox');
Coveo.CNL.Web.Scripts.Ajax.FlipTransition.registerClass('Coveo.CNL.Web.Scripts.Ajax.FlipTransition', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect);
Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager.registerClass('Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager');
Coveo.CNL.Web.Scripts.Ajax.FadeFlipTransition.registerClass('Coveo.CNL.Web.Scripts.Ajax.FadeFlipTransition', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect);
Coveo.CNL.Web.Scripts.Ajax.HAdjustTransition.registerClass('Coveo.CNL.Web.Scripts.Ajax.HAdjustTransition', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect);
Coveo.CNL.Web.Scripts.Ajax.HCollapseTransition.registerClass('Coveo.CNL.Web.Scripts.Ajax.HCollapseTransition', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect);
Coveo.CNL.Web.Scripts.Ajax.HExpandTransition.registerClass('Coveo.CNL.Web.Scripts.Ajax.HExpandTransition', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect);
Coveo.CNL.Web.Scripts.Ajax.ExpandTransition.registerClass('Coveo.CNL.Web.Scripts.Ajax.ExpandTransition', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect);
Coveo.CNL.Web.Scripts.Ajax.RegionFlipper.registerClass('Coveo.CNL.Web.Scripts.Ajax.RegionFlipper', null, Coveo.CNL.Web.Scripts.Ajax.IContentFlipper);
Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.registerClass('Coveo.CNL.Web.Scripts.Ajax.PartialPostBack');
Coveo.CNL.Web.Scripts.Ajax._feedbackInfo.registerClass('Coveo.CNL.Web.Scripts.Ajax._feedbackInfo');
Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.registerClass('Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript');
Coveo.CNL.Web.Scripts.BetterControls.BetterButtonScript.registerClass('Coveo.CNL.Web.Scripts.BetterControls.BetterButtonScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CNL.Web.Scripts.BetterControls.BetterLinkButtonScript.registerClass('Coveo.CNL.Web.Scripts.BetterControls.BetterLinkButtonScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CNL.Web.Scripts.MulticastEventHandler.registerClass('Coveo.CNL.Web.Scripts.MulticastEventHandler');
Coveo.CNL.Web.Scripts.OnClickElsewhereEvent.registerClass('Coveo.CNL.Web.Scripts.OnClickElsewhereEvent');
Coveo.CNL.Web.Scripts.ScriptLoader.registerClass('Coveo.CNL.Web.Scripts.ScriptLoader', null, Sys.IDisposable);
Coveo.CNL.Web.Scripts.StringDeserializer.registerClass('Coveo.CNL.Web.Scripts.StringDeserializer');
Coveo.CNL.Web.Scripts.Utilities.registerClass('Coveo.CNL.Web.Scripts.Utilities');
Coveo.CNL.Web.Scripts.TransferMargin.registerClass('Coveo.CNL.Web.Scripts.TransferMargin');
Coveo.CNL.Web.Scripts.Timeout.registerClass('Coveo.CNL.Web.Scripts.Timeout');
Coveo.CNL.Web.Scripts.OnLeaveManyEvent.registerClass('Coveo.CNL.Web.Scripts.OnLeaveManyEvent');
Coveo.CNL.Web.Scripts.OnDwellEvent.registerClass('Coveo.CNL.Web.Scripts.OnDwellEvent');
Coveo.CNL.Web.Scripts.ElementPosition.registerClass('Coveo.CNL.Web.Scripts.ElementPosition');
Coveo.CNL.Web.Scripts.ElementBounds.registerClass('Coveo.CNL.Web.Scripts.ElementBounds');
Coveo.CNL.Web.Scripts.BrowserHelper.registerClass('Coveo.CNL.Web.Scripts.BrowserHelper');
Coveo.CNL.Web.Scripts.ElementSize.registerClass('Coveo.CNL.Web.Scripts.ElementSize');
Coveo.CNL.Web.Scripts.DOMUtilities.registerClass('Coveo.CNL.Web.Scripts.DOMUtilities');
Coveo.CNL.Web.Scripts.MarshalUtilities.registerClass('Coveo.CNL.Web.Scripts.MarshalUtilities');
Coveo.CNL.Web.Scripts.CNLAssert.registerClass('Coveo.CNL.Web.Scripts.CNLAssert');
Coveo.CNL.Web.Scripts.Misc.TextChangedEventScript.registerClass('Coveo.CNL.Web.Scripts.Misc.TextChangedEventScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CNL.Web.Scripts.Misc.ToolTipScript.registerClass('Coveo.CNL.Web.Scripts.Misc.ToolTipScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CNL.Web.Scripts.Ajax.CollapseTransition._framE_DELAY$2 = 7;
Coveo.CNL.Web.Scripts.Ajax.AdjustTransition._framE_DELAY$2 = 7;
Coveo.CNL.Web.Scripts.Ajax.Console._s_Console = null;
Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Element = null;
Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request = null;
Coveo.CNL.Web.Scripts.Ajax.AjaxProgressScript._initiaL_DELAY$1 = 500;
Coveo.CNL.Web.Scripts.Ajax.AjaxProgressScript._polL_DELAY$1 = 500;
Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack._framE_DELAY$2 = 750;
Coveo.CNL.Web.Scripts.Ajax.Profiler._s_Current = null;
Coveo.CNL.Web.Scripts.Ajax.Profiler._s_Results = null;
Coveo.CNL.Web.Scripts.Ajax.UpdateDebugger._displaY_DELAY$2 = 3000;
Coveo.CNL.Web.Scripts.Ajax.FlipFadeTransition._framE_DELAY$2 = 25;
Coveo.CNL.Web.Scripts.Ajax.Feedback._initiaL_DELAY$1 = 25;
Coveo.CNL.Web.Scripts.Ajax.FadeInTransition._framE_DELAY$2 = 20;
Coveo.CNL.Web.Scripts.Ajax.GradualFadeInEffect._framE_DELAY$2 = 7;
Coveo.CNL.Web.Scripts.Ajax.FadeFlipTransition._framE_DELAY$2 = 7;
Coveo.CNL.Web.Scripts.Ajax.HAdjustTransition._framE_DELAY$2 = 7;
Coveo.CNL.Web.Scripts.Ajax.HCollapseTransition._framE_DELAY$2 = 7;
Coveo.CNL.Web.Scripts.Ajax.HExpandTransition._framE_DELAY$2 = 7;
Coveo.CNL.Web.Scripts.Ajax.ExpandTransition._framE_DELAY$2 = 7;
Coveo.CNL.Web.Scripts.Ajax.PartialPostBack._s_FirstPartialPostBack = true;
Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.headeR_PARTIAL_POSTBACK = 'Coveo-Partial-Postback';
Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.headeR_BOOTSTRAP = 'Coveo-Bootstrap';
Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.headeR_HISTORY_STATE = 'Coveo-HState';
Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.headeR_NO_CONTROL_DATA = 'Coveo-No-Control-Data';
Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_EVENT_TARGET = '__EVENTTARGET';
Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_EVENT_ARGUMENT = '__EVENTARGUMENT';
Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_VIEW_STATE = '__VIEWSTATE';
Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_VIEW_STATE_ENCRYPTED = '__VIEWSTATEENCRYPTED';
Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_REQUEST_DIGEST = '__REQUESTDIGEST';
Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript._s_Instance = null;
Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript._s_InitialHistoryEventArgs = null;
var historyFrame = document.getElementById('__historyFrame');
if (historyFrame != null) {
    Sys.Application.set_enableHistory(true);
    Sys.Application.add_navigate(Function.createDelegate(null, Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript._initial_History_Navigated));
    if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE7() || Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE8Compat()) {
        var hash = window.location.hash;
        if ((hash.length > 0) && (hash.charAt(0) === '#')) {
            hash = hash.substr(1);
        }
        var frameDoc = historyFrame.contentWindow.document;
        frameDoc.open();
        frameDoc.write('<html><head><title>' + document.title + '</title><script type=\"text/javascript\">parent.Sys.Application._onIFrameLoad(\'' + hash + '\');</script></head><body></body></html>');
        frameDoc.close();
    }
}
Coveo.CNL.Web.Scripts.StringDeserializer.defaulT_SEPARATOR = '!';
Coveo.CNL.Web.Scripts.StringDeserializer.escapE_CHARACTER = '\\';
Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyCounter = 0;
Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyMarker = null;
Coveo.CNL.Web.Scripts.Misc.TextChangedEventScript._postbacK_DELAY$1 = 250;

// ---- Do not remove this footer ----
// This script was generated using Script# v0.5.5.0 (http://projects.nikhilk.net/ScriptSharp)
// -----------------------------------
