/* tabs
 * widget by IonDen
 * v. 2.1
 * 01.03.2010
 * rev. 22
 * depends on jQuery 1.4
 */

$(document).ready(function(){
	var tabsNum = $(".tabs a").length;
	var tabHash = document.location.hash;
	if(tabHash === "") {tabHash = "#tab0"};
	var currentTab = parseInt(tabHash.slice(4));
	$(".tabs a[href='" + tabHash + "']").addClass("on");

	$(".tabs a").click(function() {
		$(".tabs a").removeClass("on");
		$(this).addClass("on");
		$(this).blur(0);
		tabHash = $(this).attr("href");
		currentTab = parseInt(tabHash.slice(4));
		setTabs();
	});

	function setTabs() {
		$("div.tab").hide();
		$("#tabCont" + currentTab).show();
	};
	setTabs();
});
