<!DOCTYPE html>
<html lang="<?php echo Yii::app()->language; ?>">
    <head>
        <meta charset="utf-8" />
        
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title><?php echo CHtml::encode($this->pageTitle); ?></title>

        <!-- Bootstrap framework -->
        <link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl; ?>/bootstrap/css/bootstrap.min.css" />
        <link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl; ?>/bootstrap/css/bootstrap-responsive.min.css" />
        <link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl; ?>/lib/qtip2/jquery.qtip.min.css" />
        <!-- notifications -->
        <link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl; ?>/lib/sticky/sticky.css" />    
        <!-- enhanced select -->
        <link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl; ?>/lib/chosen/chosen.css" />

        <link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/profind.css" />
        <link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/azul.css" />

        <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans" />

        <!-- Favicon -->
        <link rel="shortcut icon" href="favicon.ico" />

        <!--[if lte IE 8]>
            <link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/ie.css" />
            <script src="<?php echo Yii::app()->theme->baseUrl; ?>/js/ie/html5.js"></script>
                        <script src="<?php echo Yii::app()->theme->baseUrl; ?>/js/ie/respond.min.js"></script>
        <![endif]-->

    </head>
    <body class="sidebar_right">
        <div id="loading_layer" style="display:none"><img src="<?php echo Yii::app()->theme->baseUrl; ?>/images/ajax_loader.gif" alt="" /></div>		

        <div id="maincontainer" class="clearfix">
            <!-- header -->
            <header>
                <div class="navbar navbar-fixed-top">
                    <div class="navbar-inner">
                        <div class="container-fluid">
                            <a class="brand" href="<?php echo $this->createUrl('/usuario/modificar', array('id' => Yii::app()->user->id)); ?>"><i class="icon-home icon-white"></i> <?php echo CHtml::encode(Yii::app()->name); ?></a>
                            <ul class="nav user_menu pull-right">
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo Yii::app()->user->name; ?> <b class="caret"></b></a>
                                    <ul class="dropdown-menu">
                                        <li><?php echo CHtml::link(Yii::t('profind', 'Salir'), $this->createUrl('site/logout')); ?></li>
                                    </ul>
                                </li>
                            </ul>
                            <a data-target=".nav-collapse" data-toggle="collapse" class="btn_menu">
                                <span class="icon-align-justify icon-white"></span>
                            </a>
                            <nav>
                                <div class="nav-collapse">
                                    <?php
                                    $this->widget('zii.widgets.CMenu', array(
                                        'activeCssClass' => 'active',
                                        'encodeLabel' => false,
                                        'htmlOptions' => array(
                                            'class' => 'nav',
                                        ),
                                        'items' => array(
                                            array(
                                                'label' => CHtml::tag('i', array('class' => 'icon-file icon-white'), '') . ' ' . Yii::t('profind', 'Perfil'),
                                                'url' => array('/usuario/modificar', 'id' => Yii::app()->user->id),
                                                'linkOptions' => array(),
                                            ),
                                            array(
                                                'label' => CHtml::tag('i', array('class' => 'icon-briefcase icon-white'), '') . ' ' . Yii::t('profind', 'Empresa'),
                                                'url' => array('/empresa/modificar', 'id' => Yii::app()->user->id_empresa),
                                                'linkOptions' => array(),
                                            ),
                                            array(
                                                'label' => CHtml::tag('i', array('class' => 'icon-user icon-white'), '') . ' ' . Yii::t('profind', 'Equipo'),
                                                'url' => array('/equipo/index'),
                                                'linkOptions' => array('class' => 'icon_block contacto'),
                                            ),
                                        ),
                                    ));
                                    ?>                                        

                                </div>
                            </nav>
                        </div>
                    </div>
                </div>
            </header>

            <!-- main content -->
            <div id="contentwrapper">
                <div class="main_content">
                    <?php echo $content; ?>
                </div>
            </div>

            <!-- sidebar -->
            <a href="javascript:void(0)" class="sidebar_switch on_switch ttip_r" title="<?php echo Yii::t('profind', 'Ocultar barra lateral'); ?>"><?php echo Yii::t('profind', 'Barra lateral'); ?></a>
            <div class="sidebar">
                <div class="antiScroll">
                    <div class="antiscroll-inner">
                        <div class="antiscroll-content">

                            <div class="sidebar_inner">
                                <div class='sepH_c'></div>

                                <div id="side_accordion" class="accordion">

                                    <div class="accordion-group">
                                        <div class="accordion-heading sdb_h_active">
                                            <a class="accordion-toggle" data-toggle="collapse" data-parent="#side_accordion" href="#collapseLong">
                                                <i class="icon-question-sign"></i> Ayuda
                                            </a>
                                        </div>
                                        <div id="collapseLong" class="accordion-body in collapse" style="height: auto;">
                                            <div class="accordion-inner">
                                                Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus rhoncus, orci ac fermentum imperdiet, purus sapien pharetra diam, at varius nibh tellus tristique sem. 
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="push"></div>
                            </div>
                        </div>
                    </div>
                </div>

            </div>

            <script src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery.min.js"></script>
            <!-- smart resize event -->
            <script src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery.debouncedresize.min.js"></script>
            <!-- hidden elements width/height -->
            <script src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery.actual.min.js"></script>
            <!-- js cookie plugin -->
            <script src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery.cookie.min.js"></script>
            <!-- main bootstrap js -->
            <script src="<?php echo Yii::app()->theme->baseUrl; ?>/bootstrap/js/bootstrap.min.js"></script>
            <!-- tooltips -->
            <script src="<?php echo Yii::app()->theme->baseUrl; ?>/lib/qtip2/jquery.qtip.min.js"></script>            
            <!-- sticky messages -->
            <script src="<?php echo Yii::app()->theme->baseUrl; ?>/lib/sticky/sticky.min.js"></script>
            <!-- fix for ios orientation change -->
            <script src="<?php echo Yii::app()->theme->baseUrl; ?>/js/ios-orientationchange-fix.js"></script>
            <!-- scrollbar -->
            <script src="<?php echo Yii::app()->theme->baseUrl; ?>/lib/antiscroll/antiscroll.js"></script>
            <script src="<?php echo Yii::app()->theme->baseUrl; ?>/lib/antiscroll/jquery-mousewheel.js"></script>
            <!-- bootstrap plugins -->
            <script src="<?php echo Yii::app()->theme->baseUrl; ?>/js/bootstrap.plugins.min.js"></script>
            <!-- autosize textareas -->
            <script src="<?php echo Yii::app()->theme->baseUrl; ?>/js/forms/jquery.autosize.min.js"></script>
            <!-- common functions -->
            <script src="<?php echo Yii::app()->theme->baseUrl; ?>/js/profind.js"></script>

        </div>
    </body>
</html>


<?php
$flashMessages = Yii::app()->user->getFlashes(false);
if (!empty($flashMessages)) {
    $profind_notificaciones = <<<JS
            $(document).ready(function() {
                    profind_notificaciones.sticky();
            });
            profind_notificaciones = {
                sticky: function() {            
JS;
    if (Yii::app()->user->hasFlash('success')):
        $profind_notificaciones .= '$.sticky("' . Yii::app()->user->getFlash('success') . '", {autoclose : 5000, position: "top-center", type: "st-success" });';
    endif;
    if (Yii::app()->user->hasFlash('error')):
        $profind_notificaciones .= '$.sticky("' . Yii::app()->user->getFlash('error') . '", {autoclose : 5000, position: "top-center", type: "st-error" });';
    endif;
    if (Yii::app()->user->hasFlash('notice')):
        $profind_notificaciones .= '$.sticky("' . Yii::app()->user->getFlash('notice') . '", {autoclose : 5000, position: "top-center", type: "st-info" });';
    endif;

    $profind_notificaciones .= '}';
    $profind_notificaciones .= '}';

    Yii::app()->clientScript->registerScript('profind_notificaciones', $profind_notificaciones, CClientScript::POS_END);
}
?>