# --
# FooterJS.dtl - provides global HTML footer JavaScript
# Copyright (C) 2001-2010 OTRS AG, http://otrs.org/
# --
# $Id: FooterJS.dtl,v 1.26 2010/12/10 10:49:21 mg Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

<!-- dtl:block:CommonJS -->
<script type="text/javascript" src="$Config{"Frontend::JavaScriptPath"}$QData{"JSDirectory"}$QData{"Filename"}"></script>
<!-- dtl:block:CommonJS -->

<!-- dtl:block:ModuleJS -->
<script type="text/javascript" src="$Config{"Frontend::JavaScriptPath"}$QData{"JSDirectory"}$QData{"Filename"}"></script>
<!-- dtl:block:ModuleJS -->

<script type="text/javascript">//<![CDATA[
"use strict";
Core.App.Ready(function () {

    Core.Config.AddConfig({
        // config
        Baselink: '$Env{"Baselink"}',
        CGIHandle: '$Env{"CGIHandle"}',
        Action: '$Env{"Action"}',
        SessionIDCookie: '$Env{"SessionIDCookie"}',
        SessionName: '$Config{"SessionName"}',
        SessionID: '$Env{"SessionID"}',
        CustomerPanelSessionName: '$Config{"CustomerPanelSessionName"}',
        Images: '$Config{"Frontend::ImagePath"}',
        UserLanguage: '$Env{"UserLanguage"}',
        CheckEmailAddresses: parseInt('$Config{"CheckEmailAddresses"}', 10),
        AnimationEnabled: parseInt('$Config{"Frontend::AnimationEnabled"}', 10),
        OpenMainMenuOnHover: parseInt('$Config{"OpenMainMenuOnHover"}', 10),
        HTMLArticleHeightDefault: parseInt("$Config{"Ticket::Frontend::HTMLArticleHeightDefault"}" || 0, 10),
        HTMLArticleHeightMax: parseInt("$Config{"Ticket::Frontend::HTMLArticleHeightMax"}" || 0, 10),
        // translations
        ValidateServerErrorTitle: '$JSText{"Error"}',
        ValidateServerErrorMsg: '$JSText{"One or more errors occurred!"}',
        PopupLeaveParentWindowMsg: '$JSText{"If you now leave this page, all open popup windows will be closed, too!"}',
        DialogCloseMsg: '$JSText{"Close this dialog"}',
        PopupBlockerMsg: '$JSText{"Could not open popup window. Please disable any popup blockers for this application."}',
        PopupAlreadyOpenMsg: '$JSText{"A popup of this screen is already open. Do you want to close it and load this one instead?"}',
        LoadingMsg: '$JSText{"Loading..."}',
        SearchMsg: '$JSText{"Search"}'
    });

    Core.Agent.Init();

$Include{"Datepicker"}

<!-- dtl:block:NewTicketInNewWindow -->
    $('#nav-Tickets-PhoneTicket a').attr('target', '_blank');
    $('#nav-Tickets-EmailTicket a').attr('target', '_blank');
    $('.PhoneTicket a').attr('target', '_blank');
    $('.EmailTicket a').attr('target', '_blank');
<!-- dtl:block:NewTicketInNewWindow -->

});
//]]></script>

<script type="text/javascript">//<![CDATA[
"use strict";
Core.App.Ready(function () {

<!-- dtl:js_on_document_complete_placeholder -->

});
//]]></script>

# Finally, unblock click events on the page again after all JavaScript was loaded and
# executed. Put in an own block to make sure it is always run.
<script type="text/javascript">//<![CDATA[
"use strict";
Core.App.Ready(function () {
    Core.App.UnblockEvents();
});
//]]></script>