$(document).ready(function() {
	//When page loads...
	$(".tab_content").hide(); //Hide all content
	if(location.hash != "") {
		var target = location.hash.substr(2,1);
		if(target >= 1 && target <= 5) {
			$(location.hash).show(); //Show selected tab content
			$("ul.tabs li:has(a[rel=t"+target+"])").addClass("active").show();
		}
		else {
			$("ul.tabs li:first").addClass("active").show(); //Activate first tab
			$(".tab_content:first").show(); //Show first tab content
		}
	}
	else {
		$("ul.tabs li:first").addClass("active").show(); //Activate first tab
		$(".tab_content:first").show(); //Show first tab content
	}
	$('div.gallery a').lightBox();
	
	//On Click Event
	$("ul.tabs li").click(function() {
		if (!$(this).hasClass("active")) {
			$("ul.tabs li").removeClass("active"); //Remove any "active" class
			$(this).addClass("active"); //Add "active" class to selected tab
			$(".tab_content").hide(); //Hide all tab content
			$($(this).find("a").attr("href")).fadeIn(400, function(){if($.browser.msie) this.style.removeAttribute('filter');}); //Fade in the active ID content
		}
		return false;
	});
});
