<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
/**
 * include some common code (like we did in the 90s)
 * People still do this? ;)
 */
include_once './common.php';

function special_display_archives_list($archives_list, $box_class, $url_root, $basepath, &$translate) {
    
    
    for($i=0;$i<count($archives_list);$i++) {
        print("             <div class=\"$box_class\">\n");
        $archive_ref = $archives_list[$i];
    
        $archive_name = $archive_ref;
        $metadata = null;
        if(is_array($archive_ref)) {
            $archive_name = $archive_ref[0];
            $metadata = $archive_ref[1];
        }
        print(get_archive_box($archive_name,$metadata, $url_root, $basepath, $translate));
        print("             </div>\n");
    }
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="<?php echo($actual); ?>">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Polemic tweet - Live Video and Annotation</title>

    <link rel="stylesheet" href="<?php echo(registry_url('archives-iframe','css'));?>" type="text/css" media="screen, projection"/>

    <!-- JAVASCRIPT -->
    <script type="text/javascript" src="<?php echo(registry_url('jquery','js'));?>"></script>
    <script type="text/javascript" src="<?php echo(registry_url('jquery-tools','js'));?>"></script>

    <!-- FONT -->
    <link href='<?php echo(registry_url('PT-Sans_Narrow','font'));?>' rel='stylesheet' type='text/css'>

    <script type="text/javascript">
        var _timerJqScroll;
        function startTimer() {
            if (_timerJqScroll) {
                clearInterval(_timerJqScroll);
            }
            _timerJqScroll = setInterval(function() { $(".scrollable").scrollable().next()}, 8000);
        }
        $(function() {
            $(".archivesVideoBox").mouseover(function() {
                $(this).css({'backgroundColor':'#fff'});
                $(this).cursor = "pointer";
            }).mouseout(function() {
                $(this).css({'backgroundColor':'#f2f2f2'});
            });
            $(".scrollable").scrollable({"circular":true});
            $(".browse, .item").click(function() {
                startTimer();
            })
            startTimer();
            $("a").attr("target", "_blank");
        });

        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-23581291-1']);
        _gaq.push(['_trackPageview']);
        _gaq.push(['_setAllowAnchor', true]);
      
        (function() {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();
    
    </script>
  </head>
  <body>
        <div class="archivesBoxContainer scrollable">
            <!-- -->
            <div class="archivesTitleActionsContainer">
                <div class="archivesActionsContainer" id="actions">
                    <a class="prev browse left">&laquo;&nbsp;</a>
                    <a class="next browse right">&nbsp;&raquo;</a>
                </div>
                <h3 class="archivesTitle">Polemic Tweet</h3>
            </div>
            
            <!-- -->
            <div class="items">
                <?php
                $arch_list = array_reverse($archives_list);
                special_display_archives_list($arch_list, "archive_box_3 item", URL_ROOT, dirname(__FILE__)."/", $translate);
                ?>
            </div>
        </div>
  </body>
</html>