$(document).ready( function(){
	$(".description-panel").each( function(){
		var currentNav = $(this).find(".panel-nav.current").find("a").attr("name");
		if (currentNav == undefined) {
			currentNav = $(this).find(".panel-nav:first").attr("name");
			if(currentNav == undefined){
				return false;
			}
		}
		$(this).find(".panel-content[title!=" + currentNav + "-content]").hide();
	});
});
$(".description-panel .panel-nav").live("click", function(){
	if(!$(this).hasClass("current")){
		var elementHeight = $(this).parent(".description-panel").height();
		$(this).parent(".description-panel").css("min-height", "200px");
		$(this).parent().find(".panel-nav.current").removeClass("current");
		$(this).addClass("current");
		var currentNav = $(this).find("a").attr("name");
		$(this).parent().find(".panel-content").slideUp("fast", function(){
			$(this).parent().find(".panel-content[title="+currentNav+"-content]").slideDown();
			$(this).parent(".description-panel").css("height", "auto");
		});
	}
	return false;
});
