var tabSections;

function init() {
	//Hide the sections, set the height, overflow:scroll and hide their h1s
	tabSections = $('.jstabs .panel');
		
	//Show the tab controls
	tabControls = $('.jstabs .tabcontrols');
	 
	tabAs = $('li a', tabControls);

	tabAs.each(function(element) {
		$(this).attr("href", "javascript:void(0);");
	});
	
	/* Go gadget Tabs! */
	tabAs.click(function(element) {
		//Hide all the tabs
		tabSections.each(function(element) {
			$(this).css('display', 'none');
		});
		
		tabAs.each(function(element) {
			$(this).removeClass("highlight");
		});
		
		$(this).addClass("highlight");

		//Show the relevant one
		this.myTitle = $(this).attr('name');
		this.theDiv = $('#'+this.myTitle);
		this.theDiv.css('display', 'block');
		
	});
	
	//Start with the 1st one
	$(tabAs[0]).trigger('click');
}

$(document).ready(init);

