$(document).ready(function (){
	$('html').addClass('js');
	$(".announcements").css('display','block');
	$(".marquee").marquee({
		loop: -1
		// this callback runs when the marquee is initialized
		, init: function ($marquee, options){		
			// shows how we can change the options at runtime
			//if( $marquee.is("#marquee") ) options.yScroll = "bottom";
			if( $marquee.is("#marquee") ) options.scrollSpeed = "18";
		}
		// this callback runs before a marquee is shown
		, beforeshow: function ($marquee, $li){
			// check to see if we have an author in the message
			var $author = $li.find(".author");
			// move author from the item marquee-author layer and then fade it in
			if( $author.length ){
				$("#marquee-author").html("<span style='display:none;'>" + $author.html() + "</span>").find("> span").fadeIn(850);
			}
		}
		// this callback runs when a has fully scrolled into view (from either top or bottom)
		, show: function (){
			
		}
		// this callback runs when a after message has being shown
		, aftershow: function ($marquee, $li){		
			// find the author
			var $author = $li.find(".author");
			// hide the author
			if( $author.length ) $("#marquee-author").find("> span").fadeOut(250);
		}
	});
});

//function pause(selector){
//	$(selector).marquee('pause');
//}

//function resume(selector){
//	$(selector).marquee('resume');
//}