$(document).ready(function(){	
	// set height of the wrapper
	var pageHeight = $(window).height();
	var pageWidth = $(window).width();
	$('div#candy').css('height', pageHeight - 115);
	$('div#scroll').css('height', pageHeight - 115);
	
	// due to a bug in jscrollpane the links menu must be outside the scrollable div
	var links = $('ul#outside').html();
	if (links != null) {
		$('div#candy').prepend('<ul id="moved">' + links + '</ul>');
		$('ul#outside').remove();
	}
	
	// downloads menu
	$('ul#performance ul').hide();
	$('ul#performance li h4').click( function() {
		var checkElement = $(this).next();
		var parent = this.parentNode.parentNode.id;

		if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
			$('#' + parent + ' ul:visible').slideUp('normal');
			return false;
		}
		if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
			$('#' + parent + ' ul:visible').slideUp('normal');
			checkElement.slideDown('normal');
			return false;
		}
	});
	$(".post table").each( function() {
		$(this).find("tr:even").css("backgroundColor", "#e6e7e6");
	}); 

	
});
