if( window.location.hash )
{
  //added to remove the hash from new page loads
  window.location.href = window.location.href.replace( window.location.hash, '' );
}

var jefftabs = new Class({
	Implements: [Options],

	options: {
		onActivateTabFunction: $empty
	},
 
	initialize: function( element, options ) {
		if(options) this.setOptions(options);

		this.el = $(element);
		this.elid = element;

		this.titles = $$('#' + this.elid + ' ul.jefftabs_title li');
		this.panels = $$('#' + this.elid + ' div.jefftabs_panel');

		this.titles.each(function(el,idx) {
			el.onclick = (function (x,obj) { return function() { obj.activateTab(x); } })(idx,this)
		}.bind(this)); // each
	},

	activateTab: function(tabidx) {
		this.titles.removeClass('active');
		this.panels.removeClass('active');

		this.titles[tabidx].addClass('active');
		this.panels[tabidx].addClass('active');

		this.options.onActivateTabFunction(tabidx);
	}	
}); // class..jeffTabs