$(document).ready(function() {
 //tabs   http://www.sohtanaka.com/web-design/simple-tabs-w-css-jquery/#blog
	
	
    var pathname = window.location.hash.substring(1);	
	var time = 400;
	var hovertime = 200;
	var greycoloroff = '#f8f8f8';
	var greycoloron = '#f0f0f0';
	
	$(".tab_content").hide();

	if(pathname.substring(3) < 10 && 
	   pathname.substring(3) > 0 && 
	   pathname.substring(0,3) == "tab"){
		$("ul.tabs li." + pathname).addClass("active");
		$("ul.tabs li." + pathname).children().css({'background-color': '#fff'});
		$("div#" + pathname).addClass("current").fadeIn(2*time);}
	else{
		$("ul.tabs li:first").addClass("active");
		$("ul.tabs li:first").children().css({'background-color': '#fff'});
		$(".tab_content:first").addClass("current").fadeIn(2*time);}
	
	
	$("a.clicker").click(function() {
		if(!$(this).parent().hasClass("active")){
			$(".current").stop(true,false).fadeOut(time);
			$(".current").queue(function(next){$(this).removeClass("current");next();});
			$("ul.tabs li").removeClass("active");
			$("ul.tabs li").children().css({'background-color': ''});;
			$(this).parent().addClass("active");
			$(this).css({'background-color': '#fff'});
			var activeTab = $(this).attr("href");
			$(activeTab).addClass("current").delay(time + 5).fadeIn(time);}});
	
	$("ul.tabs li li").hover(
		function(){
			$(this).gx({'background-color': greycoloron},hovertime, 'Linear');
			$(this).parent().parent().css({'background-color': greycoloron});},
		function(){
			$(this).gx({'background-color': greycoloroff},hovertime, 'Linear');
			$(this).parent().parent().css({'background-color': greycoloroff});});

	$("ul.tabs li").hover(
		function(){
			$(this).gx({'background-color': greycoloron},hovertime, 'Linear');},
		function(){
			$(this).gx({'background-color': greycoloroff},hovertime, 'Linear');});
	
});
