<?php
// Copyright 1999-2015. Parallels IP Holdings GmbH. All Rights Reserved.
?>
<?php echo $this->doctype(); ?>
<html <?php echo $this->htmlDoc() ?>>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE">
<meta name="forgery_protection_token" id="forgery_protection_token" content="<?php echo Session::get()->panel()->forgeryProtectionToken; ?>">
<meta name="whp_parent_frame_origin" id="whp_parent_frame_origin" content="<?php echo Session::get()->whm()->origin; ?>">
<?php if ($this->layout()->isSmb && $this->layout()->isMultipleSessionContexts): ?>
<meta name="ctx_id_name" id="ctx_id_name" content="<?php echo Session::GPC_CTX_ID; ?>">
<meta name="<?php echo Session::GPC_CTX_ID; ?>" id="<?php echo Session::GPC_CTX_ID; ?>" content="<?php echo Session::getContextId(); ?>">
<?php endif; ?>
<?php echo $this->headTitle(); ?>
<link rel="shortcut icon" href="<?php echo $this->cacheStamp('/favicon.ico'); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

<?php echo $this->headStyle(); ?>
<?php echo $this->headLink(); ?>

<?php echo $GLOBALS['skin']->getThemeCssIncludes(); ?>

<?php $this->jsLoad()->prepend('/javascript/whp-embedded-frame.js'); ?>
<?php $this->jsLoad()->prepend('/javascript/responsive.js'); ?>
<?php $this->jsLoad()->prepend('/javascript/externals/modernizr.js'); ?>
<?php if ($this->layout()->isSmb): ?>
<?php $this->jsLoad()->prepend('/smb/scripts/smb.js'); ?>
<?php else: ?>
<?php $this->jsLoad()->prepend('/admin/scripts/admin-panel.js'); ?>
<?php endif; ?>
<?php $this->jsLoad()->prepend('/javascript/common.js'); ?>
<?php $this->jsLoad()->load('jsw'); ?>
<?php $this->jsLoad()->prepend('/javascript/prototype.js'); ?>

<?php echo $this->headScript(); ?>
<?php echo $this->partial('partials/context_header.phtml'); ?>

<?php if ($this->layout()->googleAnalyticsId): ?>
    <?php echo $this->partial('partials/google-analytics.phtml'); ?>
<?php endif; ?>

<?php echo $this->layout()->pleskAdditionalHead ?>

<?php echo $this->layout()->extensionsAdditionalHead; ?>
</head>
<body class="<?php echo ($this->layout()->isSmb ? '' : 'sid-frame ') . $this->layout()->bodyClass . " " . $this->layout()->integrationClass . (Session::get()->panel()->showFrames ? '' : ' page-content-only'); ?>">
<?php if (Session::get()->panel()->showFrames):?>
    <script type="text/javascript">
        //<![CDATA[
        (function() {
            var inFrame = true;

            try {
                if (window.self === window.top) {
                    inFrame = false
                }
            } catch (e) {
            }

            if (inFrame) {
                $(document.body).addClassName('page-content-only');
            }
        })();
        //]]>
    </script>
<?php endif; ?>
<?php if ($this->layout()->isSmb): ?>
    <script type="text/javascript">
        <?php if ($this->layout()->isClassicMode): ?>
            $(document.body).addClassName('sid-frame');
            $(document.body).addClassName('sid-frame-main');
            $(document.body).addClassName('sid-main-embedded');
        <?php else: ?>
            $(document.body).addClassName('sid-main');
        <?php endif; ?>

        if ($(document.body).hasClassName('sid-legacy')) {
            $(document.body).addClassName('sid-main-legacy');
        }
    </script>

    <?php if ($this->layout()->informer): ?>
        <?php echo $this->render($this->layout()->informer); ?>
    <?php endif; ?>
<?php endif; ?>
    <?php if (!$this->hideTasks): ?>
        <?php echo $this->partial('partials/task-progress-bar.phtml'); ?>
    <?php endif; ?>
    <div class="tooltip" style="display: none;"><b><i><i><i><span></span></i></i></i></b></div>
    <div class="page-container" id="page">
        <?php if (Session::get()->panel()->showFrames): ?>
        <div class="page-header-wrapper">
            <div class="page-header">
                <?php if (!$this->layout()->isSmb || $this->layout()->isClassicMode): ?>
                    <?php echo $this->head(Session::get()->auth()->getUser()); ?>
                <?php else: ?>
                    <?php echo $this->layout()->smbHeader; ?>
                    <script>
                        Jsw.onReady(function()  {
                            $$('.top-help a[target="help"]').each(function(help) {
                                <?php if ($this->layout()->helpContext): ?>
                                SetContext('<?php echo $this->layout()->helpContext; ?>');
                                <?php endif; ?>
                                if (GetContext()) {
                                    help.href = help.href + '/plesk-context/' + GetContext();
                                }
                                if (GetHelpModule()) {
                                    help.href = help.href  + '/plesk-module/' + GetHelpModule();
                                }
                            });
                        });
                    </script>
                <?php endif; ?>
            </div>
        </div>
        <?php endif; ?>
        <div class="page-main-wrapper">
            <div class="page-main">
                <?php if (Session::get()->panel()->showFrames && !$this->hideLeftMenu): ?>
                    <?php echo $this->leftMenu(Session::get()); ?>
                <?php endif; ?>
                <script type="text/javascript">
                    //<![CDATA[
                    (function() {
                        var pageHeaderWrapper = $$('.page-header-wrapper').first();
                        var pageSidebarWrapper = $$('.page-sidebar-wrapper').first();

                        function fixHeaderHeight() {
                            var height = pageHeaderWrapper.down('.page-header').getHeight();
                            pageHeaderWrapper.setStyle({height: height + 'px'});
                            if (pageSidebarWrapper) {
                                pageSidebarWrapper.setStyle({top: height + 'px'})
                            }
                        }

                        if (pageHeaderWrapper) {
                            fixHeaderHeight();
                            Event.observe(window, 'resize', fixHeaderHeight);
                        }
                    })();
                    //]]>
                </script>
                <div class="page-content-wrapper">
                    <div class="page-content">
