_coveoDefineJQuery = function() { var $ = _coveoJQuery;
Type.registerNamespace('Coveo.CES.Common');

////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Common.SearchInterfaceQueryString

Coveo.CES.Common.SearchInterfaceQueryString = function Coveo_CES_Common_SearchInterfaceQueryString() {
    /// <summary>
    /// Provides constants for the various query string parameters used by CES.
    /// </summary>
    /// <field name="queryParameter" type="String" static="true">
    /// The query string parameter used for passing the query.
    /// </field>
    /// <field name="conversationSubjectParameter" type="String" static="true">
    /// The query string parameter used for passing the conversation Subject.
    /// </field>
    /// <field name="targetFrameParameter" type="String" static="true">
    /// The query string parameter used for the target frame.
    /// </field>
    /// <field name="oldOutlookAddInVersion" type="String" static="true">
    /// The query string parameter used for the old Outlook Add-In Version.
    /// </field>
    /// <field name="collectionNamesParameter" type="String" static="true">
    /// The query string parameter used for selecting collections (by names).
    /// </field>
    /// <field name="collectionIdsParameter" type="String" static="true">
    /// The query string parameter used for selecting collections (by ids).
    /// </field>
    /// <field name="initialScopeParameter" type="String" static="true">
    /// The query string parameter used for specifying the initial search scope.
    /// </field>
    /// <field name="timeZoneParameter" type="String" static="true">
    /// The query string parameter used for passing the time zone id.
    /// </field>
    /// <field name="timeZoneOffsetParameter" type="String" static="true">
    /// The query string parameter used for passing the time zone offset.
    /// </field>
    /// <field name="lcidParameter" type="String" static="true">
    /// The query string parameter used for passing the lcid to use.
    /// </field>
    /// <field name="stateParameter" type="String" static="true">
    /// The query string parameter used for passing the state.
    /// </field>
    /// <field name="sessionGuidParameter" type="String" static="true">
    /// The query string parameter used for passing the Analytics Action Guid.
    /// </field>
    /// <field name="interfaceNameParameter" type="String" static="true">
    /// The query string parameter used for passing the interface name.
    /// </field>
    /// <field name="iconSizeParameter" type="String" static="true">
    /// The query string parameter used for passing the icon size.
    /// </field>
    /// <field name="superUserTokenParameter" type="String" static="true">
    /// The query string parameter used for passing the super user token.
    /// </field>
    /// <field name="quirksModeParameter" type="String" static="true">
    /// The query string parameter used to tell when quirks mode is being used.
    /// </field>
    /// <field name="hubNameParameter" type="String" static="true">
    /// The query string parameter used for passing the hub name.
    /// </field>
    /// <field name="documentIdParameter" type="String" static="true">
    /// The query string parameter used to pass the id of a document.
    /// </field>
    /// <field name="mirrorIdParameter" type="String" static="true">
    /// The query string parameter used to pass the id of an aggregated mirror.
    /// </field>
    /// <field name="wildcardsParameter" type="String" static="true">
    /// The query string parameter used to pass whether wildcards are enabled.
    /// </field>
    /// <field name="improveReadabilityParameter" type="String" static="true">
    /// The query string parameter used to pass whether readability should be improved.
    /// </field>
    /// <field name="customContentRelayParameter" type="String" static="true">
    /// The query string parameter to use to relay custom content requests.
    /// </field>
    /// <field name="xmlSearchParameter" type="String" static="true">
    /// The query string parameter to use to retrieve results in xml format.
    /// </field>
    /// <field name="exportToExcelParameter" type="String" static="true">
    /// The query string parameter to use to export the query results to excel.
    /// </field>
    /// <field name="excelXmlDataSourceParameter" type="String" static="true">
    /// The query string parameter to use to export the query results to an XML data source for Microsoft Excel.
    /// </field>
    /// <field name="openSearchParameter" type="String" static="true">
    /// The query string parameter to use to retrieve the OpenSearch description document.
    /// </field>
    /// <field name="openSearchSuggestParameter" type="String" static="true">
    /// The query string parameter to use to retrieve query suggestions through OpenSearch.
    /// </field>
    /// <field name="desktopSearchParameter" type="String" static="true">
    /// The query string parameter to signal that the page is loaded under Coveo Desktop Search.
    /// </field>
    /// <field name="wakeUpParameter" type="String" static="true">
    /// The query string parameter used to wake up the search interface.
    /// </field>
    /// <field name="showDebugInfoParameter" type="String" static="true">
    /// The query string parameter to use to display debugging information.
    /// </field>
    /// <field name="emailAddressParameter" type="String" static="true">
    /// The query string parameter to specify the email address to use in the emailsearch interface.
    /// </field>
    /// <field name="caseIDParameter" type="String" static="true">
    /// The query string parameter to specify the id of a support case.
    /// </field>
    /// <field name="chartIDParameter" type="String" static="true">
    /// The query string parameter to specify the id of the chart to serve.
    /// </field>
    /// <field name="chartWidthParameter" type="String" static="true">
    /// The query string parameter to specify the width of the chart to serve.
    /// </field>
    /// <field name="chartHeightParameter" type="String" static="true">
    /// The query string parameter to specify the height of the chart to serve.
    /// </field>
    /// <field name="disableAnalyticsLoggingParameter" type="String" static="true">
    /// The query string parameter to disable the analytics logging.
    /// </field>
    /// <field name="searchBarParameter" type="String" static="true">
    /// The query string parameter to signal that the page is loaded under the Coveo Search Bar.
    /// </field>
    /// <field name="searchBarInfoParameter" type="String" static="true">
    /// The query string parameter to use to retrieve the Coveo Search Bar information.
    /// </field>
    /// <field name="searchBarVersionParameter" type="String" static="true">
    /// The query string parameter used to pass the version of the search bar.
    /// </field>
    /// <field name="searchBarAutoCompletionsParameter" type="String" static="true">
    /// The query string parameter used to retrieve auto-completions for the search bar.
    /// </field>
    /// <field name="outlookAddInParameter" type="String" static="true">
    /// The query string parameter to signal that the page is loaded under the Coveo Outlook Add-In.
    /// </field>
    /// <field name="outlookSenderEmailParameter" type="String" static="true">
    /// The query string parameter to specify the sender of the currently selected email.
    /// </field>
    /// <field name="outlookSubjectHash" type="String" static="true">
    /// The query string parameter to specify the hash of the currently selected email's subject.
    /// </field>
    /// <field name="outlookSentOn" type="String" static="true">
    /// The query string parameter to specify the sent date of the currently selected email.
    /// </field>
    /// <field name="interfaceReloaded" type="String" static="true">
    /// The query string parameter to specify that the interface was reloaded because the
    /// interface settings were changed by an administrator.
    /// </field>
}


Type.registerNamespace('Coveo.CES.Web.Search.SharePoint');

////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.SharePoint.SharePointItemAttributes

Coveo.CES.Web.Search.SharePoint.SharePointItemAttributes = function Coveo_CES_Web_Search_SharePoint_SharePointItemAttributes() {
    /// <summary>
    /// Provides constantes for SharePoint item attributes.
    /// </summary>
    /// <field name="lisT_VERSION_ENABLED" type="String" static="true">
    /// Constant for <b>SPList.EnableVersioning</b> property.
    /// </field>
    /// <field name="lisT_IS_FORCE_CHECKOUT" type="String" static="true">
    /// Constant for <b>SPList.ForceCheckout</b> property.
    /// </field>
    /// <field name="lisT_ENABLE_MINOR_VERSIONS" type="String" static="true">
    /// Constant for <b>SPList.EnableMinorVersions</b> property.
    /// </field>
    /// <field name="lisT_CONTENT_TYPES_ENABLED" type="String" static="true">
    /// Constant for <b>SPList.ContentTypesEnabled</b> property.
    /// </field>
    /// <field name="lisT_BASE_TYPE" type="String" static="true">
    /// Constant for <b>SPList.BaseType</b> property.
    /// </field>
    /// <field name="lisT_BASE_TEMPLATE" type="String" static="true">
    /// Constant for <b>SPList.BaseTemplate</b> property.
    /// </field>
    /// <field name="lisT_WRITE_SECURITY" type="String" static="true">
    /// Constant for <b>SPList.WriteSecurity</b> property.
    /// </field>
    /// <field name="lisT_USER_ID" type="String" static="true">
    /// Constant for the current web session user id.
    /// </field>
    /// <field name="d_REF" type="String" static="true">
    /// Constant for the item <b>DRef</b> attribute.
    /// </field>
}


Type.registerNamespace('Coveo.CES.Web.Search.Scripts.Controls');

////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.StateEnum

Coveo.CES.Web.Search.Scripts.Controls.StateEnum = function() { 
    /// <summary>
    /// Enumerates the various state possible for a media player.
    /// </summary>
    /// <field name="ready" type="Number" integer="true" static="true">
    /// Player is ready but not yet started.
    /// </field>
    /// <field name="playing" type="Number" integer="true" static="true">
    /// Currently playing.
    /// </field>
    /// <field name="stopped" type="Number" integer="true" static="true">
    /// Currently stopped.
    /// </field>
    /// <field name="paused" type="Number" integer="true" static="true">
    /// Currently paused.
    /// </field>
    /// <field name="buffering" type="Number" integer="true" static="true">
    /// Currently buffering.
    /// </field>
    /// <field name="ended" type="Number" integer="true" static="true">
    /// Media playback has ended by itself.
    /// </field>
};
Coveo.CES.Web.Search.Scripts.Controls.StateEnum.prototype = {
    ready: 0, 
    playing: 1, 
    stopped: 2, 
    paused: 3, 
    buffering: 4, 
    ended: 5
}
Coveo.CES.Web.Search.Scripts.Controls.StateEnum.registerEnum('Coveo.CES.Web.Search.Scripts.Controls.StateEnum', false);


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.IMediaPlayer

Coveo.CES.Web.Search.Scripts.Controls.IMediaPlayer = function() { 
    /// <summary>
    /// Generic MediaPlayer Interface.
    /// </summary>
};
Coveo.CES.Web.Search.Scripts.Controls.IMediaPlayer.prototype = {
    get_id : null,
    tearDown : null,
    play : null,
    pause : null,
    stop : null,
    getPosition : null,
    setPosition : null,
    getState : null,
    getStatus : null,
    createPlayerElement : null,
    createPlayerString : null,
    isReady : null
}
Coveo.CES.Web.Search.Scripts.Controls.IMediaPlayer.registerInterface('Coveo.CES.Web.Search.Scripts.Controls.IMediaPlayer');


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.FacetScript

Coveo.CES.Web.Search.Scripts.Controls.FacetScript = function Coveo_CES_Web_Search_Scripts_Controls_FacetScript() {
    /// <summary>
    /// Client side code for the Facet control.
    /// </summary>
    /// <field name="m_Main" type="Object" domElement="true">
    /// </field>
    /// <field name="m_Header" type="Object" domElement="true">
    /// </field>
    /// <field name="m_Popup" type="Object" domElement="true">
    /// </field>
    /// <field name="m_Showing" type="Boolean">
    /// </field>
    /// <field name="_m_OnClickElsewhereEvent$2" type="Coveo.CNL.Web.Scripts.OnClickElsewhereEvent">
    /// </field>
    Coveo.CES.Web.Search.Scripts.Controls.FacetScript.initializeBase(this);
}
Coveo.CES.Web.Search.Scripts.Controls.FacetScript.prototype = {
    m_Main: null,
    m_Header: null,
    m_Popup: null,
    m_Showing: false,
    _m_OnClickElsewhereEvent$2: null,
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$initialize() {
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_Main);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_Header);
        Coveo.CES.Web.Search.Scripts.Controls.FacetScript.callBaseMethod(this, 'initialize');
        this.addOnClickAttribute(this.m_Header, ss.Delegate.create(this, this._header_Click$2), true);
        if (this.m_Popup != null) {
            this._m_OnClickElsewhereEvent$2 = new Coveo.CNL.Web.Scripts.OnClickElsewhereEvent([ this.m_Main ], ss.Delegate.create(this, this._main_ClickElsewhere$2), true);
        }
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$tearDown() {
        if (this._m_OnClickElsewhereEvent$2 != null) {
            this._m_OnClickElsewhereEvent$2.dispose();
            this._m_OnClickElsewhereEvent$2 = null;
        }
        Coveo.CES.Web.Search.Scripts.Controls.FacetScript.callBaseMethod(this, 'tearDown');
    },
    
    fillItems: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$fillItems(p_Callback) {
        /// <param name="p_Callback" type="Coveo.CNL.Web.Scripts.Ajax.PostBackCallback">
        /// </param>
    },
    
    hideItems: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$hideItems(p_Callback) {
        /// <param name="p_Callback" type="Coveo.CNL.Web.Scripts.Ajax.PostBackCallback">
        /// </param>
    },
    
    _fillItemsCallback$2: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$_fillItemsCallback$2(p_Return) {
        /// <summary>
        /// Callback for when the server has filled the items.
        /// </summary>
        /// <param name="p_Return" type="Object">
        /// </param>
        this.m_Showing = true;
        if (this.m_Popup != null) {
            this.m_Popup.style.display = 'block';
            Coveo.CNL.Web.Scripts.DOMUtilities.positionElement(this.m_Popup, this.m_Main, Coveo.CNL.Web.Scripts.PositionEnum.belowLeft);
            this.m_Popup.style.visibility = 'visible';
        }
    },
    
    _hideItemsCallback$2: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$_hideItemsCallback$2(p_Return) {
        /// <summary>
        /// Callback for when the server has hidden the items.
        /// </summary>
        /// <param name="p_Return" type="Object">
        /// </param>
        this.m_Showing = false;
    },
    
    _header_Click$2: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$_header_Click$2() {
        if (!this.m_Showing) {
            if (this.m_Popup != null) {
                this.m_Popup.style.visibility = 'hidden';
            }
            this.fillItems(ss.Delegate.create(this, this._fillItemsCallback$2));
        }
        else if (this.m_Popup == null) {
            this.hideItems(ss.Delegate.create(this, this._hideItemsCallback$2));
        }
    },
    
    _main_ClickElsewhere$2: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$_main_ClickElsewhere$2() {
        Coveo.CNL.Web.Scripts.CNLAssert.check(this.m_Popup != null);
        if (this.m_Showing) {
            this.m_Showing = false;
            this.m_Popup.style.display = 'none';
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.BaseChartScript

Coveo.CES.Web.Search.Scripts.Controls.BaseChartScript = function Coveo_CES_Web_Search_Scripts_Controls_BaseChartScript() {
    /// <summary>
    /// Client side code for the BaseChart control.
    /// </summary>
    /// <field name="_m_ImageLoadEventHandler$1" type="ElementEventHandler">
    /// </field>
    /// <field name="_m_Request$1" type="XMLHttpRequest">
    /// </field>
    /// <field name="_m_CheckSizeTimeout$1" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    /// <field name="_m_ChangeSizeTimeout$1" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    /// <field name="_m_FirstLoad$1" type="Boolean">
    /// </field>
    /// <field name="_m_LastSeenWidth$1" type="Number" integer="true">
    /// </field>
    /// <field name="_m_LastSeenHeight$1" type="Number" integer="true">
    /// </field>
    /// <field name="_m_LastRequestedWidth$1" type="Number" integer="true">
    /// </field>
    /// <field name="_m_LastRequestedHeight$1" type="Number" integer="true">
    /// </field>
    /// <field name="m_Image" type="Object" domElement="true">
    /// The element that holds image to attach the map to.
    /// </field>
    /// <field name="m_CookieUrlPrefix" type="String">
    /// The prefix of the image map url when the map doesn't fit in the cookie.
    /// </field>
    /// <field name="m_ImageMapIdSuffix" type="String">
    /// The suffix of the image map HTML tag id.
    /// </field>
    /// <field name="m_BaseImageUri" type="String">
    /// The base uri for the image, to which we should add desired width and height
    /// </field>
    Coveo.CES.Web.Search.Scripts.Controls.BaseChartScript.initializeBase(this);
}
Coveo.CES.Web.Search.Scripts.Controls.BaseChartScript.prototype = {
    _m_ImageLoadEventHandler$1: null,
    _m_Request$1: null,
    _m_CheckSizeTimeout$1: null,
    _m_ChangeSizeTimeout$1: null,
    _m_FirstLoad$1: true,
    _m_LastSeenWidth$1: 0,
    _m_LastSeenHeight$1: 0,
    _m_LastRequestedWidth$1: 0,
    _m_LastRequestedHeight$1: 0,
    m_Image: null,
    m_CookieUrlPrefix: null,
    m_ImageMapIdSuffix: null,
    m_BaseImageUri: null,
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_BaseChartScript$initialize() {
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_Image);
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(this.m_CookieUrlPrefix);
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(this.m_ImageMapIdSuffix);
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(this.m_BaseImageUri);
        this._m_ImageLoadEventHandler$1 = ss.Delegate.create(this, this._image_OnLoad$1);
        this.m_Image.attachEvent('onload', this._m_ImageLoadEventHandler$1);
        this._setImageUriWithProperSize$1();
        Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_LastRequestedWidth$1 !== 0);
        Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_LastRequestedHeight$1 !== 0);
        this._m_LastSeenWidth$1 = this._m_LastRequestedWidth$1;
        this._m_LastSeenHeight$1 = this._m_LastRequestedHeight$1;
        this._m_CheckSizeTimeout$1 = new Coveo.CNL.Web.Scripts.Timeout(ss.Delegate.create(this, this._checkIfSizeHasChanged$1), 500);
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_BaseChartScript$tearDown() {
        this.m_Image.detachEvent('onload', this._m_ImageLoadEventHandler$1);
        this._m_ImageLoadEventHandler$1 = null;
        if (this._m_CheckSizeTimeout$1 != null) {
            this._m_CheckSizeTimeout$1.cancel();
        }
        if (this._m_ChangeSizeTimeout$1 != null) {
            this._m_ChangeSizeTimeout$1.cancel();
        }
    },
    
    _requestCallback$1: function Coveo_CES_Web_Search_Scripts_Controls_BaseChartScript$_requestCallback$1() {
        /// <summary>
        /// Callback for the image map XmlHttpRequest.
        /// </summary>
        if (this._m_Request$1.readyState === 4) {
            Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Response has been received.');
            if (this._m_Request$1.status === 200) {
                this._createImageMap$1(this._m_Request$1.responseText);
            }
            this._m_Request$1 = null;
        }
    },
    
    _createImageMap$1: function Coveo_CES_Web_Search_Scripts_Controls_BaseChartScript$_createImageMap$1(p_MapHtml) {
        /// <summary>
        /// Creates the image map element and binds the chart image to it.
        /// </summary>
        /// <param name="p_MapHtml" type="String">
        /// The image map HTML markup.
        /// </param>
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_MapHtml);
        var spanElem = document.createElement('span');
        this.m_Image.parentNode.appendChild(spanElem);
        spanElem.style.display = 'none';
        spanElem.innerHTML = p_MapHtml;
        eval('setTimeout(\"var elem = document.getElementById(\'' + this.m_Image.id + '\'); if (elem) elem.useMap=\'#' + this.m_Image.id + this.m_ImageMapIdSuffix + '\';\", 0);');
    },
    
    _checkIfSizeHasChanged$1: function Coveo_CES_Web_Search_Scripts_Controls_BaseChartScript$_checkIfSizeHasChanged$1() {
        /// <summary>
        /// Checks if the size of the image has changed, and triggers a reload if needed.
        /// </summary>
        Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_LastSeenWidth$1 !== 0);
        Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_LastSeenHeight$1 !== 0);
        var image = $(this.m_Image);
        var width = image.outerWidth();
        var height = image.outerHeight();
        if (width > 0 && height > 0) {
            if (width !== this._m_LastSeenWidth$1 || height !== this._m_LastSeenHeight$1) {
                this._m_LastSeenWidth$1 = width;
                this._m_LastSeenHeight$1 = height;
                if (this._m_ChangeSizeTimeout$1 != null) {
                    this._m_ChangeSizeTimeout$1.cancel();
                }
                this._m_ChangeSizeTimeout$1 = new Coveo.CNL.Web.Scripts.Timeout(ss.Delegate.create(this, this._setImageUriWithProperSize$1), 1000);
            }
        }
        this._m_CheckSizeTimeout$1 = new Coveo.CNL.Web.Scripts.Timeout(ss.Delegate.create(this, this._checkIfSizeHasChanged$1), 500);
    },
    
    _setImageUriWithProperSize$1: function Coveo_CES_Web_Search_Scripts_Controls_BaseChartScript$_setImageUriWithProperSize$1() {
        /// <summary>
        /// Sets the uri of the image to one that contains the needed width and height.
        /// </summary>
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(this.m_BaseImageUri);
        var image = $(this.m_Image);
        var width = image.outerWidth();
        Coveo.CNL.Web.Scripts.CNLAssert.check(width === this._m_LastSeenWidth$1 || this._m_LastSeenWidth$1 === 0);
        var height = image.outerHeight();
        Coveo.CNL.Web.Scripts.CNLAssert.check(height === this._m_LastSeenHeight$1 || this._m_LastSeenHeight$1 === 0);
        if (width > 0 && height > 0) {
            if (width !== this._m_LastRequestedWidth$1 || height !== this._m_LastRequestedHeight$1) {
                var uri = this.m_BaseImageUri;
                uri += '&width=' + width;
                uri += '&height=' + height;
                this.m_Image.src = uri;
                this._m_LastRequestedWidth$1 = width;
                this._m_LastRequestedHeight$1 = height;
            }
        }
        else {
            this._m_LastRequestedWidth$1 = -1;
            this._m_LastRequestedHeight$1 = -1;
        }
    },
    
    _image_OnLoad$1: function Coveo_CES_Web_Search_Scripts_Controls_BaseChartScript$_image_OnLoad$1() {
        if (this._m_FirstLoad$1) {
            this.m_Image.style.display = 'none';
            var image = $(this.m_Image);
            image.fadeIn('slow');
            this._m_FirstLoad$1 = false;
        }
        var cookie = Coveo.CNL.Web.Scripts.CookieUtilities.getCookie(this.m_Image.id);
        if (cookie != null) {
            var prefixLength = this.m_CookieUrlPrefix.length;
            if (cookie.length > prefixLength && cookie.substr(0, prefixLength) === this.m_CookieUrlPrefix) {
                var url = cookie.substr(prefixLength, cookie.length - prefixLength);
                this._m_Request$1 = new XMLHttpRequest();
                this._m_Request$1.open('GET', url, true);
                this._m_Request$1.onreadystatechange = ss.Delegate.create(this, this._requestCallback$1);
                this._m_Request$1.send();
            }
            else {
                this._createImageMap$1(cookie);
            }
            Coveo.CNL.Web.Scripts.CookieUtilities.setCookie(this.m_Image.id, '', -1);
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.MasterAndDetailScript

Coveo.CES.Web.Search.Scripts.Controls.MasterAndDetailScript = function Coveo_CES_Web_Search_Scripts_Controls_MasterAndDetailScript() {
    /// <summary>
    /// Client side code for the MasterAndDetail control.
    /// </summary>
    /// <field name="_resizE_TIMEOUT_DELAY$1" type="Number" integer="true" static="true">
    /// </field>
    /// <field name="_animatioN_DURATION$1" type="Number" integer="true" static="true">
    /// </field>
    /// <field name="_animatioN_TIMEOUT_DELAY$1" type="Number" integer="true" static="true">
    /// </field>
    /// <field name="_m_ResizeTimeout$1" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    /// <field name="_m_WindowResizeEventHandler$1" type="ElementEventHandler">
    /// </field>
    /// <field name="_m_PreviousRootTop$1" type="Number" integer="true">
    /// </field>
    /// <field name="_m_PreviousWindowHeight$1" type="Number" integer="true">
    /// </field>
    /// <field name="_m_DetailHeightWhenCollapsed$1" type="Number" integer="true">
    /// </field>
    /// <field name="_m_AnimationTimeout$1" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    /// <field name="_m_AnimationProgress$1" type="Coveo.CNL.Web.Scripts.Ajax.PercentTimer">
    /// </field>
    /// <field name="_m_StartDetailHeight$1" type="Number" integer="true">
    /// </field>
    /// <field name="_m_EndDetailHeight$1" type="Number" integer="true">
    /// </field>
    /// <field name="_m_HeaderMouseDownEventHandler$1" type="ElementEventHandler">
    /// </field>
    /// <field name="_m_HeaderMouseCapture$1" type="Coveo.CNL.Web.Scripts.MouseCapture">
    /// </field>
    /// <field name="m_Root" type="Object" domElement="true">
    /// </field>
    /// <field name="m_Master" type="Object" domElement="true">
    /// </field>
    /// <field name="m_Detail" type="Object" domElement="true">
    /// </field>
    /// <field name="m_ExpandedDetailHeader" type="Object" domElement="true">
    /// </field>
    /// <field name="m_ExpandedDetailBody" type="Object" domElement="true">
    /// </field>
    /// <field name="m_CollapsedDetail" type="Object" domElement="true">
    /// </field>
    /// <field name="m_DetailExpanded" type="Boolean">
    /// </field>
    /// <field name="m_OldDetailHeightWhenExpanded" type="Number" integer="true">
    /// </field>
    /// <field name="m_DetailHeightWhenExpanded" type="Number" integer="true">
    /// </field>
    Coveo.CES.Web.Search.Scripts.Controls.MasterAndDetailScript.initializeBase(this);
}
Coveo.CES.Web.Search.Scripts.Controls.MasterAndDetailScript.prototype = {
    _m_ResizeTimeout$1: null,
    _m_WindowResizeEventHandler$1: null,
    _m_PreviousRootTop$1: 0,
    _m_PreviousWindowHeight$1: 0,
    _m_DetailHeightWhenCollapsed$1: 0,
    _m_AnimationTimeout$1: null,
    _m_AnimationProgress$1: null,
    _m_StartDetailHeight$1: 0,
    _m_EndDetailHeight$1: 0,
    _m_HeaderMouseDownEventHandler$1: null,
    _m_HeaderMouseCapture$1: null,
    m_Root: null,
    m_Master: null,
    m_Detail: null,
    m_ExpandedDetailHeader: null,
    m_ExpandedDetailBody: null,
    m_CollapsedDetail: null,
    m_DetailExpanded: false,
    m_OldDetailHeightWhenExpanded: 0,
    m_DetailHeightWhenExpanded: 0,
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_MasterAndDetailScript$initialize() {
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_Root);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_Master);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_Detail);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_ExpandedDetailHeader);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_ExpandedDetailBody);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_CollapsedDetail);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_DetailHeightWhenExpanded !== 0);
        this._m_WindowResizeEventHandler$1 = ss.Delegate.create(this, this._window_Resize$1);
        window.attachEvent('onresize', this._m_WindowResizeEventHandler$1);
        this._m_HeaderMouseDownEventHandler$1 = ss.Delegate.create(this, this._header_MouseDown$1);
        this.m_ExpandedDetailHeader.attachEvent('onmousedown', this._m_HeaderMouseDownEventHandler$1);
        this._m_ResizeTimeout$1 = new Coveo.CNL.Web.Scripts.Timeout(ss.Delegate.create(this, this._resizeTimeoutCallback$1), Coveo.CES.Web.Search.Scripts.Controls.MasterAndDetailScript._resizE_TIMEOUT_DELAY$1);
        this._resizeSections$1(true);
        this.m_ExpandedDetailHeader.style.display = (this.m_DetailExpanded) ? 'block' : 'none';
        this.m_ExpandedDetailBody.style.display = (this.m_DetailExpanded) ? 'block' : 'none';
        this.m_CollapsedDetail.style.display = (this.m_DetailExpanded) ? 'none' : 'block';
        this._m_DetailHeightWhenCollapsed$1 = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this.m_CollapsedDetail).height;
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_MasterAndDetailScript$tearDown() {
        window.detachEvent('onresize', this._m_WindowResizeEventHandler$1);
        this._m_WindowResizeEventHandler$1 = null;
        this.m_ExpandedDetailHeader.detachEvent('onmousedown', this._m_HeaderMouseDownEventHandler$1);
        this._m_HeaderMouseDownEventHandler$1 = null;
        if (this._m_HeaderMouseCapture$1 != null) {
            this._m_HeaderMouseCapture$1.dispose();
        }
        this._m_ResizeTimeout$1.cancel();
        if (this._m_AnimationTimeout$1 != null) {
            this._m_AnimationTimeout$1.cancel();
        }
    },
    
    expandDetailSection: function Coveo_CES_Web_Search_Scripts_Controls_MasterAndDetailScript$expandDetailSection() {
        /// <summary>
        /// Expands the detail section.
        /// </summary>
        Coveo.CNL.Web.Scripts.CNLAssert.check(!this.m_DetailExpanded);
        this.m_DetailExpanded = true;
        this.m_ExpandedDetailHeader.style.display = 'block';
        this.m_ExpandedDetailBody.style.display = 'block';
        this.m_CollapsedDetail.style.display = 'none';
        this._m_StartDetailHeight$1 = this._m_DetailHeightWhenCollapsed$1;
        this._m_EndDetailHeight$1 = this.m_DetailHeightWhenExpanded;
        this._m_AnimationTimeout$1 = new Coveo.CNL.Web.Scripts.Timeout(ss.Delegate.create(this, this._animateTimeoutCallback$1), 10);
        this._m_AnimationProgress$1 = new Coveo.CNL.Web.Scripts.Ajax.PercentTimer(Coveo.CES.Web.Search.Scripts.Controls.MasterAndDetailScript._animatioN_DURATION$1, Coveo.CNL.Web.Scripts.Ajax.EasingFunction.slowFastSlow);
        this._m_AnimationProgress$1.ensureStarted();
    },
    
    collapseDetailSection: function Coveo_CES_Web_Search_Scripts_Controls_MasterAndDetailScript$collapseDetailSection() {
        /// <summary>
        /// Collapses the detail section.
        /// </summary>
        Coveo.CNL.Web.Scripts.CNLAssert.check(this.m_DetailExpanded);
        if (this._m_HeaderMouseCapture$1 != null) {
            this._m_HeaderMouseCapture$1.dispose();
            this._m_HeaderMouseCapture$1 = null;
        }
        this.m_DetailExpanded = false;
        this.m_ExpandedDetailHeader.style.display = 'none';
        this.m_ExpandedDetailBody.style.display = 'none';
        this.m_CollapsedDetail.style.display = 'block';
        this._m_StartDetailHeight$1 = this.m_DetailHeightWhenExpanded;
        this._m_EndDetailHeight$1 = this._m_DetailHeightWhenCollapsed$1;
        this.m_Detail.style.height = Math.max(this._m_StartDetailHeight$1, 0) + 'px';
        this._m_AnimationTimeout$1 = new Coveo.CNL.Web.Scripts.Timeout(ss.Delegate.create(this, this._animateTimeoutCallback$1), 10);
        this._m_AnimationProgress$1 = new Coveo.CNL.Web.Scripts.Ajax.PercentTimer(Coveo.CES.Web.Search.Scripts.Controls.MasterAndDetailScript._animatioN_DURATION$1, Coveo.CNL.Web.Scripts.Ajax.EasingFunction.slowFastSlow);
        this._m_AnimationProgress$1.ensureStarted();
    },
    
    updateExpandedDetailHeight: function Coveo_CES_Web_Search_Scripts_Controls_MasterAndDetailScript$updateExpandedDetailHeight(p_Height) {
        /// <summary>
        /// Updates the preferred detail height in the user profile, following a
        /// resize done by the user on the client side.
        /// </summary>
        /// <param name="p_Height" type="Number" integer="true">
        /// The new detail section height.
        /// </param>
    },
    
    _resizeSections$1: function Coveo_CES_Web_Search_Scripts_Controls_MasterAndDetailScript$_resizeSections$1(p_Force) {
        /// <summary>
        /// Resizes all the sections depending on the current state.
        /// </summary>
        /// <param name="p_Force" type="Boolean">
        /// Whether to force resizing the sections, even if the parameters haven't changed since last time.
        /// </param>
        var windowHeight = document.documentElement.clientHeight;
        var rootTop = Coveo.CNL.Web.Scripts.DOMUtilities.getElementPosition(this.m_Root).top;
        if (p_Force || windowHeight !== this._m_PreviousWindowHeight$1 || rootTop !== this._m_PreviousRootTop$1) {
            var rootHeight = Math.max(windowHeight - rootTop, 0);
            this.m_Root.style.height = rootHeight + 'px';
            if (this.m_DetailExpanded) {
                var availableDetailHeight = Math.min(this.m_DetailHeightWhenExpanded, rootHeight);
                Coveo.CNL.Web.Scripts.CNLAssert.check(availableDetailHeight >= 0);
                Coveo.CNL.Web.Scripts.CNLAssert.check(rootHeight >= availableDetailHeight);
                this.m_Master.style.height = (rootHeight - availableDetailHeight) + 'px';
                this.m_Detail.style.height = availableDetailHeight + 'px';
                var expandedHeaderHeight = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this.m_ExpandedDetailHeader).height;
                this.m_ExpandedDetailBody.style.height = Math.max(availableDetailHeight - expandedHeaderHeight, 0) + 'px';
            }
            else {
                this.m_Detail.style.height = '';
                var collapsedDetailHeight = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this.m_CollapsedDetail).height;
                this.m_Master.style.height = Math.max(rootHeight - collapsedDetailHeight, 0) + 'px';
            }
            this._m_PreviousWindowHeight$1 = windowHeight;
            this._m_PreviousRootTop$1 = rootTop;
        }
    },
    
    _resizeTimeoutCallback$1: function Coveo_CES_Web_Search_Scripts_Controls_MasterAndDetailScript$_resizeTimeoutCallback$1() {
        /// <summary>
        /// Callback for the timeout used to regularly check for size updates.
        /// </summary>
        if (this._m_AnimationTimeout$1 == null) {
            this._resizeSections$1(false);
            this._m_ResizeTimeout$1 = new Coveo.CNL.Web.Scripts.Timeout(ss.Delegate.create(this, this._resizeTimeoutCallback$1), Coveo.CES.Web.Search.Scripts.Controls.MasterAndDetailScript._resizE_TIMEOUT_DELAY$1);
        }
    },
    
    _animateTimeoutCallback$1: function Coveo_CES_Web_Search_Scripts_Controls_MasterAndDetailScript$_animateTimeoutCallback$1() {
        /// <summary>
        /// Callback for the timeout used to animate expands and collapses.
        /// </summary>
        if (this._m_AnimationProgress$1.isFinished()) {
            this._m_AnimationTimeout$1 = null;
            this._m_AnimationProgress$1 = null;
            this._resizeSections$1(true);
        }
        else {
            var rootHeight = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this.m_Root).height;
            var detailHeight = (this._m_StartDetailHeight$1 + (this._m_EndDetailHeight$1 - this._m_StartDetailHeight$1) * this._m_AnimationProgress$1.getPercentage());
            var masterHeight = rootHeight - detailHeight;
            this.m_Master.style.height = Math.max(masterHeight, 0) + 'px';
            this.m_Detail.style.height = Math.max(detailHeight, 0) + 'px';
            this._m_AnimationTimeout$1 = new Coveo.CNL.Web.Scripts.Timeout(ss.Delegate.create(this, this._animateTimeoutCallback$1), Coveo.CES.Web.Search.Scripts.Controls.MasterAndDetailScript._animatioN_TIMEOUT_DELAY$1);
        }
    },
    
    _window_Resize$1: function Coveo_CES_Web_Search_Scripts_Controls_MasterAndDetailScript$_window_Resize$1() {
        if (this._m_AnimationTimeout$1 == null) {
            this._resizeSections$1(false);
            this._m_ResizeTimeout$1.cancel();
            this._m_ResizeTimeout$1 = new Coveo.CNL.Web.Scripts.Timeout(ss.Delegate.create(this, this._resizeTimeoutCallback$1), Coveo.CES.Web.Search.Scripts.Controls.MasterAndDetailScript._resizE_TIMEOUT_DELAY$1);
        }
    },
    
    _header_MouseDown$1: function Coveo_CES_Web_Search_Scripts_Controls_MasterAndDetailScript$_header_MouseDown$1() {
        Coveo.CNL.Web.Scripts.CNLAssert.isNull(this._m_HeaderMouseCapture$1);
        this.m_OldDetailHeightWhenExpanded = this.m_DetailHeightWhenExpanded;
        this._m_HeaderMouseCapture$1 = new Coveo.CNL.Web.Scripts.MouseCapture(ss.Delegate.create(this, this._headerMouseCapture_MouseMove$1), ss.Delegate.create(this, this._headerMouseCapture_MouseUp$1));
        window.event.returnValue = false;
        window.event.cancelBubble = true;
    },
    
    _headerMouseCapture_MouseMove$1: function Coveo_CES_Web_Search_Scripts_Controls_MasterAndDetailScript$_headerMouseCapture_MouseMove$1() {
        var expandedHeaderHeight = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this.m_ExpandedDetailHeader).height;
        this.m_DetailHeightWhenExpanded += this._m_HeaderMouseCapture$1.get_offsetY();
        this.m_DetailHeightWhenExpanded = Math.max(this.m_DetailHeightWhenExpanded, expandedHeaderHeight);
        var rootHeight = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this.m_Root).height;
        this.m_DetailHeightWhenExpanded = Math.min(this.m_DetailHeightWhenExpanded, rootHeight);
        this._resizeSections$1(true);
    },
    
    _headerMouseCapture_MouseUp$1: function Coveo_CES_Web_Search_Scripts_Controls_MasterAndDetailScript$_headerMouseCapture_MouseUp$1() {
        this._m_HeaderMouseCapture$1.dispose();
        this._m_HeaderMouseCapture$1 = null;
        if (this.m_OldDetailHeightWhenExpanded !== this.m_DetailHeightWhenExpanded) {
            this.updateExpandedDetailHeight(this.m_DetailHeightWhenExpanded);
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.ContextualDropDownScript

Coveo.CES.Web.Search.Scripts.Controls.ContextualDropDownScript = function Coveo_CES_Web_Search_Scripts_Controls_ContextualDropDownScript() {
    /// <summary>
    /// Client side code for the ContextualDropDown control.
    /// </summary>
    /// <field name="m_HotSpot" type="Object" domElement="true">
    /// </field>
    /// <field name="m_DropDown" type="Object" domElement="true">
    /// </field>
    /// <field name="m_IFrame" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_OnClickElsewhere$2" type="Coveo.CNL.Web.Scripts.OnClickElsewhereEvent">
    /// </field>
    /// <field name="_m_Showing$2" type="Boolean">
    /// </field>
    Coveo.CES.Web.Search.Scripts.Controls.ContextualDropDownScript.initializeBase(this);
}
Coveo.CES.Web.Search.Scripts.Controls.ContextualDropDownScript.prototype = {
    m_HotSpot: null,
    m_DropDown: null,
    m_IFrame: null,
    _m_OnClickElsewhere$2: null,
    _m_Showing$2: false,
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_ContextualDropDownScript$initialize() {
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_HotSpot);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_DropDown);
        if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE6()) {
            Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_IFrame);
        }
        Coveo.CES.Web.Search.Scripts.Controls.ContextualDropDownScript.callBaseMethod(this, 'initialize');
        this.addOnClickAttribute(this.m_HotSpot, ss.Delegate.create(this, this._hotSpot_Click$2), true);
        this.m_DropDown.attachEvent('onclick', ss.Delegate.create(this, this._dropDown_Click$2));
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_ContextualDropDownScript$tearDown() {
        this.m_HotSpot = null;
        this.m_DropDown = null;
        if (this._m_OnClickElsewhere$2 != null) {
            this._m_OnClickElsewhere$2.dispose();
            this._m_OnClickElsewhere$2 = null;
        }
        Coveo.CES.Web.Search.Scripts.Controls.ContextualDropDownScript.callBaseMethod(this, 'tearDown');
    },
    
    _hotSpot_Click$2: function Coveo_CES_Web_Search_Scripts_Controls_ContextualDropDownScript$_hotSpot_Click$2() {
        if (!this._m_Showing$2) {
            this.m_DropDown.style.position = 'absolute';
            this.m_DropDown.style.zIndex = 999;
            this.m_DropDown.style.display = 'block';
            Coveo.CNL.Web.Scripts.DOMUtilities.positionElement(this.m_DropDown, this.m_HotSpot, Coveo.CNL.Web.Scripts.PositionEnum.belowLeft);
            if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE6()) {
                this.m_IFrame.style.display = 'block';
                Coveo.CNL.Web.Scripts.DOMUtilities.setElementSize(this.m_IFrame, Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this.m_DropDown));
                Coveo.CNL.Web.Scripts.DOMUtilities.positionElement(this.m_IFrame, this.m_HotSpot, Coveo.CNL.Web.Scripts.PositionEnum.belowLeft);
            }
            this._m_Showing$2 = true;
            Coveo.CNL.Web.Scripts.CNLAssert.isNull(this._m_OnClickElsewhere$2);
            this._m_OnClickElsewhere$2 = new Coveo.CNL.Web.Scripts.OnClickElsewhereEvent([ this.m_HotSpot, this.m_DropDown ], ss.Delegate.create(this, this._document_ClickElsewhere$2), true);
        }
        else {
            this._hideDropdown$2();
        }
    },
    
    _dropDown_Click$2: function Coveo_CES_Web_Search_Scripts_Controls_ContextualDropDownScript$_dropDown_Click$2() {
        this._hideDropdown$2();
    },
    
    _document_ClickElsewhere$2: function Coveo_CES_Web_Search_Scripts_Controls_ContextualDropDownScript$_document_ClickElsewhere$2() {
        this._hideDropdown$2();
    },
    
    _hideDropdown$2: function Coveo_CES_Web_Search_Scripts_Controls_ContextualDropDownScript$_hideDropdown$2() {
        /// <summary>
        /// Hides the dropdown.
        /// </summary>
        if (this._m_Showing$2) {
            Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_OnClickElsewhere$2);
            this.m_DropDown.style.display = 'none';
            if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE6()) {
                this.m_IFrame.style.display = 'none';
            }
            this._m_OnClickElsewhere$2.dispose();
            this._m_OnClickElsewhere$2 = null;
            this._m_Showing$2 = false;
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript

Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript = function Coveo_CES_Web_Search_Scripts_Controls_SearchControlScript() {
    /// <summary>
    /// Client side code for the SearchControl control.
    /// </summary>
    /// <field name="_s_Instances$1" type="Object" static="true">
    /// </field>
    /// <field name="m_Id" type="String">
    /// </field>
    /// <field name="m_Prefetch" type="Coveo.CNL.Web.Scripts.Ajax.PartialPostBack">
    /// </field>
    Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript.initializeBase(this);
}
Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript.getInstance = function Coveo_CES_Web_Search_Scripts_Controls_SearchControlScript$getInstance(p_Id) {
    /// <summary>
    /// Retrieves an instance of the <see cref="T:Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript" /> associated
    /// with a specific SearchControl object on the server side.
    /// </summary>
    /// <param name="p_Id" type="String">
    /// The UniqueID of the SearchControl.
    /// </param>
    /// <returns type="Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript"></returns>
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Id);
    var found = Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript._s_Instances$1[p_Id];
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(found);
    return found;
}
Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript.tryOpeningOutlookUri = function Coveo_CES_Web_Search_Scripts_Controls_SearchControlScript$tryOpeningOutlookUri(p_Uri, p_OnSuccess, p_OnFailure) {
    /// <summary>
    /// Tries opening an Outlook uri, and executes a piece of Javascript code
    /// if it is detected that the proper protocol handler is not installed.
    /// </summary>
    /// <param name="p_Uri" type="String">
    /// The outlook uri to open.
    /// </param>
    /// <param name="p_OnSuccess" type="String">
    /// The JavaScript code to execute on success.
    /// </param>
    /// <param name="p_OnFailure" type="String">
    /// The JavaScript code to execute on failure.
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Uri);
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_OnSuccess);
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_OnFailure);
    var html = new ss.StringBuilder();
    html.appendLine('<html>');
    html.appendLine('<body onload=\"OpenItem()\">');
    html.appendLine('<script language=\"javascript\">');
    html.appendLine('initialized = false;');
    html.appendLine('function OpenItem() {');
    html.appendLine('  initialized = true;');
    html.appendLine('  var uri = \'' + p_Uri + '\';');
    html.appendLine('  var iframe = document.getElementById(\'f\');');
    html.appendLine('  iframe.src = uri;');
    html.appendLine('}');
    html.appendLine('function ItWorked() {');
    html.appendLine('  window.close();');
    html.appendLine('}');
    html.appendLine('</script>');
    html.appendLine('<iframe id=\"f\" onload=\"if (initialized) { ItWorked(); }\"></iframe>');
    html.appendLine('</body>');
    html.appendLine('</html>');
    var wnd = window.open('about:blank', '_blank', 'width=150,height=150,left=0,top=0,toolbar=no,status=no,menubar=no,location=no');
    var doc = wnd.document.open('text/html');
    doc.write(html.toString());
    doc.close();
    Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript._checkWindowStatus$1(wnd, p_OnSuccess, p_OnFailure, 20);
}
Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript._checkWindowStatus$1 = function Coveo_CES_Web_Search_Scripts_Controls_SearchControlScript$_checkWindowStatus$1(p_Window, p_OnSuccess, p_OnFailure, p_CountDown) {
    /// <summary>
    /// Checks the status of the window that is opening the outlook uri, and
    /// take the appropriate action if a result can be determined. Otherwise,
    /// arm a time to check the status again later.
    /// </summary>
    /// <param name="p_Window" type="WindowInstance">
    /// The window that is opening the Outlook uri.
    /// </param>
    /// <param name="p_OnSuccess" type="String">
    /// The JavaScript code to execute on success.
    /// </param>
    /// <param name="p_OnFailure" type="String">
    /// The JavaScript code to execute on failure.
    /// </param>
    /// <param name="p_CountDown" type="Number" integer="true">
    /// Number of remaining attempts.
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Window);
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_OnSuccess);
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_OnFailure);
    if (p_CountDown === 0) {
        p_Window.close();
    }
    if (Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript._isWindowClosed$1(p_Window)) {
        eval(p_OnSuccess);
    }
    else {
        try {
            var dummy = p_Window.location.href;
            window.setTimeout(function() {
                Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript._checkWindowStatus$1(p_Window, p_OnSuccess, p_OnFailure, p_CountDown - 1);
            }, 100);
        }
        catch ($e1) {
            if (Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript._isWindowClosed$1(p_Window)) {
                eval(p_OnSuccess);
            }
            else {
                p_Window.close();
                eval(p_OnFailure);
            }
        }
    }
}
Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript._isWindowClosed$1 = function Coveo_CES_Web_Search_Scripts_Controls_SearchControlScript$_isWindowClosed$1(p_Window) {
    /// <summary>
    /// Checks if a window is closed in a IE6 friendly way.
    /// </summary>
    /// <param name="p_Window" type="WindowInstance">
    /// The window to check.
    /// </param>
    /// <returns type="Boolean"></returns>
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Window);
    var closed;
    try {
        closed = p_Window.closed;
    }
    catch ($e1) {
        closed = true;
    }
    return closed;
}
Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript.prototype = {
    m_Id: null,
    m_Prefetch: null,
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_SearchControlScript$initialize() {
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(this.m_Id);
        Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript._s_Instances$1[this.m_Id] = this;
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_SearchControlScript$tearDown() {
        delete Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript._s_Instances$1[this.m_Id];
    },
    
    startPrefetch: function Coveo_CES_Web_Search_Scripts_Controls_SearchControlScript$startPrefetch(p_Target, p_Argument) {
        /// <summary>
        /// Starts a prefetching postback.
        /// </summary>
        /// <param name="p_Target" type="String">
        /// The postback target.
        /// </param>
        /// <param name="p_Argument" type="String">
        /// The postback argument.
        /// </param>
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Target);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Argument);
        this.invalidatePendingPrefetch();
        this.m_Prefetch = Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current().DPB(p_Target, p_Argument, true, false);
    },
    
    invalidatePendingPrefetch: function Coveo_CES_Web_Search_Scripts_Controls_SearchControlScript$invalidatePendingPrefetch() {
        /// <summary>
        /// Invalidates any currently pending prefetch operation.
        /// </summary>
        this.m_Prefetch = null;
    },
    
    usePrefetchResultsIfPossible: function Coveo_CES_Web_Search_Scripts_Controls_SearchControlScript$usePrefetchResultsIfPossible() {
        /// <summary>
        /// Uses the results of the current prefetch operation, if any.
        /// </summary>
        /// <returns type="Boolean"></returns>
        var used;
        if (this.m_Prefetch != null) {
            this.m_Prefetch.applyPreemptivePostback();
            used = true;
        }
        else {
            used = false;
        }
        return used;
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.CloseModalBoxLinkScript

Coveo.CES.Web.Search.Scripts.Controls.CloseModalBoxLinkScript = function Coveo_CES_Web_Search_Scripts_Controls_CloseModalBoxLinkScript() {
    /// <summary>
    /// Client side code for the CloseModalBoxLink control.
    /// </summary>
    /// <field name="_m_OnKeyPressHandler$1" type="ElementEventHandler">
    /// </field>
    Coveo.CES.Web.Search.Scripts.Controls.CloseModalBoxLinkScript.initializeBase(this);
}
Coveo.CES.Web.Search.Scripts.Controls.CloseModalBoxLinkScript.prototype = {
    _m_OnKeyPressHandler$1: null,
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_CloseModalBoxLinkScript$initialize() {
        this._m_OnKeyPressHandler$1 = ss.Delegate.create(this, this._body_KeyPress$1);
        document.attachEvent('onkeydown', this._m_OnKeyPressHandler$1);
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_CloseModalBoxLinkScript$tearDown() {
        document.detachEvent('onkeydown', this._m_OnKeyPressHandler$1);
    },
    
    closeModalBox: function Coveo_CES_Web_Search_Scripts_Controls_CloseModalBoxLinkScript$closeModalBox() {
        /// <summary>
        /// Closes the modal box.
        /// </summary>
    },
    
    _body_KeyPress$1: function Coveo_CES_Web_Search_Scripts_Controls_CloseModalBoxLinkScript$_body_KeyPress$1() {
        if (window.event.keyCode === 27) {
            window.event.cancelBubble = true;
            window.event.returnValue = false;
            this.closeModalBox();
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.DateParamsScript

Coveo.CES.Web.Search.Scripts.Controls.DateParamsScript = function Coveo_CES_Web_Search_Scripts_Controls_DateParamsScript() {
    /// <summary>
    /// Client side code for the DateParams control.
    /// </summary>
    /// <field name="m_AnytimeRadioButton" type="Object" domElement="true">
    /// The RadioButton element reference for the anytime selection into the DateParams.
    /// </field>
    /// <field name="m_InTheLastRadioButton" type="Object" domElement="true">
    /// The RadioButton element reference for the duration selection into the DateParams.
    /// </field>
    /// <field name="m_BetweenRadioButton" type="Object" domElement="true">
    /// The RadioButton element reference for the "Between" selection into the DateParams.
    /// </field>
    /// <field name="m_MinimumDate" type="Object" domElement="true">
    /// The DateParams element reference for the minimum date selection (enabled by the m_BetweenRadioButton).
    /// </field>
    /// <field name="m_MaximumDate" type="Object" domElement="true">
    /// The DateParams element reference for the maximum date selection (enabled by the m_BetweenRadioButton).
    /// </field>
    /// <field name="m_ModifiedInTheLast" type="Object" domElement="true">
    /// The DateParams element reference for the duration selection (enabled by the m_InTheLastRadioButton).
    /// </field>
    /// <field name="_m_RadioButtonClickEventHandler$1" type="ElementEventHandler">
    /// The event handler to handle the RadioButton click event.
    /// </field>
    Coveo.CES.Web.Search.Scripts.Controls.DateParamsScript.initializeBase(this);
}
Coveo.CES.Web.Search.Scripts.Controls.DateParamsScript.prototype = {
    m_AnytimeRadioButton: null,
    m_InTheLastRadioButton: null,
    m_BetweenRadioButton: null,
    m_MinimumDate: null,
    m_MaximumDate: null,
    m_ModifiedInTheLast: null,
    _m_RadioButtonClickEventHandler$1: null,
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_DateParamsScript$initialize() {
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_AnytimeRadioButton);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_InTheLastRadioButton);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_BetweenRadioButton);
        this._m_RadioButtonClickEventHandler$1 = ss.Delegate.create(this, this._radioButton_Click$1);
        this.m_AnytimeRadioButton.attachEvent('onclick', this._m_RadioButtonClickEventHandler$1);
        this.m_InTheLastRadioButton.attachEvent('onclick', this._m_RadioButtonClickEventHandler$1);
        this.m_BetweenRadioButton.attachEvent('onclick', this._m_RadioButtonClickEventHandler$1);
        this._radioButton_Click$1();
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_DateParamsScript$tearDown() {
        if (this._m_RadioButtonClickEventHandler$1 != null) {
            this.m_AnytimeRadioButton.detachEvent('onclick', this._m_RadioButtonClickEventHandler$1);
            this.m_InTheLastRadioButton.detachEvent('onclick', this._m_RadioButtonClickEventHandler$1);
            this.m_BetweenRadioButton.detachEvent('onclick', this._m_RadioButtonClickEventHandler$1);
        }
        this._m_RadioButtonClickEventHandler$1 = null;
    },
    
    _radioButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_DateParamsScript$_radioButton_Click$1() {
        /// <summary>
        /// From the current radio button selection enable/disable their control
        /// accordingly.
        /// </summary>
        if ((this.m_BetweenRadioButton).checked) {
            Coveo.CNL.Web.Scripts.DOMUtilities.changeEnableStateOfChildren(this.m_MinimumDate, false, false);
            Coveo.CNL.Web.Scripts.DOMUtilities.changeEnableStateOfChildren(this.m_MaximumDate, false, false);
            Coveo.CNL.Web.Scripts.DOMUtilities.changeEnableStateOfChildren(this.m_ModifiedInTheLast, true, true);
        }
        else if ((this.m_AnytimeRadioButton).checked) {
            Coveo.CNL.Web.Scripts.DOMUtilities.changeEnableStateOfChildren(this.m_MinimumDate, true, true);
            Coveo.CNL.Web.Scripts.DOMUtilities.changeEnableStateOfChildren(this.m_MaximumDate, true, true);
            Coveo.CNL.Web.Scripts.DOMUtilities.changeEnableStateOfChildren(this.m_ModifiedInTheLast, true, true);
        }
        else {
            Coveo.CNL.Web.Scripts.CNLAssert.check((this.m_InTheLastRadioButton).checked);
            Coveo.CNL.Web.Scripts.DOMUtilities.changeEnableStateOfChildren(this.m_MinimumDate, true, true);
            Coveo.CNL.Web.Scripts.DOMUtilities.changeEnableStateOfChildren(this.m_MaximumDate, true, true);
            Coveo.CNL.Web.Scripts.DOMUtilities.changeEnableStateOfChildren(this.m_ModifiedInTheLast, false, false);
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.NoticesScript

Coveo.CES.Web.Search.Scripts.Controls.NoticesScript = function Coveo_CES_Web_Search_Scripts_Controls_NoticesScript() {
    /// <summary>
    /// Client side code for the Notices control.
    /// </summary>
    /// <field name="_m_JMain$1" type="jQueryObject">
    /// </field>
    /// <field name="_m_JCloseButton$1" type="jQueryObject">
    /// </field>
    /// <field name="m_Main" type="Object" domElement="true">
    /// </field>
    /// <field name="m_CloseButton" type="Object" domElement="true">
    /// </field>
    Coveo.CES.Web.Search.Scripts.Controls.NoticesScript.initializeBase(this);
}
Coveo.CES.Web.Search.Scripts.Controls.NoticesScript.prototype = {
    _m_JMain$1: null,
    _m_JCloseButton$1: null,
    m_Main: null,
    m_CloseButton: null,
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_NoticesScript$initialize() {
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_Main);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_CloseButton);
        this._m_JMain$1 = $(this.m_Main);
        this._m_JCloseButton$1 = $(this.m_CloseButton);
        this._m_JCloseButton$1.bind('click', ss.Delegate.create(this, function(p_Event) {
            this._hideNotice$1();
        }));
        Coveo.CES.Web.Search.Scripts.Controls.NoticesScript.callBaseMethod(this, 'initialize');
        this._displayNotice$1();
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_NoticesScript$tearDown() {
        this._m_JCloseButton$1.unbind('click');
        Coveo.CES.Web.Search.Scripts.Controls.NoticesScript.callBaseMethod(this, 'tearDown');
    },
    
    _displayNotice$1: function Coveo_CES_Web_Search_Scripts_Controls_NoticesScript$_displayNotice$1() {
        /// <summary>
        /// Display the notice
        /// </summary>
        var main = $(this.m_Main);
        $(ss.Delegate.create(this, function() {
            new Coveo.CNL.Web.Scripts.Timeout(ss.Delegate.create(this, function() {
                this._m_JMain$1.slideToggle('fast');
            }), 500);
        }));
    },
    
    _hideNotice$1: function Coveo_CES_Web_Search_Scripts_Controls_NoticesScript$_hideNotice$1() {
        /// <summary>
        /// Hides the notice
        /// </summary>
        this._m_JMain$1.slideToggle('fast');
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.SharePointSearchBoxScript

Coveo.CES.Web.Search.Scripts.Controls.SharePointSearchBoxScript = function Coveo_CES_Web_Search_Scripts_Controls_SharePointSearchBoxScript() {
    /// <summary>
    /// Client side code for the SharePoint SearchBox control.
    /// </summary>
    /// <field name="_coreV4_CSS_URL$1" type="Array" elementType="Array">
    /// </field>
    /// <field name="_searcH_CSS_URL$1" type="Array" elementType="Array">
    /// </field>
    /// <field name="_defaulT_SEARCH_CSS_URL$1" type="String" static="true">
    /// </field>
    /// <field name="m_OurSearchUrl" type="String">
    /// </field>
    /// <field name="m_SearchRootStyle" type="String">
    /// </field>
    this._coreV4_CSS_URL$1 = [ [ '/corev4.css' ], [ '/corev4-', '.css' ] ];
    this._searcH_CSS_URL$1 = [ [ '/search.css' ], [ '/search-', '.css' ] ];
    Coveo.CES.Web.Search.Scripts.Controls.SharePointSearchBoxScript.initializeBase(this);
}
Coveo.CES.Web.Search.Scripts.Controls.SharePointSearchBoxScript._stringMatches$1 = function Coveo_CES_Web_Search_Scripts_Controls_SharePointSearchBoxScript$_stringMatches$1(p_Str, p_Patterns) {
    /// <param name="p_Str" type="String">
    /// </param>
    /// <param name="p_Patterns" type="Array" elementType="Array">
    /// </param>
    /// <returns type="Boolean"></returns>
    var retMatch = false;
    for (var patternNo = 0; patternNo < p_Patterns.length; ++patternNo) {
        var startIndex = 0;
        for (var partNo = 0; startIndex !== -1 && partNo < p_Patterns[patternNo].length; ++partNo) {
            var partStr = p_Patterns[patternNo][partNo];
            startIndex = p_Str.indexOf(partStr, startIndex);
            if (startIndex !== -1) {
                startIndex += partStr.length;
            }
        }
        if (startIndex !== -1) {
            retMatch = true;
            break;
        }
    }
    return retMatch;
}
Coveo.CES.Web.Search.Scripts.Controls.SharePointSearchBoxScript.prototype = {
    m_OurSearchUrl: null,
    m_SearchRootStyle: null,
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_SharePointSearchBoxScript$initialize() {
        var OurSearch = '{0}' + this.m_OurSearchUrl + '?q=\"{1}\"';
        var s_MossPerson = new RegExp('(.+)Person\\.aspx.*', 'i');
        var s_MossPeopleResults = new RegExp('https?://.+/PeopleResults\\.aspx\\?.*k=(\\w+:)?\"(.+)\"', 'i');
        var person = s_MossPerson.exec(window.location.href);
        if (person != null && person.length > 0) {
            var elements = document.documentElement.getElementsByTagName('a');
            for (var i = 0; i < elements.length; i++) {
                var hrefAttribute = elements[i].attributes.getNamedItem('href');
                if (hrefAttribute != null) {
                    var match = s_MossPeopleResults.exec(hrefAttribute.value);
                    if (match != null && match.length > 0) {
                        hrefAttribute.value = String.format(OurSearch, person[1], match[2]);
                    }
                }
            }
        }
        var headColl = document.documentElement.getElementsByTagName('head');
        if (headColl.length >= 1) {
            var headElem = headColl[0];
            var foundCorev4 = false;
            var foundSearch = false;
            for (var childNo = 0; childNo < headElem.childNodes.length; ++childNo) {
                var tagName = headElem.childNodes[childNo].tagName;
                if (tagName != null && tagName.toLowerCase() === 'link') {
                    var relAttr = headElem.childNodes[childNo].attributes.getNamedItem('rel');
                    var typeAttr = headElem.childNodes[childNo].attributes.getNamedItem('type');
                    var hrefAttr = headElem.childNodes[childNo].attributes.getNamedItem('href');
                    if (relAttr != null && typeAttr != null && hrefAttr != null && relAttr.value === 'stylesheet' && typeAttr.value === 'text/css') {
                        var hrefStr = hrefAttr.value.toLowerCase();
                        if (Coveo.CES.Web.Search.Scripts.Controls.SharePointSearchBoxScript._stringMatches$1(hrefStr, this._coreV4_CSS_URL$1)) {
                            foundCorev4 = true;
                        }
                        else if (Coveo.CES.Web.Search.Scripts.Controls.SharePointSearchBoxScript._stringMatches$1(hrefStr, this._searcH_CSS_URL$1)) {
                            foundSearch = true;
                        }
                    }
                }
            }
            if (foundCorev4) {
                if (!foundSearch) {
                    var elem = document.createElement('link');
                    elem.setAttribute('rel', 'stylesheet');
                    elem.setAttribute('type', 'text/css');
                    elem.setAttribute('href', Coveo.CES.Web.Search.Scripts.Controls.SharePointSearchBoxScript._defaulT_SEARCH_CSS_URL$1);
                    headElem.appendChild(elem);
                }
                var divColl = document.documentElement.getElementsByTagName('div');
                for (var divNo = 0; divNo < divColl.length; ++divNo) {
                    var popup = divColl[divNo];
                    if (popup.id.indexOf('_PlaceHolderSearchArea_') !== -1 && popup.id.endsWith('_Popup')) {
                        popup.parentNode.removeChild(popup);
                        document.documentElement.getElementsByTagName('form')[0].appendChild(popup);
                        popup.className = this.m_SearchRootStyle;
                        break;
                    }
                }
            }
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript

Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript = function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript() {
    /// <summary>
    /// Client side code for the SearchBox control.
    /// </summary>
    /// <field name="m_Target" type="String">
    /// </field>
    /// <field name="m_SearchAsYouType" type="Boolean">
    /// </field>
    /// <field name="m_TextBox" type="Object" domElement="true">
    /// </field>
    /// <field name="m_SearchButton" type="Object" domElement="true">
    /// </field>
    /// <field name="m_LinkButton" type="Object" domElement="true">
    /// </field>
    /// <field name="m_ScopeDropDownList" type="Object" domElement="true">
    /// </field>
    /// <field name="m_ShowDelay" type="Number" integer="true">
    /// </field>
    /// <field name="m_HideDelay" type="Number" integer="true">
    /// </field>
    /// <field name="m_Position" type="Coveo.CNL.Web.Scripts.PositionEnum">
    /// </field>
    /// <field name="m_Popup" type="Object" domElement="true">
    /// </field>
    /// <field name="m_IFrame" type="Object" domElement="true">
    /// </field>
    /// <field name="m_NonFocusText" type="String">
    /// </field>
    /// <field name="m_NonFocusCssClass" type="String">
    /// </field>
    /// <field name="_m_OnFocusHandler$1" type="ElementEventHandler">
    /// </field>
    /// <field name="_m_OnBlurHandler$1" type="ElementEventHandler">
    /// </field>
    /// <field name="_m_OnKeyPressHandler$1" type="ElementEventHandler">
    /// </field>
    /// <field name="_m_SearchButtonClickEventHandler$1" type="ElementEventHandler">
    /// </field>
    /// <field name="_m_LinkButtonClickEventHandler$1" type="ElementEventHandler">
    /// </field>
    /// <field name="_m_PopupOnMouseOver$1" type="ElementEventHandler">
    /// </field>
    /// <field name="_m_PopupOnMouseOut$1" type="ElementEventHandler">
    /// </field>
    /// <field name="_m_UpdateTimeout$1" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    /// <field name="_m_HideTimeout$1" type="Coveo.CNL.Web.Scripts.Timeout">
    /// </field>
    /// <field name="_m_HasFocus$1" type="Boolean">
    /// </field>
    /// <field name="_m_OverResults$1" type="Boolean">
    /// </field>
    /// <field name="_m_WakeUpSent$1" type="Boolean">
    /// </field>
    Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript.initializeBase(this);
}
Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript.prototype = {
    m_Target: null,
    m_SearchAsYouType: false,
    m_TextBox: null,
    m_SearchButton: null,
    m_LinkButton: null,
    m_ScopeDropDownList: null,
    m_ShowDelay: 0,
    m_HideDelay: 0,
    m_Position: 0,
    m_Popup: null,
    m_IFrame: null,
    m_NonFocusText: null,
    m_NonFocusCssClass: null,
    _m_OnFocusHandler$1: null,
    _m_OnBlurHandler$1: null,
    _m_OnKeyPressHandler$1: null,
    _m_SearchButtonClickEventHandler$1: null,
    _m_LinkButtonClickEventHandler$1: null,
    _m_PopupOnMouseOver$1: null,
    _m_PopupOnMouseOut$1: null,
    _m_UpdateTimeout$1: null,
    _m_HideTimeout$1: null,
    _m_HasFocus$1: false,
    _m_OverResults$1: false,
    _m_WakeUpSent$1: false,
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$initialize() {
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_TextBox);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_SearchButton);
        this._m_OnKeyPressHandler$1 = ss.Delegate.create(this, this._textBox_KeyPress$1);
        this.m_TextBox.attachEvent('onkeydown', this._m_OnKeyPressHandler$1);
        this._m_SearchButtonClickEventHandler$1 = ss.Delegate.create(this, this._searchButton_Click$1);
        this.m_SearchButton.attachEvent('onclick', this._m_SearchButtonClickEventHandler$1);
        if (this.m_LinkButton != null) {
            this._m_LinkButtonClickEventHandler$1 = ss.Delegate.create(this, this._linkButton_Click$1);
            this.m_LinkButton.attachEvent('onclick', this._m_LinkButtonClickEventHandler$1);
        }
        if (this.m_NonFocusText != null && this.m_TextBox.value === '') {
            this._timerTick$1();
            window.setTimeout(ss.Delegate.create(this, this._timerTick$1), 10);
        }
        if (this.m_SearchAsYouType) {
            if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE6()) {
                Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_IFrame);
            }
            Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_Popup);
            this._m_PopupOnMouseOver$1 = ss.Delegate.create(this, this._popup_OnMouseOver$1);
            this.m_Popup.attachEvent('onmouseover', this._m_PopupOnMouseOver$1);
            this._m_PopupOnMouseOut$1 = ss.Delegate.create(this, this._popup_OnMouseOut$1);
            this.m_Popup.attachEvent('onmouseout', this._m_PopupOnMouseOut$1);
        }
        this._m_OnFocusHandler$1 = ss.Delegate.create(this, this._textBox_Focus$1);
        this.m_TextBox.attachEvent('onfocus', this._m_OnFocusHandler$1);
        this._m_OnBlurHandler$1 = ss.Delegate.create(this, this._textBox_Blur$1);
        this.m_TextBox.attachEvent('onblur', this._m_OnBlurHandler$1);
    },
    
    _timerTick$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_timerTick$1() {
        if (this.m_TextBox.className.indexOf(this.m_NonFocusCssClass) === -1) {
            this.m_TextBox.className += ' ' + this.m_NonFocusCssClass;
        }
        this.m_TextBox.value = this.m_NonFocusText;
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$tearDown() {
        if (this._m_OnFocusHandler$1 != null) {
            this.m_TextBox.detachEvent('onfocus', this._m_OnFocusHandler$1);
        }
        if (this._m_OnBlurHandler$1 != null) {
            this.m_TextBox.detachEvent('onblur', this._m_OnBlurHandler$1);
        }
        if (this._m_OnKeyPressHandler$1 != null) {
            this.m_TextBox.detachEvent('onkeydown', this._m_OnKeyPressHandler$1);
        }
        if (this._m_SearchButtonClickEventHandler$1 != null) {
            this.m_SearchButton.detachEvent('onclick', this._m_SearchButtonClickEventHandler$1);
        }
        if (this._m_LinkButtonClickEventHandler$1 != null) {
            this.m_LinkButton.detachEvent('onclick', this._m_LinkButtonClickEventHandler$1);
        }
    },
    
    serverUpdateResults: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$serverUpdateResults(p_Query, p_Scope, p_Callback) {
        /// <param name="p_Query" type="String">
        /// </param>
        /// <param name="p_Scope" type="String">
        /// </param>
        /// <param name="p_Callback" type="Coveo.CNL.Web.Scripts.Ajax.PostBackCallback">
        /// </param>
    },
    
    _scheduleUpdateResults$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_scheduleUpdateResults$1() {
        /// <summary>
        /// Schedules an update of the results.
        /// </summary>
        this._cancelUpdateResults$1();
        this._m_UpdateTimeout$1 = new Coveo.CNL.Web.Scripts.Timeout(ss.Delegate.create(this, this._updateResults$1), this.m_ShowDelay);
    },
    
    _cancelUpdateResults$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_cancelUpdateResults$1() {
        /// <summary>
        /// Cancels a scheduled update of the results.
        /// </summary>
        if (this._m_UpdateTimeout$1 != null) {
            this._m_UpdateTimeout$1.cancel();
            this._m_UpdateTimeout$1 = null;
        }
    },
    
    _updateResults$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_updateResults$1() {
        /// <summary>
        /// Launches the server calls to update the results.
        /// </summary>
        this._m_UpdateTimeout$1 = null;
        if (this.m_TextBox.value !== '') {
            if (this.m_ScopeDropDownList != null) {
                this.serverUpdateResults(this.m_TextBox.value, this.m_ScopeDropDownList.value, ss.Delegate.create(this, this._updateResultsCallback$1));
            }
            else {
                this.serverUpdateResults(this.m_TextBox.value, '', ss.Delegate.create(this, this._updateResultsCallback$1));
            }
        }
        else {
            this._hidePopup$1();
        }
    },
    
    _updateResultsCallback$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_updateResultsCallback$1(p_Return) {
        /// <summary>
        /// Callback for when the server has updated the results.
        /// </summary>
        /// <param name="p_Return" type="Object">
        /// </param>
        this._showPopup$1();
    },
    
    _showPopup$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_showPopup$1() {
        /// <summary>
        /// Shows the popup containing quick results.
        /// </summary>
        this.m_Popup.style.display = 'block';
        Coveo.CNL.Web.Scripts.DOMUtilities.positionElement(this.m_Popup, this.m_TextBox, this.m_Position);
        if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE6()) {
            this.m_IFrame.style.display = 'block';
            Coveo.CNL.Web.Scripts.DOMUtilities.setElementSize(this.m_IFrame, Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this.m_Popup));
            Coveo.CNL.Web.Scripts.DOMUtilities.positionElement(this.m_IFrame, this.m_TextBox, this.m_Position);
        }
    },
    
    _scheduleHidePopup$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_scheduleHidePopup$1() {
        /// <summary>
        /// Schedules hiding the popup (when the user stops using the search box).
        /// </summary>
        this._cancelHidePopup$1();
        this._m_HideTimeout$1 = new Coveo.CNL.Web.Scripts.Timeout(ss.Delegate.create(this, this._hidePopup$1), this.m_HideDelay);
    },
    
    _cancelHidePopup$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_cancelHidePopup$1() {
        /// <summary>
        /// Cancels a scheduled hiding of the popup.
        /// </summary>
        if (this._m_HideTimeout$1 != null) {
            this._m_HideTimeout$1.cancel();
            this._m_HideTimeout$1 = null;
        }
    },
    
    _hidePopup$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_hidePopup$1() {
        /// <summary>
        /// Hides the popup containing quick results.
        /// </summary>
        this._cancelHidePopup$1();
        this.m_Popup.style.display = 'none';
        if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE6()) {
            this.m_IFrame.style.display = 'none';
        }
    },
    
    _submitSearch$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_submitSearch$1() {
        /// <summary>
        /// Submits the current search query.
        /// </summary>
        var query = ((this.m_NonFocusText == null || this.m_TextBox.className.indexOf(' ' + this.m_NonFocusCssClass) === -1) ? this.m_TextBox.value : '');
        var uri = this.m_Target;
        uri += '&' + Coveo.CES.Common.SearchInterfaceQueryString.queryParameter + '=' + encodeURIComponent(query);
        if (this.m_ScopeDropDownList != null && this.m_ScopeDropDownList.value !== '') {
            uri += '&' + Coveo.CES.Common.SearchInterfaceQueryString.initialScopeParameter + '=' + encodeURIComponent(this.m_ScopeDropDownList.value);
        }
        uri += '&' + Coveo.CES.Common.SearchInterfaceQueryString.timeZoneParameter + '=' + encodeURIComponent(eval('jstz.determine_timezone().name()').toString());
        window.navigate(uri);
    },
    
    _textBox_Focus$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_textBox_Focus$1() {
        if (this.m_SearchAsYouType) {
            this._cancelHidePopup$1();
            this._m_HasFocus$1 = true;
        }
        if (this.m_NonFocusText != null) {
            if (this.m_TextBox.className.indexOf(' ' + this.m_NonFocusCssClass) !== -1) {
                this.m_TextBox.value = '';
                this.m_TextBox.className = this.m_TextBox.className.replaceAll(' ' + this.m_NonFocusCssClass, '');
            }
        }
        if (this.m_SearchAsYouType) {
            if (this.m_TextBox.value !== '') {
                this._scheduleUpdateResults$1();
            }
            if (!this._m_WakeUpSent$1) {
                var uri = this.m_Target;
                uri += '&' + Coveo.CES.Common.SearchInterfaceQueryString.wakeUpParameter + '=1';
                var request = new XMLHttpRequest();
                request.open('GET', uri, true);
                request.send('');
                this._m_WakeUpSent$1 = true;
            }
        }
    },
    
    _textBox_Blur$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_textBox_Blur$1() {
        if (this.m_SearchAsYouType) {
            if (!this._m_OverResults$1) {
                this._scheduleHidePopup$1();
            }
            this._cancelUpdateResults$1();
            this._m_HasFocus$1 = false;
        }
        if (this.m_NonFocusText != null) {
            if (this.m_TextBox.value === '') {
                this.m_TextBox.className += ' ' + this.m_NonFocusCssClass;
                this.m_TextBox.value = this.m_NonFocusText;
            }
        }
    },
    
    _textBox_KeyPress$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_textBox_KeyPress$1() {
        if (window.event.keyCode === 13) {
            this._submitSearch$1();
            window.event.returnValue = false;
        }
        else if (this.m_SearchAsYouType) {
            this._scheduleUpdateResults$1();
        }
    },
    
    _searchButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_searchButton_Click$1() {
        this._submitSearch$1();
    },
    
    _linkButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_linkButton_Click$1() {
        window.navigate(this.m_Target);
    },
    
    _popup_OnMouseOver$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_popup_OnMouseOver$1() {
        this._m_OverResults$1 = true;
        this._cancelHidePopup$1();
    },
    
    _popup_OnMouseOut$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_popup_OnMouseOut$1() {
        if (!this._m_HasFocus$1) {
            this._scheduleHidePopup$1();
        }
        this._m_OverResults$1 = false;
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.SilverlightMediaPlayer

Coveo.CES.Web.Search.Scripts.Controls.SilverlightMediaPlayer = function Coveo_CES_Web_Search_Scripts_Controls_SilverlightMediaPlayer(p_XAPUrl) {
    /// <summary>
    /// Client side code for the Player class: version Silverlight.
    /// </summary>
    /// <param name="p_XAPUrl" type="String">
    /// The url of the media player xap file.
    /// </param>
    /// <field name="_objecT_ID" type="String" static="true">
    /// </field>
    /// <field name="_m_PlayerElement" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_XAPUrl" type="String">
    /// </field>
    this._m_XAPUrl = p_XAPUrl;
}
Coveo.CES.Web.Search.Scripts.Controls.SilverlightMediaPlayer.prototype = {
    _m_PlayerElement: null,
    _m_XAPUrl: null,
    
    get_id: function Coveo_CES_Web_Search_Scripts_Controls_SilverlightMediaPlayer$get_id() {
        /// <value type="String"></value>
        return 'coveoMediaPlayer';
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_SilverlightMediaPlayer$tearDown() {
        this._m_XAPUrl = null;
        this._m_PlayerElement = null;
    },
    
    play: function Coveo_CES_Web_Search_Scripts_Controls_SilverlightMediaPlayer$play() {
        this._getControlElement().Play();
    },
    
    pause: function Coveo_CES_Web_Search_Scripts_Controls_SilverlightMediaPlayer$pause() {
        this._getControlElement().Pause();
    },
    
    stop: function Coveo_CES_Web_Search_Scripts_Controls_SilverlightMediaPlayer$stop() {
        this._getControlElement().Stop();
    },
    
    getPosition: function Coveo_CES_Web_Search_Scripts_Controls_SilverlightMediaPlayer$getPosition() {
        /// <returns type="Number"></returns>
        return parseFloat(this._getControlElement().GetPosition().toString());
    },
    
    setPosition: function Coveo_CES_Web_Search_Scripts_Controls_SilverlightMediaPlayer$setPosition(p_Position) {
        /// <param name="p_Position" type="Number">
        /// </param>
        this._getControlElement().SetPosition(p_Position);
    },
    
    getState: function Coveo_CES_Web_Search_Scripts_Controls_SilverlightMediaPlayer$getState() {
        /// <returns type="Coveo.CES.Web.Search.Scripts.Controls.StateEnum"></returns>
        switch (this._getControlElement().GetState().toString()) {
            case 'Paused':
                return Coveo.CES.Web.Search.Scripts.Controls.StateEnum.paused;
            case 'Playing':
                return Coveo.CES.Web.Search.Scripts.Controls.StateEnum.playing;
            case 'Buffering':
                return Coveo.CES.Web.Search.Scripts.Controls.StateEnum.buffering;
            case 'Stopped':
            default:
                return Coveo.CES.Web.Search.Scripts.Controls.StateEnum.stopped;
        }
    },
    
    getStatus: function Coveo_CES_Web_Search_Scripts_Controls_SilverlightMediaPlayer$getStatus() {
        /// <returns type="String"></returns>
        return this._getControlElement().GetState().toString();
    },
    
    createPlayerElement: function Coveo_CES_Web_Search_Scripts_Controls_SilverlightMediaPlayer$createPlayerElement(p_Uri, p_Height, p_Width) {
        /// <param name="p_Uri" type="String">
        /// </param>
        /// <param name="p_Height" type="String">
        /// </param>
        /// <param name="p_Width" type="String">
        /// </param>
        /// <returns type="Object" domElement="true"></returns>
        var elem = document.createElement('div');
        elem.setAttribute('id', this.get_id());
        elem.style.width = p_Width;
        elem.style.height = p_Height;
        var obj = document.createElement('object');
        obj.setAttribute('id', Coveo.CES.Web.Search.Scripts.Controls.SilverlightMediaPlayer._objecT_ID);
        obj.setAttribute('data', 'data:application/x-silverlight-2,');
        obj.setAttribute('type', 'application/x-silverlight-2');
        obj.setAttribute('width', '100%');
        obj.setAttribute('height', '100%');
        var sourceParam = document.createElement('param');
        sourceParam.setAttribute('name', 'source');
        sourceParam.setAttribute('value', this._m_XAPUrl);
        var minRuntimeParam = document.createElement('param');
        minRuntimeParam.setAttribute('name', 'minRuntimeVersion');
        minRuntimeParam.setAttribute('value', '4.0.50401.0');
        var autoUpgradeParam = document.createElement('param');
        autoUpgradeParam.setAttribute('name', 'autoUpgrade');
        autoUpgradeParam.setAttribute('value', 'true');
        var windowlessParam = document.createElement('param');
        windowlessParam.setAttribute('name', 'windowless');
        windowlessParam.setAttribute('value', 'true');
        var initParamsParam = document.createElement('param');
        initParamsParam.setAttribute('name', 'initParams');
        initParamsParam.setAttribute('value', 'MediaUri=' + p_Uri);
        var dwnLnk = document.createElement('a');
        dwnLnk.setAttribute('href', 'http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50401.0');
        dwnLnk.setAttribute('style', 'text-decoration:none');
        var dwnImg = document.createElement('img');
        dwnImg.src = 'http://go.microsoft.com/fwlink/?LinkId=161376';
        dwnImg.alt = 'Get Microsoft Silverlight';
        dwnImg.style.borderStyle = 'none';
        var historyFrame = document.createElement('iframe');
        historyFrame.setAttribute('id', '_sl_historyFrame');
        historyFrame.setAttribute('style', 'visibility:hidden;height:0px;width:0px;border:0px');
        dwnLnk.appendChild(dwnImg);
        obj.appendChild(dwnLnk);
        obj.appendChild(sourceParam);
        obj.appendChild(minRuntimeParam);
        obj.appendChild(autoUpgradeParam);
        obj.appendChild(windowlessParam);
        obj.appendChild(initParamsParam);
        elem.appendChild(obj);
        elem.appendChild(historyFrame);
        return elem;
    },
    
    createPlayerString: function Coveo_CES_Web_Search_Scripts_Controls_SilverlightMediaPlayer$createPlayerString(p_Uri, p_Height, p_Width) {
        /// <param name="p_Uri" type="String">
        /// </param>
        /// <param name="p_Height" type="String">
        /// </param>
        /// <param name="p_Width" type="String">
        /// </param>
        /// <returns type="String"></returns>
        var sb = new ss.StringBuilder();
        sb.append('<div id=\"' + this.get_id() + '\" style=\"height:' + p_Height + '; width:' + p_Width + '\">');
        sb.append('<object ID=\"' + Coveo.CES.Web.Search.Scripts.Controls.SilverlightMediaPlayer._objecT_ID + '\" data=\"data:application/x-silverlight-2\" type=\"application/x-silverlight-2\" width=\"100%\" height=\"100%\" >');
        sb.append('<param name=\"initParams\" value=\"MediaUri=' + p_Uri + '\" >');
        sb.append('<param name=\"source\" value=\"' + this._m_XAPUrl + '\"/>');
        sb.append('<param name=\"windowless\" value=\"true\"/>');
        sb.append('<param name=\"autoUpgrade\" value=\"true\"/>');
        sb.append('<param name=\"minRuntimeVersion\" value=\"4.0.50401.0\"/>');
        sb.append('<a href=\"http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50401.0\" >');
        sb.append('<img src=\"http://go.microsoft.com/fwlink/?LinkId=161376\" alt=\"Get Microsoft Silverlight\" style=\"border-style:none\" />');
        sb.append('</a>');
        sb.append('</object>');
        sb.append('<iframe id=\"_sl_historyFrame\" style=\"visibility:hidden; height:0px; width:0px; border:0px\" />');
        sb.append('</div>');
        return sb.toString();
    },
    
    isReady: function Coveo_CES_Web_Search_Scripts_Controls_SilverlightMediaPlayer$isReady() {
        /// <returns type="Boolean"></returns>
        return !ss.isNullOrUndefined(this._getControlElement());
    },
    
    _getControlElement: function Coveo_CES_Web_Search_Scripts_Controls_SilverlightMediaPlayer$_getControlElement() {
        /// <summary>
        /// Get the DOM Element element used to interact with Silverlight Media Player.
        /// </summary>
        /// <returns type="Object" domElement="true"></returns>
        try {
            if (ss.isNullOrUndefined(this._m_PlayerElement)) {
                this._m_PlayerElement = document.getElementById(Coveo.CES.Web.Search.Scripts.Controls.SilverlightMediaPlayer._objecT_ID);
            }
            return this._m_PlayerElement.Content.mediaPlayer;
        }
        catch ($e1) {
            return null;
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.WindowsMediaPlayer

Coveo.CES.Web.Search.Scripts.Controls.WindowsMediaPlayer = function Coveo_CES_Web_Search_Scripts_Controls_WindowsMediaPlayer() {
    /// <summary>
    /// Client side code for the Player class: version Windows Media Player.
    /// </summary>
    /// <field name="_clasS_ID" type="String" static="true">
    /// </field>
    /// <field name="_m_PlayerElement" type="Object" domElement="true">
    /// </field>
}
Coveo.CES.Web.Search.Scripts.Controls.WindowsMediaPlayer.prototype = {
    _m_PlayerElement: null,
    
    get_id: function Coveo_CES_Web_Search_Scripts_Controls_WindowsMediaPlayer$get_id() {
        /// <value type="String"></value>
        return 'coveoMediaPlayer';
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_WindowsMediaPlayer$tearDown() {
        if (!ss.isNullOrUndefined(this._m_PlayerElement)) {
            this._getPlayerElement().close();
        }
        this._m_PlayerElement = null;
    },
    
    play: function Coveo_CES_Web_Search_Scripts_Controls_WindowsMediaPlayer$play() {
        this._getControlElement().play();
    },
    
    pause: function Coveo_CES_Web_Search_Scripts_Controls_WindowsMediaPlayer$pause() {
        this._getControlElement().pause();
    },
    
    stop: function Coveo_CES_Web_Search_Scripts_Controls_WindowsMediaPlayer$stop() {
        this._getControlElement().stop();
    },
    
    getPosition: function Coveo_CES_Web_Search_Scripts_Controls_WindowsMediaPlayer$getPosition() {
        /// <returns type="Number"></returns>
        return parseFloat(this._getControlElement().currentPosition.toString());
    },
    
    setPosition: function Coveo_CES_Web_Search_Scripts_Controls_WindowsMediaPlayer$setPosition(p_Position) {
        /// <param name="p_Position" type="Number">
        /// </param>
        this._getControlElement().currentPosition = p_Position;
    },
    
    getState: function Coveo_CES_Web_Search_Scripts_Controls_WindowsMediaPlayer$getState() {
        /// <returns type="Coveo.CES.Web.Search.Scripts.Controls.StateEnum"></returns>
        switch (this._getPlayerElement().playState.toString()) {
            case '1':
                return Coveo.CES.Web.Search.Scripts.Controls.StateEnum.stopped;
            case '2':
                return Coveo.CES.Web.Search.Scripts.Controls.StateEnum.paused;
            case '3':
                return Coveo.CES.Web.Search.Scripts.Controls.StateEnum.playing;
            case '6':
                return Coveo.CES.Web.Search.Scripts.Controls.StateEnum.buffering;
            case '8':
                return Coveo.CES.Web.Search.Scripts.Controls.StateEnum.ended;
            case '10':
                return Coveo.CES.Web.Search.Scripts.Controls.StateEnum.ready;
            default:
                return Coveo.CES.Web.Search.Scripts.Controls.StateEnum.stopped;
        }
    },
    
    getStatus: function Coveo_CES_Web_Search_Scripts_Controls_WindowsMediaPlayer$getStatus() {
        /// <returns type="String"></returns>
        return this._getPlayerElement().status.toString();
    },
    
    createPlayerElement: function Coveo_CES_Web_Search_Scripts_Controls_WindowsMediaPlayer$createPlayerElement(p_Uri, p_Height, p_Width) {
        /// <param name="p_Uri" type="String">
        /// </param>
        /// <param name="p_Height" type="String">
        /// </param>
        /// <param name="p_Width" type="String">
        /// </param>
        /// <returns type="Object" domElement="true"></returns>
        var elem = document.createElement('object');
        elem.setAttribute('classid', Coveo.CES.Web.Search.Scripts.Controls.WindowsMediaPlayer._clasS_ID);
        elem.setAttribute('stretchToFit', true);
        elem.setAttribute('windowlessVideo', true);
        elem.setAttribute('uiMode', 'none');
        elem.setAttribute('URL', p_Uri);
        elem.style.width = p_Width;
        elem.style.height = p_Height;
        return elem;
    },
    
    createPlayerString: function Coveo_CES_Web_Search_Scripts_Controls_WindowsMediaPlayer$createPlayerString(p_Uri, p_Height, p_Width) {
        /// <param name="p_Uri" type="String">
        /// </param>
        /// <param name="p_Height" type="String">
        /// </param>
        /// <param name="p_Width" type="String">
        /// </param>
        /// <returns type="String"></returns>
        var sb = new ss.StringBuilder();
        sb.append('<object ID=\"' + this.get_id() + '\" classid=\"' + Coveo.CES.Web.Search.Scripts.Controls.WindowsMediaPlayer._clasS_ID + '\" style=\"height:' + p_Height + '; width:' + p_Width + '\" >');
        sb.append('<param name=\"URL\" value=\"' + p_Uri + '\" >');
        sb.append('<param name=\"stretchToFit\" value=\"true\"/>');
        sb.append('<param name=\"windowlessVideo\" value=\"true\"/>');
        sb.append('<param name=\"autostart\" value=\"true\"/>');
        sb.append('<param name=\"uiMode\" value=\"none\"/>');
        sb.append('</object>');
        return sb.toString();
    },
    
    isReady: function Coveo_CES_Web_Search_Scripts_Controls_WindowsMediaPlayer$isReady() {
        /// <returns type="Boolean"></returns>
        return !ss.isNullOrUndefined(this._getControlElement());
    },
    
    _getPlayerElement: function Coveo_CES_Web_Search_Scripts_Controls_WindowsMediaPlayer$_getPlayerElement() {
        /// <summary>
        /// Gets the DOM Element element used to interact with Windows Media Player.
        /// </summary>
        /// <returns type="Object" domElement="true"></returns>
        try {
            if (ss.isNullOrUndefined(this._m_PlayerElement)) {
                this._m_PlayerElement = document.getElementById(this.get_id());
            }
            return this._m_PlayerElement.object;
        }
        catch ($e1) {
            return null;
        }
    },
    
    _getControlElement: function Coveo_CES_Web_Search_Scripts_Controls_WindowsMediaPlayer$_getControlElement() {
        /// <summary>
        /// Gets the DOM Element element used to interact with Windows Media Player's controls.
        /// </summary>
        /// <returns type="Object" domElement="true"></returns>
        try {
            return this._getPlayerElement().controls;
        }
        catch ($e1) {
            return null;
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.ResultImagePresenterScript

Coveo.CES.Web.Search.Scripts.Controls.ResultImagePresenterScript = function Coveo_CES_Web_Search_Scripts_Controls_ResultImagePresenterScript() {
    /// <summary>
    /// Client side code for the ResultImagePresenter control.
    /// </summary>
    /// <field name="_m_OnDwellEvent$1" type="Coveo.CNL.Web.Scripts.OnDwellEvent">
    /// </field>
    /// <field name="_m_OnLeaveMany$1" type="Coveo.CNL.Web.Scripts.OnLeaveManyEvent">
    /// </field>
    /// <field name="_m_PopupShowing$1" type="Boolean">
    /// </field>
    /// <field name="m_Image" type="Object" domElement="true">
    /// The element for the image.
    /// </field>
    /// <field name="m_Popup" type="Object" domElement="true">
    /// The element for the popup.
    /// </field>
    /// <field name="m_ImageInPopup" type="Object" domElement="true">
    /// The element for the image within the popup.
    /// </field>
    /// <field name="m_Detail" type="Object" domElement="true">
    /// The element containing the detail.
    /// </field>
    Coveo.CES.Web.Search.Scripts.Controls.ResultImagePresenterScript.initializeBase(this);
}
Coveo.CES.Web.Search.Scripts.Controls.ResultImagePresenterScript.prototype = {
    _m_OnDwellEvent$1: null,
    _m_OnLeaveMany$1: null,
    _m_PopupShowing$1: false,
    m_Image: null,
    m_Popup: null,
    m_ImageInPopup: null,
    m_Detail: null,
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_ResultImagePresenterScript$initialize() {
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_Image);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_Popup);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_ImageInPopup);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_Detail);
        this._m_OnDwellEvent$1 = new Coveo.CNL.Web.Scripts.OnDwellEvent(this.m_Image, 200, ss.Delegate.create(this, this._image_OnDwell$1));
        this._m_OnLeaveMany$1 = new Coveo.CNL.Web.Scripts.OnLeaveManyEvent([ this.m_Image, this.m_Popup ], 200, ss.Delegate.create(this, this._popup_OnLeaveMany$1));
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_ResultImagePresenterScript$tearDown() {
        if (this._m_OnDwellEvent$1 != null) {
            this._m_OnDwellEvent$1.dispose();
        }
        if (this._m_OnLeaveMany$1 != null) {
            this._m_OnLeaveMany$1.dispose();
        }
        if (this.m_Popup != null) {
            this.m_Popup.parentNode.removeChild(this.m_Popup);
        }
    },
    
    _image_OnDwell$1: function Coveo_CES_Web_Search_Scripts_Controls_ResultImagePresenterScript$_image_OnDwell$1() {
        if (!this._m_PopupShowing$1) {
            this.m_Popup.style.visibility = 'hidden';
            this.m_Popup.style.display = 'block';
            var pos = {};
            pos['of'] = this.m_Image;
            pos['my'] = 'center center';
            pos['at'] = 'center center';
            pos['offset'] = '1 1';
            pos['collision'] = 'fit fit';
            this.m_Detail.style.display = 'none';
            this.m_ImageInPopup.style.width = '300px';
            $(this.m_Popup).position(pos);
            this.m_Detail.style.display = 'block';
            var finalPopupPosition = Coveo.CNL.Web.Scripts.DOMUtilities.getElementPosition(this.m_Popup);
            this.m_Detail.style.display = 'none';
            var imageSize = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this.m_Image);
            this.m_ImageInPopup.style.width = imageSize.width + 'px';
            $(this.m_Popup).position(pos);
            this.m_Detail.style.display = 'block';
            var popupAnimProperties = {};
            popupAnimProperties['left'] = finalPopupPosition.left + 'px';
            popupAnimProperties['top'] = finalPopupPosition.top + 'px';
            $(this.m_Popup).animate(popupAnimProperties, 100);
            var imageAnimProperties = {};
            imageAnimProperties['width'] = '300px';
            $(this.m_ImageInPopup).animate(imageAnimProperties, 100);
            this.m_Popup.style.visibility = 'visible';
            this._m_PopupShowing$1 = true;
        }
    },
    
    _popup_OnLeaveMany$1: function Coveo_CES_Web_Search_Scripts_Controls_ResultImagePresenterScript$_popup_OnLeaveMany$1() {
        if (this._m_PopupShowing$1) {
            this.m_Popup.style.display = 'none';
            this._m_PopupShowing$1 = false;
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript

Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript = function Coveo_CES_Web_Search_Scripts_Controls_ResultPresenceIndicatorScript() {
    /// <summary>
    /// Client side code for the ResultPresenceIndicator control.
    /// </summary>
    /// <field name="_s_NameCtrl$1" type="Object" static="true">
    /// </field>
    /// <field name="_s_TriedCreatingNameCtrl$1" type="Boolean" static="true">
    /// </field>
    /// <field name="_s_RunningControls$1" type="Array" static="true">
    /// </field>
    /// <field name="_m_UnknownImageUrl$1" type="String">
    /// </field>
    /// <field name="m_Image" type="Object" domElement="true">
    /// The image element in which to display presence information.
    /// </field>
    /// <field name="m_Email" type="String">
    /// The email address of the user for which to display presence.
    /// </field>
    Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript.initializeBase(this);
}
Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._nameCtrl_OnStatusChange$1 = function Coveo_CES_Web_Search_Scripts_Controls_ResultPresenceIndicatorScript$_nameCtrl_OnStatusChange$1(p_Email, p_Status, p_Id) {
    /// <param name="p_Email" type="String">
    /// </param>
    /// <param name="p_Status" type="Number" integer="true">
    /// </param>
    /// <param name="p_Id" type="String">
    /// </param>
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Email);
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_NameCtrl$1);
    for (var i = 0; i < Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_RunningControls$1.length; ++i) {
        var control = Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_RunningControls$1[i];
        if (control.m_Email.toLowerCase() === p_Email.toLowerCase()) {
            control._updateStatus$1(p_Status);
        }
    }
}
Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript.prototype = {
    _m_UnknownImageUrl$1: null,
    m_Image: null,
    m_Email: null,
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_ResultPresenceIndicatorScript$initialize() {
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_Image);
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(this.m_Email);
        this._m_UnknownImageUrl$1 = this.m_Image.src;
        if (Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_NameCtrl$1 == null && !Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_TriedCreatingNameCtrl$1) {
            try {
                Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_TriedCreatingNameCtrl$1 = true;
                Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_NameCtrl$1 = eval('new ActiveXObject(\'Name.NameCtrl.1\')');
                if (Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_NameCtrl$1 != null && Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_NameCtrl$1.PresenceEnabled) {
                    Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_NameCtrl$1.OnStatusChange = Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._nameCtrl_OnStatusChange$1;
                }
                else {
                    Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_NameCtrl$1 = null;
                }
            }
            catch ($e1) {
                Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_NameCtrl$1 = null;
            }
        }
        if (Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_NameCtrl$1 != null) {
            ArrayPrototype_add(Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_RunningControls$1, this);
            this.m_Image.attachEvent('onmouseover', ss.Delegate.create(this, this._image_OnMouseOver$1));
            this.m_Image.attachEvent('onmouseout', ss.Delegate.create(this, this._image_OnMouseOut$1));
            var status = Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_NameCtrl$1.GetStatus(this.m_Email, '');
            this._updateStatus$1(status);
        }
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_ResultPresenceIndicatorScript$tearDown() {
        if (Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_NameCtrl$1 != null) {
            Coveo.CNL.Web.Scripts.CNLAssert.check(ArrayPrototype_contains(Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_RunningControls$1, this));
            ArrayPrototype_remove(Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_RunningControls$1, this);
            Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_NameCtrl$1.HideOOUI();
        }
        this.m_Image = null;
    },
    
    _image_OnMouseOver$1: function Coveo_CES_Web_Search_Scripts_Controls_ResultPresenceIndicatorScript$_image_OnMouseOver$1() {
        Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_NameCtrl$1.HideOOUI();
        var pos = Coveo.CNL.Web.Scripts.DOMUtilities.getElementPosition(this.m_Image);
        var visible = Coveo.CNL.Web.Scripts.DOMUtilities.getVisibleRectangle();
        Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_NameCtrl$1.ShowOOUI(this.m_Email, 0, pos.left - visible.left, pos.top - visible.top);
    },
    
    _updateStatus$1: function Coveo_CES_Web_Search_Scripts_Controls_ResultPresenceIndicatorScript$_updateStatus$1(p_Status) {
        /// <summary>
        /// Updates the status image for the user.
        /// </summary>
        /// <param name="p_Status" type="Number" integer="true">
        /// The status of the user.
        /// </param>
        var src;
        switch (p_Status) {
            case 0:
                src = this._m_UnknownImageUrl$1.replaceAll('_unknown', '_online');
                break;
            case 1:
                src = this._m_UnknownImageUrl$1.replaceAll('_unknown', '_offline');
                break;
            case 2:
                src = this._m_UnknownImageUrl$1.replaceAll('_unknown', '_away');
                break;
            case 3:
                src = this._m_UnknownImageUrl$1.replaceAll('_unknown', '_busy');
                break;
            case 4:
                src = this._m_UnknownImageUrl$1.replaceAll('_unknown', '_away');
                break;
            case 5:
                src = this._m_UnknownImageUrl$1.replaceAll('_unknown', '_busy');
                break;
            case 6:
                src = this._m_UnknownImageUrl$1.replaceAll('_unknown', '_away');
                break;
            case 7:
                src = this._m_UnknownImageUrl$1.replaceAll('_unknown', '_busy');
                break;
            case 8:
                src = this._m_UnknownImageUrl$1.replaceAll('_unknown', '_busy');
                break;
            case 9:
                src = this._m_UnknownImageUrl$1.replaceAll('_unknown', '_dnd');
                break;
            case 15:
                src = this._m_UnknownImageUrl$1.replaceAll('_unknown', '_busy');
                break;
            case 16:
                src = this._m_UnknownImageUrl$1.replaceAll('_unknown', '_away');
                break;
            default:
                src = this._m_UnknownImageUrl$1;
                break;
        }
        this.m_Image.src = src;
        this.m_Image.style.display = 'inline';
    },
    
    _image_OnMouseOut$1: function Coveo_CES_Web_Search_Scripts_Controls_ResultPresenceIndicatorScript$_image_OnMouseOut$1() {
        Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_NameCtrl$1.HideOOUI();
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.HighlightedQueryScript

Coveo.CES.Web.Search.Scripts.Controls.HighlightedQueryScript = function Coveo_CES_Web_Search_Scripts_Controls_HighlightedQueryScript() {
    /// <summary>
    /// Client side code for the HighlightedQuery control.
    /// </summary>
    /// <field name="_m_MouseDownEventHandler$1" type="ElementEventHandler">
    /// </field>
    /// <field name="_m_MouseWheelEventHandler$1" type="ElementEventHandler">
    /// </field>
    /// <field name="m_Term" type="Object" domElement="true">
    /// The term control to attach the mouse events to.
    /// </field>
    /// <field name="m_Index" type="Number" integer="true">
    /// The index of the term.
    /// </field>
    /// <field name="m_FrameName" type="String">
    /// The name of the frame that contains the terms to iterate.
    /// </field>
    Coveo.CES.Web.Search.Scripts.Controls.HighlightedQueryScript.initializeBase(this);
}
Coveo.CES.Web.Search.Scripts.Controls.HighlightedQueryScript.prototype = {
    _m_MouseDownEventHandler$1: null,
    _m_MouseWheelEventHandler$1: null,
    m_Term: null,
    m_Index: 0,
    m_FrameName: null,
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_HighlightedQueryScript$initialize() {
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_Term);
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(this.m_FrameName);
        this._m_MouseDownEventHandler$1 = ss.Delegate.create(this, this._term_MouseDown$1);
        this._m_MouseWheelEventHandler$1 = ss.Delegate.create(this, this._term_MouseWheel$1);
        this.m_Term.attachEvent('onmousedown', this._m_MouseDownEventHandler$1);
        this.m_Term.attachEvent('xxDOMMouseScroll', this._m_MouseWheelEventHandler$1);
        this.m_Term.attachEvent('onmousewheel', this._m_MouseWheelEventHandler$1);
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_HighlightedQueryScript$tearDown() {
        if (this.m_Term != null) {
            if (this._m_MouseDownEventHandler$1 != null) {
                this.m_Term.detachEvent('onmousedown', this._m_MouseDownEventHandler$1);
            }
            if (this._m_MouseWheelEventHandler$1 != null) {
                this.m_Term.detachEvent('xxDOMMouseScroll', this._m_MouseWheelEventHandler$1);
                this.m_Term.detachEvent('onmousewheel', this._m_MouseWheelEventHandler$1);
            }
            this.m_Term = null;
        }
    },
    
    _term_MouseDown$1: function Coveo_CES_Web_Search_Scripts_Controls_HighlightedQueryScript$_term_MouseDown$1() {
        this._highlightNextOccurence$1();
        window.event.returnValue = false;
    },
    
    _term_MouseWheel$1: function Coveo_CES_Web_Search_Scripts_Controls_HighlightedQueryScript$_term_MouseWheel$1() {
        if (this._getMouseWheelDelta$1() < 0) {
            this._highlightNextOccurence$1();
        }
        else {
            this._highlightPreviousOccurence$1();
        }
        window.event.cancelBubble = true;
        window.event.returnValue = false;
    },
    
    _getMouseWheelDelta$1: function Coveo_CES_Web_Search_Scripts_Controls_HighlightedQueryScript$_getMouseWheelDelta$1() {
        /// <summary>
        /// Get the mouse wheel delta for the current event.
        /// </summary>
        /// <returns type="Number" integer="true"></returns>
        var wheelDelta = 0;
        if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isFirefox()) {
            wheelDelta = (eval('event.detail')) * -1;
        }
        else {
            wheelDelta = eval('window.event.wheelDelta');
        }
        return wheelDelta;
    },
    
    _highlightNextOccurence$1: function Coveo_CES_Web_Search_Scripts_Controls_HighlightedQueryScript$_highlightNextOccurence$1() {
        /// <summary>
        /// Highlights the next occurrence of a term.
        /// </summary>
        var frame = document.getElementsByName(this.m_FrameName)[0];
        if (frame != null) {
            frame.HighlightNextOccurence(this.m_Index);
        }
    },
    
    _highlightPreviousOccurence$1: function Coveo_CES_Web_Search_Scripts_Controls_HighlightedQueryScript$_highlightPreviousOccurence$1() {
        /// <summary>
        /// Highlights the previous occurrence of a term.
        /// </summary>
        var frame = document.getElementsByName(this.m_FrameName)[0];
        if (frame != null) {
            frame.HighlightPreviousOccurence(this.m_Index);
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.PlayerScript

Coveo.CES.Web.Search.Scripts.Controls.PlayerScript = function Coveo_CES_Web_Search_Scripts_Controls_PlayerScript() {
    /// <summary>
    /// Client side code for the Player class.
    /// </summary>
    Coveo.CES.Web.Search.Scripts.Controls.PlayerScript.initializeBase(this);
}
Coveo.CES.Web.Search.Scripts.Controls.PlayerScript.prototype = {
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_PlayerScript$initialize() {
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.ResultPlayerScript

Coveo.CES.Web.Search.Scripts.Controls.ResultPlayerScript = function Coveo_CES_Web_Search_Scripts_Controls_ResultPlayerScript() {
    /// <summary>
    /// Client side code for the Player class.
    /// </summary>
    /// <field name="_m_LastPositions$1" type="Array">
    /// </field>
    /// <field name="_m_LastTerm$1" type="Number" integer="true">
    /// </field>
    /// <field name="_m_LastOccurence$1" type="Number" integer="true">
    /// </field>
    /// <field name="_m_LastCurrentWord$1" type="Object" domElement="true">
    /// </field>
    /// <field name="_m_Positions$1" type="Array">
    /// </field>
    /// <field name="_player$1" type="Coveo.CES.Web.Search.Scripts.Controls.IMediaPlayer">
    /// </field>
    /// <field name="_m_StartCount$1" type="Number" integer="true">
    /// </field>
    /// <field name="_m_SynchronizeTimerId$1" type="Number" integer="true">
    /// </field>
    /// <field name="_m_PlayClickEventHandler$1" type="ElementEventHandler">
    /// </field>
    /// <field name="_m_PauseClickEventHandler$1" type="ElementEventHandler">
    /// </field>
    /// <field name="_m_TimeLineClickEventHandler$1" type="ElementEventHandler">
    /// </field>
    /// <field name="_m_TranscriptLinkClickEventHandler$1" type="ElementEventHandler">
    /// </field>
    /// <field name="_m_UtterancesLinkClickEventHandler$1" type="ElementEventHandler">
    /// </field>
    /// <field name="m_UtteranceUri" type="String">
    /// The uri of the image to use for utterances.
    /// </field>
    /// <field name="m_UtteranceSelectedUri" type="String">
    /// The uri of the image to use for selected utterances.
    /// </field>
    /// <field name="m_Length" type="Number" integer="true">
    /// The length of the stream to play.
    /// </field>
    /// <field name="m_HeadStart" type="Number" integer="true">
    /// The initial head start for this media.
    /// </field>
    /// <field name="m_XAPUrl" type="String">
    /// The url of the media player xap file.
    /// </field>
    /// <field name="m_Video" type="Boolean">
    /// Whether there is video in this media or only audio.
    /// </field>
    /// <field name="m_Player" type="Object" domElement="true">
    /// The DOM element for the player.
    /// </field>
    /// <field name="m_TimeLine" type="Object" domElement="true">
    /// The DOM element for the timeline.
    /// </field>
    /// <field name="m_Play" type="Object" domElement="true">
    /// The DOM element for the play button.
    /// </field>
    /// <field name="m_Pause" type="Object" domElement="true">
    /// The DOM element for the pause button.
    /// </field>
    /// <field name="m_Slider" type="Object" domElement="true">
    /// The DOM element for the slider.
    /// </field>
    /// <field name="m_Filler" type="Object" domElement="true">
    /// The DOM element for the filler.
    /// </field>
    /// <field name="m_Status" type="Object" domElement="true">
    /// The DOM element for the status.
    /// </field>
    /// <field name="m_UtterancesLink" type="Object" domElement="true">
    /// The DOM element for the utterances link.
    /// </field>
    /// <field name="m_TranscriptLink" type="Object" domElement="true">
    /// The DOM element for the transcript link.
    /// </field>
    /// <field name="m_Utterances" type="Object" domElement="true">
    /// The DOM element for the utterances panel.
    /// </field>
    /// <field name="m_Transcript" type="Object" domElement="true">
    /// The DOM element for the transcript panel.
    /// </field>
    this._m_SynchronizeTimerId$1 = -1;
    Coveo.CES.Web.Search.Scripts.Controls.ResultPlayerScript.initializeBase(this);
}
Coveo.CES.Web.Search.Scripts.Controls.ResultPlayerScript.prototype = {
    _m_LastPositions$1: null,
    _m_LastTerm$1: 0,
    _m_LastOccurence$1: 0,
    _m_LastCurrentWord$1: null,
    _m_Positions$1: null,
    _player$1: null,
    _m_StartCount$1: 0,
    _m_PlayClickEventHandler$1: null,
    _m_PauseClickEventHandler$1: null,
    _m_TimeLineClickEventHandler$1: null,
    _m_TranscriptLinkClickEventHandler$1: null,
    _m_UtterancesLinkClickEventHandler$1: null,
    m_UtteranceUri: null,
    m_UtteranceSelectedUri: null,
    m_Length: 0,
    m_HeadStart: 0,
    m_XAPUrl: null,
    m_Video: false,
    m_Player: null,
    m_TimeLine: null,
    m_Play: null,
    m_Pause: null,
    m_Slider: null,
    m_Filler: null,
    m_Status: null,
    m_UtterancesLink: null,
    m_TranscriptLink: null,
    m_Utterances: null,
    m_Transcript: null,
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_ResultPlayerScript$initialize() {
        this._m_LastPositions$1 = [];
        this._m_LastTerm$1 = 0;
        this._m_LastOccurence$1 = 0;
        this._m_LastCurrentWord$1 = null;
        this._m_StartCount$1 = 0;
        this._m_PlayClickEventHandler$1 = ss.Delegate.create(this, this._play_OnClick$1);
        this._m_PauseClickEventHandler$1 = ss.Delegate.create(this, this._pause_OnClick$1);
        this._m_TimeLineClickEventHandler$1 = ss.Delegate.create(this, this._timeLine_OnClick$1);
        this._m_TranscriptLinkClickEventHandler$1 = ss.Delegate.create(this, this._transcriptLink_OnClick$1);
        this._m_UtterancesLinkClickEventHandler$1 = ss.Delegate.create(this, this._utterancesLink_OnClick$1);
        this.m_Play.attachEvent('onclick', this._m_PlayClickEventHandler$1);
        this.m_Pause.attachEvent('onclick', this._m_PauseClickEventHandler$1);
        this.m_TimeLine.attachEvent('onclick', this._m_TimeLineClickEventHandler$1);
        if (!ss.isNullOrUndefined(this.m_TranscriptLink) && !ss.isNullOrUndefined(this.m_UtterancesLink)) {
            this.m_TranscriptLink.attachEvent('onclick', this._m_TranscriptLinkClickEventHandler$1);
            this.m_UtterancesLink.attachEvent('onclick', this._m_UtterancesLinkClickEventHandler$1);
        }
        if (Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE()) {
            this._player$1 = new Coveo.CES.Web.Search.Scripts.Controls.WindowsMediaPlayer();
        }
        else {
            this._player$1 = new Coveo.CES.Web.Search.Scripts.Controls.SilverlightMediaPlayer(this.m_XAPUrl);
        }
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_ResultPlayerScript$tearDown() {
        if (this._player$1.isReady()) {
            this._player$1.stop();
        }
        if (this._m_SynchronizeTimerId$1 !== -1) {
            window.clearTimeout(this._m_SynchronizeTimerId$1);
        }
        if (!ss.isNullOrUndefined(this.m_Play)) {
            this.m_Play.detachEvent('onclick', this._m_PlayClickEventHandler$1);
            this._m_PlayClickEventHandler$1 = null;
        }
        if (!ss.isNullOrUndefined(this.m_Pause)) {
            this.m_Pause.detachEvent('onclick', this._m_PauseClickEventHandler$1);
            this._m_PauseClickEventHandler$1 = null;
        }
        if (!ss.isNullOrUndefined(this.m_TimeLine)) {
            this.m_TimeLine.detachEvent('onclick', this._m_TimeLineClickEventHandler$1);
            this._m_TimeLineClickEventHandler$1 = null;
        }
        if (!ss.isNullOrUndefined(this.m_TranscriptLink)) {
            this.m_TranscriptLink.detachEvent('onclick', this._m_TranscriptLinkClickEventHandler$1);
            this._m_TranscriptLinkClickEventHandler$1 = null;
        }
        if (!ss.isNullOrUndefined(this.m_UtterancesLink)) {
            this.m_UtterancesLink.detachEvent('onclick', this._m_UtterancesLinkClickEventHandler$1);
            this._m_UtterancesLinkClickEventHandler$1 = null;
        }
        this.m_Filler = null;
        this._m_LastCurrentWord$1 = null;
        this._m_LastPositions$1 = null;
        this.m_Pause = null;
        this.m_Play = null;
        this.m_Player = null;
        this._m_Positions$1 = null;
        this.m_Slider = null;
        this.m_Status = null;
        this.m_TimeLine = null;
        this.m_Transcript = null;
        this.m_TranscriptLink = null;
        this.m_Utterances = null;
        this.m_UtterancesLink = null;
        this._player$1.tearDown();
        this._player$1 = null;
    },
    
    _utterancesLink_OnClick$1: function Coveo_CES_Web_Search_Scripts_Controls_ResultPlayerScript$_utterancesLink_OnClick$1() {
        this.showUtterances();
    },
    
    _transcriptLink_OnClick$1: function Coveo_CES_Web_Search_Scripts_Controls_ResultPlayerScript$_transcriptLink_OnClick$1() {
        this.showTranscript();
    },
    
    _timeLine_OnClick$1: function Coveo_CES_Web_Search_Scripts_Controls_ResultPlayerScript$_timeLine_OnClick$1() {
        var tlpos = Coveo.CNL.Web.Scripts.DOMUtilities.getElementPosition(this.m_TimeLine);
        var tlsize = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this.m_TimeLine);
        var x = parseInt(window.event.clientX.toString());
        var percent = (x - tlpos.left) / tlsize.width;
        this._jump$1(this.m_Length * percent);
    },
    
    _play_OnClick$1: function Coveo_CES_Web_Search_Scripts_Controls_ResultPlayerScript$_play_OnClick$1() {
        this._player$1.play();
        this._synchronize$1(false);
    },
    
    _pause_OnClick$1: function Coveo_CES_Web_Search_Scripts_Controls_ResultPlayerScript$_pause_OnClick$1() {
        this._player$1.pause();
        this._synchronize$1(false);
    },
    
    showUtterances: function Coveo_CES_Web_Search_Scripts_Controls_ResultPlayerScript$showUtterances() {
        /// <summary>
        /// Shows the utterances tab.
        /// </summary>
        this.m_UtterancesLink.style.fontWeight = 'bold';
        this.m_UtterancesLink.style.backgroundColor = 'silver';
        this.m_TranscriptLink.style.fontWeight = 'normal';
        this.m_TranscriptLink.style.backgroundColor = 'whitesmoke';
        this.m_Utterances.style.display = 'block';
        this.m_Transcript.style.display = 'none';
    },
    
    showTranscript: function Coveo_CES_Web_Search_Scripts_Controls_ResultPlayerScript$showTranscript() {
        /// <summary>
        /// Shows the transcript tab.
        /// </summary>
        this.m_UtterancesLink.style.fontWeight = 'normal';
        this.m_UtterancesLink.style.backgroundColor = 'whitesmoke';
        this.m_TranscriptLink.style.fontWeight = 'bold';
        this.m_TranscriptLink.style.backgroundColor = 'silver';
        this.m_Utterances.style.display = 'none';
        this.m_Transcript.style.display = 'block';
        this._synchronize$1(false);
    },
    
    createMediaPlayer: function Coveo_CES_Web_Search_Scripts_Controls_ResultPlayerScript$createMediaPlayer(p_Uri, p_Start) {
        /// <summary>
        /// Creates the media player within the page.
        /// </summary>
        /// <param name="p_Uri" type="String">
        /// The uri to load within the media player.
        /// </param>
        /// <param name="p_Start" type="Number" integer="true">
        /// The position of the first utterance.
        /// </param>
        var height = (this.m_Video) ? this.m_Player.style.height : '0px';
        var width = (this.m_Video) ? this.m_Player.style.width : '0px';
        if (!Coveo.CNL.Web.Scripts.BrowserHelper.get_isFirefox()) {
            this.m_Player.innerHTML = this._player$1.createPlayerString(p_Uri, height, width);
        }
        else {
            this.m_Player.appendChild(this._player$1.createPlayerElement(p_Uri, height, width));
        }
        this.startPlayer(p_Start);
    },
    
    startPlayer: function Coveo_CES_Web_Search_Scripts_Controls_ResultPlayerScript$startPlayer(p_Start) {
        /// <summary>
        /// Try to start the player until it's ready.
        /// </summary>
        /// <param name="p_Start" type="Number" integer="true">
        /// The head start to give to the player.
        /// </param>
        if (this._player$1.isReady()) {
            this._jump$1(this._getHeadStart$1(p_Start));
            this._synchronize$1(true);
        }
        else {
            if (this._m_StartCount$1 < 50) {
                this._m_StartCount$1++;
                this._m_SynchronizeTimerId$1 = window.setTimeout(ss.Delegate.create(this, function() {
                    this.startPlayer(p_Start);
                }), 100);
            }
            else {
                alert('Unable to start the media player.');
            }
        }
    },
    
    addUtterance: function Coveo_CES_Web_Search_Scripts_Controls_ResultPlayerScript$addUtterance(p_Start, p_Percent, p_Html) {
        /// <summary>
        /// Adds an utterance to the various displays.
        /// </summary>
        /// <param name="p_Start" type="Number" integer="true">
        /// The start time of the utterance.
        /// </param>
        /// <param name="p_Percent" type="Number" integer="true">
        /// The position expressed as a percentage.
        /// </param>
        /// <param name="p_Html" type="String">
        /// The html for displaying info about the utterance.
        /// </param>
        var utelem = document.createElement('div');
        utelem.className = 'CesUnselectedMenuItem';
        utelem.style.cursor = 'pointer';
        utelem.innerHTML = p_Html;
        this.m_Utterances.appendChild(utelem);
        var tlpos = Coveo.CNL.Web.Scripts.DOMUtilities.getElementPosition(this.m_TimeLine);
        var tlsize = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this.m_TimeLine);
        var tlelem = document.createElement('img');
        tlelem.setAttribute('src', this.m_UtteranceUri);
        tlelem.style.position = 'absolute';
        tlelem.style.cursor = 'pointer';
        tlelem.style.zIndex = 800;
        this.m_TimeLine.appendChild(tlelem);
        Coveo.CNL.Web.Scripts.DOMUtilities.setElementPosition(tlelem, new Coveo.CNL.Web.Scripts.ElementPosition(tlpos.left + tlsize.width * p_Percent - 6, tlpos.top + 3));
        var ttelem = document.createElement('div');
        ttelem.style.position = 'absolute';
        ttelem.style.width = '500px';
        ttelem.style.border = '1px solid black';
        ttelem.style.backgroundColor = 'whitesmoke';
        ttelem.style.padding = '5px';
        ttelem.style.zIndex = 999;
        ttelem.innerHTML = p_Html;
        this.m_TimeLine.appendChild(ttelem);
        Coveo.CNL.Web.Scripts.DOMUtilities.positionElement(ttelem, tlelem, Coveo.CNL.Web.Scripts.PositionEnum.aboveLeft);
        ttelem.style.visibility = 'hidden';
        utelem.attachEvent('onmouseover', ss.Delegate.create(this, function() {
            utelem.className = 'CesSelectedMenuItem';
            tlelem.setAttribute('src', this.m_UtteranceSelectedUri);
        }));
        utelem.attachEvent('onmouseout', ss.Delegate.create(this, function() {
            utelem.className = 'CesUnselectedMenuItem';
            tlelem.setAttribute('src', this.m_UtteranceUri);
        }));
        utelem.attachEvent('onclick', ss.Delegate.create(this, function() {
            this._jump$1(this._getHeadStart$1(p_Start));
        }));
        tlelem.attachEvent('onmouseover', ss.Delegate.create(this, function() {
            utelem.style.backgroundColor = 'lightgrey';
            tlelem.setAttribute('src', this.m_UtteranceSelectedUri);
            ttelem.style.visibility = 'visible';
        }));
        tlelem.attachEvent('onmouseout', ss.Delegate.create(this, function() {
            utelem.style.backgroundColor = '';
            tlelem.setAttribute('src', this.m_UtteranceUri);
            ttelem.style.visibility = 'hidden';
        }));
    },
    
    _highlightNextOccurence$1: function Coveo_CES_Web_Search_Scripts_Controls_ResultPlayerScript$_highlightNextOccurence$1(p_Term) {
        /// <summary>
        /// Highlights the next occurence of a term.
        /// </summary>
        /// <param name="p_Term" type="Number" integer="true">
        /// The index of the term to highlight.
        /// </param>
        this.showTranscript();
        this._removeLastHighlight$1();
        var last = this._m_LastPositions$1[p_Term];
        if (ss.isUndefined(last)) {
            last = 0;
        }
        var current = last + 1;
        if (this._getTermPart$1(p_Term, current, 1) == null) {
            current = 1;
        }
        this._highlightTerm$1(p_Term, current);
        this._m_LastPositions$1[p_Term] = current;
    },
    
    _highlightPreviousOccurence$1: function Coveo_CES_Web_Search_Scripts_Controls_ResultPlayerScript$_highlightPreviousOccurence$1(p_Term) {
        /// <summary>
        /// Highlights the previous occurence of a term.
        /// </summary>
        /// <param name="p_Term" type="Number" integer="true">
        /// The index of the term to highlight.
        /// </param>
        this.showTranscript();
        this._removeLastHighlight$1();
        var last = this._m_LastPositions$1[p_Term];
        if (ss.isUndefined(last)) {
            last = 1;
        }
        var current = last - 1;
        if (this._getTermPart$1(p_Term, current, 1) == null) {
            current = 1;
            while (this._getTermPart$1(p_Term, current, 1) != null) {
                ++current;
            }
            --current;
        }
        this._highlightTerm$1(p_Term, current);
        this._m_LastPositions$1[p_Term] = current;
    },
    
    _jump$1: function Coveo_CES_Web_Search_Scripts_Controls_ResultPlayerScript$_jump$1(p_Position) {
        /// <summary>
        /// Jumps to a given position within the clip.
        /// </summary>
        /// <param name="p_Position" type="Number">
        /// The position to which to jump.
        /// </param>
        this._player$1.setPosition(p_Position);
        this._player$1.play();
    },
    
    _synchronize$1: function Coveo_CES_Web_Search_Scripts_Controls_ResultPlayerScript$_synchronize$1(p_Auto) {
        /// <summary>
        /// Synchronizes the currently highlighted word with the position of the player.
        /// </summary>
        /// <param name="p_Auto" type="Boolean">
        /// Whether the call comes from the timer.
        /// </param>
        if (!this._player$1.isReady()) {
            return;
        }
        var found = false;
        var up = this.m_Player.parentNode;
        while (up != null) {
            if (up.tagName === 'BODY') {
                found = true;
                break;
            }
            up = up.parentNode;
        }
        if (!found) {
            this.tearDown();
            return;
        }
        switch (this._player$1.getState()) {
            case Coveo.CES.Web.Search.Scripts.Controls.StateEnum.playing:
                this.m_Play.style.display = 'none';
                this.m_Pause.style.display = 'inline';
                this.m_Status.innerHTML = '';
                break;
            case Coveo.CES.Web.Search.Scripts.Controls.StateEnum.buffering:
                this.m_Play.style.display = 'none';
                this.m_Pause.style.display = 'inline';
                this.m_Status.innerHTML = this._player$1.getStatus();
                break;
            default:
                this.m_Play.style.display = 'inline';
                this.m_Pause.style.display = 'none';
                this.m_Status.innerHTML = '';
                break;
        }
        var slsize = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this.m_Slider);
        var position = this._player$1.getPosition();
        var spos = this._getTimeLinePosition$1(position / this.m_Length);
        Coveo.CNL.Web.Scripts.DOMUtilities.setElementPosition(this.m_Slider, new Coveo.CNL.Web.Scripts.ElementPosition(spos.left - slsize.width / 2, spos.top - 8));
        var tlpos = Coveo.CNL.Web.Scripts.DOMUtilities.getElementPosition(this.m_TimeLine);
        var tlsize = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this.m_TimeLine);
        Coveo.CNL.Web.Scripts.DOMUtilities.setElementPosition(this.m_Filler, new Coveo.CNL.Web.Scripts.ElementPosition(tlpos.left - 2, tlpos.top + 3));
        this.m_Filler.style.width = (spos.left - tlpos.left + 2).toString() + 'px';
        var delay;
        if (this.m_Transcript != null) {
            if (this._m_LastCurrentWord$1 != null) {
                this._m_LastCurrentWord$1.style.color = this._m_LastCurrentWord$1.getAttribute('BackupColor').toString();
                this._m_LastCurrentWord$1.style.backgroundColor = this._m_LastCurrentWord$1.getAttribute('BackupBackground').toString();
            }
            var beg = 0;
            var end = this._m_Positions$1.length;
            var index = 0;
            while (beg < end) {
                index = beg + Math.floor((end - beg) / 2);
                var value = this._m_Positions$1[index];
                if (value < position) {
                    beg = index + 1;
                }
                else {
                    end = index;
                }
            }
            index = Math.max(beg - 1, 0);
            this._m_LastCurrentWord$1 = document.getElementById(this.get_ownerId() + '_' + this._m_Positions$1[index]);
            if (this._m_LastCurrentWord$1 != null) {
                this._m_LastCurrentWord$1.setAttribute('BackupColor', this._m_LastCurrentWord$1.style.color);
                this._m_LastCurrentWord$1.setAttribute('BackupBackground', this._m_LastCurrentWord$1.style.backgroundColor);
                this._m_LastCurrentWord$1.style.color = 'white';
                this._m_LastCurrentWord$1.style.backgroundColor = 'maroon';
                if (!p_Auto) {
                    this._m_LastCurrentWord$1.scrollIntoView();
                }
            }
            if ((this._m_Positions$1[index]) > position) {
                delay = ((this._m_Positions$1[index]) - position) * 1000;
            }
            else if (index + 1 < this._m_Positions$1.length) {
                delay = ((this._m_Positions$1[index + 1]) - position) * 1000;
            }
            else {
                delay = 1000;
            }
            if (delay > 500) {
                delay = 500;
            }
        }
        else {
            delay = 500;
        }
        if (p_Auto) {
            this._m_SynchronizeTimerId$1 = window.setTimeout(ss.Delegate.create(this, function() {
                this._synchronize$1(true);
            }), parseInt(delay));
        }
    },
    
    _getHeadStart$1: function Coveo_CES_Web_Search_Scripts_Controls_ResultPlayerScript$_getHeadStart$1(p_Start) {
        /// <summary>
        /// Retrieves the position at which to jump for an utterance, including a head start.
        /// </summary>
        /// <param name="p_Start" type="Number" integer="true">
        /// The position at which the utterance starts.
        /// </param>
        /// <returns type="Number" integer="true"></returns>
        var pos = p_Start - this.m_HeadStart;
        if (pos < 0) {
            pos = 0;
        }
        return pos;
    },
    
    _getTimeLinePosition$1: function Coveo_CES_Web_Search_Scripts_Controls_ResultPlayerScript$_getTimeLinePosition$1(p_Percent) {
        /// <summary>
        /// Retrieves the position of a point on the timeline.
        /// </summary>
        /// <param name="p_Percent" type="Number">
        /// The percentage of the point on the timeline.
        /// </param>
        /// <returns type="Coveo.CNL.Web.Scripts.ElementPosition"></returns>
        var tlpos = Coveo.CNL.Web.Scripts.DOMUtilities.getElementPosition(this.m_TimeLine);
        var tlsize = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this.m_TimeLine);
        tlpos.left += (tlsize.width * p_Percent - 2);
        return tlpos;
    },
    
    _getTermPart$1: function Coveo_CES_Web_Search_Scripts_Controls_ResultPlayerScript$_getTermPart$1(p_Term, p_Occurence, p_Part) {
        /// <summary>
        /// Retrieves a specific highlight part.
        /// </summary>
        /// <param name="p_Term" type="Number" integer="true">
        /// The index of the term.
        /// </param>
        /// <param name="p_Occurence" type="Number" integer="true">
        /// The index of the occurence of the term.
        /// </param>
        /// <param name="p_Part" type="Number" integer="true">
        /// The index of the part of the term.
        /// </param>
        /// <returns type="Object" domElement="true"></returns>
        return document.getElementById('CoveoHighlight:' + p_Term + '.' + p_Occurence + '.' + p_Part);
    },
    
    _highlightTerm$1: function Coveo_CES_Web_Search_Scripts_Controls_ResultPlayerScript$_highlightTerm$1(p_Term, p_Occurence) {
        /// <summary>
        /// Highlights a term and scrolls it into view.
        /// </summary>
        /// <param name="p_Term" type="Number" integer="true">
        /// The index of the term to highlight.
        /// </param>
        /// <param name="p_Occurence" type="Number" integer="true">
        /// The index of the term occurence to highlight.
        /// </param>
        var part = 1;
        var elem = this._getTermPart$1(p_Term, p_Occurence, part);
        if (elem != null) {
            var time = parseFloat(elem.parentNode.id.substring(this.get_ownerId().length + 1, elem.parentNode.id.length));
            this._jump$1(time);
            elem.scrollIntoView();
            while (elem != null) {
                elem.setAttribute('BackupColor', elem.style.color);
                elem.setAttribute('BackupBackground', elem.style.backgroundColor);
                elem.style.color = 'white';
                elem.style.backgroundColor = 'green';
                elem = this._getTermPart$1(p_Term, p_Occurence, ++part);
            }
            this._m_LastTerm$1 = p_Term;
            this._m_LastOccurence$1 = p_Occurence;
        }
    },
    
    _removeLastHighlight$1: function Coveo_CES_Web_Search_Scripts_Controls_ResultPlayerScript$_removeLastHighlight$1() {
        /// <summary>
        /// Unhighlights the last highlighted term.
        /// </summary>
        if (this._m_LastTerm$1 !== 0) {
            var part = 1;
            var elem = this._getTermPart$1(this._m_LastTerm$1, this._m_LastOccurence$1, part);
            while (elem != null) {
                elem.style.color = elem.getAttribute('BackupColor').toString();
                elem.style.backgroundColor = elem.getAttribute('BackupBackground').toString();
                elem = this._getTermPart$1(this._m_LastTerm$1, this._m_LastOccurence$1, ++part);
            }
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.ViewAsHtmlPanelScript

Coveo.CES.Web.Search.Scripts.Controls.ViewAsHtmlPanelScript = function Coveo_CES_Web_Search_Scripts_Controls_ViewAsHtmlPanelScript() {
    /// <summary>
    /// Client side code for the ViewAsHtmlPanel control.
    /// </summary>
    /// <field name="_m_BackupDocumentMargin$1" type="String">
    /// </field>
    /// <field name="_m_BackupDocumentPadding$1" type="String">
    /// </field>
    /// <field name="_m_BackupDocumentHeight$1" type="String">
    /// </field>
    /// <field name="_m_BackupDocumentOverflow$1" type="String">
    /// </field>
    /// <field name="_m_BackupBodyMargin$1" type="String">
    /// </field>
    /// <field name="_m_BackupBodyPadding$1" type="String">
    /// </field>
    /// <field name="_m_BackupBodyHeight$1" type="String">
    /// </field>
    /// <field name="_m_BackupBodyOverflow$1" type="String">
    /// </field>
    Coveo.CES.Web.Search.Scripts.Controls.ViewAsHtmlPanelScript.initializeBase(this);
}
Coveo.CES.Web.Search.Scripts.Controls.ViewAsHtmlPanelScript.prototype = {
    _m_BackupDocumentMargin$1: null,
    _m_BackupDocumentPadding$1: null,
    _m_BackupDocumentHeight$1: null,
    _m_BackupDocumentOverflow$1: null,
    _m_BackupBodyMargin$1: null,
    _m_BackupBodyPadding$1: null,
    _m_BackupBodyHeight$1: null,
    _m_BackupBodyOverflow$1: null,
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_ViewAsHtmlPanelScript$initialize() {
        this._m_BackupDocumentMargin$1 = document.documentElement.style.margin;
        document.documentElement.style.margin = '0px';
        this._m_BackupDocumentPadding$1 = document.documentElement.style.padding;
        document.documentElement.style.padding = '0px';
        this._m_BackupDocumentHeight$1 = document.documentElement.style.height;
        document.documentElement.style.height = '100%';
        this._m_BackupDocumentOverflow$1 = document.documentElement.style.overflow;
        document.documentElement.style.overflow = 'hidden';
        this._m_BackupBodyMargin$1 = document.body.style.margin;
        document.body.style.margin = '0px';
        this._m_BackupBodyPadding$1 = document.body.style.padding;
        document.body.style.padding = '0px';
        this._m_BackupBodyHeight$1 = document.body.style.height;
        document.body.style.height = '100%';
        this._m_BackupBodyOverflow$1 = document.body.style.overflow;
        document.body.style.overflow = 'hidden';
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_ViewAsHtmlPanelScript$tearDown() {
        document.documentElement.style.margin = this._m_BackupDocumentMargin$1;
        document.documentElement.style.padding = this._m_BackupDocumentPadding$1;
        document.documentElement.style.height = this._m_BackupDocumentHeight$1;
        document.documentElement.style.overflow = this._m_BackupDocumentOverflow$1;
        document.body.style.margin = this._m_BackupBodyMargin$1;
        document.body.style.padding = this._m_BackupBodyPadding$1;
        document.body.style.height = this._m_BackupBodyHeight$1;
        document.body.style.overflow = this._m_BackupBodyOverflow$1;
    }
}


Type.registerNamespace('Coveo.CES.Web.Search.Scripts.Controls.SharePoint');

////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu

Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu = function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu() {
    /// <summary>
    /// This class represents the associated Javascript object for the control
    /// used to render the SharePoint contextual menus.
    /// </summary>
    /// <field name="_sP_MENU_COLOR$1" type="String" static="true">
    /// </field>
    /// <field name="_m_OnMouseOver$1" type="ElementEventHandler">
    /// </field>
    /// <field name="_m_OnMouseOut$1" type="ElementEventHandler">
    /// </field>
    /// <field name="_m_OnDwellEvent$1" type="Coveo.CNL.Web.Scripts.OnDwellEvent">
    /// </field>
    /// <field name="_m_Request$1" type="jQueryXmlHttpRequest">
    /// </field>
    /// <field name="_m_IsBusy$1" type="Boolean">
    /// </field>
    /// <field name="_m_QueryDone$1" type="Boolean">
    /// </field>
    /// <field name="_m_MouseIsOver$1" type="Boolean">
    /// </field>
    /// <field name="_m_ContextIsInvalid$1" type="Boolean">
    /// </field>
    /// <field name="m_Target" type="Object" domElement="true">
    /// </field>
    /// <field name="m_SPTable" type="Object" domElement="true">
    /// </field>
    /// <field name="m_SPTableImage" type="Object" domElement="true">
    /// </field>
    /// <field name="m_SiteUri" type="String">
    /// </field>
    /// <field name="m_ListId" type="String">
    /// </field>
    /// <field name="m_ListItemId" type="String">
    /// </field>
    /// <field name="m_ShowDelay" type="Number" integer="true">
    /// </field>
    /// <field name="m_BorderColor" type="String">
    /// </field>
    /// <field name="m_FileName" type="String">
    /// </field>
    /// <field name="m_SPVersion" type="String">
    /// </field>
    Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.initializeBase(this);
}
Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.prototype = {
    _m_OnMouseOver$1: null,
    _m_OnMouseOut$1: null,
    _m_OnDwellEvent$1: null,
    _m_Request$1: null,
    _m_IsBusy$1: false,
    _m_QueryDone$1: false,
    _m_MouseIsOver$1: false,
    _m_ContextIsInvalid$1: false,
    m_Target: null,
    m_SPTable: null,
    m_SPTableImage: null,
    m_SiteUri: null,
    m_ListId: null,
    m_ListItemId: null,
    m_ShowDelay: 0,
    m_BorderColor: null,
    m_FileName: null,
    m_SPVersion: null,
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$initialize() {
        Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.callBaseMethod(this, 'initialize');
        Coveo.CNL.Web.Scripts.CNLAssert.check(this.m_ShowDelay > 0);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_SPTable);
        this._m_OnDwellEvent$1 = new Coveo.CNL.Web.Scripts.OnDwellEvent(this.m_SPTable, this.m_ShowDelay, ss.Delegate.create(this, this._spTable_OnDwell$1));
        this._m_OnMouseOver$1 = ss.Delegate.create(this, this._onMouseOver$1);
        this._m_OnMouseOut$1 = ss.Delegate.create(this, this._onMouseOut$1);
        this.m_Target.attachEvent('onmouseover', this._m_OnMouseOver$1);
        this.m_Target.attachEvent('onmouseout', this._m_OnMouseOut$1);
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$tearDown() {
        if (this._m_Request$1 != null) {
            this._m_Request$1.abort();
            this._m_Request$1 = null;
        }
        this._m_OnDwellEvent$1.dispose();
        this._m_OnDwellEvent$1 = null;
        this.m_Target.detachEvent('onmouseover', this._m_OnMouseOver$1);
        this.m_Target.detachEvent('onmouseout', this._m_OnMouseOut$1);
        Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.callBaseMethod(this, 'tearDown');
    },
    
    _spTable_OnDwell$1: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$_spTable_OnDwell$1() {
        if (!this._m_QueryDone$1) {
            this._doBeforeMouseOver$1();
        }
    },
    
    _onMouseOver$1: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$_onMouseOver$1() {
        this._m_MouseIsOver$1 = true;
        if (this._m_QueryDone$1) {
            this._handleSPOnItem$1();
        }
    },
    
    _onMouseOut$1: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$_onMouseOut$1() {
        this._m_MouseIsOver$1 = !this._isMouseReallyOut$1(window.event, this.m_Target);
        if (!this._m_MouseIsOver$1) {
            this._resetBorder$1();
        }
    },
    
    _resetBorder$1: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$_resetBorder$1() {
        /// <summary>
        /// Resets the table border after the menu has been displayed. This method
        /// is called after the mouse has exited the control area. However, when the
        /// menu is displayed, a timeout mecanism is started to automatically hide
        /// the menu since the mouse is already outside the control boundaries.
        /// </summary>
        if (this.m_SPTableImage.style.visibility === 'hidden') {
            var resetTimeOut = document.body.getAttribute(this.m_Target.id + 'ResetBorderTimeOut');
            if (resetTimeOut != null) {
                window.clearTimeout(resetTimeOut);
            }
            document.body.removeAttribute(this.m_Target.id + 'ResetBorderTimeOut');
            Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(this.m_BorderColor);
            this.m_SPTable.style.borderLeftColor = this.m_BorderColor;
            this.m_SPTable.style.borderTopColor = this.m_BorderColor;
            this.m_SPTable.style.borderRightColor = this.m_BorderColor;
            this.m_SPTable.style.borderBottomColor = this.m_BorderColor;
        }
        else {
            document.body.setAttribute(this.m_Target.id + 'ResetBorderTimeOut', window.setTimeout(ss.Delegate.create(this, this._resetBorder$1), 500));
        }
    },
    
    _isMouseReallyOut$1: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$_isMouseReallyOut$1(p_Event, p_Target) {
        /// <summary>
        /// This function determines if the mouse is really outside the control
        /// boundaries. The <b>mouseout</b> event is triggered when the cursor
        /// pass from the current control to a child control and vice-versa.
        /// </summary>
        /// <param name="p_Event" type="ElementEvent">
        /// The triggered event.
        /// </param>
        /// <param name="p_Target" type="Object" domElement="true">
        /// The element from which the event was triggered.
        /// </param>
        /// <returns type="Boolean"></returns>
        var relatedTarget = p_Event.toElement;
        while (relatedTarget != null && relatedTarget !== p_Target) {
            relatedTarget = relatedTarget.parentNode;
        }
        return relatedTarget !== p_Target;
    },
    
    _doBeforeMouseOver$1: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$_doBeforeMouseOver$1() {
        /// <summary>
        /// Prefetch contextual menu information from the installed service.
        /// </summary>
        if (this._m_IsBusy$1) {
            return;
        }
        this._m_IsBusy$1 = true;
        if (this._m_Request$1 != null) {
            this._m_Request$1.abort();
            this._m_Request$1 = null;
        }
        var uri = String.format(this.m_SiteUri + '/_layouts/CES/AttributesSelector.aspx?ListItemId={0}&ListId={1}', this.m_ListItemId, this.m_ListId);
        var options = {};
        options.dataType = 'jsonp';
        options.success = ss.Delegate.create(this, this._onRequestComplete$1);
        this._m_Request$1 = $.ajax(uri, options);
        this._m_ContextIsInvalid$1 = true;
    },
    
    _onRequestComplete$1: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$_onRequestComplete$1(p_Data, p_TextStatus, p_Request) {
        /// <summary>
        /// Update the control with the contextual menu informations received from
        /// the installed service.
        /// </summary>
        /// <param name="p_Data" type="Object">
        /// </param>
        /// <param name="p_TextStatus" type="String">
        /// </param>
        /// <param name="p_Request" type="jQueryXmlHttpRequest">
        /// </param>
        Coveo.CNL.Web.Scripts.CNLAssert.check(p_Request === this._m_Request$1);
        this._m_Request$1 = null;
        this._m_QueryDone$1 = true;
        this._m_IsBusy$1 = false;
        var context = eval(this.m_SPTable.getAttribute('CTXName').toString());
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(context);
        var mergeWithContext = p_Data.MergeWithContext;
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(mergeWithContext);
        $.extend(context, mergeWithContext);
        var attributesForTable = p_Data.AttributesForTable;
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(attributesForTable);
        Coveo.CNL.Web.Scripts.CNLAssert.check(Object.getKeyCount(attributesForTable) !== 0);
        var $dict1 = attributesForTable;
        for (var $key2 in $dict1) {
            var entry = { key: $key2, value: $dict1[$key2] };
            this.m_SPTable.setAttribute(entry.key, entry.value);
        }
        this._m_ContextIsInvalid$1 = false;
        if (this._m_MouseIsOver$1) {
            this._handleSPOnItem$1();
            if (this.m_SPVersion === '2010' && (Coveo.CNL.Web.Scripts.BrowserHelper.get_isIE() || Coveo.CNL.Web.Scripts.BrowserHelper.get_isFirefox())) {
                eval('if (typeof(currentCtx) != \"undefined\") window[\"ctx\"+currentCtx.ctxId] = currentCtx;');
            }
        }
    },
    
    _handleSPOnItem$1: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$_handleSPOnItem$1() {
        /// <summary>
        /// Call the SharePoint Javascript method that renders the contextual menu.
        /// </summary>
        if (!this._m_ContextIsInvalid$1) {
            this.m_SPTable.style.borderLeftColor = Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu._sP_MENU_COLOR$1;
            this.m_SPTable.style.borderTopColor = Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu._sP_MENU_COLOR$1;
            this.m_SPTable.style.borderRightColor = Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu._sP_MENU_COLOR$1;
            this.m_SPTable.style.borderBottomColor = Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu._sP_MENU_COLOR$1;
            OnItem(this.m_SPTable);
        }
    }
}


Type.registerNamespace('Coveo.CES.Web.Search.Scripts');

////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.SharePointItemUtilities

Coveo.CES.Web.Search.Scripts.SharePointItemUtilities = function Coveo_CES_Web_Search_Scripts_SharePointItemUtilities() {
    /// <summary>
    /// Client side code for the SearchControl control.
    /// </summary>
}
Coveo.CES.Web.Search.Scripts.SharePointItemUtilities.viewDocument = function Coveo_CES_Web_Search_Scripts_SharePointItemUtilities$viewDocument(p_Uri, p_Window) {
    /// <summary>
    /// Opens a SharePoint document for viewing.
    /// </summary>
    /// <param name="p_Uri" type="String">
    /// The uri of the document to open.
    /// </param>
    /// <param name="p_Window" type="WindowInstance">
    /// The window that opens the document.
    /// </param>
    var res = false;
    var obj = Coveo.CES.Web.Search.Scripts.SharePointItemUtilities._getOpenDocuments();
    if (obj != null) {
        try {
            res = obj.viewDocument2(p_Window, p_Uri);
        }
        catch ($e1) {
            try {
                res = obj.viewDocument(p_Uri);
            }
            catch ($e2) {
                res = false;
            }
        }
    }
    if (obj == null || !res) {
        p_Window.navigate(p_Uri);
    }
}
Coveo.CES.Web.Search.Scripts.SharePointItemUtilities.editDocument = function Coveo_CES_Web_Search_Scripts_SharePointItemUtilities$editDocument(p_Uri, p_Window) {
    /// <summary>
    /// Opens a SharePoint document for editing.
    /// </summary>
    /// <param name="p_Uri" type="String">
    /// The uri of the document to open.
    /// </param>
    /// <param name="p_Window" type="WindowInstance">
    /// The window that opens the document.
    /// </param>
    var obj = Coveo.CES.Web.Search.Scripts.SharePointItemUtilities._getOpenDocuments();
    if (obj != null) {
        try {
            obj.editDocument2(p_Window, p_Uri);
        }
        catch ($e1) {
            obj.editDocument(p_Uri);
        }
    }
    else {
        Coveo.CES.Web.Search.Scripts.SharePointItemUtilities.viewDocument(p_Uri, p_Window);
    }
}
Coveo.CES.Web.Search.Scripts.SharePointItemUtilities._getOpenDocuments = function Coveo_CES_Web_Search_Scripts_SharePointItemUtilities$_getOpenDocuments() {
    /// <summary>
    /// Attempts to create an SharePoint.OpenDocuments object.
    /// </summary>
    /// <returns type="SharePointOpenDocuments"></returns>
    var obj;
    try {
        obj = new ActiveXObject('SharePoint.OpenDocuments.2');
    }
    catch ($e1) {
        try {
            obj = new ActiveXObject('SharePoint.OpenDocuments.1');
        }
        catch ($e2) {
            try {
                obj = new ActiveXObject('SharePoint.OpenDocuments');
            }
            catch ($e3) {
                obj = null;
            }
        }
    }
    return obj;
}


Coveo.CES.Common.SearchInterfaceQueryString.registerClass('Coveo.CES.Common.SearchInterfaceQueryString');
Coveo.CES.Web.Search.SharePoint.SharePointItemAttributes.registerClass('Coveo.CES.Web.Search.SharePoint.SharePointItemAttributes');
Coveo.CES.Web.Search.Scripts.Controls.FacetScript.registerClass('Coveo.CES.Web.Search.Scripts.Controls.FacetScript', Coveo.CNL.Web.Scripts.Ajax.AjaxTabableObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.BaseChartScript.registerClass('Coveo.CES.Web.Search.Scripts.Controls.BaseChartScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.MasterAndDetailScript.registerClass('Coveo.CES.Web.Search.Scripts.Controls.MasterAndDetailScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.ContextualDropDownScript.registerClass('Coveo.CES.Web.Search.Scripts.Controls.ContextualDropDownScript', Coveo.CNL.Web.Scripts.Ajax.AjaxTabableObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript.registerClass('Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.CloseModalBoxLinkScript.registerClass('Coveo.CES.Web.Search.Scripts.Controls.CloseModalBoxLinkScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.DateParamsScript.registerClass('Coveo.CES.Web.Search.Scripts.Controls.DateParamsScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.NoticesScript.registerClass('Coveo.CES.Web.Search.Scripts.Controls.NoticesScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.SharePointSearchBoxScript.registerClass('Coveo.CES.Web.Search.Scripts.Controls.SharePointSearchBoxScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript.registerClass('Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.SilverlightMediaPlayer.registerClass('Coveo.CES.Web.Search.Scripts.Controls.SilverlightMediaPlayer', null, Coveo.CES.Web.Search.Scripts.Controls.IMediaPlayer);
Coveo.CES.Web.Search.Scripts.Controls.WindowsMediaPlayer.registerClass('Coveo.CES.Web.Search.Scripts.Controls.WindowsMediaPlayer', null, Coveo.CES.Web.Search.Scripts.Controls.IMediaPlayer);
Coveo.CES.Web.Search.Scripts.Controls.ResultImagePresenterScript.registerClass('Coveo.CES.Web.Search.Scripts.Controls.ResultImagePresenterScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript.registerClass('Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.HighlightedQueryScript.registerClass('Coveo.CES.Web.Search.Scripts.Controls.HighlightedQueryScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.PlayerScript.registerClass('Coveo.CES.Web.Search.Scripts.Controls.PlayerScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.ResultPlayerScript.registerClass('Coveo.CES.Web.Search.Scripts.Controls.ResultPlayerScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.ViewAsHtmlPanelScript.registerClass('Coveo.CES.Web.Search.Scripts.Controls.ViewAsHtmlPanelScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.registerClass('Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CES.Web.Search.Scripts.SharePointItemUtilities.registerClass('Coveo.CES.Web.Search.Scripts.SharePointItemUtilities');
Coveo.CES.Common.SearchInterfaceQueryString.queryParameter = 'q';
Coveo.CES.Common.SearchInterfaceQueryString.conversationSubjectParameter = 'convsj';
Coveo.CES.Common.SearchInterfaceQueryString.targetFrameParameter = 'f';
Coveo.CES.Common.SearchInterfaceQueryString.oldOutlookAddInVersion = 'oaiv';
Coveo.CES.Common.SearchInterfaceQueryString.collectionNamesParameter = 'c';
Coveo.CES.Common.SearchInterfaceQueryString.collectionIdsParameter = 'ci';
Coveo.CES.Common.SearchInterfaceQueryString.initialScopeParameter = 'sc';
Coveo.CES.Common.SearchInterfaceQueryString.timeZoneParameter = 'tz';
Coveo.CES.Common.SearchInterfaceQueryString.timeZoneOffsetParameter = 't';
Coveo.CES.Common.SearchInterfaceQueryString.lcidParameter = 'lcid';
Coveo.CES.Common.SearchInterfaceQueryString.stateParameter = 's';
Coveo.CES.Common.SearchInterfaceQueryString.sessionGuidParameter = 'sg';
Coveo.CES.Common.SearchInterfaceQueryString.interfaceNameParameter = 'sk';
Coveo.CES.Common.SearchInterfaceQueryString.iconSizeParameter = 'is';
Coveo.CES.Common.SearchInterfaceQueryString.superUserTokenParameter = 'sut';
Coveo.CES.Common.SearchInterfaceQueryString.quirksModeParameter = 'qm';
Coveo.CES.Common.SearchInterfaceQueryString.hubNameParameter = 'sh';
Coveo.CES.Common.SearchInterfaceQueryString.documentIdParameter = 'docid';
Coveo.CES.Common.SearchInterfaceQueryString.mirrorIdParameter = 'mir';
Coveo.CES.Common.SearchInterfaceQueryString.wildcardsParameter = 'wld';
Coveo.CES.Common.SearchInterfaceQueryString.improveReadabilityParameter = 'rdb';
Coveo.CES.Common.SearchInterfaceQueryString.customContentRelayParameter = 'ccr';
Coveo.CES.Common.SearchInterfaceQueryString.xmlSearchParameter = 'xml';
Coveo.CES.Common.SearchInterfaceQueryString.exportToExcelParameter = 'xls';
Coveo.CES.Common.SearchInterfaceQueryString.excelXmlDataSourceParameter = 'exds';
Coveo.CES.Common.SearchInterfaceQueryString.openSearchParameter = 'opensearch';
Coveo.CES.Common.SearchInterfaceQueryString.openSearchSuggestParameter = 'opensearchsuggest';
Coveo.CES.Common.SearchInterfaceQueryString.desktopSearchParameter = 'desktopsearch';
Coveo.CES.Common.SearchInterfaceQueryString.wakeUpParameter = 'wakeup';
Coveo.CES.Common.SearchInterfaceQueryString.showDebugInfoParameter = 'debug';
Coveo.CES.Common.SearchInterfaceQueryString.emailAddressParameter = 'ea';
Coveo.CES.Common.SearchInterfaceQueryString.caseIDParameter = 'caseid';
Coveo.CES.Common.SearchInterfaceQueryString.chartIDParameter = 'chart';
Coveo.CES.Common.SearchInterfaceQueryString.chartWidthParameter = 'width';
Coveo.CES.Common.SearchInterfaceQueryString.chartHeightParameter = 'height';
Coveo.CES.Common.SearchInterfaceQueryString.disableAnalyticsLoggingParameter = 'disableanalyticslogging';
Coveo.CES.Common.SearchInterfaceQueryString.searchBarParameter = 'searchbar';
Coveo.CES.Common.SearchInterfaceQueryString.searchBarInfoParameter = 'searchbarinfo';
Coveo.CES.Common.SearchInterfaceQueryString.searchBarVersionParameter = 'searchbarversion';
Coveo.CES.Common.SearchInterfaceQueryString.searchBarAutoCompletionsParameter = 'searchbarcompletions';
Coveo.CES.Common.SearchInterfaceQueryString.outlookAddInParameter = 'outlookaddin';
Coveo.CES.Common.SearchInterfaceQueryString.outlookSenderEmailParameter = 'senderemail';
Coveo.CES.Common.SearchInterfaceQueryString.outlookSubjectHash = 'subjecthash';
Coveo.CES.Common.SearchInterfaceQueryString.outlookSentOn = 'senton';
Coveo.CES.Common.SearchInterfaceQueryString.interfaceReloaded = 'itfrld';
Coveo.CES.Web.Search.SharePoint.SharePointItemAttributes.lisT_VERSION_ENABLED = 'VersionEnabled';
Coveo.CES.Web.Search.SharePoint.SharePointItemAttributes.lisT_IS_FORCE_CHECKOUT = 'IsForceCheckout';
Coveo.CES.Web.Search.SharePoint.SharePointItemAttributes.lisT_ENABLE_MINOR_VERSIONS = 'EnableMinorVersions';
Coveo.CES.Web.Search.SharePoint.SharePointItemAttributes.lisT_CONTENT_TYPES_ENABLED = 'ContentTypesEnabled';
Coveo.CES.Web.Search.SharePoint.SharePointItemAttributes.lisT_BASE_TYPE = 'ListBaseType';
Coveo.CES.Web.Search.SharePoint.SharePointItemAttributes.lisT_BASE_TEMPLATE = 'ListBaseTemplate';
Coveo.CES.Web.Search.SharePoint.SharePointItemAttributes.lisT_WRITE_SECURITY = 'WriteSecurity';
Coveo.CES.Web.Search.SharePoint.SharePointItemAttributes.lisT_USER_ID = 'UserID';
Coveo.CES.Web.Search.SharePoint.SharePointItemAttributes.d_REF = 'DRef';
Coveo.CES.Web.Search.Scripts.Controls.MasterAndDetailScript._resizE_TIMEOUT_DELAY$1 = 500;
Coveo.CES.Web.Search.Scripts.Controls.MasterAndDetailScript._animatioN_DURATION$1 = 150;
Coveo.CES.Web.Search.Scripts.Controls.MasterAndDetailScript._animatioN_TIMEOUT_DELAY$1 = 10;
Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript._s_Instances$1 = {};
Coveo.CES.Web.Search.Scripts.Controls.SharePointSearchBoxScript._defaulT_SEARCH_CSS_URL$1 = '/_layouts/1033/styles/themable/search.css';
Coveo.CES.Web.Search.Scripts.Controls.SilverlightMediaPlayer._objecT_ID = 'SilverlightControl';
Coveo.CES.Web.Search.Scripts.Controls.WindowsMediaPlayer._clasS_ID = 'CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6';
Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_NameCtrl$1 = null;
Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_TriedCreatingNameCtrl$1 = false;
Coveo.CES.Web.Search.Scripts.Controls.ResultPresenceIndicatorScript._s_RunningControls$1 = [];
Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu._sP_MENU_COLOR$1 = '#b09460';
};
_coveoDefineJQuery();
//****************************************************************************
// Copyright (c) 2005, Coveo Solutions Inc.
//****************************************************************************

function CES_CachedDocument() {

// PUBLIC INTERFACE

//****************************************************************************
// Opens the currently displayed document in a new window.
//****************************************************************************
this.OpenInNewWindow = function()
{
    window.open(this.m_Uri, this.m_Uri.indexOf('outlook:') == 0 ? '_self' : '_blank');
}

//****************************************************************************
// Opens the currently displayed view as html in a new window.
//****************************************************************************
this.OpenViewAsHtmlInNewWindow = function()
{
    window.open(this.src, '_blank');
}

//****************************************************************************
// Highlights the next occurence of a term.
// p_Term  - The index of the term to highlight.
//****************************************************************************
this.HighlightNextOccurence = function(p_Term)
{
    if (!this.m_DoNotHighlight) {
        this.RemoveLastHighlight();
        
        var last = this.m_Positions[p_Term];
        if (last == undefined) {
            last = 0;
        }

        var current = last + 1;
        if (this.GetTermPart(p_Term, current, 1) == null) {
            current = 1;
        }

        this.HighlightTerm(p_Term, current);
        this.m_Positions[p_Term] = current;
    }
}

//****************************************************************************
// Highlights the previous occurence of a term.
// p_Term  - The index of the term to highlight.
//****************************************************************************
this.HighlightPreviousOccurence = function(p_Term)
{
    if (!this.m_DoNotHighlight) {
        this.RemoveLastHighlight();
        
        var last = this.m_Positions[p_Term];
        if (last == undefined) {
            last = 1;
        }

        var current = last - 1;
        if (this.GetTermPart(p_Term, current, 1) == null) {
            // Skip to the last one
            current = 1;
            while (this.GetTermPart(p_Term, current, 1) != null) {
                ++current;
            }
            --current;
        }

        this.HighlightTerm(p_Term, current);
        this.m_Positions[p_Term] = current;
    }
}

// PRIVATE INTERFACE

//****************************************************************************
// Resets the members used to track the current highlight.
//****************************************************************************
this.ResetMembers = function()
{
    this.m_Positions = new Array();
    this.m_LastTerm = 0;
    this.m_LastOccurence = 0;
    this.m_DoNotHighlight = false;
}

//****************************************************************************
// Retrieves the document object inside the frame.
//****************************************************************************
this.GetDocument = function()
{
    return this.contentWindow.document;
}

//****************************************************************************
// Retrieves a specific highlight part.
// p_Term      - The index of the term.
// p_Occurence - The index of the occurence of the term.
// p_Part      - The index of the part of the term.
//****************************************************************************
this.GetTermPart = function(p_Term, p_Occurence, p_Part)
{
    return this.GetDocument().getElementById('CoveoHighlight:' + p_Term + '.' + p_Occurence + '.' + p_Part);
}

//****************************************************************************
// Highlights a term and scrolls it into view.
// p_Term      - The index of the term to highlight.
// p_Occurence - The index of the term occurence to highlight.
//****************************************************************************
this.HighlightTerm = function(p_Term, p_Occurence) 
{
    var part = 1;
    var elem = this.GetTermPart(p_Term, p_Occurence, part);
    if (elem != null) {
        var newScroll = -1;
        if (CNL_IsIE() && !CNL_IsIE6()) {
            // The horizontal scroll of scrollIntoView works differently in IE than in other browser.
            // It tries to place the term on the left side of the frame, even when it's not neccessary.
            var doc = this.GetDocument();
            if (CNL_IsStandard()) {
                doc = doc.documentElement;
            } else {
                doc = doc.body;
            }
            newScroll = doc.scrollLeft;

            // Calculates the X position of the term by adding every offsetLeft 
            // until there is no offsetParent left (top of the frame is reached).
            var elemPosX = 0;
            var offsetElem = elem;
            do {
                elemPosX += offsetElem.offsetLeft;
            } while (offsetElem = offsetElem.offsetParent);

            if (elemPosX < newScroll) {
                // We want the term on the left side, IE will do the job.
                newScroll = -1;
            } else if (elemPosX + elem.offsetWidth > newScroll + doc.clientWidth) {
                // We want the term on the right side.
                newScroll += (elemPosX + elem.offsetWidth) - (newScroll + doc.clientWidth);
            } // Otherwise, we want to keep the same horizontal scroll.
        }

        elem.scrollIntoView();
        if (newScroll != -1) {
            doc.scrollLeft = newScroll;
        }

        while (elem != null) {
            elem.m_BackupColor = elem.style.color;
            elem.m_BackupBackground = elem.style.backgroundColor;
            elem.style.color = 'white';
            elem.style.backgroundColor = 'green';
            elem = this.GetTermPart(p_Term, p_Occurence, ++part);
        }

        this.m_LastTerm = p_Term;
        this.m_LastOccurence = p_Occurence;

        // FireFox 1.5.0.2 has a bug with scrollIntoView
        document.documentElement.scrollTop = 0;
    }
}

//****************************************************************************
// Unhighlights the last highlighted term.
//****************************************************************************
this.RemoveLastHighlight = function()
{
    if (this.m_LastTerm != 0) {
        var part = 1;
        var elem = this.GetTermPart(this.m_LastTerm, this.m_LastOccurence, part);
        while (elem != null) {
            elem.style.color = elem.m_BackupColor;
            elem.style.backgroundColor = elem.m_BackupBackground;
            elem = this.GetTermPart(this.m_LastTerm, this.m_LastOccurence, ++part);
        }
    }
}

} // Constructor

