Type.createNamespace('Coveo.CES.Web.Search.Scripts.Controls');

////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.FacetScript

Coveo.CES.Web.Search.Scripts.Controls.FacetScript = function Coveo_CES_Web_Search_Scripts_Controls_FacetScript() {
    Coveo.CES.Web.Search.Scripts.Controls.FacetScript.constructBase(this);
}
Coveo.CES.Web.Search.Scripts.Controls.FacetScript.prototype = {
    m_Main: null,
    m_Header: null,
    m_Popup: null,
    m_Showing: false,
    _m_HeaderClickDomEventHandler$1: null,
    _m_OnClickElsewhereEvent$1: 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);
        this._m_HeaderClickDomEventHandler$1 = Delegate.create(this, this._header_Click$1);
        this.m_Header.attachEvent('onclick', this._m_HeaderClickDomEventHandler$1);
        if (this.m_Popup) {
            this._m_OnClickElsewhereEvent$1 = new Coveo.CNL.Web.Scripts.OnClickElsewhereEvent([ this.m_Main ], Delegate.create(this, this._main_ClickElsewhere$1));
        }
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$tearDown() {
        if (this._m_HeaderClickDomEventHandler$1) {
            this.m_Header.detachEvent('onclick', this._m_HeaderClickDomEventHandler$1);
            this._m_HeaderClickDomEventHandler$1 = null;
        }
        if (this._m_OnClickElsewhereEvent$1) {
            this._m_OnClickElsewhereEvent$1.dispose();
            this._m_OnClickElsewhereEvent$1 = null;
        }
    },
    
    fillItems: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$fillItems(p_Callback) {
    },
    
    hideItems: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$hideItems(p_Callback) {
    },
    
    _fillItemsCallback$1: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$_fillItemsCallback$1(p_Return) {
        this.m_Showing = true;
        if (this.m_Popup) {
            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$1: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$_hideItemsCallback$1(p_Return) {
        this.m_Showing = false;
    },
    
    _header_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$_header_Click$1() {
        if (!this.m_Showing) {
            if (this.m_Popup) {
                this.m_Popup.style.visibility = 'hidden';
            }
            this.fillItems(Delegate.create(this, this._fillItemsCallback$1));
        }
        else if (!this.m_Popup) {
            this.hideItems(Delegate.create(this, this._hideItemsCallback$1));
        }
    },
    
    _main_ClickElsewhere$1: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$_main_ClickElsewhere$1() {
        Coveo.CNL.Web.Scripts.CNLAssert.check(this.m_Popup);
        if (this.m_Showing) {
            this.m_Showing = false;
            this.m_Popup.style.display = 'none';
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.CloseModalBoxLinkScript

Coveo.CES.Web.Search.Scripts.Controls.CloseModalBoxLinkScript = function Coveo_CES_Web_Search_Scripts_Controls_CloseModalBoxLinkScript() {
    Coveo.CES.Web.Search.Scripts.Controls.CloseModalBoxLinkScript.constructBase(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 = 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() {
    },
    
    _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.SharePointSearchBoxScript

Coveo.CES.Web.Search.Scripts.Controls.SharePointSearchBoxScript = function Coveo_CES_Web_Search_Scripts_Controls_SharePointSearchBoxScript() {
    Coveo.CES.Web.Search.Scripts.Controls.SharePointSearchBoxScript.constructBase(this);
}
Coveo.CES.Web.Search.Scripts.Controls.SharePointSearchBoxScript.prototype = {
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_SharePointSearchBoxScript$initialize() {
        var OurSearch = '{0}_layouts/CES/Search2007.aspx?q=\"{1}\"';
        var s_MossPerson = new RegExp('(.+)Person\\.aspx.*');
        var s_MossPeopleResults = new RegExp('https?://.+/PeopleResults\\.aspx\\?.*k=\\w+:\"(.+)\"');
        var person = s_MossPerson.exec(window.location.href);
        if (person && person.length > 0) {
            var elements = document.documentElement.getElementsByTagName('a');
            for (var i = 0; i < elements.length; i++) {
                var hrefAttribute = elements[i].attributes.getNamedItem('href');
                var match = s_MossPeopleResults.exec(hrefAttribute.value);
                if (match && match.length > 0) {
                    hrefAttribute.value = String.format(OurSearch, person[1], match[1]);
                }
            }
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript

Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript = function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript() {
    Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript.constructBase(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_ShowDelay: 0,
    m_HideDelay: 0,
    m_Position: 0,
    m_Popup: 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,
    
    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 = Delegate.create(this, this._textBox_KeyPress$1);
        this.m_TextBox.attachEvent('onkeydown', this._m_OnKeyPressHandler$1);
        this._m_SearchButtonClickEventHandler$1 = Delegate.create(this, this._searchButton_Click$1);
        this.m_SearchButton.attachEvent('onclick', this._m_SearchButtonClickEventHandler$1);
        if (this.m_LinkButton) {
            this._m_LinkButtonClickEventHandler$1 = Delegate.create(this, this._linkButton_Click$1);
            this.m_LinkButton.attachEvent('onclick', this._m_LinkButtonClickEventHandler$1);
        }
        if (this.m_SearchAsYouType) {
            Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_Popup);
            this._m_OnFocusHandler$1 = Delegate.create(this, this._textBox_Focus$1);
            this.m_TextBox.attachEvent('onfocus', this._m_OnFocusHandler$1);
            this._m_OnBlurHandler$1 = Delegate.create(this, this._textBox_Blur$1);
            this.m_TextBox.attachEvent('onblur', this._m_OnBlurHandler$1);
            this._m_PopupOnMouseOver$1 = Delegate.create(this, this._popup_OnMouseOver$1);
            this.m_Popup.attachEvent('onmouseover', this._m_PopupOnMouseOver$1);
            this._m_PopupOnMouseOut$1 = Delegate.create(this, this._popup_OnMouseOut$1);
            this.m_Popup.attachEvent('onmouseout', this._m_PopupOnMouseOut$1);
        }
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$tearDown() {
        if (this._m_OnFocusHandler$1) {
            this.m_TextBox.detachEvent('onfocus', this._m_OnFocusHandler$1);
        }
        if (this._m_OnBlurHandler$1) {
            this.m_TextBox.detachEvent('onblur', this._m_OnBlurHandler$1);
        }
        if (this._m_OnKeyPressHandler$1) {
            this.m_TextBox.detachEvent('onkeydown', this._m_OnKeyPressHandler$1);
        }
        if (this._m_SearchButtonClickEventHandler$1) {
            this.m_SearchButton.detachEvent('onclick', this._m_SearchButtonClickEventHandler$1);
        }
        if (this._m_LinkButtonClickEventHandler$1) {
            this.m_LinkButton.detachEvent('onclick', this._m_LinkButtonClickEventHandler$1);
        }
    },
    
    serverUpdateResults: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$serverUpdateResults(p_Query, p_Callback) {
    },
    
    _scheduleUpdateResults$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_scheduleUpdateResults$1() {
        this._cancelUpdateResults$1();
        this._m_UpdateTimeout$1 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._updateResults$1), this.m_ShowDelay);
    },
    
    _cancelUpdateResults$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_cancelUpdateResults$1() {
        if (this._m_UpdateTimeout$1) {
            this._m_UpdateTimeout$1.cancel();
            this._m_UpdateTimeout$1 = null;
        }
    },
    
    _updateResults$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_updateResults$1() {
        this._m_UpdateTimeout$1 = null;
        if (this.m_TextBox.value !== '') {
            this.serverUpdateResults(this.m_TextBox.value, Delegate.create(this, this._updateResultsCallback$1));
        }
        else {
            this._hidePopup$1();
        }
    },
    
    _updateResultsCallback$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_updateResultsCallback$1(p_Return) {
        this._showPopup$1();
    },
    
    _showPopup$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_showPopup$1() {
        this.m_Popup.style.display = 'block';
        Coveo.CNL.Web.Scripts.DOMUtilities.positionElement(this.m_Popup, this.m_TextBox, this.m_Position);
    },
    
    _scheduleHidePopup$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_scheduleHidePopup$1() {
        this._cancelHidePopup$1();
        this._m_HideTimeout$1 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._hidePopup$1), this.m_HideDelay);
    },
    
    _cancelHidePopup$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_cancelHidePopup$1() {
        if (this._m_HideTimeout$1) {
            this._m_HideTimeout$1.cancel();
            this._m_HideTimeout$1 = null;
        }
    },
    
    _hidePopup$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_hidePopup$1() {
        this._cancelHidePopup$1();
        this.m_Popup.style.display = 'none';
    },
    
    _submitSearch$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_submitSearch$1() {
        var uri = this.m_Target;
        uri += '&' + Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript.querY_PARAMETER + '=' + encodeURIComponent(this.m_TextBox.value);
        uri += '&' + Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript.timE_ZONE_OFFSET_PARAMETER + '=' + eval('-new Date().getTimezoneOffset()');
        window.navigate(uri);
    },
    
    _textBox_Focus$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_textBox_Focus$1() {
        this._cancelHidePopup$1();
        this._m_HasFocus$1 = true;
        if (this.m_TextBox.value !== '') {
            this._scheduleUpdateResults$1();
        }
    },
    
    _textBox_Blur$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_textBox_Blur$1() {
        if (!this._m_OverResults$1) {
            this._scheduleHidePopup$1();
        }
        this._cancelUpdateResults$1();
        this._m_HasFocus$1 = false;
    },
    
    _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.ViewAsHtmlPanelScript

Coveo.CES.Web.Search.Scripts.Controls.ViewAsHtmlPanelScript = function Coveo_CES_Web_Search_Scripts_Controls_ViewAsHtmlPanelScript() {
    Coveo.CES.Web.Search.Scripts.Controls.ViewAsHtmlPanelScript.constructBase(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.createNamespace('Coveo.CES.Web.Search.Scripts.Controls.Results');

////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButtonMode

Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButtonMode = function() { };
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButtonMode.prototype = {
    play: 0, 
    pause: 1
}
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButtonMode.createEnum('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButtonMode', false);


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation

Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation = function() { };
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation.prototype = {
    horizontal: 0, 
    vertical: 1
}
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation.createEnum('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation', false);


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButtonState

Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButtonState = function() { };
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButtonState.prototype = {
    disabled: 0, 
    enabled: 1, 
    grayed: 2
}
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButtonState.createEnum('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButtonState', false);


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.Results.ZoomDirection

Coveo.CES.Web.Search.Scripts.Controls.Results.ZoomDirection = function() { };
Coveo.CES.Web.Search.Scripts.Controls.Results.ZoomDirection.prototype = {
    zoomIn: 0, 
    zoomOut: 1
}
Coveo.CES.Web.Search.Scripts.Controls.Results.ZoomDirection.createEnum('Coveo.CES.Web.Search.Scripts.Controls.Results.ZoomDirection', false);


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry

Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtteranceTextEntry(p_TargetControl) {
    Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry.constructBase(this, [ p_TargetControl ]);
}
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry.prototype = {
    _m_TextBlock$2: null,
    _m_TextContainer$2: null,
    
    get_width: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtteranceTextEntry$get_width() {
        return Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry.callBase(this, 'get_width');
    },
    set_width: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtteranceTextEntry$set_width(value) {
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry.callBase(this, 'set_width', [ value ]);
        this.set_text(this.get_text());
        return value;
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtteranceTextEntry$tearDown() {
        this._m_TextBlock$2 = null;
        this._m_TextContainer$2 = null;
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry.callBase(this, 'tearDown');
    },
    
    highlight: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtteranceTextEntry$highlight() {
        (this._m_TextBlock$2.foreground).color = Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry._mousE_ENTER_TEXT_COLOR$2;
    },
    
    undoHighlight: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtteranceTextEntry$undoHighlight() {
        this.renderControl();
    },
    
    buildTextControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtteranceTextEntry$buildTextControl() {
        (this.m_TargetControl).children.clear();
        var utt = this.get_data();
        var datetime = new Date(0, 0, 0, 0, 0, utt.get_start());
        var time = datetime.getHours().toString().padLeft(2, '0') + ':' + datetime.getMinutes().toString().padLeft(2, '0') + ':' + datetime.getSeconds().toString().padLeft(2, '0');
        var targetWidth = this.m_TargetControl.width - 2;
        var containerXaml = '<Canvas xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"/>';
        this._m_TextContainer$2 = this.m_TargetControl.getHost().content.createFromXaml(containerXaml);
        var xaml = '<TextBlock xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" TextWrapping=\"Wrap\" FontFamily=\"Verdana\" FontSize=\"11\" Foreground=\"' + Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry._mousE_LEAVE_TEXT_COLOR$2 + '\" Canvas.Left=\"3\" Width=\"' + (targetWidth - 3) + '\" Cursor=\"Hand\"><Run FontWeight=\"Bold\">' + time + '</Run> ' + utt.get_excerpt() + '</TextBlock>';
        this._m_TextBlock$2 = this.m_TargetControl.getHost().content.createFromXaml(xaml);
        this._m_TextContainer$2.children.add(this._m_TextBlock$2);
        this._m_TextContainer$2.height = this._m_TextBlock$2.actualHeight;
        this._m_TextContainer$2.width = this.m_TargetControl.width;
        (this.m_TargetControl).children.add(this._m_TextContainer$2);
        var lineXaml = '<Line Fill=\"#FFFFFFFF\" Stretch=\"Fill\" Stroke=\"#FFCCCCCC\" StrokeLineJoin=\"Round\" StrokeThickness=\"1.33333\"/>';
        var lineWidth = this.m_TargetControl.width;
        var line = this.m_TargetControl.getHost().content.createFromXaml(lineXaml);
        line.x1 = 0;
        line.x2 = line.x1 + lineWidth;
        line.y1 = this._m_TextContainer$2.height + 4;
        line.y2 = line.y1;
        (this.m_TargetControl).children.add(line);
        this.set_height(this._m_TextContainer$2.height + 4 + line.height + 4);
    },
    
    renderControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtteranceTextEntry$renderControl() {
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry.callBase(this, 'renderControl');
        if (this.get_selected()) {
            var xaml = '<SolidColorBrush Color=\"' + Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry._selecteD_COLOR$2 + '\" />';
            this._m_TextContainer$2.background = this.m_TargetControl.getHost().content.createFromXaml(xaml);
            (this._m_TextBlock$2.foreground).color = Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry._selecteD_TEXT_COLOR$2;
        }
        else {
            this._m_TextContainer$2.background = null;
            (this._m_TextBlock$2.foreground).color = Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry._mousE_LEAVE_TEXT_COLOR$2;
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.Results.TextContainerEventArgs

Coveo.CES.Web.Search.Scripts.Controls.Results.TextContainerEventArgs = function Coveo_CES_Web_Search_Scripts_Controls_Results_TextContainerEventArgs() {
    Coveo.CES.Web.Search.Scripts.Controls.Results.TextContainerEventArgs.constructBase(this);
}
Coveo.CES.Web.Search.Scripts.Controls.Results.TextContainerEventArgs.prototype = {
    textEntry: null
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextContainer

Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextContainer = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer(p_Target) {
    this._m_TextEntries$1 = [];
    Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextContainer.constructBase(this, [ p_Target ]);
}
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextContainer.prototype = {
    _m_IsUpdating$1: false,
    
    add_textEntryClick: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$add_textEntryClick(value) {
        this.__textEntryClick$1 = Delegate.combine(this.__textEntryClick$1, value);
    },
    remove_textEntryClick: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$remove_textEntryClick(value) {
        this.__textEntryClick$1 = Delegate.remove(this.__textEntryClick$1, value);
    },
    
    __textEntryClick$1: null,
    
    get_width: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$get_width() {
        return Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextContainer.callBase(this, 'get_width');
    },
    set_width: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$set_width(value) {
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextContainer.callBase(this, 'set_width', [ value ]);
        var $enum1 = this._m_TextEntries$1.getEnumerator();
        while ($enum1.moveNext()) {
            var textEntry = $enum1.get_current();
            if (Type.canCast(textEntry, Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry)) {
                textEntry.set_width(this.get_width());
            }
        }
        this._internalEndUpdate$1();
        return value;
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$tearDown() {
        var $enum1 = this._m_TextEntries$1.getEnumerator();
        while ($enum1.moveNext()) {
            var textEntry = $enum1.get_current();
            textEntry.tearDown();
        }
        this._m_TextEntries$1.clear();
        this._m_TextEntries$1 = null;
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextContainer.callBase(this, 'tearDown');
    },
    
    beginUpdate: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$beginUpdate() {
        Coveo.CNL.Web.Scripts.CNLAssert.check(!this._m_IsUpdating$1);
        this._m_IsUpdating$1 = true;
    },
    
    endUpdate: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$endUpdate() {
        Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_IsUpdating$1);
        this._m_IsUpdating$1 = false;
        this._internalEndUpdate$1();
    },
    
    clear: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$clear() {
        var $enum1 = this._m_TextEntries$1.getEnumerator();
        while ($enum1.moveNext()) {
            var textEntry = $enum1.get_current();
            textEntry.tearDown();
        }
        this._m_TextEntries$1.clear();
        this._internalEndUpdate$1();
    },
    
    addSeparatorTextEntry: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$addSeparatorTextEntry(p_Text, p_Data, p_SelectedText) {
        Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_IsUpdating$1);
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Text);
        var containerXaml = '<Canvas xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"/>';
        if (this._m_TextEntries$1.length > 0) {
            var sepContainer = this.m_TargetControl.getHost().content.createFromXaml(containerXaml);
            sepContainer.width = this.m_TargetControl.width;
            var sepEntry = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry(sepContainer);
            sepEntry.set_text('  .  ');
            sepEntry.disableEvents();
            this._m_TextEntries$1.add(sepEntry);
        }
        var textContainer = this.m_TargetControl.getHost().content.createFromXaml(containerXaml);
        textContainer.width = this.m_TargetControl.width;
        var textEntry = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry(textContainer);
        textEntry.set_data(p_Data);
        textEntry.set_selected(p_SelectedText);
        textEntry.set_text(p_Text);
        textEntry.add_click(Delegate.create(this, this._textEntry_Click$1));
        this._m_TextEntries$1.add(textEntry);
        return textEntry;
    },
    
    addUtteranceTextEntry: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$addUtteranceTextEntry(p_Text, p_Data, p_SelectedText) {
        Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_IsUpdating$1);
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Text);
        var containerXaml = '<Canvas xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"/>';
        var textContainer = this.m_TargetControl.getHost().content.createFromXaml(containerXaml);
        textContainer.width = this.m_TargetControl.width;
        var textEntry = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry(textContainer);
        textEntry.set_data(p_Data);
        textEntry.set_text(p_Text);
        textEntry.set_selected(p_SelectedText);
        textEntry.add_click(Delegate.create(this, this._textEntry_Click$1));
        this._m_TextEntries$1.add(textEntry);
        return textEntry;
    },
    
    _internalEndUpdate$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$_internalEndUpdate$1() {
        (this.m_TargetControl).children.clear();
        var height = 0;
        var width = 0;
        var count = this._m_TextEntries$1.length;
        var top = 0;
        for (var i = 0; i <= count - 1; i++) {
            var textEntry = this._m_TextEntries$1[i];
            if (width + textEntry.get_width() > this.m_TargetControl.width) {
                width = 0;
                top = height;
                height += textEntry.get_height();
            }
            else {
                height = Math.max(height, textEntry.get_height());
            }
            textEntry.set_left(width);
            textEntry.set_top(top);
            width += textEntry.get_width();
            (this.m_TargetControl).children.add(textEntry.get_targetControl());
        }
        this.set_height(height);
    },
    
    _textEntry_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$_textEntry_Click$1(p_Sender, p_Args) {
        if (this.__textEntryClick$1) {
            var args = new Coveo.CES.Web.Search.Scripts.Controls.Results.TextContainerEventArgs();
            args.textEntry = p_Sender;
            this.__textEntryClick$1.invoke(this, args);
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry

Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry(p_TargetControl) {
    Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry.constructBase(this, [ p_TargetControl ]);
}
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry.prototype = {
    _m_Selected$1: false,
    _m_Text$1: null,
    _m_Data$1: null,
    _m_TextBlock$1: null,
    
    get_selected: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry$get_selected() {
        return this._m_Selected$1;
    },
    set_selected: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry$set_selected(value) {
        this._m_Selected$1 = value;
        if (this._m_TextBlock$1) {
            if (this._m_Selected$1) {
                (this._m_TextBlock$1.foreground).color = Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry._selecteD_TEXT_COLOR$1;
                this._m_TextBlock$1.fontWeight = 'Bold';
            }
            else {
                (this._m_TextBlock$1.foreground).color = 'Black';
                this._m_TextBlock$1.fontWeight = 'Normal';
            }
        }
        this.renderControl();
        return value;
    },
    
    get_text: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry$get_text() {
        return this._m_Text$1;
    },
    set_text: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry$set_text(value) {
        this._m_Text$1 = value;
        this.buildTextControl();
        return value;
    },
    
    get_data: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry$get_data() {
        return this._m_Data$1;
    },
    set_data: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry$set_data(value) {
        this._m_Data$1 = value;
        return value;
    },
    
    highlight: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry$highlight() {
        ((this.m_TargetControl).children.getItem(0)).textDecorations = 'Underline';
    },
    
    undoHighlight: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry$undoHighlight() {
        ((this.m_TargetControl).children.getItem(0)).textDecorations = 'None';
    },
    
    buildTextControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry$buildTextControl() {
        (this.m_TargetControl).children.clear();
        var color = 'Black';
        if (this._m_Selected$1) {
            color = Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry._selecteD_TEXT_COLOR$1;
        }
        var xaml = '<TextBlock xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" TextWrapping=\"Wrap\" FontFamily=\"Verdana\" FontSize=\"11\" Foreground=\"' + color + '\" Cursor=\"Hand\" Text=\"' + this._m_Text$1 + '\"/>';
        this._m_TextBlock$1 = this.m_TargetControl.getHost().content.createFromXaml(xaml);
        if (this._m_Selected$1) {
            this._m_TextBlock$1.fontWeight = 'Bold';
        }
        this._m_TextBlock$1.width = this.m_TargetControl.width;
        (this.m_TargetControl).children.add(this._m_TextBlock$1);
        this.m_TargetControl.height = this._m_TextBlock$1.actualHeight + 3;
        this.m_TargetControl.width = this._m_TextBlock$1.actualWidth;
    },
    
    onMouseMove: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry$onMouseMove(p_Args) {
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry.callBase(this, 'onMouseMove', [ p_Args ]);
        this.highlight();
    },
    
    onMouseLeave: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry$onMouseLeave(p_Args) {
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry.callBase(this, 'onMouseLeave', [ p_Args ]);
        this.undoHighlight();
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea

Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea(p_TargetCanvas) {
    Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea.constructBase(this, [ p_TargetCanvas ]);
}
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea.prototype = {
    _m_ScrollBarControlName$1: null,
    _m_ScrollUpButtonName$1: null,
    _m_ScrollDownButtonName$1: null,
    _m_ScrollHookControlName$1: null,
    _m_ScrollHookThumbControlName$1: null,
    _m_ScrollTop$1: 0,
    _m_EnableAnimation$1: true,
    _m_ScrollStoryboard$1: null,
    _m_ScrollAnimation$1: null,
    _m_ScrollDownButton$1: null,
    _m_ScrollUpButton$1: null,
    _m_HookControl$1: null,
    _m_ScrollTarget$1: null,
    _m_ScrollDownButton_Click$1: null,
    _m_ScrollUpButton_Click$1: null,
    _m_HookControl_ProgressChange$1: null,
    
    get_height: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$get_height() {
        return Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea.callBase(this, 'get_height');
    },
    set_height: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$set_height(value) {
        (this.m_TargetControl.getHost().content.findName(this._m_ScrollBarControlName$1)).height = value;
        this._m_ScrollDownButton$1.set_top(value - this._m_ScrollDownButton$1.get_height());
        this._m_HookControl$1.set_height(value - (this._m_ScrollDownButton$1.get_height() * 2));
        var xaml = '<RectangleGeometry Rect=\"0, 0, ' + this.get_width() + ', ' + value + '\" />';
        var rect = this.m_TargetControl.getHost().content.createFromXaml(xaml);
        (this.m_TargetControl).clip = rect;
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea.callBase(this, 'set_height', [ value ]);
        return value;
    },
    
    get_width: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$get_width() {
        return Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea.callBase(this, 'get_width');
    },
    set_width: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$set_width(value) {
        (this.m_TargetControl.getHost().content.findName(this._m_ScrollBarControlName$1)).setValue('Canvas.Left', value - 20);
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea.callBase(this, 'set_width', [ value ]);
        return value;
    },
    
    get_scrollBarControlName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$get_scrollBarControlName() {
        return this._m_ScrollBarControlName$1;
    },
    set_scrollBarControlName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$set_scrollBarControlName(value) {
        this._m_ScrollBarControlName$1 = value;
        return value;
    },
    
    get_scrollUpButtonName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$get_scrollUpButtonName() {
        return this._m_ScrollUpButtonName$1;
    },
    set_scrollUpButtonName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$set_scrollUpButtonName(value) {
        this._m_ScrollUpButtonName$1 = value;
        this._m_ScrollUpButton$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton(this.m_TargetControl.findName(this._m_ScrollUpButtonName$1));
        this._m_ScrollUpButton_Click$1 = Delegate.create(this, this._scrollUpButton_Click$1);
        this._m_ScrollUpButton$1.add_click(this._m_ScrollUpButton_Click$1);
        return value;
    },
    
    get_scrollDownButtonName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$get_scrollDownButtonName() {
        return this._m_ScrollDownButtonName$1;
    },
    set_scrollDownButtonName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$set_scrollDownButtonName(value) {
        this._m_ScrollDownButtonName$1 = value;
        this._m_ScrollDownButton$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton(this.m_TargetControl.findName(this._m_ScrollDownButtonName$1));
        this._m_ScrollDownButton_Click$1 = Delegate.create(this, this._scrollDownButton_Click$1);
        this._m_ScrollDownButton$1.add_click(this._m_ScrollDownButton_Click$1);
        return value;
    },
    
    get_scrollHookControlName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$get_scrollHookControlName() {
        return this._m_ScrollHookControlName$1;
    },
    set_scrollHookControlName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$set_scrollHookControlName(value) {
        this._m_ScrollHookControlName$1 = value;
        this._m_HookControl$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress(this.m_TargetControl.findName(this._m_ScrollHookControlName$1));
        this._m_HookControl$1.set_orientation(Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation.vertical);
        this._m_HookControl$1.set_progressWhileDraggingThumb(true);
        this._m_HookControl$1.set_thumbControlName(this._m_ScrollHookThumbControlName$1);
        this._m_HookControl_ProgressChange$1 = Delegate.create(this, this._hookControl_ProgressChange$1);
        this._m_HookControl$1.add_progressChange(this._m_HookControl_ProgressChange$1);
        return value;
    },
    
    get_scrollHookThumbControlName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$get_scrollHookThumbControlName() {
        return this._m_ScrollHookThumbControlName$1;
    },
    set_scrollHookThumbControlName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$set_scrollHookThumbControlName(value) {
        this._m_ScrollHookThumbControlName$1 = value;
        return value;
    },
    
    get_scrollTarget: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$get_scrollTarget() {
        return this._m_ScrollTarget$1;
    },
    set_scrollTarget: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$set_scrollTarget(value) {
        var xaml = '<Storyboard xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" x:Name=\"ScrollStoryboard\"><DoubleAnimation x:Name=\"ScrollAnimation\" Storyboard.TargetName=\"' + value.get_targetControl().name + '\"  Storyboard.TargetProperty=\"(Canvas.Top)\" From=\"1.0\" To=\"0.0\" Duration=\"0:0:0.3\" /></Storyboard>';
        this._m_ScrollStoryboard$1 = this.m_TargetControl.getHost().content.createFromXaml(xaml);
        (this.m_TargetControl).resources.add(this._m_ScrollStoryboard$1);
        this._m_ScrollAnimation$1 = this.m_TargetControl.findName('ScrollAnimation');
        this._m_ScrollTarget$1 = value;
        return value;
    },
    
    get_scrollTop: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$get_scrollTop() {
        return this._m_ScrollTop$1;
    },
    set_scrollTop: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$set_scrollTop(value) {
        var newValue = 0;
        if (this._m_ScrollTarget$1.get_height() > this.get_height()) {
            newValue = Math.max(0, value);
            newValue = Math.min(this._m_ScrollTarget$1.get_height() - this.get_height(), newValue);
        }
        this._m_ScrollTop$1 = newValue;
        this._m_HookControl$1.updateProgress(this._m_ScrollTop$1 / (this._m_ScrollTarget$1.get_height() - this.get_height()));
        this.renderControl();
        return value;
    },
    
    scrollTo: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$scrollTo(p_TargetTop, p_MustSeeThreshold) {
        var actualTargetTop = this._m_ScrollTarget$1.get_top() + p_TargetTop;
        if (actualTargetTop < 0) {
            this.set_scrollTop(p_TargetTop);
        }
        else if (actualTargetTop + p_MustSeeThreshold > this.get_height()) {
            this.set_scrollTop(this.get_scrollTop() + (actualTargetTop + p_MustSeeThreshold) - this.get_height());
        }
    },
    
    renderControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$renderControl() {
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea.callBase(this, 'renderControl');
        if (this._m_ScrollTarget$1.get_height() <= this.get_height()) {
            this._m_HookControl$1.set_opacity(0);
        }
        else {
            this._m_HookControl$1.set_opacity(1);
        }
        if (this._m_EnableAnimation$1) {
            this._m_ScrollAnimation$1.from = this._m_ScrollTarget$1.get_top();
            this._m_ScrollAnimation$1.to = this._m_ScrollTop$1 * -1;
            this._m_ScrollStoryboard$1.begin();
        }
        else {
            this._m_ScrollTarget$1.set_top(this._m_ScrollTop$1 * -1);
        }
    },
    
    onMouseWheel: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$onMouseWheel(p_WheelDelta) {
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea.callBase(this, 'onMouseWheel', [ p_WheelDelta ]);
        if (p_WheelDelta < 0) {
            this._scrollDown$1();
        }
        else {
            this._scrollUp$1();
        }
    },
    
    _scrollUp$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$_scrollUp$1() {
        this.set_scrollTop(this.get_scrollTop() - Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea._scrolL_MOVE_SIZE$1);
    },
    
    _scrollDown$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$_scrollDown$1() {
        this.set_scrollTop(this.get_scrollTop() + Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea._scrolL_MOVE_SIZE$1);
    },
    
    _scrollUpButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$_scrollUpButton_Click$1(p_Sender, p_Args) {
        this._scrollUp$1();
    },
    
    _scrollDownButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$_scrollDownButton_Click$1(p_Sender, p_Args) {
        this._scrollDown$1();
    },
    
    _hookControl_ProgressChange$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$_hookControl_ProgressChange$1(p_Sender, p_Args) {
        this._m_EnableAnimation$1 = false;
        try {
            var progress = (p_Sender).get_progress();
            this.set_scrollTop((this._m_ScrollTarget$1.get_height() - this.get_height()) * progress);
        }
        finally {
            this._m_EnableAnimation$1 = true;
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton

Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightAnimatedButton(p_TargetControl) {
    Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton.constructBase(this, [ p_TargetControl ]);
}
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton.prototype = {
    _m_FocusInAnimation$2: null,
    _m_FocusOutAnimation$2: null,
    _m_PressAnimation$2: null,
    _m_DepressAnimation$2: null,
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightAnimatedButton$tearDown() {
        this._m_FocusInAnimation$2 = null;
        this._m_FocusOutAnimation$2 = null;
        this._m_PressAnimation$2 = null;
        this._m_DepressAnimation$2 = null;
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton.callBase(this, 'tearDown');
    },
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightAnimatedButton$initialize() {
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton.callBase(this, 'initialize');
        this._m_FocusInAnimation$2 = this.m_TargetControl.getHost().content.findName(this.m_TargetControl.name + '_FocusInAnimation');
        this._m_FocusOutAnimation$2 = this.m_TargetControl.getHost().content.findName(this.m_TargetControl.name + '_FocusOutAnimation');
        this._m_PressAnimation$2 = this.m_TargetControl.getHost().content.findName(this.m_TargetControl.name + '_PressAnimation');
        this._m_DepressAnimation$2 = this.m_TargetControl.getHost().content.findName(this.m_TargetControl.name + '_DepressAnimation');
    },
    
    onMouseEnter: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightAnimatedButton$onMouseEnter(p_Args) {
        if (this._m_FocusInAnimation$2) {
            this._m_FocusInAnimation$2.begin();
        }
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton.callBase(this, 'onMouseEnter', [ p_Args ]);
    },
    
    onMouseLeave: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightAnimatedButton$onMouseLeave(p_Args) {
        if (this._m_FocusOutAnimation$2 && !this.m_ButtonPressed) {
            this._m_FocusOutAnimation$2.begin();
        }
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton.callBase(this, 'onMouseLeave', [ p_Args ]);
    },
    
    onMouseLeftButtonDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightAnimatedButton$onMouseLeftButtonDown(p_Args) {
        if (this._m_PressAnimation$2) {
            this._m_PressAnimation$2.begin();
        }
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton.callBase(this, 'onMouseLeftButtonDown', [ p_Args ]);
    },
    
    onMouseLeftButtonUp: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightAnimatedButton$onMouseLeftButtonUp(p_Args) {
        if (this._m_DepressAnimation$2) {
            this._m_DepressAnimation$2.begin();
        }
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton.callBase(this, 'onMouseLeftButtonUp', [ p_Args ]);
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl

Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl(p_TargetControl) {
    Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_TargetControl);
    this._m_Controls = [];
    this.m_TargetControl = p_TargetControl;
    this.initialize();
}
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl.prototype = {
    _m_DebugControl: null,
    _m_LastMouseDownTime: null,
    _m_Dragging: false,
    _m_DraggingThresholdRefX: 0,
    _m_DraggingThresholdRefY: 0,
    _m_Top: 0,
    _m_Left: 0,
    _m_Height: 0,
    _m_Width: 0,
    _m_Opacity: 0,
    _m_Visible: false,
    _m_Controls: null,
    _m_TargetMouseEnter: null,
    _m_TargetMouseLeave: null,
    _m_TargetMouseMove: null,
    _m_TargetMouseLeftButtonDown: null,
    _m_TargetMouseLeftButtonUp: null,
    _m_MouseWheel: null,
    m_MouseOver: false,
    m_MouseWheelDelta: 0,
    m_ButtonPressed: false,
    m_TargetControl: null,
    
    add_beginDrag: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$add_beginDrag(value) {
        this.__beginDrag = Delegate.combine(this.__beginDrag, value);
    },
    remove_beginDrag: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$remove_beginDrag(value) {
        this.__beginDrag = Delegate.remove(this.__beginDrag, value);
    },
    
    __beginDrag: null,
    
    add_mouseEnter: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$add_mouseEnter(value) {
        this.__mouseEnter = Delegate.combine(this.__mouseEnter, value);
    },
    remove_mouseEnter: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$remove_mouseEnter(value) {
        this.__mouseEnter = Delegate.remove(this.__mouseEnter, value);
    },
    
    __mouseEnter: null,
    
    add_mouseLeave: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$add_mouseLeave(value) {
        this.__mouseLeave = Delegate.combine(this.__mouseLeave, value);
    },
    remove_mouseLeave: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$remove_mouseLeave(value) {
        this.__mouseLeave = Delegate.remove(this.__mouseLeave, value);
    },
    
    __mouseLeave: null,
    
    add_mouseMove: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$add_mouseMove(value) {
        this.__mouseMove = Delegate.combine(this.__mouseMove, value);
    },
    remove_mouseMove: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$remove_mouseMove(value) {
        this.__mouseMove = Delegate.remove(this.__mouseMove, value);
    },
    
    __mouseMove: null,
    
    add_dragging: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$add_dragging(value) {
        this.__dragging = Delegate.combine(this.__dragging, value);
    },
    remove_dragging: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$remove_dragging(value) {
        this.__dragging = Delegate.remove(this.__dragging, value);
    },
    
    __dragging: null,
    
    add_dragDrop: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$add_dragDrop(value) {
        this.__dragDrop = Delegate.combine(this.__dragDrop, value);
    },
    remove_dragDrop: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$remove_dragDrop(value) {
        this.__dragDrop = Delegate.remove(this.__dragDrop, value);
    },
    
    __dragDrop: null,
    
    add_click: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$add_click(value) {
        this.__click = Delegate.combine(this.__click, value);
    },
    remove_click: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$remove_click(value) {
        this.__click = Delegate.remove(this.__click, value);
    },
    
    __click: null,
    
    add_doubleClick: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$add_doubleClick(value) {
        this.__doubleClick = Delegate.combine(this.__doubleClick, value);
    },
    remove_doubleClick: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$remove_doubleClick(value) {
        this.__doubleClick = Delegate.remove(this.__doubleClick, value);
    },
    
    __doubleClick: null,
    
    get_targetControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$get_targetControl() {
        return this.m_TargetControl;
    },
    
    get_controls: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$get_controls() {
        return this._m_Controls;
    },
    
    get_debugControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$get_debugControl() {
        return this._m_DebugControl;
    },
    set_debugControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$set_debugControl(value) {
        this._m_DebugControl = value;
        return value;
    },
    
    get_isDragging: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$get_isDragging() {
        return this._m_Dragging;
    },
    
    get_top: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$get_top() {
        this._m_Top = this.m_TargetControl.getValue('Canvas.Top');
        return this._m_Top;
    },
    set_top: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$set_top(value) {
        this._m_Top = value;
        this.renderControl();
        return value;
    },
    
    get_left: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$get_left() {
        this._m_Left = this.m_TargetControl.getValue('Canvas.Left');
        return this._m_Left;
    },
    set_left: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$set_left(value) {
        this._m_Left = value;
        this.renderControl();
        return value;
    },
    
    get_height: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$get_height() {
        this._m_Height = this.m_TargetControl.height;
        return this._m_Height;
    },
    set_height: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$set_height(value) {
        this._m_Height = value;
        this.renderControl();
        return value;
    },
    
    get_width: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$get_width() {
        this._m_Width = this.m_TargetControl.width;
        return this._m_Width;
    },
    set_width: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$set_width(value) {
        this._m_Width = value;
        this.renderControl();
        return value;
    },
    
    get_opacity: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$get_opacity() {
        this._m_Opacity = this.m_TargetControl.opacity;
        return this._m_Opacity;
    },
    set_opacity: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$set_opacity(value) {
        this._m_Opacity = value;
        this.renderControl();
        return value;
    },
    
    get_visible: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$get_visible() {
        this._m_Visible = this.m_TargetControl.visibility === 'Visible';
        return this._m_Visible;
    },
    set_visible: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$set_visible(value) {
        this._m_Visible = value;
        this.renderControl();
        return value;
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$tearDown() {
        window.detachEvent('onmousewheel', this._m_MouseWheel);
        this.m_TargetControl.removeEventListener('MouseEnter', this._m_TargetMouseEnter);
        this.m_TargetControl.removeEventListener('MouseLeave', this._m_TargetMouseLeave);
        this.m_TargetControl.removeEventListener('MouseMove', this._m_TargetMouseMove);
        this.m_TargetControl.removeEventListener('MouseLeftButtonDown', this._m_TargetMouseLeftButtonDown);
        this.m_TargetControl.removeEventListener('MouseLeftButtonUp', this._m_TargetMouseLeftButtonUp);
        var $enum1 = this._m_Controls.getEnumerator();
        while ($enum1.moveNext()) {
            var control = $enum1.get_current();
            control.tearDown();
        }
        this._m_DebugControl = null;
        this.m_TargetControl = null;
    },
    
    disableEvents: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$disableEvents() {
        this.m_TargetControl.isHitTestVisible = false;
    },
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$initialize() {
        this._m_Top = this.m_TargetControl.getValue('Canvas.Top');
        this._m_Left = this.m_TargetControl.getValue('Canvas.Left');
        this._m_Height = this.m_TargetControl.height;
        this._m_Width = this.m_TargetControl.width;
        this._m_Opacity = this.m_TargetControl.opacity;
        this._m_Visible = this.m_TargetControl.visibility === 'Visible';
        this._m_TargetMouseEnter = this.m_TargetControl.addEventListener('MouseEnter', Delegate.create(this, this._targetMouseEnter));
        this._m_TargetMouseLeave = this.m_TargetControl.addEventListener('MouseLeave', Delegate.create(this, this._targetMouseLeave));
        this._m_TargetMouseMove = this.m_TargetControl.addEventListener('MouseMove', Delegate.create(this, this._targetMouseMove));
        this._m_TargetMouseLeftButtonDown = this.m_TargetControl.addEventListener('MouseLeftButtonDown', Delegate.create(this, this._targetMouseLeftButtonDown));
        this._m_TargetMouseLeftButtonUp = this.m_TargetControl.addEventListener('MouseLeftButtonUp', Delegate.create(this, this._targetMouseLeftButtonUp));
        this._m_MouseWheel = Delegate.create(this, this._window_MouseWheel);
        this.m_TargetControl.getHost().attachEvent('onmousewheel', this._m_MouseWheel);
    },
    
    renderControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$renderControl() {
        this.m_TargetControl.setValue('Canvas.Top', this._m_Top);
        this.m_TargetControl.setValue('Canvas.Left', this._m_Left);
        this.m_TargetControl.height = this._m_Height;
        this.m_TargetControl.width = this._m_Width;
        this.m_TargetControl.opacity = this._m_Opacity;
        if (this._m_Visible) {
            this.m_TargetControl.visibility = 'Visible';
        }
        else {
            this.m_TargetControl.visibility = 'Collapsed';
        }
    },
    
    ensureBoudaries: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$ensureBoudaries() {
        this._m_Left = this.m_TargetControl.getValue('Canvas.Left');
        this._m_Top = this.m_TargetControl.getValue('Canvas.Top');
        this._m_Height = this.m_TargetControl.height;
        this._m_Width = this.m_TargetControl.width;
    },
    
    onClick: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$onClick(p_Args) {
        if (this.__click) {
            this.__click.invoke(this, new EventArgs());
        }
    },
    
    onDoubleClick: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$onDoubleClick(p_Args) {
        if (this.__doubleClick) {
            this.__doubleClick.invoke(this, new EventArgs());
        }
    },
    
    onMouseEnter: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$onMouseEnter(p_Args) {
        if (this.__mouseEnter) {
            this.__mouseEnter.invoke(this, p_Args);
        }
    },
    
    onMouseLeave: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$onMouseLeave(p_Args) {
        if (this.__mouseLeave) {
            this.__mouseLeave.invoke(this, p_Args);
        }
    },
    
    onMouseMove: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$onMouseMove(p_Args) {
        if (this.__mouseMove) {
            this.__mouseMove.invoke(this, p_Args);
        }
    },
    
    onMouseLeftButtonDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$onMouseLeftButtonDown(p_Args) {
    },
    
    onMouseLeftButtonUp: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$onMouseLeftButtonUp(p_Args) {
    },
    
    onBeginDrag: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$onBeginDrag(p_Args) {
        if (this.__beginDrag) {
            this.__beginDrag.invoke(this, p_Args);
        }
    },
    
    onDragging: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$onDragging(p_Args) {
        if (this.__dragging) {
            this.__dragging.invoke(this, p_Args);
        }
    },
    
    onDragDrop: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$onDragDrop(p_Args) {
        if (this.__dragDrop) {
            this.__dragDrop.invoke(this, p_Args);
        }
    },
    
    onMouseWheel: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$onMouseWheel(p_WheelDelta) {
    },
    
    _targetMouseEnter: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$_targetMouseEnter(p_Sender, p_Args) {
        this.m_MouseOver = true;
        this.onMouseEnter(p_Args);
    },
    
    _targetMouseLeave: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$_targetMouseLeave(p_Sender, p_Args) {
        this.m_MouseOver = false;
        this.onMouseLeave(p_Args);
    },
    
    _targetMouseMove: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$_targetMouseMove(p_Sender, p_Args) {
        if (this.m_ButtonPressed) {
            var wasDragging = this._m_Dragging;
            this._m_Dragging = this._m_Dragging || (Math.abs(this._m_DraggingThresholdRefX - p_Args.getPosition(this.m_TargetControl).x) >= Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl._draG_MOUSE_THRESHOLD) || (Math.abs(this._m_DraggingThresholdRefY - p_Args.getPosition(this.m_TargetControl).y) >= Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl._draG_MOUSE_THRESHOLD);
            if (this._m_Dragging) {
                if (!wasDragging) {
                    this.onBeginDrag(p_Args);
                }
                this.onDragging(p_Args);
            }
        }
        this.onMouseMove(p_Args);
    },
    
    _targetMouseLeftButtonDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$_targetMouseLeftButtonDown(p_Sender, p_Args) {
        var currentTime = new Date();
        if (this._m_LastMouseDownTime && currentTime.getTime() - this._m_LastMouseDownTime.getTime() <= 300) {
            this.onDoubleClick(p_Args);
        }
        else {
            this._m_LastMouseDownTime = currentTime;
            this.m_TargetControl.captureMouse();
            this.m_ButtonPressed = true;
            this._m_DraggingThresholdRefX = p_Args.getPosition(this.m_TargetControl).x;
            this._m_DraggingThresholdRefY = p_Args.getPosition(this.m_TargetControl).y;
            this.onMouseLeftButtonDown(p_Args);
        }
    },
    
    _targetMouseLeftButtonUp: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$_targetMouseLeftButtonUp(p_Sender, p_Args) {
        this.m_TargetControl.releaseMouseCapture();
        this.m_ButtonPressed = false;
        if (this._m_Dragging) {
            this._m_Dragging = false;
            this.onMouseLeftButtonUp(p_Args);
            this.onDragDrop(p_Args);
        }
        else if (this.m_MouseOver) {
            this.onMouseLeftButtonUp(p_Args);
            this.onClick(p_Args);
        }
    },
    
    _window_MouseWheel: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$_window_MouseWheel() {
        if (this.m_MouseOver) {
            eval('this.m_MouseWheelDelta = window.event.wheelDelta;');
            this.onMouseWheel(this.m_MouseWheelDelta);
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButton

Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButton = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightButton(p_TargetCanvas) {
    Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButton.constructBase(this, [ p_TargetCanvas ]);
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightDebug

Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightDebug = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightDebug(p_TargetControl) {
    this._m_Array$1 = [];
    Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightDebug.constructBase(this, [ p_TargetControl ]);
}
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightDebug.prototype = {
    _m_DebugText$1: null,
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightDebug$tearDown() {
        this._m_Array$1.clear();
        this._m_Array$1 = null;
        this._m_DebugText$1 = null;
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightDebug.callBase(this, 'tearDown');
    },
    
    turnOn: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightDebug$turnOn() {
        this.m_TargetControl.opacity = 0.75;
    },
    
    turnOff: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightDebug$turnOff() {
        this.m_TargetControl.opacity = 0;
    },
    
    log: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightDebug$log(p_DebugLog) {
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_DebugLog);
        this._m_Array$1.add(p_DebugLog);
        var start = 0;
        var end = this._m_Array$1.length;
        if (end > 20) {
            start = this._m_Array$1.length - 20;
        }
        var sb = new StringBuilder();
        for (var i = start; i <= end - 1; i++) {
            sb.appendLine(this._m_Array$1[i].toString());
        }
        this._m_DebugText$1.text = sb.toString();
    },
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightDebug$initialize() {
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightDebug.callBase(this, 'initialize');
        this._m_Array$1.add('Debug On...');
        this._m_DebugText$1 = this.m_TargetControl.findName('DebugText');
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_DebugText$1);
        this.m_TargetControl.opacity = 0.75;
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip

Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightExcerptTooltip(p_Target) {
    Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip.constructBase(this, [ p_Target ]);
}
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip.prototype = {
    _m_Rectangle$1: null,
    _m_Text$1: null,
    
    get_width: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightExcerptTooltip$get_width() {
        return Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip.callBase(this, 'get_width');
    },
    set_width: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightExcerptTooltip$set_width(value) {
        this._m_Rectangle$1.width = value;
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip.callBase(this, 'set_width', [ value ]);
        return value;
    },
    
    get_height: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightExcerptTooltip$get_height() {
        return Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip.callBase(this, 'get_height');
    },
    set_height: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightExcerptTooltip$set_height(value) {
        this._m_Rectangle$1.height = value;
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip.callBase(this, 'set_height', [ value ]);
        return value;
    },
    
    get_text: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightExcerptTooltip$get_text() {
        return this._m_Text$1;
    },
    set_text: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightExcerptTooltip$set_text(value) {
        this._m_Text$1 = value;
        this.renderControl();
        return value;
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightExcerptTooltip$tearDown() {
        this._m_Rectangle$1 = null;
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip.callBase(this, 'tearDown');
    },
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightExcerptTooltip$initialize() {
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip.callBase(this, 'initialize');
        this._m_Rectangle$1 = this.m_TargetControl.findName('ExcerptRect');
    },
    
    renderControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightExcerptTooltip$renderControl() {
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip.callBase(this, 'renderControl');
        (this.m_TargetControl).children.clear();
        (this.m_TargetControl).children.add(this._m_Rectangle$1);
        var xaml = '<TextBlock TextWrapping=\"Wrap\" FontFamily=\"Verdana\" FontSize=\"11\" Foreground=\"White\" Canvas.Left=\"3\" Canvas.Top=\"3\" Width=\"' + (this.m_TargetControl.width - 6) + '\" Height=\"' + (this.m_TargetControl.height - 6) + '\">' + this._m_Text$1 + '</TextBlock>';
        var textBlock = this.m_TargetControl.getHost().content.createFromXaml(xaml);
        (this.m_TargetControl).children.add(textBlock);
        var clipXaml = '<RectangleGeometry Rect=\"0, 0, ' + this.m_TargetControl.width + ', ' + this.m_TargetControl.height + '\" />';
        var clipRect = this.m_TargetControl.getHost().content.createFromXaml(clipXaml);
        (this.m_TargetControl).clip = clipRect;
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayerControl

Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayerControl = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl() {
    this._m_Concepts$1 = [];
    this._m_Utterances$1 = [];
    Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayerControl.constructBase(this);
}
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayerControl.prototype = {
    _m_UtterancesDirty$1: false,
    _m_LastSelectedUtterance$1: null,
    _m_LastHighlightUtterance$1: null,
    _m_HeadStartAsPercent$1: 0,
    _m_Loaded$1: false,
    m_LastSelectedConcept: null,
    _m_DebugControl$1: null,
    _m_UtterancesCanvas$1: null,
    _m_PlayerControls$1: null,
    _m_MediaPlayer$1: null,
    _m_PlayerControlsFadeInAnimation$1: null,
    _m_PlayerControlsFadeOutInAnimation$1: null,
    _m_ProgressTimer$1: null,
    _m_MarkerLeftTimer$1: null,
    _m_AudioVisualAnimationFadeIn$1: null,
    _m_AudioVisualAnimationFadeOut$1: null,
    _m_FullScreenHook$1: null,
    _m_TotalTimeText$1: null,
    _m_CurrentTimeText$1: null,
    _m_PlayPauseButton$1: null,
    _m_ProgressControl$1: null,
    _m_DownloadControl$1: null,
    _m_VolumeControl$1: null,
    _m_MarkersZoomButton$1: null,
    _m_MarkerContainer$1: null,
    _m_FullScreenButton$1: null,
    _m_StopButton$1: null,
    _m_NextButton$1: null,
    _m_PreviousButton$1: null,
    _m_MuteButton$1: null,
    _m_VolumeDownButton$1: null,
    _m_VolumeUpButton$1: null,
    _m_ExcerptTooltip$1: null,
    _m_ConceptsControl$1: null,
    _m_UtteranceContainer$1: null,
    _m_ScrollArea$1: null,
    _m_PlayerControls_MouseEnter$1: null,
    _m_PlayerControls_MouseLeave$1: null,
    _m_MediaPlayer_MediaOpened$1: null,
    _m_MediaPlayer_MarkerReached$1: null,
    _m_MediaPlayer_CurrentStateChanged$1: null,
    _m_MediaPlayer_BufferingProgressChanged$1: null,
    _m_MediaPlayer_DownloadProgressChanged$1: null,
    _m_MediaPlayer_MediaFailed$1: null,
    _m_ProgressTimer_Completed$1: null,
    _m_MarkerLeftTimer_Completed$1: null,
    _m_AudioVisualFadeIn_Completed$1: null,
    _m_AudioVisualFadeOut_Completed$1: null,
    _m_FullScreenButton_Click$1: null,
    _m_MarkersZoom_Click$1: null,
    _m_PlayPauseButton_Click$1: null,
    _m_StopButton_Click$1: null,
    _m_NextButton_Click$1: null,
    _m_PreviousButton_Click$1: null,
    _m_ProgressControl_ProgressChange$1: null,
    _m_MarkerContainer_UtteranceHighlighted$1: null,
    _m_MarkerContainer_UtteranceClick$1: null,
    _m_MuteButton_Click$1: null,
    _m_VolumeDownButton_Click$1: null,
    _m_VolumeUpButton_Click$1: null,
    _m_VolumeControl_ProgressChange$1: null,
    m_Control: null,
    m_MediaUri: null,
    m_MediaLength: 0,
    m_PlayerXaml: null,
    m_HeadStart: 0,
    m_PlayerWidth: 0,
    m_PlayerHeight: 0,
    m_Debug: false,
    m_SelectedConcept: null,
    m_PartialCallbackMethod: null,
    m_AudioFileOnly: false,
    m_SearchControls: null,
    m_SearchTextBox: null,
    m_SearchButton: null,
    m_Host: null,
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$initialize() {
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_SearchControls);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_Host);
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(this.m_PlayerXaml);
        if (!isSilverlightInstalled()) {
            this.m_SearchControls.style.display = 'none';
        }
        var controlParams = $create_ControlParameters(this.m_PlayerXaml, this.m_Host);
        controlParams.id = this.m_Host.id + 'SilverlightPlugIn';
        controlParams['width'] = this.m_PlayerWidth.toString();
        controlParams['height'] = this.m_PlayerHeight.toString();
        this.m_Control = createSilverlight(controlParams, Delegate.create(this, this.onSilverlightLoad));
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$tearDown() {
        if (!this.m_Control) {
            return;
        }
        this._m_PlayerControls$1.removeEventListener('MouseEnter', this._m_PlayerControls_MouseEnter$1);
        this._m_PlayerControls$1.removeEventListener('MouseLeave', this._m_PlayerControls_MouseLeave$1);
        this._m_MediaPlayer$1.stop();
        this._m_MediaPlayer$1.removeEventListener('MediaOpened', this._m_MediaPlayer_MediaOpened$1);
        this._m_MediaPlayer$1.removeEventListener('MarkerReached', this._m_MediaPlayer_MarkerReached$1);
        this._m_MediaPlayer$1.removeEventListener('CurrentStateChanged', this._m_MediaPlayer_CurrentStateChanged$1);
        this._m_MediaPlayer$1.removeEventListener('BufferingProgressChanged', this._m_MediaPlayer_BufferingProgressChanged$1);
        this._m_MediaPlayer$1.removeEventListener('DownloadProgressChanged', this._m_MediaPlayer_DownloadProgressChanged$1);
        this._m_MediaPlayer$1.removeEventListener('MediaFailed', this._m_MediaPlayer_MediaFailed$1);
        (this._m_ProgressTimer$1).removeEventListener('Completed', this._m_ProgressTimer_Completed$1);
        (this._m_MarkerLeftTimer$1).removeEventListener('Completed', this._m_MarkerLeftTimer_Completed$1);
        this._m_FullScreenButton$1.remove_click(this._m_FullScreenButton_Click$1);
        this._m_MarkersZoomButton$1.remove_click(this._m_MarkersZoom_Click$1);
        this._m_PlayPauseButton$1.remove_click(this._m_PlayPauseButton_Click$1);
        this._m_StopButton$1.remove_click(this._m_StopButton_Click$1);
        this._m_NextButton$1.remove_click(this._m_NextButton_Click$1);
        this._m_PreviousButton$1.remove_click(this._m_PreviousButton_Click$1);
        this._m_ProgressControl$1.remove_progressChange(this._m_ProgressControl_ProgressChange$1);
        this._m_MarkerContainer$1.remove_utteranceHighlighted(this._m_MarkerContainer_UtteranceHighlighted$1);
        this._m_MarkerContainer$1.remove_utteranceClick(this._m_MarkerContainer_UtteranceClick$1);
        this._m_MuteButton$1.remove_click(this._m_MuteButton_Click$1);
        this._m_VolumeDownButton$1.remove_click(this._m_VolumeDownButton_Click$1);
        this._m_VolumeUpButton$1.remove_click(this._m_VolumeUpButton_Click$1);
        this._m_VolumeControl$1.remove_progressChange(this._m_VolumeControl_ProgressChange$1);
        this.m_MediaUri = null;
        this.m_PlayerXaml = null;
        this.m_SearchControls = null;
        this.m_Host = null;
        this._m_UtterancesCanvas$1 = null;
        (this._m_ProgressTimer$1).stop();
        (this._m_MarkerLeftTimer$1).stop();
        this._m_MediaPlayer$1.source = null;
        this._m_MediaPlayer$1 = null;
        this._m_Utterances$1.clear();
        this._m_Utterances$1 = null;
        this._m_LastSelectedUtterance$1 = null;
        this._m_LastHighlightUtterance$1 = null;
        eval('this.m_Control.content.onFullScreenChange = null;');
        eval('this.m_Control.content.onResize = null;');
        this.m_Control = null;
        this._m_DebugControl$1.tearDown();
        this._m_DebugControl$1 = null;
        this._m_PlayerControls$1 = null;
        this._m_PlayerControlsFadeInAnimation$1 = null;
        this._m_PlayerControlsFadeOutInAnimation$1 = null;
        this._m_ProgressTimer$1 = null;
        this._m_MarkerLeftTimer$1 = null;
        this._m_ExcerptTooltip$1.tearDown();
        this._m_ExcerptTooltip$1 = null;
        this._m_FullScreenHook$1.tearDown();
        this._m_FullScreenHook$1 = null;
        this._m_TotalTimeText$1.tearDown();
        this._m_TotalTimeText$1 = null;
        this._m_CurrentTimeText$1.tearDown();
        this._m_CurrentTimeText$1 = null;
        this._m_PlayPauseButton$1.tearDown();
        this._m_PlayPauseButton$1 = null;
        this._m_ProgressControl$1.tearDown();
        this._m_ProgressControl$1 = null;
        this._m_DownloadControl$1.tearDown();
        this._m_DownloadControl$1 = null;
        this._m_VolumeControl$1.tearDown();
        this._m_VolumeControl$1 = null;
        this._m_MarkersZoomButton$1.tearDown();
        this._m_MarkersZoomButton$1 = null;
        this._m_MarkerContainer$1.tearDown();
        this._m_MarkerContainer$1 = null;
        this._m_FullScreenButton$1.tearDown();
        this._m_FullScreenButton$1 = null;
        this._m_StopButton$1.tearDown();
        this._m_StopButton$1 = null;
        this._m_NextButton$1.tearDown();
        this._m_NextButton$1 = null;
        this._m_PreviousButton$1.tearDown();
        this._m_PreviousButton$1 = null;
        this._m_MuteButton$1.tearDown();
        this._m_MuteButton$1 = null;
        this._m_VolumeDownButton$1.tearDown();
        this._m_VolumeDownButton$1 = null;
        this._m_VolumeUpButton$1.tearDown();
        this._m_VolumeUpButton$1 = null;
        this._m_ConceptsControl$1.tearDown();
        this._m_ConceptsControl$1 = null;
        this._m_UtteranceContainer$1.tearDown();
        this._m_UtteranceContainer$1 = null;
        this._m_ScrollArea$1.tearDown();
        this._m_ScrollArea$1 = null;
        if (this.m_AudioFileOnly) {
            (this._m_AudioVisualAnimationFadeIn$1).removeEventListener('Completed', this._m_AudioVisualFadeIn_Completed$1);
            (this._m_AudioVisualAnimationFadeOut$1).removeEventListener('Completed', this._m_AudioVisualFadeOut_Completed$1);
        }
        this._m_AudioVisualAnimationFadeIn$1 = null;
        this._m_AudioVisualAnimationFadeOut$1 = null;
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayerControl.callBase(this, 'tearDown');
    },
    
    addConcept: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$addConcept(p_Concept) {
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Concept);
        this._m_Concepts$1.add(p_Concept);
    },
    
    addUtterance: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$addUtterance(p_Start, p_Percent, p_Excerpt) {
        Coveo.CNL.Web.Scripts.CNLAssert.check(p_Start >= 0);
        Coveo.CNL.Web.Scripts.CNLAssert.check(p_Percent >= 0 && p_Percent <= 1);
        Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Excerpt);
        this._m_Utterances$1.add(new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtterance(p_Start, p_Percent, p_Excerpt));
    },
    
    onSilverlightLoad: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$onSilverlightLoad(p_Control, p_UserContext) {
        if (this._m_Loaded$1) {
            return;
        }
        this.m_Control = p_Control;
        eval('this.m_Control.content.onFullScreenChange = Delegate.create(this, this.control_FullScreenChange);');
        eval('this.m_Control.content.onResize = Delegate.create(this, this.control_Resize);');
        this._m_DebugControl$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightDebug(this.m_Control.content.findName('Debug'));
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_DebugControl$1);
        if (this.m_Debug) {
            this._m_DebugControl$1.turnOn();
        }
        else {
            this._m_DebugControl$1.turnOff();
        }
        this._m_UtterancesCanvas$1 = this.m_Control.content.findName('Utterances');
        this._m_UtteranceContainer$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextContainer(this.m_Control.content.findName('UtteranceContainer'));
        this._m_UtteranceContainer$1.add_textEntryClick(Delegate.create(this, this._utteranceContainer_UtteranceClick$1));
        this._m_ConceptsControl$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextContainer(this.m_Control.content.findName('Concepts'));
        this._m_ConceptsControl$1.add_textEntryClick(Delegate.create(this, this._conceptsControl_TextEntryClick$1));
        this._m_ScrollArea$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea(this.m_Control.content.findName('UtterancesScrollArea'));
        this._m_ScrollArea$1.set_scrollBarControlName('UtterancesScrollBar');
        this._m_ScrollArea$1.set_scrollUpButtonName('UtterancesUpButton');
        this._m_ScrollArea$1.set_scrollDownButtonName('UtterancesDownButton');
        this._m_ScrollArea$1.set_scrollHookThumbControlName('UtterancesThumb');
        this._m_ScrollArea$1.set_scrollHookControlName('UtterancesScrollHook');
        this._m_ScrollArea$1.set_scrollTarget(this._m_UtteranceContainer$1);
        this._m_PlayerControls$1 = this.m_Control.content.findName('PlayerControls');
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_PlayerControls$1);
        this._m_PlayerControls_MouseEnter$1 = this._m_PlayerControls$1.addEventListener('MouseEnter', Delegate.create(this, this._playerControls_MouseEnter$1));
        this._m_PlayerControls_MouseLeave$1 = this._m_PlayerControls$1.addEventListener('MouseLeave', Delegate.create(this, this._playerControls_MouseLeave$1));
        this._m_PlayerControlsFadeInAnimation$1 = this.m_Control.content.findName('PlayerControlsFadeIn');
        this._m_PlayerControlsFadeOutInAnimation$1 = this.m_Control.content.findName('PlayerControlsFadeOut');
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_PlayerControlsFadeInAnimation$1);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_PlayerControlsFadeOutInAnimation$1);
        this._m_FullScreenButton$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButton(this.m_Control.content.findName('FullScreenButton'));
        this._m_FullScreenButton_Click$1 = Delegate.create(this, this._fullScreenButton_Click$1);
        this._m_FullScreenButton$1.add_click(this._m_FullScreenButton_Click$1);
        this._m_MarkersZoomButton$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightSymbolButton(this.m_Control.content.findName('MarkerZoomButton'));
        this._m_MarkersZoomButton$1.set_state(Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButtonState.grayed);
        this._m_MarkersZoom_Click$1 = Delegate.create(this, this._markersZoom_Click$1);
        this._m_MarkersZoomButton$1.add_click(this._m_MarkersZoom_Click$1);
        this._m_FullScreenHook$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl(this.m_Control.content.findName('PlayerCanvas'));
        this._m_FullScreenHook$1.add_doubleClick(Delegate.create(this, this._fullScreenHook_DoubleClick$1));
        this._m_MediaPlayer$1 = this.m_Control.content.findName('MediaPlayer');
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_MediaPlayer$1);
        this._m_MediaPlayer_MediaOpened$1 = this._m_MediaPlayer$1.addEventListener('MediaOpened', Delegate.create(this, this._mediaPlayer_MediaOpened$1));
        this._m_MediaPlayer_MarkerReached$1 = this._m_MediaPlayer$1.addEventListener('MarkerReached', Delegate.create(this, this._mediaPlayer_MarkerReached$1));
        this._m_MediaPlayer_CurrentStateChanged$1 = this._m_MediaPlayer$1.addEventListener('CurrentStateChanged', Delegate.create(this, this._mediaPlayer_CurrentStateChanged$1));
        this._m_MediaPlayer_BufferingProgressChanged$1 = this._m_MediaPlayer$1.addEventListener('BufferingProgressChanged', Delegate.create(this, this._mediaPlayer_BufferingProgressChanged$1));
        this._m_MediaPlayer_DownloadProgressChanged$1 = this._m_MediaPlayer$1.addEventListener('DownloadProgressChanged', Delegate.create(this, this._mediaPlayer_DownloadProgressChanged$1));
        this._m_MediaPlayer_MediaFailed$1 = this._m_MediaPlayer$1.addEventListener('MediaFailed', Delegate.create(this, this._mediaPlayer_MediaFailed$1));
        this._m_ProgressTimer$1 = this.m_Control.content.findName('ProgressTimer');
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_ProgressTimer$1);
        this._m_ProgressTimer_Completed$1 = (this._m_ProgressTimer$1).addEventListener('Completed', Delegate.create(this, this._progressTimer_Completed$1));
        this._m_MarkerLeftTimer$1 = this.m_Control.content.findName('MarkerLeftTimer');
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_MarkerLeftTimer$1);
        this._m_MarkerLeftTimer_Completed$1 = (this._m_MarkerLeftTimer$1).addEventListener('Completed', Delegate.create(this, this._markerLeftTimer_Completed$1));
        this._m_TotalTimeText$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextTime(this.m_Control.content.findName('TotalTimeText'));
        this._m_CurrentTimeText$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextTime(this.m_Control.content.findName('CurrentTimeText'));
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_TotalTimeText$1);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_CurrentTimeText$1);
        this._m_PlayPauseButton$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButton(this.m_Control.content.findName('PlayPauseButton'));
        this._m_PlayPauseButton_Click$1 = Delegate.create(this, this._playPauseButton_Click$1);
        this._m_PlayPauseButton$1.add_click(this._m_PlayPauseButton_Click$1);
        this._m_StopButton$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton(this.m_Control.content.findName('StopButton'));
        this._m_StopButton_Click$1 = Delegate.create(this, this._stopButton_Click$1);
        this._m_StopButton$1.add_click(this._m_StopButton_Click$1);
        this._m_NextButton$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton(this.m_Control.content.findName('NextButton'));
        this._m_NextButton_Click$1 = Delegate.create(this, this._nextButton_Click$1);
        this._m_NextButton$1.add_click(this._m_NextButton_Click$1);
        this._m_PreviousButton$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton(this.m_Control.content.findName('PreviousButton'));
        this._m_PreviousButton_Click$1 = Delegate.create(this, this._previousButton_Click$1);
        this._m_PreviousButton$1.add_click(this._m_PreviousButton_Click$1);
        this._m_ProgressControl$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress(this.m_Control.content.findName('Timeline'));
        this._m_ProgressControl$1.set_highlightControlName('TimeSlider_Highlight');
        this._m_ProgressControl$1.set_thumbControlName('TimeThumb');
        this._m_ProgressControl$1.set_progress(0);
        this._m_ProgressControl_ProgressChange$1 = Delegate.create(this, this._progressControl_ProgressChange$1);
        this._m_ProgressControl$1.add_progressChange(this._m_ProgressControl_ProgressChange$1);
        this._m_DownloadControl$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress(this.m_Control.content.findName('DownloadProgressSlider'));
        this._m_DownloadControl$1.set_highlightControlName('DownloadProgressSlider_Highlight');
        this._m_DownloadControl$1.set_progress(0);
        this._m_MarkerContainer$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer(this.m_Control.content.findName('Timeline_MarkerContainer'));
        this._m_MarkerContainer$1.set_zoomOnMarkerConflict(false);
        this._m_MarkerContainer_UtteranceHighlighted$1 = Delegate.create(this, this._markerContainer_UtteranceHighlighted$1);
        this._m_MarkerContainer$1.add_utteranceHighlighted(this._m_MarkerContainer_UtteranceHighlighted$1);
        this._m_MarkerContainer_UtteranceClick$1 = Delegate.create(this, this._markerContainer_UtteranceClick$1);
        this._m_MarkerContainer$1.add_utteranceClick(this._m_MarkerContainer_UtteranceClick$1);
        this._m_MarkerContainer$1.set_debugControl(this._m_DebugControl$1);
        this._m_ExcerptTooltip$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip(this.m_Control.content.findName('Excerpt'));
        this._m_MuteButton$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButton(this.m_Control.content.findName('MuteButton'));
        this._m_MuteButton_Click$1 = Delegate.create(this, this._muteButton_Click$1);
        this._m_MuteButton$1.add_click(this._m_MuteButton_Click$1);
        this._m_VolumeDownButton$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton(this.m_Control.content.findName('VolumeDownButton'));
        this._m_VolumeDownButton_Click$1 = Delegate.create(this, this._volumeDownButton_Click$1);
        this._m_VolumeDownButton$1.add_click(this._m_VolumeDownButton_Click$1);
        this._m_VolumeUpButton$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton(this.m_Control.content.findName('VolumeUpButton'));
        this._m_VolumeUpButton_Click$1 = Delegate.create(this, this._volumeUpButton_Click$1);
        this._m_VolumeUpButton$1.add_click(this._m_VolumeUpButton_Click$1);
        this._m_VolumeControl$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress(this.m_Control.content.findName('VolumeSliderHook'));
        this._m_VolumeControl$1.set_thumbControlName('VolumeThumb');
        this._m_VolumeControl_ProgressChange$1 = Delegate.create(this, this._volumeControl_ProgressChange$1);
        this._m_VolumeControl$1.add_progressChange(this._m_VolumeControl_ProgressChange$1);
        this._m_ConceptsControl$1.beginUpdate();
        try {
            var $enum1 = this._m_Concepts$1.getEnumerator();
            while ($enum1.moveNext()) {
                var concept = $enum1.get_current();
                var entry = this._m_ConceptsControl$1.addSeparatorTextEntry(concept, null, concept === this.m_SelectedConcept);
                if (concept === this.m_SelectedConcept) {
                    this.m_LastSelectedConcept = entry;
                }
            }
        }
        finally {
            this._m_ConceptsControl$1.endUpdate();
        }
        if (this.m_AudioFileOnly) {
            this._m_AudioVisualAnimationFadeIn$1 = this.m_Control.content.findName('AudioVisualAnimationFadeIn');
            this._m_AudioVisualAnimationFadeOut$1 = this.m_Control.content.findName('AudioVisualAnimationFadeOut');
            Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_AudioVisualAnimationFadeIn$1);
            Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_AudioVisualAnimationFadeOut$1);
            this._m_AudioVisualFadeIn_Completed$1 = (this._m_AudioVisualAnimationFadeIn$1).addEventListener('Completed', Delegate.create(this, this._audioVisualFadeIn_Completed$1));
            this._m_AudioVisualFadeOut_Completed$1 = (this._m_AudioVisualAnimationFadeOut$1).addEventListener('Completed', Delegate.create(this, this._audioVisualFadeOut_Completed$1));
            (this.m_Control.content.findName('AudioVisual')).visibility = 'Visible';
            this._m_PlayerControls$1.opacity = 1;
        }
        this._m_MediaPlayer$1.source = this.m_MediaUri;
        this._m_Loaded$1 = true;
    },
    
    control_FullScreenChange: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$control_FullScreenChange(p_Sender, p_Args) {
        this._resize$1();
    },
    
    control_Resize: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$control_Resize(p_Sender, p_Args) {
        this._resize$1();
    },
    
    changeConcept: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$changeConcept(p_Concept, p_Callback) {
        Coveo.CNL.Web.Scripts.CNLAssert.fail();
    },
    
    _feedMarkersUtterances$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_feedMarkersUtterances$1() {
        this._m_LastHighlightUtterance$1 = null;
        this._m_LastSelectedUtterance$1 = null;
        this._m_UtteranceContainer$1.clear();
        this._m_MarkerContainer$1.clear();
        this._m_MediaPlayer$1.markers.clear();
        this._m_UtteranceContainer$1.beginUpdate();
        try {
            for (var i = 0; i <= this._m_Utterances$1.length - 1; i++) {
                var utterance = this._m_Utterances$1[i];
                var datetime = new Date(0, 0, 0, 0, 0, utterance.get_start());
                var xaml = '<TimelineMarker Time=\'' + datetime.getHours().toString() + ':' + datetime.getMinutes().toString() + ':' + datetime.getSeconds().toString() + '\' Type=\'CESMarker\' Text=\'' + i + '\' />';
                var newMarker = this.m_Control.content.createFromXaml(xaml);
                this._m_MediaPlayer$1.markers.add(newMarker);
                this._m_MarkerContainer$1.addNewTimeLineMarker(utterance);
                utterance.set_data(this._m_UtteranceContainer$1.addUtteranceTextEntry(utterance.get_excerpt(), utterance, false));
            }
        }
        finally {
            this._m_UtteranceContainer$1.endUpdate();
        }
        this._m_ScrollArea$1.set_scrollTop(0);
    },
    
    _resize$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_resize$1() {
        var m_FullScreenScale = this.m_Control.content.findName('FullScreenScale');
        var m_ControlsFullScreenScale = this.m_Control.content.findName('ControlsFullScreenScale');
        var controlScale = 1;
        this._m_UtterancesCanvas$1.width = Math.min(360, this.m_Control.content.actualWidth / 2);
        this._m_UtterancesCanvas$1.setValue('Canvas.Left', this.m_Control.content.actualWidth - this._m_UtterancesCanvas$1.width);
        this._m_UtterancesCanvas$1.height = this.m_Control.content.actualHeight;
        var uttRect = this.m_Control.content.findName('UtterancesRect');
        uttRect.height = this.m_Control.content.actualHeight;
        uttRect.width = this._m_UtterancesCanvas$1.width;
        var conceptArea = this.m_Control.content.findName('ConceptsArea');
        conceptArea.width = this._m_UtterancesCanvas$1.width;
        var conceptRect = this.m_Control.content.findName('ConceptsAreaRect');
        conceptRect.width = conceptArea.width - (conceptRect.getValue('Canvas.Left') * 2);
        var xaml = '<RectangleGeometry Rect=\"' + conceptRect.getValue('Canvas.Left') + ', ' + conceptRect.getValue('Canvas.Top') + ', ' + conceptRect.width + ', ' + conceptRect.height + '\" RadiusX=\"' + conceptRect.radiusX + '\" RadiusY=\"' + conceptRect.radiusY + '\" />';
        var clip = this.m_Control.content.createFromXaml(xaml);
        conceptArea.clip = clip;
        this._m_ConceptsControl$1.set_width(this._m_UtterancesCanvas$1.width - (this._m_ConceptsControl$1.get_left() * 2));
        var rectTop = conceptRect.getValue('Canvas.Top');
        if (this._m_ConceptsControl$1.get_height() < conceptRect.height + 4) {
            this._m_ConceptsControl$1.set_top(rectTop + (((conceptRect.height + 4) - this._m_ConceptsControl$1.get_height()) / 2));
        }
        else {
            this._m_ConceptsControl$1.set_top(rectTop + 2);
        }
        this._m_ScrollArea$1.set_height(this.m_Control.content.actualHeight - conceptArea.height - 10);
        this._m_ScrollArea$1.set_width(this._m_UtterancesCanvas$1.width);
        this._m_UtteranceContainer$1.set_width((this.m_Control.content.findName('UtterancesScrollBar')).getValue('Canvas.Left') - (this._m_UtteranceContainer$1.get_left() * 2));
        if (this._m_LastSelectedUtterance$1) {
            this._m_ScrollArea$1.set_scrollTop(this._m_LastSelectedUtterance$1.get_top());
        }
        else {
            this._m_ScrollArea$1.set_scrollTop(0);
        }
        if (this.m_PlayerHeight !== 480 || this.m_PlayerWidth !== 1005 || this.m_Control.content.fullScreen) {
            (m_FullScreenScale).scaleX = (this.m_Control.content.actualWidth - this._m_UtterancesCanvas$1.width) / 640;
            (m_FullScreenScale).scaleY = this.m_Control.content.actualHeight / 480;
            if (this._m_PlayerControls$1.width <= (this._m_MediaPlayer$1.width * (m_FullScreenScale).scaleX)) {
                (m_ControlsFullScreenScale).scaleX = 1;
                (m_ControlsFullScreenScale).scaleY = 1;
            }
            else {
                controlScale = (this._m_MediaPlayer$1.width * (m_FullScreenScale).scaleX) / this._m_PlayerControls$1.width;
                (m_ControlsFullScreenScale).scaleX = controlScale;
                (m_ControlsFullScreenScale).scaleY = controlScale;
            }
        }
        else {
            (m_FullScreenScale).scaleX = 1;
            (m_FullScreenScale).scaleY = 1;
            (m_ControlsFullScreenScale).scaleX = 1;
            (m_ControlsFullScreenScale).scaleY = 1;
        }
        this._m_PlayerControls$1.setValue('Canvas.Left', ((this._m_MediaPlayer$1.width * (m_FullScreenScale).scaleX) - (this._m_PlayerControls$1.width * controlScale)) / 2);
        this._m_PlayerControls$1.setValue('Canvas.Top', this._m_MediaPlayer$1.getValue('Canvas.Top') + (this._m_MediaPlayer$1.height * (m_FullScreenScale).scaleY) - (this._m_PlayerControls$1.height * controlScale));
        this._m_ExcerptTooltip$1.set_left(this._m_MediaPlayer$1.getValue('Canvas.Left') + 5);
        this._m_ExcerptTooltip$1.set_width((this._m_MediaPlayer$1.width * (m_FullScreenScale).scaleX) - 10);
        this._m_ExcerptTooltip$1.set_top(this._m_PlayerControls$1.getValue('Canvas.Top') - 60);
    },
    
    _getMediaNaturalDuration$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_getMediaNaturalDuration$1() {
        var result = 0;
        var naturalDuration = this._m_MediaPlayer$1.getValue('NaturalDuration');
        if (naturalDuration) {
            var durationHack = (naturalDuration).getValue('seconds');
            result = durationHack;
        }
        return result;
    },
    
    _getMediaPosition$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_getMediaPosition$1() {
        var position = this._m_MediaPlayer$1.getValue('Position');
        var positionHack = (position).getValue('seconds');
        return positionHack;
    },
    
    _changeMediaPlayerPosition$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_changeMediaPlayerPosition$1(p_newTime) {
        if (p_newTime <= this._getMediaNaturalDuration$1()) {
            var newTimeHack = this._m_MediaPlayer$1.getValue('Position');
            (newTimeHack).setValue('seconds', p_newTime);
            this._m_MediaPlayer$1.setValue('Position', newTimeHack);
        }
    },
    
    _getCurrentUtteranceIndex$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_getCurrentUtteranceIndex$1(p_IncludeHeadStartTolerance) {
        var seconds = this._getMediaPosition$1();
        if (p_IncludeHeadStartTolerance) {
            seconds = Math.min(seconds + this.m_HeadStart, this.m_MediaLength);
        }
        var result = -1;
        for (var i = 0; i <= this._m_Utterances$1.length - 1; i++) {
            var utterance = this._m_Utterances$1[i];
            if (utterance.get_start() < seconds) {
                result = i;
            }
            else {
                break;
            }
        }
        return result;
    },
    
    _getCurrentUtterance$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_getCurrentUtterance$1() {
        var result = null;
        var index = this._getCurrentUtteranceIndex$1(false);
        if (index > -1) {
            result = this._m_Utterances$1[index];
        }
        return result;
    },
    
    _handleMarkerReached$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_handleMarkerReached$1(p_Utterance) {
        if (this._m_LastSelectedUtterance$1) {
            this._m_LastSelectedUtterance$1.set_selected(false);
        }
        if (p_Utterance) {
            var text = p_Utterance.get_data();
            text.set_selected(true);
            this._m_ScrollArea$1.scrollTo(text.get_top(), text.get_height());
            this._m_LastSelectedUtterance$1 = text;
        }
    },
    
    _handleUtteranceClick$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_handleUtteranceClick$1(p_Utterance) {
        this._m_UtterancesDirty$1 = true;
        if (p_Utterance) {
            this._m_ProgressControl$1.set_progress(Math.max(0, p_Utterance.get_percent() - this._m_HeadStartAsPercent$1));
        }
        this._handleMarkerReached$1(p_Utterance);
    },
    
    _mediaPlayer_CurrentStateChanged$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_mediaPlayer_CurrentStateChanged$1(p_Sender, p_Args) {
        if (this._m_MediaPlayer$1.currentState === 'Playing') {
            (this._m_ProgressTimer$1).begin();
            this._m_PlayPauseButton$1.set_mode(Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButtonMode.pause);
            if (this.m_AudioFileOnly) {
                (this._m_AudioVisualAnimationFadeIn$1).begin();
            }
        }
        else {
            (this._m_ProgressTimer$1).stop();
            if (this.m_AudioFileOnly) {
                (this._m_AudioVisualAnimationFadeIn$1).stop();
                (this._m_AudioVisualAnimationFadeOut$1).stop();
            }
            this._m_PlayPauseButton$1.set_mode(Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButtonMode.play);
            if (this._m_MediaPlayer$1.currentState === 'Stopped') {
                this._m_ProgressControl$1.updateProgress(0);
                this._m_CurrentTimeText$1.set_seconds(0);
                this._handleMarkerReached$1(null);
            }
        }
    },
    
    _mediaPlayer_BufferingProgressChanged$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_mediaPlayer_BufferingProgressChanged$1(p_Sender, p_Args) {
        if (!this._m_UtterancesDirty$1 && (this._m_Utterances$1.length > 0)) {
        }
    },
    
    _mediaPlayer_DownloadProgressChanged$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_mediaPlayer_DownloadProgressChanged$1(p_Sender, p_Args) {
        this._m_DownloadControl$1.set_progress(this._m_MediaPlayer$1.downloadProgress);
        if (!this._m_UtterancesDirty$1 && (this._m_Utterances$1.length > 0) && (((this._m_Utterances$1[0]).get_percent() * 1.05) < this._m_MediaPlayer$1.downloadProgress)) {
        }
    },
    
    _audioVisualFadeIn_Completed$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_audioVisualFadeIn_Completed$1(p_Sender, p_Args) {
        Coveo.CNL.Web.Scripts.CNLAssert.check(this.m_AudioFileOnly);
        if (this._m_MediaPlayer$1.currentState === 'Playing') {
            (this._m_AudioVisualAnimationFadeOut$1).begin();
        }
    },
    
    _audioVisualFadeOut_Completed$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_audioVisualFadeOut_Completed$1(p_Sender, p_Args) {
        Coveo.CNL.Web.Scripts.CNLAssert.check(this.m_AudioFileOnly);
        if (this._m_MediaPlayer$1.currentState === 'Playing') {
            (this._m_AudioVisualAnimationFadeIn$1).begin();
        }
    },
    
    _progressTimer_Completed$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_progressTimer_Completed$1(p_Sender, p_Args) {
        if (this._m_MediaPlayer$1.currentState === 'Playing') {
            var seconds = this._getMediaPosition$1();
            this._m_ProgressControl$1.updateProgress(seconds / this.m_MediaLength);
            this._m_CurrentTimeText$1.set_seconds(seconds);
            (this._m_ProgressTimer$1).begin();
        }
    },
    
    _fullScreenHook_DoubleClick$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_fullScreenHook_DoubleClick$1(sender, e) {
        this.m_Control.content.fullScreen = !this.m_Control.content.fullScreen;
    },
    
    _fullScreenButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_fullScreenButton_Click$1(p_Sender, p_Args) {
        this.m_Control.content.fullScreen = !this.m_Control.content.fullScreen;
    },
    
    _markersZoom_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_markersZoom_Click$1(p_Sender, p_Args) {
        this._m_MarkerContainer$1.set_zoomOnMarkerConflict(!this._m_MarkerContainer$1.get_zoomOnMarkerConflict());
        if (this._m_MarkerContainer$1.get_zoomOnMarkerConflict()) {
            this._m_MarkersZoomButton$1.set_state(Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButtonState.enabled);
        }
        else {
            this._m_MarkersZoomButton$1.set_state(Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButtonState.grayed);
        }
    },
    
    _volumeControl_ProgressChange$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_volumeControl_ProgressChange$1(p_Sender, p_Args) {
        this._m_MediaPlayer$1.volume = (p_Sender).get_progress();
    },
    
    _volumeUpButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_volumeUpButton_Click$1(p_Sender, p_Args) {
        var newVolume = this._m_MediaPlayer$1.volume + 0.05;
        this._m_VolumeControl$1.set_progress(Math.min(newVolume, 1));
    },
    
    _volumeDownButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_volumeDownButton_Click$1(p_Sender, p_Args) {
        var newVolume = this._m_MediaPlayer$1.volume - 0.05;
        this._m_VolumeControl$1.set_progress(Math.max(newVolume, 0));
    },
    
    _muteButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_muteButton_Click$1(p_Sender, p_Args) {
        if (this._m_MediaPlayer$1.isMuted) {
            this._m_MediaPlayer$1.isMuted = false;
            (this.m_Control.content.findName('MuteOffSymbol')).opacity = 1;
        }
        else {
            this._m_MediaPlayer$1.isMuted = true;
            (this.m_Control.content.findName('MuteOffSymbol')).opacity = 0;
        }
    },
    
    _progressControl_ProgressChange$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_progressControl_ProgressChange$1(p_Sender, p_Args) {
        var newTime = (p_Sender).get_progress() * this.m_MediaLength;
        this._changeMediaPlayerPosition$1(newTime);
        this._handleMarkerReached$1(this._getCurrentUtterance$1());
    },
    
    _previousButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_previousButton_Click$1(p_Sender, p_Args) {
        if (this._m_MediaPlayer$1.currentState === 'Buffering') {
            return;
        }
        var currentIndex = this._getCurrentUtteranceIndex$1(true);
        if (currentIndex >= 1) {
            this._handleUtteranceClick$1(this._m_Utterances$1[currentIndex - 1]);
        }
    },
    
    _nextButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_nextButton_Click$1(p_Sender, p_Args) {
        if (this._m_MediaPlayer$1.currentState === 'Buffering') {
            return;
        }
        var currentIndex = this._getCurrentUtteranceIndex$1(true);
        if (currentIndex < this._m_Utterances$1.length - 1) {
            this._handleUtteranceClick$1(this._m_Utterances$1[currentIndex + 1]);
        }
    },
    
    _stopButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_stopButton_Click$1(p_Sender, p_Args) {
        if ((this._m_MediaPlayer$1.currentState === 'Playing') || (this._m_MediaPlayer$1.currentState === 'Paused') || (this._m_MediaPlayer$1.currentState === 'Buffering')) {
            this._m_MediaPlayer$1.stop();
        }
    },
    
    _playPauseButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_playPauseButton_Click$1(p_Sender, p_Args) {
        if (this._m_MediaPlayer$1.currentState === 'Playing') {
            this._m_MediaPlayer$1.pause();
        }
        else {
            this._m_MediaPlayer$1.play();
        }
    },
    
    _playerControls_MouseEnter$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_playerControls_MouseEnter$1(p_Sender, p_Args) {
        if (!this.m_AudioFileOnly) {
            (this._m_PlayerControlsFadeInAnimation$1).begin();
        }
    },
    
    _playerControls_MouseLeave$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_playerControls_MouseLeave$1(p_Sender, p_Args) {
        if (!this.m_AudioFileOnly) {
            (this._m_PlayerControlsFadeOutInAnimation$1).begin();
        }
    },
    
    _mediaPlayer_MediaFailed$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_mediaPlayer_MediaFailed$1(p_Sender, p_Args) {
        alert(Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayerControl.unablE_TO_PLAY_ERROR);
    },
    
    _mediaPlayer_MediaOpened$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_mediaPlayer_MediaOpened$1(p_Sender, p_Args) {
        var totalSeconds = this.m_MediaLength;
        this._m_TotalTimeText$1.set_seconds(totalSeconds);
        this._m_HeadStartAsPercent$1 = 0;
        if (totalSeconds > 0) {
            this._m_HeadStartAsPercent$1 = this.m_HeadStart / totalSeconds;
        }
        this._m_VolumeControl$1.set_progress(this._m_MediaPlayer$1.volume);
        this._feedMarkersUtterances$1();
        this._m_MediaPlayer$1.play();
    },
    
    _mediaPlayer_MarkerReached$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_mediaPlayer_MarkerReached$1(p_Sender, p_Args) {
        var marker = p_Args.marker.text;
        this._handleMarkerReached$1(this._m_Utterances$1[marker]);
    },
    
    _conceptsControl_TextEntryClick$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_conceptsControl_TextEntryClick$1(p_Sender, p_Args) {
        this.m_SearchTextBox.setAttribute('value', p_Args.textEntry.get_text());
        if (this.m_LastSelectedConcept) {
            this.m_LastSelectedConcept.set_selected(false);
        }
        p_Args.textEntry.set_selected(true);
        this.m_LastSelectedConcept = p_Args.textEntry;
        this.changeConcept(p_Args.textEntry.get_text(), Delegate.create(this, this._conceptChanged$1));
    },
    
    _conceptChanged$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_conceptChanged$1(p_ReturnValue) {
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_ReturnValue);
        this._m_Utterances$1.clear();
        var xml = p_ReturnValue;
        var nodes = xml.selectSingleNode('Utterances').childNodes;
        for (var i = 0; i < nodes.length; i++) {
            var node = nodes[i];
            this.addUtterance(Number.parse((node.attributes.getNamedItem('Start')).value), Number.parse((node.attributes.getNamedItem('Percent')).value), (node.attributes.getNamedItem('Excerpt')).value);
        }
        this._feedMarkersUtterances$1();
    },
    
    _utteranceContainer_UtteranceClick$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_utteranceContainer_UtteranceClick$1(p_Sender, p_Args) {
        this._handleUtteranceClick$1(p_Args.textEntry.get_data());
    },
    
    _markerLeftTimer_Completed$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_markerLeftTimer_Completed$1(p_Sender, p_Args) {
        if (this._m_LastSelectedUtterance$1) {
            this._m_ScrollArea$1.scrollTo(this._m_LastSelectedUtterance$1.get_top(), this._m_LastSelectedUtterance$1.get_height());
        }
    },
    
    _markerContainer_UtteranceClick$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_markerContainer_UtteranceClick$1(p_Sender, p_Args) {
        this._handleUtteranceClick$1(p_Args);
    },
    
    _markerContainer_UtteranceHighlighted$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_markerContainer_UtteranceHighlighted$1(p_Sender, p_Args) {
        (this._m_MarkerLeftTimer$1).stop();
        if (p_Args) {
            var text = p_Args.get_data();
            this._m_ScrollArea$1.scrollTo(text.get_top(), text.get_height());
            text.highlight();
            this._m_LastHighlightUtterance$1 = text;
            this._m_ExcerptTooltip$1.set_text(p_Args.get_excerpt());
            this._m_ExcerptTooltip$1.set_visible(true);
        }
        else {
            if (this._m_LastSelectedUtterance$1) {
                (this._m_MarkerLeftTimer$1).begin();
            }
            if (this._m_LastHighlightUtterance$1) {
                this._m_LastHighlightUtterance$1.undoHighlight();
                this._m_LastHighlightUtterance$1 = null;
            }
            this._m_ExcerptTooltip$1.set_visible(false);
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButton

Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButton = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayPauseButton(p_TargetControl) {
    this._m_Mode$3 = Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButtonMode.play;
    Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButton.constructBase(this, [ p_TargetControl ]);
}
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButton.prototype = {
    _m_PlaySymbol$3: null,
    _m_PauseSymbol$3: null,
    
    get_mode: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayPauseButton$get_mode() {
        return this._m_Mode$3;
    },
    set_mode: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayPauseButton$set_mode(value) {
        this._m_Mode$3 = value;
        this.renderControl();
        return value;
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayPauseButton$tearDown() {
        this._m_PlaySymbol$3 = null;
        this._m_PauseSymbol$3 = null;
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButton.callBase(this, 'tearDown');
    },
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayPauseButton$initialize() {
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButton.callBase(this, 'initialize');
        this._m_PlaySymbol$3 = this.m_TargetControl.findName('PlaySymbol');
        this._m_PauseSymbol$3 = this.m_TargetControl.findName('PauseSymbol');
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_PlaySymbol$3);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_PauseSymbol$3);
    },
    
    renderControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayPauseButton$renderControl() {
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButton.callBase(this, 'renderControl');
        if (this._m_Mode$3 === Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButtonMode.play) {
            this._m_PlaySymbol$3.opacity = 1;
            this._m_PauseSymbol$3.opacity = 0;
        }
        else if (this._m_Mode$3 === Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButtonMode.pause) {
            this._m_PlaySymbol$3.opacity = 0;
            this._m_PauseSymbol$3.opacity = 1;
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress

Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress(p_TargetControl) {
    this._m_Orientation$1 = Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation.horizontal;
    Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress.constructBase(this, [ p_TargetControl ]);
}
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress.prototype = {
    _m_ThumbControlName$1: null,
    _m_HighlightControlName$1: null,
    _m_ProgressWhileDraggingThumb$1: false,
    _m_Progress$1: 0,
    _m_Thumb$1: null,
    _m_Highlight$1: null,
    _m_Thumb_Dragging$1: null,
    _m_Thumb_DragDrop$1: null,
    
    add_progressChange: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$add_progressChange(value) {
        this.__progressChange$1 = Delegate.combine(this.__progressChange$1, value);
    },
    remove_progressChange: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$remove_progressChange(value) {
        this.__progressChange$1 = Delegate.remove(this.__progressChange$1, value);
    },
    
    __progressChange$1: null,
    
    get_thumbControlName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$get_thumbControlName() {
        return this._m_ThumbControlName$1;
    },
    set_thumbControlName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$set_thumbControlName(value) {
        this._m_ThumbControlName$1 = value;
        this._m_Thumb$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton(this.m_TargetControl.findName(this._m_ThumbControlName$1));
        this._m_Thumb_Dragging$1 = Delegate.create(this, this._thumb_Dragging$1);
        this._m_Thumb$1.add_dragging(this._m_Thumb_Dragging$1);
        this._m_Thumb_DragDrop$1 = Delegate.create(this, this._thumb_DragDrop$1);
        this._m_Thumb$1.add_dragDrop(this._m_Thumb_DragDrop$1);
        return value;
    },
    
    get_highlightControlName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$get_highlightControlName() {
        return this._m_HighlightControlName$1;
    },
    set_highlightControlName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$set_highlightControlName(value) {
        this._m_HighlightControlName$1 = value;
        this._m_Highlight$1 = this.m_TargetControl.findName(this._m_HighlightControlName$1);
        return value;
    },
    
    get_orientation: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$get_orientation() {
        return this._m_Orientation$1;
    },
    set_orientation: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$set_orientation(value) {
        this._m_Orientation$1 = value;
        return value;
    },
    
    get_progressWhileDraggingThumb: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$get_progressWhileDraggingThumb() {
        return this._m_ProgressWhileDraggingThumb$1;
    },
    set_progressWhileDraggingThumb: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$set_progressWhileDraggingThumb(value) {
        this._m_ProgressWhileDraggingThumb$1 = value;
        return value;
    },
    
    get_progress: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$get_progress() {
        return this._m_Progress$1;
    },
    set_progress: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$set_progress(value) {
        this._setProgress$1(value, true);
        return value;
    },
    
    updateProgress: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$updateProgress(p_Progress) {
        Coveo.CNL.Web.Scripts.CNLAssert.check(p_Progress >= 0 && p_Progress <= 1);
        this._setProgress$1(p_Progress, false);
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$tearDown() {
        if (this._m_Thumb$1) {
            this._m_Thumb$1.remove_dragging(this._m_Thumb_Dragging$1);
            this._m_Thumb$1.remove_dragDrop(this._m_Thumb_DragDrop$1);
        }
        this._m_Thumb$1 = null;
        this._m_Highlight$1 = null;
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress.callBase(this, 'tearDown');
    },
    
    getProgressFromMousePos: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$getProgressFromMousePos(p_MousePos) {
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_MousePos);
        if (this._m_Orientation$1 === Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation.horizontal) {
            return Math.min(Math.max(0, p_MousePos.getPosition(this.m_TargetControl).x / this.m_TargetControl.width), 1);
        }
        else {
            return Math.min(Math.max(0, p_MousePos.getPosition(this.m_TargetControl).y / this.m_TargetControl.height), 1);
        }
    },
    
    renderControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$renderControl() {
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress.callBase(this, 'renderControl');
        if (this._m_Thumb$1) {
            if (this._m_Orientation$1 === Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation.horizontal) {
                this._m_Thumb$1.set_left(Math.min(Math.max(0, (this.get_progress() * this.m_TargetControl.width) - (this._m_Thumb$1.get_width() / 2)), this.m_TargetControl.width - this._m_Thumb$1.get_width()));
            }
            else {
                this._m_Thumb$1.set_top(Math.min(Math.max(0, (this.get_progress() * this.m_TargetControl.height) - (this._m_Thumb$1.get_height() / 2)), this.m_TargetControl.height - this._m_Thumb$1.get_height()));
            }
        }
        if (this._m_Highlight$1) {
            if (this._m_Orientation$1 === Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation.horizontal) {
                this._m_Highlight$1.width = this.get_progress() * this.m_TargetControl.width;
            }
            else {
                this._m_Highlight$1.height = this.get_progress() * this.m_TargetControl.height;
            }
        }
    },
    
    onDragging: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$onDragging(p_Args) {
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Args);
        if (this._m_ProgressWhileDraggingThumb$1) {
            this.set_progress(this.getProgressFromMousePos(p_Args));
        }
        this.onProgressDragging(this.getProgressFromMousePos(p_Args));
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress.callBase(this, 'onDragging', [ p_Args ]);
    },
    
    onProgressDragging: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$onProgressDragging(p_Progress) {
    },
    
    onClick: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$onClick(p_Args) {
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Args);
        this.set_progress(this.getProgressFromMousePos(p_Args));
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress.callBase(this, 'onClick', [ p_Args ]);
    },
    
    onDragDrop: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$onDragDrop(p_Args) {
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Args);
        this.set_progress(this.getProgressFromMousePos(p_Args));
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress.callBase(this, 'onDragDrop', [ p_Args ]);
    },
    
    _setProgress$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$_setProgress$1(p_Progress, p_TriggerChange) {
        Coveo.CNL.Web.Scripts.CNLAssert.check(p_Progress >= 0 && p_Progress <= 1);
        this._m_Progress$1 = p_Progress;
        if (!this.get_isDragging()) {
            this.renderControl();
        }
        if (p_TriggerChange && (this.__progressChange$1)) {
            this.__progressChange$1.invoke(this, new EventArgs());
        }
    },
    
    _thumb_DragDrop$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$_thumb_DragDrop$1(p_Sender, p_Args) {
        this.set_progress(this.getProgressFromMousePos(p_Args));
    },
    
    _thumb_Dragging$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$_thumb_Dragging$1(p_Sender, p_Args) {
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_Thumb$1);
        if (this._m_Orientation$1 === Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation.horizontal) {
            this._m_Thumb$1.set_left(Math.min(Math.max(0, (this.getProgressFromMousePos(p_Args) * this.m_TargetControl.width) - (this._m_Thumb$1.get_width() / 2)), this.m_TargetControl.width - this._m_Thumb$1.get_width()));
        }
        else {
            this._m_Thumb$1.set_top(Math.min(Math.max(0, (this.getProgressFromMousePos(p_Args) * this.m_TargetControl.height) - (this._m_Thumb$1.get_height() / 2)), this.m_TargetControl.height - this._m_Thumb$1.get_height()));
        }
        if (this._m_Highlight$1) {
            if (this._m_Orientation$1 === Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation.horizontal) {
                this._m_Highlight$1.width = this.getProgressFromMousePos(p_Args) * this.m_TargetControl.width;
            }
            else {
                this._m_Highlight$1.height = this.getProgressFromMousePos(p_Args) * this.m_TargetControl.height;
            }
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightSymbolButton

Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightSymbolButton = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightSymbolButton(p_TargetCanvas) {
    Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightSymbolButton.constructBase(this, [ p_TargetCanvas ]);
}
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightSymbolButton.prototype = {
    _m_EnabledSymbol$2: null,
    _m_DisabledSymbol$2: null,
    _m_GrayedSymbol$2: null,
    _m_State$2: 0,
    
    get_state: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightSymbolButton$get_state() {
        return this._m_State$2;
    },
    set_state: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightSymbolButton$set_state(value) {
        this._m_State$2 = value;
        this.renderControl();
        return value;
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightSymbolButton$tearDown() {
        this._m_EnabledSymbol$2 = null;
        this._m_DisabledSymbol$2 = null;
        this._m_GrayedSymbol$2 = null;
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightSymbolButton.callBase(this, 'tearDown');
    },
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightSymbolButton$initialize() {
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightSymbolButton.callBase(this, 'initialize');
        this._m_EnabledSymbol$2 = this.m_TargetControl.findName(this.m_TargetControl.name + '_Enabled');
        this._m_DisabledSymbol$2 = this.m_TargetControl.findName(this.m_TargetControl.name + '_Disabled');
        this._m_GrayedSymbol$2 = this.m_TargetControl.findName(this.m_TargetControl.name + '_Grayed');
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_EnabledSymbol$2);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_DisabledSymbol$2);
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_GrayedSymbol$2);
    },
    
    renderControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightSymbolButton$renderControl() {
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightSymbolButton.callBase(this, 'renderControl');
        this._m_EnabledSymbol$2.opacity = 0;
        this._m_DisabledSymbol$2.opacity = 0;
        this._m_GrayedSymbol$2.opacity = 0;
        if (this._m_State$2 === Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButtonState.disabled) {
            this._m_DisabledSymbol$2.opacity = 1;
        }
        else if (this._m_State$2 === Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButtonState.enabled) {
            this._m_EnabledSymbol$2.opacity = 1;
        }
        else if (this._m_State$2 === Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButtonState.grayed) {
            this._m_GrayedSymbol$2.opacity = 1;
        }
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextTime

Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextTime = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextTime(p_Target) {
    Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextTime.constructBase(this, [ p_Target ]);
}
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextTime.prototype = {
    _m_Seconds$1: 0,
    
    get_seconds: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextTime$get_seconds() {
        return this._m_Seconds$1;
    },
    set_seconds: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextTime$set_seconds(value) {
        this._m_Seconds$1 = value;
        this.renderControl();
        return value;
    },
    
    renderControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextTime$renderControl() {
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextTime.callBase(this, 'renderControl');
        var datetime = new Date(0, 0, 0, 0, 0, this._m_Seconds$1);
        var hours = datetime.getHours();
        var minutes = datetime.getMinutes() + (hours * 60);
        (this.m_TargetControl).text = minutes.toString().padLeft(2, '0') + ':' + datetime.getSeconds().toString().padLeft(2, '0');
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker

Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarker(p_TargetControl) {
    Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker.constructBase(this, [ p_TargetControl ]);
}
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker.prototype = {
    _m_Utterance$1: null,
    
    get_utterance: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarker$get_utterance() {
        return this._m_Utterance$1;
    },
    set_utterance: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarker$set_utterance(value) {
        this._m_Utterance$1 = value;
        return value;
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarker$tearDown() {
        this._m_Utterance$1 = null;
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker.callBase(this, 'tearDown');
    },
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarker$initialize() {
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker.callBase(this, 'initialize');
    },
    
    onMouseMove: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarker$onMouseMove(p_Args) {
        ((this.m_TargetControl).fill).color = Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker._mousE_ENTER_COLOR$1;
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker.callBase(this, 'onMouseMove', [ p_Args ]);
    },
    
    onMouseLeave: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarker$onMouseLeave(p_Args) {
        ((this.m_TargetControl).fill).color = Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker._mousE_LEAVE_COLOR$1;
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker.callBase(this, 'onMouseLeave', [ p_Args ]);
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer

Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer(p_TargetControl) {
    this._m_Markers$1 = [];
    Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer.constructBase(this, [ p_TargetControl ]);
}
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer.prototype = {
    _m_ZoomOnMarkerConflict$1: false,
    _m_CanZoom$1: true,
    _m_DelayResetZoom$1: false,
    _m_MarkerConflictContainer$1: null,
    _m_ConflictFocusInAnimation$1: null,
    _m_ConflictScaleAnimation$1: null,
    _m_ContainerAnimation$1: null,
    _m_ContainerDoubleAnimation$1: null,
    _m_ConflictFocusOutTimer$1: null,
    _m_ScaleFactor$1: 1,
    _m_BaseWidth$1: 0,
    _m_BaseLeft$1: 0,
    _m_LastCursorPos$1: null,
    _m_LastZoomStartPos$1: null,
    _m_MarkerConflictContainerMouseLeave$1: null,
    _m_ConflictFocusOut_Completed$1: null,
    _m_ContainerAnimation_Completed$1: null,
    
    add_utteranceHighlighted: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$add_utteranceHighlighted(value) {
        this.__utteranceHighlighted$1 = Delegate.combine(this.__utteranceHighlighted$1, value);
    },
    remove_utteranceHighlighted: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$remove_utteranceHighlighted(value) {
        this.__utteranceHighlighted$1 = Delegate.remove(this.__utteranceHighlighted$1, value);
    },
    
    __utteranceHighlighted$1: null,
    
    add_utteranceClick: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$add_utteranceClick(value) {
        this.__utteranceClick$1 = Delegate.combine(this.__utteranceClick$1, value);
    },
    remove_utteranceClick: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$remove_utteranceClick(value) {
        this.__utteranceClick$1 = Delegate.remove(this.__utteranceClick$1, value);
    },
    
    __utteranceClick$1: null,
    
    get_zoomOnMarkerConflict: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$get_zoomOnMarkerConflict() {
        return this._m_ZoomOnMarkerConflict$1;
    },
    set_zoomOnMarkerConflict: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$set_zoomOnMarkerConflict(value) {
        this._m_ZoomOnMarkerConflict$1 = value;
        return value;
    },
    
    tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$tearDown() {
        var $enum1 = this._m_Markers$1.getEnumerator();
        while ($enum1.moveNext()) {
            var marker = $enum1.get_current();
            marker.tearDown();
        }
        this._m_MarkerConflictContainer$1.removeEventListener('MouseLeave', this._m_MarkerConflictContainerMouseLeave$1);
        (this._m_ConflictFocusOutTimer$1).removeEventListener('Completed', this._m_ConflictFocusOut_Completed$1);
        (this._m_ContainerAnimation$1).removeEventListener('Completed', this._m_ContainerAnimation_Completed$1);
        this._m_Markers$1.clear();
        this._m_Markers$1 = null;
        this._m_MarkerConflictContainer$1 = null;
        this._m_ConflictFocusInAnimation$1 = null;
        this._m_ConflictScaleAnimation$1 = null;
        this._m_ContainerAnimation$1 = null;
        this._m_ContainerDoubleAnimation$1 = null;
        this._m_ConflictFocusOutTimer$1 = null;
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer.callBase(this, 'tearDown');
    },
    
    clear: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$clear() {
        (this.m_TargetControl).children.clear();
        for (var i = (this.m_TargetControl).resources.count - 1; i >= 1; i--) {
            (this.m_TargetControl).resources.removeAt(i);
        }
        var $enum1 = this._m_Markers$1.getEnumerator();
        while ($enum1.moveNext()) {
            var marker = $enum1.get_current();
            marker.tearDown();
        }
        this._m_Markers$1.clear();
    },
    
    addNewTimeLineMarker: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$addNewTimeLineMarker(p_Utterance) {
        var index = this._m_Markers$1.length.toString();
        var xaml = '<Rectangle xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" x:Name=\"Marker_' + index + '\" Height=\"13\" Width=\"9\" Stroke=\"White\" Opacity=\"1\" Cursor=\"Hand\">' + '<Rectangle.Fill>' + '<SolidColorBrush Color=\"#FF5D5A5A\" />' + '</Rectangle.Fill>' + '</Rectangle>';
        var newMarker = this.m_TargetControl.getHost().content.createFromXaml(xaml);
        var markerLeft = Math.min(Math.max(0, (p_Utterance.get_percent() * this.m_TargetControl.width) - (newMarker.width / 2)), this.m_TargetControl.width - newMarker.width);
        newMarker.setValue('Canvas.Left', markerLeft);
        (this.m_TargetControl).children.add(newMarker);
        var marker = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker(newMarker);
        marker.set_utterance(p_Utterance);
        marker.add_mouseEnter(Delegate.create(this, this._marker_MouseEnter$1));
        marker.add_mouseLeave(Delegate.create(this, this._marker_MouseLeave$1));
        marker.add_click(Delegate.create(this, this._marker_Click$1));
        this._m_Markers$1.add(marker);
        var zoomXaml = '<Storyboard xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" x:Name=\"MarkerAnimation_' + index + '\" >' + '<DoubleAnimation x:Name=\"_MarkerAnimationLeft_' + index + '\" Storyboard.TargetName=\"' + newMarker.name + '\" Storyboard.TargetProperty=\"(Canvas.Left)\" From=\"0.0\" To=\"0.0\" Duration=\"0:0:0.3\"  />' + '<DoubleAnimation x:Name=\"_MarkerAnimationWidth_' + index + '\" Storyboard.TargetName=\"' + newMarker.name + '\" Storyboard.TargetProperty=\"Width\" From=\"0.0\" To=\"0.0\" Duration=\"0:0:0.3\"  />' + '</Storyboard>';
        var markerAnimation = this.m_TargetControl.getHost().content.createFromXaml(zoomXaml);
        (this.m_TargetControl).resources.add(markerAnimation);
    },
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$initialize() {
        Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer.callBase(this, 'initialize');
        this._m_BaseWidth$1 = this.get_width();
        this._m_BaseLeft$1 = this.get_left();
        this._m_MarkerConflictContainer$1 = this.m_TargetControl.getHost().content.findName('Timeline_MarkersConflictContainer');
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_MarkerConflictContainer$1);
        this._m_MarkerConflictContainerMouseLeave$1 = this._m_MarkerConflictContainer$1.addEventListener('MouseLeave', Delegate.create(this, this._markerConflictContainerMouseLeave$1));
        this._m_ConflictFocusInAnimation$1 = this.m_TargetControl.getHost().content.findName('Timeline_MarkersConflictContainer_FocusIn');
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_ConflictFocusInAnimation$1);
        this._m_ConflictFocusOutTimer$1 = this.m_TargetControl.getHost().content.findName('Timeline_MarkersConflictContainer_FocusOut');
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_ConflictFocusOutTimer$1);
        this._m_ConflictFocusOut_Completed$1 = (this._m_ConflictFocusOutTimer$1).addEventListener('Completed', Delegate.create(this, this._conflictFocusOut_Completed$1));
        this._m_ConflictScaleAnimation$1 = this.m_TargetControl.getHost().content.findName('Timeline_MarkersConflictContainer_Scale');
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_ConflictScaleAnimation$1);
        this._m_ContainerAnimation$1 = this.m_TargetControl.getHost().content.findName('Timeline_MarkerContainerAnimation');
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_ContainerAnimation$1);
        this._m_ContainerAnimation_Completed$1 = (this._m_ContainerAnimation$1).addEventListener('Completed', Delegate.create(this, this._containerAnimation_Completed$1));
        this._m_ContainerDoubleAnimation$1 = this.m_TargetControl.getHost().content.findName('_Timeline_MarkerContainerAnimation');
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_ContainerDoubleAnimation$1);
    },
    
    onMouseWheel: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$onMouseWheel(p_WheelDelta) {
        if (!this._m_ZoomOnMarkerConflict$1 && this._m_LastCursorPos$1) {
            if (p_WheelDelta < 0) {
                if (this._m_LastZoomStartPos$1) {
                    this._displayConflictRect$1(this._m_LastZoomStartPos$1, Coveo.CES.Web.Search.Scripts.Controls.Results.ZoomDirection.zoomOut);
                }
            }
            else {
                if (!this._m_LastZoomStartPos$1) {
                    this._m_LastZoomStartPos$1 = this._m_LastCursorPos$1;
                }
                this._displayConflictRect$1(this._m_LastZoomStartPos$1, Coveo.CES.Web.Search.Scripts.Controls.Results.ZoomDirection.zoomIn);
            }
        }
    },
    
    onMouseMove: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$onMouseMove(p_Args) {
        this._m_LastCursorPos$1 = p_Args.getPosition(this.m_TargetControl);
    },
    
    onMouseLeave: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$onMouseLeave(p_Args) {
        this._m_ScaleFactor$1 = 1;
        if (this._m_CanZoom$1) {
            this._renderFromScale$1(null);
        }
        else {
            this._m_DelayResetZoom$1 = true;
        }
    },
    
    _displayConflictRect$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$_displayConflictRect$1(p_Point, p_Direction) {
        if (!this._m_CanZoom$1) {
            return;
        }
        Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Point);
        if (p_Direction === Coveo.CES.Web.Search.Scripts.Controls.Results.ZoomDirection.zoomIn) {
            this._m_ScaleFactor$1 = this._m_ScaleFactor$1 + 1;
            this._renderFromScale$1(p_Point);
        }
        else {
            this._m_ScaleFactor$1 = Math.max(1, this._m_ScaleFactor$1 - 1);
            if (this._m_ScaleFactor$1 === 1) {
                this._renderFromScale$1(null);
            }
            else {
                this._renderFromScale$1(p_Point);
            }
        }
    },
    
    _renderFromScale$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$_renderFromScale$1(p_Point) {
        Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_CanZoom$1);
        this._m_DelayResetZoom$1 = false;
        var newLeft = this._m_BaseLeft$1;
        if (!p_Point) {
            Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_ScaleFactor$1 === 1);
            this.set_width(this._m_BaseWidth$1);
            this._m_LastZoomStartPos$1 = null;
        }
        else {
            Coveo.CNL.Web.Scripts.CNLAssert.check(p_Point);
            var currentLeft = this.get_left();
            var pointRatio = p_Point.x / this.get_width();
            this.set_width(this._m_BaseWidth$1 * this._m_ScaleFactor$1);
            var newPointPos = pointRatio * this.get_width();
            var threshhold = newPointPos - p_Point.x;
            newLeft = currentLeft - threshhold;
        }
        this._m_ContainerDoubleAnimation$1.from = this.get_left();
        this._m_ContainerDoubleAnimation$1.to = newLeft;
        if (this._m_LastZoomStartPos$1) {
            this._m_LastZoomStartPos$1.x -= Math.round(newLeft - this.get_left());
        }
        this._m_CanZoom$1 = false;
        (this._m_ContainerAnimation$1).begin();
        var index = 0;
        var $enum1 = this._m_Markers$1.getEnumerator();
        while ($enum1.moveNext()) {
            var marker = $enum1.get_current();
            var markerWidth = Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer._markeR_WIDTH$1 * this._m_ScaleFactor$1;
            var doubleAnimationWidth = this.m_TargetControl.findName('_MarkerAnimationWidth_' + index);
            Coveo.CNL.Web.Scripts.CNLAssert.notNull(doubleAnimationWidth);
            (doubleAnimationWidth).from = marker.get_width();
            (doubleAnimationWidth).to = markerWidth;
            var markerLeft = Math.min(Math.max(0, (marker.get_utterance().get_percent() * this.get_width()) - (markerWidth / 2)), this.get_width() - markerWidth);
            var doubleAnimationLeft = this.m_TargetControl.findName('_MarkerAnimationLeft_' + index);
            Coveo.CNL.Web.Scripts.CNLAssert.notNull(doubleAnimationLeft);
            (doubleAnimationLeft).from = marker.get_left();
            (doubleAnimationLeft).to = markerLeft;
            var animation = this.m_TargetControl.findName('MarkerAnimation_' + index);
            Coveo.CNL.Web.Scripts.CNLAssert.notNull(animation);
            (animation).begin();
            index++;
        }
    },
    
    _marker_MouseEnter$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$_marker_MouseEnter$1(p_Sender, p_Args) {
        var conflict = false;
        if (this._m_ZoomOnMarkerConflict$1) {
            var currentMarkerLeft = (p_Sender).get_left();
            var $enum1 = this._m_Markers$1.getEnumerator();
            while ($enum1.moveNext()) {
                var marker = $enum1.get_current();
                var markerLeft = marker.get_left();
                if (((currentMarkerLeft < markerLeft) && ((currentMarkerLeft + Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer._markeR_WIDTH$1 / 2) > markerLeft)) || ((currentMarkerLeft > markerLeft) && ((markerLeft + Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer._markeR_WIDTH$1 / 2) > currentMarkerLeft))) {
                    conflict = true;
                    break;
                }
            }
        }
        if (conflict) {
            this._displayConflictRect$1(p_Args.getPosition(this.m_TargetControl), Coveo.CES.Web.Search.Scripts.Controls.Results.ZoomDirection.zoomIn);
        }
        var currentMarker = p_Sender;
        if (this.__utteranceHighlighted$1) {
            this.__utteranceHighlighted$1.invoke(this, currentMarker.get_utterance());
        }
    },
    
    _marker_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$_marker_Click$1(p_Sender, p_Args) {
        if (this.__utteranceClick$1) {
            this.__utteranceClick$1.invoke(this, (p_Sender).get_utterance());
        }
    },
    
    _marker_MouseLeave$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$_marker_MouseLeave$1(p_Sender, p_Args) {
        if (this.__utteranceHighlighted$1) {
            this.__utteranceHighlighted$1.invoke(this, null);
        }
    },
    
    _markerConflictContainerMouseLeave$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$_markerConflictContainerMouseLeave$1(p_Sender, p_Args) {
        (this._m_ConflictFocusOutTimer$1).begin();
    },
    
    _containerAnimation_Completed$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$_containerAnimation_Completed$1(p_Sender, p_Args) {
        this.ensureBoudaries();
        this._m_CanZoom$1 = true;
        if (this._m_DelayResetZoom$1) {
            this._renderFromScale$1(null);
        }
    },
    
    _conflictFocusOut_Completed$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$_conflictFocusOut_Completed$1(p_Sender, p_Args) {
        this._m_MarkerConflictContainer$1.setValue('Visibility', 'Collapsed');
    }
}


////////////////////////////////////////////////////////////////////////////////
// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtterance

Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtterance = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtterance(p_Start, p_Percent, p_Excerpt) {
    Coveo.CNL.Web.Scripts.CNLAssert.check(p_Start >= 0);
    Coveo.CNL.Web.Scripts.CNLAssert.check(p_Percent >= 0 && p_Percent <= 1);
    Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Excerpt);
    this._m_Start = p_Start;
    this._m_Percent = p_Percent;
    this._m_Excerpt = p_Excerpt;
}
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtterance.prototype = {
    _m_Start: 0,
    _m_Percent: 0,
    _m_Excerpt: null,
    _m_Data: null,
    m_OnUtteranceDivClick: null,
    m_OnUtteranceDivMouseOver: null,
    m_OnUtteranceDivMouseOut: null,
    
    get_start: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtterance$get_start() {
        return this._m_Start;
    },
    
    get_percent: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtterance$get_percent() {
        return this._m_Percent;
    },
    
    get_excerpt: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtterance$get_excerpt() {
        return this._m_Excerpt;
    },
    
    get_data: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtterance$get_data() {
        return this._m_Data;
    },
    set_data: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtterance$set_data(value) {
        this._m_Data = value;
        return value;
    }
}


Type.createNamespace('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() {
    Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.constructBase(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,
    
    initialize: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$initialize() {
        Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.callBase(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, Delegate.create(this, this._spTable_OnDwell$1));
        this._m_OnMouseOver$1 = Delegate.create(this, this._onMouseOver$1);
        this._m_OnMouseOut$1 = 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() {
        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);
        this._m_Request$1 = null;
        Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.callBase(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() {
        if (this.m_SPTableImage.style.visibility === 'hidden') {
            var resetTimeOut = document.body.getAttribute(this.m_Target.id + 'ResetBorderTimeOut');
            if (resetTimeOut) {
                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(Delegate.create(this, this._resetBorder$1), 500));
        }
    },
    
    _isMouseReallyOut$1: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$_isMouseReallyOut$1(p_Event, p_Target) {
        var relatedTarget = p_Event.toElement;
        while (relatedTarget && relatedTarget !== p_Target) {
            relatedTarget = relatedTarget.parentNode;
        }
        return relatedTarget !== p_Target;
    },
    
    _doBeforeMouseOver$1: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$_doBeforeMouseOver$1() {
        if (this._m_IsBusy$1) {
            return;
        }
        this._m_IsBusy$1 = true;
        if (!this._m_Request$1) {
            this._m_Request$1 = new XMLHttpRequest();
            this._m_Request$1.onreadystatechange = Delegate.create(this, this._onRequestComplete$1);
        }
        this._m_Request$1.open('GET', String.format(this.m_SiteUri + '/_layouts/CES/AttributesSelector.aspx?ListItemId={0}&ListId={1}&Dummy={2}', this.m_ListItemId, this.m_ListId, Date.get_now().toString()), true);
        this._m_Request$1.send(null);
    },
    
    _onRequestComplete$1: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$_onRequestComplete$1() {
        if (this._m_Request$1.readyState === 4) {
            this._m_QueryDone$1 = true;
            var response = this._m_Request$1.responseText;
            var xml = XMLDocumentParser.parse(response);
            var versionNode = xml.selectSingleNode('/ItemAttributes/Version');
            if ((!versionNode) || (versionNode.attributes.getNamedItem('Value').text !== Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu._VERSION$1)) {
                this._m_ContextIsInvalid$1 = true;
                return;
            }
            var errorNode = xml.selectSingleNode('/ItemAttributes/Error');
            if (errorNode) {
                this._m_ContextIsInvalid$1 = true;
                return;
            }
            var nodes = xml.selectNodes('/ItemAttributes/ItemAttribute');
            for (var i = 0; i <= nodes.length - 1; i++) {
                var node = nodes[i];
                var fieldName = node.attributes.getNamedItem('FieldName').text;
                var value = node.attributes.getNamedItem('Value').text;
                if (fieldName === Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_VERSION_ENABLED) {
                    eval('var setEnabledVersion = new Function(\"' + this.m_SPTable.getAttribute('CTXName') + '.verEnabled = ' + value + ';\"); setEnabledVersion();');
                }
                else if (fieldName === Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_IS_FORCE_CHECKOUT) {
                    eval('var setIsForceCheckout = new Function(\"' + this.m_SPTable.getAttribute('CTXName') + '.isForceCheckout = ' + value + ';\"); setIsForceCheckout();');
                }
                else if (fieldName === Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_ENABLE_MINOR_VERSIONS) {
                    eval('var setEnableMinorVersions = new Function(\"' + this.m_SPTable.getAttribute('CTXName') + '.EnableMinorVersions = ' + value + ';\"); setEnableMinorVersions();');
                }
                else if (fieldName === Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_CONTENT_TYPES_ENABLED) {
                    eval('var setContentTypesEnabled = new Function(\"' + this.m_SPTable.getAttribute('CTXName') + '.ContentTypesEnabled = ' + value + ';\"); setContentTypesEnabled();');
                }
                else if (fieldName === Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_BASE_TYPE) {
                    eval('var setListBaseType = new Function(\"' + this.m_SPTable.getAttribute('CTXName') + '.listBaseType = ' + value + ';\"); setListBaseType();');
                }
                else if (fieldName === Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_BASE_TEMPLATE) {
                    eval('var setListBaseTemplate = new Function(\"' + this.m_SPTable.getAttribute('CTXName') + '.listTemplate = ' + value + ';\"); setListBaseTemplate();');
                }
                else if (fieldName === Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_WRITE_SECURITY) {
                    eval('var setWriteSecurity = new Function(\"' + this.m_SPTable.getAttribute('CTXName') + '.WriteSecurity = ' + value + ';\"); setWriteSecurity();');
                }
                else if (fieldName === Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_USER_ID) {
                    eval('var setUserID = new Function(\"' + this.m_SPTable.getAttribute('CTXName') + '.CurrentUserID = ' + value + ';\"); setUserID();');
                }
                else if (fieldName === Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.d_REF) {
                    var url = value;
                    if (!url.startsWith('/')) {
                        url = url.insert(0, '/');
                    }
                    if (!url.endsWith('/')) {
                        url += '/';
                    }
                    url += this.m_FileName;
                    this.m_SPTable.setAttribute('Url', url);
                    this.m_SPTable.setAttribute(fieldName, value);
                }
                else {
                    this.m_SPTable.setAttribute(fieldName, value);
                }
            }
            this._m_IsBusy$1 = false;
            if (this._m_MouseIsOver$1) {
                this._handleSPOnItem$1();
            }
        }
    },
    
    _handleSPOnItem$1: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$_handleSPOnItem$1() {
        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);
        }
    }
}


Coveo.CES.Web.Search.Scripts.Controls.FacetScript.createClass('Coveo.CES.Web.Search.Scripts.Controls.FacetScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.CloseModalBoxLinkScript.createClass('Coveo.CES.Web.Search.Scripts.Controls.CloseModalBoxLinkScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.SharePointSearchBoxScript.createClass('Coveo.CES.Web.Search.Scripts.Controls.SharePointSearchBoxScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript.createClass('Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.ViewAsHtmlPanelScript.createClass('Coveo.CES.Web.Search.Scripts.Controls.ViewAsHtmlPanelScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl');
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl);
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry);
Coveo.CES.Web.Search.Scripts.Controls.Results.TextContainerEventArgs.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.TextContainerEventArgs', EventArgs);
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextContainer.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextContainer', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl);
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl);
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButton.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButton', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl);
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButton);
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightDebug.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightDebug', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl);
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl);
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayerControl.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayerControl', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButton.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButton', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton);
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl);
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightSymbolButton.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightSymbolButton', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButton);
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextTime.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextTime', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl);
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl);
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl);
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtterance.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtterance');
Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.createClass('Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript);
Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript.querY_PARAMETER = null;
Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript.timE_ZONE_OFFSET_PARAMETER = null;
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry._mousE_ENTER_TEXT_COLOR$2 = 'Black';
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry._mousE_LEAVE_TEXT_COLOR$2 = 'White';
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry._selecteD_COLOR$2 = '#FFD3D3D3';
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry._selecteD_TEXT_COLOR$2 = 'Black';
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry._selecteD_TEXT_COLOR$1 = '#FFF1922A';
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea._scrolL_MOVE_SIZE$1 = 50;
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl._draG_MOUSE_THRESHOLD = 3;
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayerControl.unablE_TO_PLAY_ERROR = null;
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker._mousE_ENTER_COLOR$1 = 'Lime';
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker._mousE_LEAVE_COLOR$1 = '#FF5D5A5A';
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer._markeR_WIDTH$1 = 9;
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer._markeR_HEIGHT$1 = 13;
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer._markeR_TOP$1 = 0;
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer._conflicT_SIDE_RANGE_LOOKUP$1 = 50;
Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer._zooM_SCALE$1 = 6;
Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu._VERSION$1 = '5.0.200708161';
Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu._sP_MENU_COLOR$1 = '#b09460';
Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_VERSION_ENABLED = null;
Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_IS_FORCE_CHECKOUT = null;
Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_ENABLE_MINOR_VERSIONS = null;
Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_CONTENT_TYPES_ENABLED = null;
Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_BASE_TYPE = null;
Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_BASE_TEMPLATE = null;
Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_WRITE_SECURITY = null;
Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_USER_ID = null;
Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.d_REF = null;

// ---- Do not remove this footer ----
// Generated using Script# v0.4.0.0 (http://projects.nikhilk.net)
// -----------------------------------
