//

function switchHomeNews(active, inactive)
{
    $('#nc'+inactive).hide();
    $('#ncb'+inactive).css("background-image", "url('/v2/themes/theme161/images/inactive.gif')");
    $('#nc'+active).show();
    $('#ncb'+active).css("background-image", "url('/v2/themes/theme161/images/active.gif')");
}

/* Emulates Suckerfish-style functionality with JQuery */
/* Adds animation effect for drop-down and fadeups */

function doNothing()
{
	//needed to make setTimeout happy;
}


$(document).ready(function(){
    $("#dfnmenu li").hover(
        function(){ $("ul", this).fadeIn("fast");  },
        function(){ $("ul", this).fadeOut("fast"); } 
    );
    if (document.all) {
        $("#dfnmenu li").hoverClass ("sfHover");
    }
    var containerElm = $('div#ncschedule').get();
//  var containerHeight = $('nschedule').height();
  var containerHeight = 310;
  var contentHeight = $('div#ncschedule table').height() + 25;
  var scrollSpeed = (contentHeight - containerHeight) * 100;

 function up(){
      var offset = 0;
      $('div#ncschedule').animate({scrollTop: offset}, scrollSpeed, 'linear', function(){
      	setTimeout(function(){down()}, 5000);
      	//down(); // private method
      });            
  }
  function down(){
      var offset = contentHeight - containerHeight + 5;
      $('div#ncschedule').animate({scrollTop: offset}, scrollSpeed, 'linear', function(){
      	setTimeout(function(){up()}, 5000);
          //up(); // private method
      });            
  }
  
    if(contentHeight - containerHeight > 10){
        // only start scrolling if there is something to scroll
        setTimeout(function(){down()}, 3000);
    }

});
 
$.fn.hoverClass = function(c) {
    return this.each(function(){
        $(this).hover( 
            function() { $(this).addClass(c);  },
            function() { $(this).removeClass(c); }
        );
    });
};



