$(document).ready(function(){
	initTabs('.tabset');
});
/*--- tabs function ---*/
function initTabs(h_list) {
	$(h_list).each(function(_ind, _el) {
		var btn_h = $(_el);
		var _btn = $(_el).find('a.tab');
		var _a = 0;
		_btn.each(function(_ind, _el) {
			this._box = $('#'+_el.href.substr(_el.href.indexOf("#") + 1));
			if($(_el).hasClass('active')) {
				this._box.show();
				_a = _ind;
			}
			else {
				this._box.hide();
			}
			_el.onclick = function() {
				if(!$(this).hasClass('active')){
					_btn.get(_a)._box.hide();
					_btn.eq(_a).removeClass('active');
					this._box.show();
					$(this).addClass('active');
					_a = _ind;
				}
				return false;
			}
		});
	});
}