<?php $__env->startSection('page_title'); ?>
    OSAA - Activities
<?php $__env->stopSection(); ?>

<?php $__env->startSection('live_alert'); ?>
    
    <?php
        GeneralController::getLiveAlert();
    ?>
    
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_sub_title'); ?>    
    <?php echo $info['page_sub_title']; ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
    @parent

    <style type="text/css">

        #track_sub_menu {
            <?php
                $a = '#e9f0f8';
                $b = '#bdbbbd';
            ?>

            border-top: 1px solid #7d7b7d;
            border-bottom: 2px solid #589FD6;
            margin-top: -9px;
            width: 1030px;   
            height: 31px;                     
            background: #C7CFD0;
            background: -moz-linear-gradient(top, <?php echo $a; ?> 0%, <?php echo $b; ?> 100%);
            background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, <?php echo $a; ?>), color-stop(100%, <?php echo $b; ?>));
            background: -webkit-linear-gradient(top, <?php echo $a; ?> 0%, <?php echo $b; ?> 100%);
            background: -o-linear-gradient(top, <?php echo $a; ?> 0%, <?php echo $b; ?> 100%);
            background: -ms-linear-gradient(top, <?php echo $a; ?> 0%, <?php echo $b; ?> 100%);
            background: linear-gradient(to bottom, <?php echo $a; ?> 0%, <?php echo $b; ?> 100%);
        }

        #track_sub_menu ul,
        #track_sub_menu ul li,
        #track_sub_menu ul li a {
            margin: 0;
            padding: 0;
            border: 0;
            list-style: none;
            line-height: 1;
            display: block;
            position: relative;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;  
        }
        
        #track_sub_menu ul {            
            box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.05);
            padding-left: 0 !important;
            display: block;
            clear: both;
        }

        #track_sub_menu ul li {
            float: left;
            display: inline-block;
        }

        #track_sub_menu ul li a {
            padding: 8px 15px 10px 15px;
            border-right: 1px solid rgba(80, 80, 80, 0.12);
            text-decoration: none;
            font-size: 13px;
            font-weight: 700;
            color: #005fa9;
            /*text-transform: uppercase;*/
            letter-spacing: 1px;
        }

        #track_sub_menu ul li:hover a,
        #track_sub_menu ul li a:hover,
        #track_sub_menu ul li.active a {
            color: #ffffff;
            background: #32a9c3;              
            background: rgba(0, 0, 0, 0.1);
        }        

        #resultsFrame {
            width: 1030px;
            height: 5000px;
            min-height: 5000px;
            border: none;
            margin: 0;
            padding: 0;            
        }

        #full_page_content {
            margin-bottom: -3px;
        }

    </style>

<?php $__env->stopSection(); ?>


<?php $__env->startSection('jquery_init'); ?>
  
    $('.page_functions').remove();

    var space = '<div style="height: 5em;">&nbsp;</div>';
    var more = '<?php echo AdsController::getAd('160x600'); ?>';    
    var more_2 = '<?php echo AdsController::getAd('160x600'); ?>';
    var more_3 = '<?php echo AdsController::getAd('160x600'); ?>';
    var more_4 = '<?php echo AdsController::getAd('160x600'); ?>';
    var more_5 = '<?php echo AdsController::getAd('160x600'); ?>';
    var more_6 = '<?php echo AdsController::getAd('160x600'); ?>';

    $('#wide_scraper_ad')
        .css({'height' : 'auto'})
        .append(space, more, space, more_2, space, more_3, space, more_4, space, more_5, space, more_6, space);

    <?php /*  $('#resultsFrame').load(function()
    {
        var results_frame = $(this);

        var current_height = 0;

        setInterval(function()
        {
            //var h = results_frame.contents().find('[name="main"]body').height();
            //var h = results_frame.contents().find('body').height();
            
            var inner_frame = $('[name="main"]', results_frame.contents());
            var h = inner_frame.contents().find('body').height();


            var inner_frame = $(window.main, results_frame);
            console.log(inner_frame.html());




            if (h != current_height)
            {
                current_height = h;
            }
            else
            {
                return;
            }
                
            console.log("Height = " + h);

            if (h < 5000)
            {
                h = 5000;
            }

            results_frame.height(h);
        }, 500);
    });  */ ?>
   
<?php $__env->stopSection(); ?>


<?php $__env->startSection('main_content'); ?>   

    <div id='track_sub_menu'>
        <ul>
            <?php foreach ($info['links'] as $path => $text): ?>

                <li <?php if (Helpers::strEqual($path, 'results')): ?> class="active" <?php endif; ?>>
                    <a href="<?php echo url('/activities/' . $info['activity_slug'] . '/' . $path); ?>"><?php echo $text; ?></a>
                </li>

            <?php endforeach; ?>
        </ul>
    </div>
        
    <iframe id="resultsFrame" src="<?php echo $info['source']; ?>"></iframe>

<?php $__env->stopSection(); ?>