$(document).ready(function(){
	
	
	function scrollToBottom() {
	
		var windowHeight = $(window).height();
		var pageHeight = $(document.body).height();
				
		if(windowHeight < pageHeight) {
			window.scrollTo(0,pageHeight);
		}
	}
	
	$(".panel:not(:first)").hide();

	$(".panel:first").show();
	
	$("#tabs li:first-child").addClass("selected");
	
	$("#tabs a").click(function(){
		stringref = $(this).attr("href").split('#')[1];
		
		$('.panel:not(#'+stringref+')').hide();
		
		$("#tabs li").removeClass("selected");
		
		$(this.parentNode).addClass("selected");
		
		
		if ($.browser.msie && $.browser.version.substr(0,3) == "6.0") {
			$('.panel#' + stringref).show();
		}
		else 
			$('.panel#' + stringref).fadeIn();
		
		scrollToBottom();
		return false;
	});
	
});
