// var $j = jQuery.noConflict();

jQuery(document).ready(function($) {
	$('table.zebra tr:odd').addClass('odd');
	$('table.zebra tr:even').addClass('even');
	$('.courses-results li').clickableBlocks();
	$('#home-slideshow li').clickableBlocks();
	$('.search-result').clickableBlocks();
	$('.widget-container').clickableBlocks();
	$('.post .entry-content').clickableBlocks();

	$('#home-slideshow').innerFade({
		animationtype: 'fade',
		speed: 1250,
		timeout: 6000,
		type: 'sequence',
		containerheight: '300px'
	});

	$.browser.msie && $("#home-slideshow li").css("left", 0);

	if ( $("#search-form #s").val() == "" )
	{
		$('#search-form #s').val("Search");
		$('#search-form #s').css({
			'color': 'rgb(180,180,180)',
			'text-align': 'center'
		});
	}

	$('#search-form #s').focus(function() {
		if ( $('#search-form #s').val() == "Search" )
		{
			$('#search-form #s').css({
				'color': 'rgb(130,130,130)',
				'text-align': 'left'
			});
			$('#search-form #s').val("");
		}
	});
	$('#search-form #s').focusout(function() {
		$('#search-form #s').val("Search");
		$('#search-form #s').css({
			'color': 'rgb(180,180,180)',
			'text-align': 'center'
		});
	});

	$('#nav-quick-links A').toggle(
		function()	{
			$('#navigation-quick-links').slideDown(400, function()	{});
		},
		function()	{
			$('#navigation-quick-links').slideUp(400, function()	{});
		}
	);

});

(function ($) {
	$.fn.clickableBlocks = function ()
	{
		return this.each (function () {
			var $this = $(this);
			var $anchor = $this.find("a");
			if ($anchor.length)
			{
				$this.css("cursor", "pointer").click (function ()
				{
					location.href = $anchor[0].href;
				});
			}
		});
	}
})(jQuery);


