﻿// JScript File
        var t;
        var timecounter = 1000;

        function timedCountnext(carousel) {
            carousel.next();
            t = setTimeout(function () { timedCountnext(carousel) }, timecounter);
        }

        function timedCountprev(carousel) {
            carousel.prev();
            t = setTimeout(function () { timedCountprev(carousel) }, timecounter);
        }


        function autonext(carousel) {                
                clearTimeout(t);
                timedCountnext(carousel);
        }

        function autoprev(carousel) {
            clearTimeout(t);
            timedCountprev(carousel);
        }



        function mycarousel_initCallback(carousel) {
            jQuery('#mycarousel-next').bind('click', function () {
                carousel.next();                
                //autonext(carousel);
                return false;
            });

            jQuery('#mycarousel-prev').bind('click', function () {
                carousel.prev();
                //autoprev(carousel);
                return false;
            });

//            jQuery('#mycarousel-next').bind('mouseout', function () {
//                clearTimeout(t);
//                return false;
//            });

//            jQuery('#mycarousel-prev').bind('mouseout', function () {
//                clearTimeout(t);
//                return false;
//            });

        };

        var dt=new Date();
        var hours=dt.getHours();
        var st=(hours-7)*2-1;
        if(st<1)
        {
            st=1;
        }  
        // Ride the carousel...
        jQuery(document).ready(function () 
        {
            jQuery("#mycarousel").jcarousel({
                vertical: true,
                scroll: 2,
                initCallback: mycarousel_initCallback,
                start: st,
                // This tells jCarousel NOT to autobuild prev/next buttons
//                buttonNextHTML: null,
//                buttonPrevHTML: null
            });
           
          $('#whatontoday').css("visibility", "visible");
  
        });



function getScheduleInfo()
{
    var oRequest = new XMLHttpRequest();
    var sURL  = "/Xml/ScheduleXml/DailyTxt.aspx";
    oRequest.open("GET",sURL,false);
    oRequest.setRequestHeader("User-Agent",navigator.userAgent);
    oRequest.send(null)
    if (oRequest.status==200) 
    {
        var resArray=oRequest.responseText.split("[@]");     
        var ob=document.getElementById("webcontent");
        ob.innerHTML=oRequest.responseText;
    }
}


