﻿// 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 counti=0;
        var st=1;      
       
       
       
        
        // Ride the carousel...
        jQuery(document).ready(function () 
        {
       
            $('#mycarousel > li').each
            (
                function()
               {
                    counti++; 
                    var tempdate=new Date(Date.parse($(this).attr('id')));
                    if(tempdate<new Date())
                    {
                        st=counti;
                    }
               } 
            );
        
            jQuery("#mycarousel").jcarousel({
                vertical: true,
                scroll: 2,
                initCallback: mycarousel_initCallback,
                start: st,
            });
        

       
        });



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;
    }
}


