$(function() {
	var url=window.location;
	var anchorName=url.hash.substring(1); //anchor without the # character

	
	if (anchorName =='')
		switch_tabs($('.defaulttab'));
	else
		switch_tabs_for_id(anchorName);
	


	$('.tabs a').click(function() {
		switch_tabs($(this));
		// return false;
	});
	
	$('a.tablink').click(function() {
		switch_tabs($(this));
		// return false;
	});

});

function switch_tabs_for_id(id) {
	$('.tab-content').hide().removeClass("selected");

	obj = $('#'+id).show();
	//obj.addClass("selected");
	//window.location.hash = '#'+id;
}

function switch_tabs(obj) {
	$('.tab-content').hide()
	//$('.tab-content').hide().removeClass("selected"); //don't disable
	var id = obj.attr("rel");
	//alert(id);

	obj = $('#'+id).show();
	//obj.addClass("selected");
	//window.location.hash = '#'+id;
}

