// Add the class 'js' to the body element on load
$("html").addClass("js");

$(document).ready(function() {

	// Adds striping to the odd rows of any data table
	$("#main-content tbody tr:odd").addClass("alt");
	
	// Controls the portfolio switching on the work section
	var workDetails = $("div.showcase");
	workDetails.hide().filter(':first').show();

	$('#portfolio ul a').click(function () {
    		workDetails.hide();
    		workDetails.filter(this.hash).fadeIn("slow");
    		$('#portfolio ul a').removeClass('active');
    		$(this).addClass('active');
    		return false;
	}).filter(':first').click();
	  
	// Adds a class to the first and last comments for border radius  	
	$("ol#comments li:first").addClass("br-first");
	$("ol#comments li:last").addClass("br-last");
	  
	// Animated scroll to top function
	$("a#toplink").click(function(){
		$('html, body').animate({scrollTop:0}, "slow");
		return false;
	});

});