/***************************************************
				  TABBED AREA
***************************************************/



$(document).ready(function() {

	//When page loads...
	var myFile = document.location.toString();
	$(".tab_content").hide(); //Hide all content
  if (myFile.match('#')) { // the URL contains an anchor
     var myAnchor = '#' + myFile.split('#')[1];
     $(myAnchor).addClass("active").show();
     $(myAnchor + "_menu").addClass("active");
     $.scrollTo($("#tabsarea"));
  }else{
	
	   $("ul.tabs li:first").addClass("active").show(); //Activate first tab
	   $(".tab_content:first").show(); //Show first tab content
	}

	//On Click Event
	$("ul.tabs li.doit").click(function() {

		$("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

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		$.scrollTo($("#tabsarea"));
		try{
		map.checkResize();
		map.setCenter(new GLatLng(52, 19), 6);
		}catch(err){};
		
		return false;
	});
	
	
  $("a.tabber").click(function() {
    var activeTab = $(this).attr("href");
    activeTab = '#' + activeTab.split('#')[1];
    $(".tab_content").hide(); //Hide all tab content
    $("ul.tabs li").removeClass("active"); //Remove any "active" class
    $(activeTab + "_menu").addClass("active");
    $(activeTab).fadeIn(); //Fade in the active ID content
		$.scrollTo($("#tabsarea")); 
		try{
  		map.checkResize();
	   	map.setCenter(new GLatLng(52, 19), 6);
		}catch(err){};
    return false; 
  });


});

