$(function() {

	$("#sidenav li li:has(ul) > a").click(function() {
		return false;
	});
	
	$("#sidenav > ul > li:has(ul) > span > a").click(function() {

		var li = $(this).parent().parent();
	
		if (!li.hasClass("open"))
		{
			li.siblings(".open").removeClass("open")
			   .find("ul").slideUp(100)
			   .end().end().addClass("open")
			   .children("ul").slideDown(100);
		}
		else
		{
			li.removeClass("open").children("ul").slideUp(100);
		}

		return false;

	});
	
	$("#sidenav ul ul").superfish({
		animation: { opacity: 'show' },
		speed: 0,
		autoArrows: false,
		dropShadows: false
	});

	if (typeof page !== "undefined" && page === 'home')
	{
		$(window).load(function() {
			var sourceheight = $(".left-col > div").height();
			$(".right-col > div").css("height", sourceheight);
			$('.right-col > div').jScrollPane();
		});
	}

	/* Open Useful Downloads in new tab */
	$('a.new-window').click(function(e){
		e.preventDefault();
		window.open($(this).attr('href'));
	});

	 $('#banner-img').cycle({
		fx: 'fade',
		speed: 2000,
		timeout: 500,
		continuous: 0
	});

});





