$(document).ready(function() {
	// Emulate :hover support for IE6
	if ($.browser.msie && $.browser.version == "6.0") {
		$('#nav > li').hover(function() {
			$(this).addClass('hover');
		}, function() {
			$(this).removeClass('hover');
		});

		$('.course-item').hover(function() {
			$(this).css('background-color', '#f9f9f9');

		}, function() {
			$(this).css('background-color', '');
		});

	}

	// Don't allow the current page to be refreshed via the nav bar
	$('#nav > li.selected > a:only-child').css('cursor', 'default').click(function() {
		return(false);
	});

	$('#nav > li > a').click(function() {
		var li = $(this).parent();
        li.siblings().removeAttr('class');
        li.attr('class', 'selected');
	});


	// override element height with auto
	$('#course-date-tabs').tabs().css({'height':'auto'});

	// add highlights to every other p
	$('.course-month p:odd').addClass('row-highlight');

	// Cycle the testimonials but only on the homepage
	if ($('#nav > li.selected > a').text() == 'Home') {
		$('#testimonials').cycle({
			timeout: 10000,
			speed: 500
		});
	}

	$('#slideshow').cycle({
		timeout: 10000,
		speed: 500
	});

	/* 2010-10-27 */
	var $tiles = $('.course.categories > li');
	$tiles.css('cursor', 'pointer').each(function() {
		$(this).click(function() {
			window.location.href = $(this).find('a').attr('href');
		});
	});

	$tiles.hover(function() {
		$(this).animate({ backgroundColor: "#f2f2f2" }, "normal");
	}, function() {
		$(this).animate({ backgroundColor: "#f9f9f9" }, "normal");
	});

	
	$('.news.more').hide();
	$('.news > a.more').css('cursor', 'pointer').before('<img src="/_images/icons/arr-right.gif">&ensp;');
	$('.news > a.more').click(function() {
			var $e = $('.news.more');
			$(this).prev('img').attr('src', '/_images/icons/arr-' + (($e.css('display') == 'none') ? 'down' : 'right') + '.gif');
			$e.toggle();

	});
	
	/* .hover(function() { 
		$(this).css('color', 'green')
	}, function() {
		$(this).css('color', 'black')
	}); */

});

// vim:ts=4:

