cLicked = "";
whichPanel = "";

$(document).ready(function(){
	$(".trigger").click(function(){
		//----toggle active class for + - when clicking a dif area
		if (String(whichPanel) != $(this).attr("id")+"Panel" & String(whichPanel) != ""){
			whichTab = String(whichPanel).substring(-String(whichPanel).length,String(whichPanel).length-5)
			$("#"+whichTab).toggleClass("active");
		}
		//var for clicked Panel
		whichPanel = $(this).attr("id")+"Panel";
		
		//hide all panels
		$(".panel").hide("slow");
		
		//check if panel is out and either hide if out or show if hidden
		if(cLicked == String(whichPanel))
		{
			//alert(cLicked+" true");
			$("#"+whichPanel).hide("slow");
			cLicked = "";
			whichPanel = "";
		}else{
			//alert(cLicked+" false");
			cLicked = String(whichPanel);
			$("#"+whichPanel).show("fast");
		}	
		//toggle active class of clicked tab
		$(this).toggleClass("active");
		
		return false;
	});
	
	$("a[rel^='prettyPhoto']").prettyPhoto();
	
	//alert(jQuery.browser.version);
});
