# --
# FooterJS.dtl - provides global HTML footer JavaScript
# Copyright (C) 2001-2012 OTRS AG, http://otrs.org/
# --
# $Id: FooterJS.dtl,v 1.34 2012/01/20 02:27:44 sb 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: '$QEnv{"Action"}',
        SessionIDCookie: '$QEnv{"SessionIDCookie"}',
        SessionName: '$Config{"SessionName"}',
        SessionID: '$QEnv{"SessionID"}',
        ChallengeToken: '$QEnv{"UserChallengeToken"}',
        CustomerPanelSessionName: '$Config{"CustomerPanelSessionName"}',
        Images: '$Config{"Frontend::ImagePath"}',
        UserLanguage: '$QEnv{"UserLanguage"}',
        CheckEmailAddresses: parseInt('$Config{"CheckEmailAddresses"}', 10),
        AnimationEnabled: parseInt('$Config{"Frontend::AnimationEnabled"}', 10),
        OpenMainMenuOnHover: parseInt('$Config{"OpenMainMenuOnHover"}', 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..."}',
        EmptySearchMsg: '$JSText{"Please enter at least one search value or * to find anything."}',
        SearchMsg: '$JSText{"Search"}'
    });

    Core.Agent.Init();

$Include{"Datepicker"}

<!-- dtl:block:NewTicketInNewWindow -->
    $('#nav-Tickets-Newphoneticket a').attr('target', '_blank');
    $('#nav-Tickets-Newemailticket 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>
