// JavaScript Document
jQuery(document).ready(function() {

	//When page loads...
	jQuery(".tab_content").hide();
	//Hide all content
	jQuery("ul.tabs li:first").addClass("active").show();
	//Activate first tab
	jQuery(".tab_content:first").show();
	//Show first tab content

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

		jQuery("ul.tabs li").removeClass("active");
		//Remove any "active" class
		jQuery(this).addClass("active");
		//Add "active" class to selected tab

		var activeTab = jQuery(this).find("a").attr("href");
		//Find the href attribute value to identify the active tab + content
		if(activeTab.substr(0, 1) != '#') {
			return;
		}
		
		jQuery(".tab_content").hide();
		//Hide all tab content
		jQuery(activeTab).fadeIn(700);
		//Fade in the active ID content

		if(activeTab == '#map') {
			initialize();
		}

		return false;
	});
});

