$(function() {
	// enable drop down menu in Explorer
	$('#nav>ul>li').mouseenter(function() {
		$(this).addClass('over');
	}).mouseleave(function() {
		$(this).removeClass('over');
	});

	// set select state on left menu
	(function() {
		var thisLoc = location.href;
		var thisPageName = thisLoc.substring(location.href.lastIndexOf('/') + 1, thisLoc.length - 4);
		$('#menu li a').each(function() {
			var pageName = $(this).attr('href');
			pageName = pageName.substring(pageName.lastIndexOf('/') + 1, pageName.length - 4);
		if (thisPageName == pageName) $(this).parents('li').addClass('select');
		});
	})();
});

// alternate display of items, for news ticker
(function($) {
	$.fn.rollItems = function(params) {

		return this.each(function(){

			var target = $(this).children();
			var itemCount = target.length;
			var index = 0;
			target.hide();
			target.eq(index).fadeIn(1000);
			var interval = setInterval(function() {
				target.eq(index).fadeOut(1000, function() {
					index++;
					if (index == itemCount) index = 0;
					target.eq(index).fadeIn(1000);
				});
			}, 5000);

		});

	}

}) (jQuery);

