// remap jQuery to $
(function($){
	
// Add .first and .last classes to certain lists
//$(".tabs li:first").addClass("first");
//$(".tabs li:last").addClass("last"); 
 
 
	//Default Action
	//$(".tab_content").hide(); //Hide all content
	//$(".tabs li:first").addClass("active").show(); //Activate first tab
	//$(".tab_content:first").show(); //Show first tab content
	
	$(".tab_content").hide();
	$(".tabs li:last").addClass("active").show();
	$(".tab_content:last").show();
	
	//On Click Event
	$(".tabs li").click(function() {
		$(".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 rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
	
	
 
// Check if the URL contains an anchor
	var url = document.location.toString();
	if (url.match('#')) {
		
		// Get the name of the anchor used in the URL
		var anc = '#' + url.split('#')[1];
		
		// Hide all TABS -
		$('.tab_content').hide();
		
		$(".tabs li").removeClass("active"); //removes all active so we can fire the next call
		
		$('.tabs li a[href='+anc+']').parent().addClass("active"); // make specific tab active
		
		// Show the corresponding content
		$(anc).show();      
		
	}
 
 


// else 

// Hide all Tabs except the first one - 
// if(i===0) $('.tab_content:not(#'+this.id+')').hide();
 
 
 
 
})(this.jQuery);
//end all jQuery-ness
