//var dbgFlag = false; // magic debugging

document.observe('dom:loaded', function(){ // one and only domload observer, order is important!
	tabInit();
});

function tabInit() {
//	dbg('tabInit');

	$$('.j-tab').each(function(el){
		if (el.down('.active') != undefined) {
			cn = el.down('.active').down('a').readAttribute('href').split('=').last();
			ok = true;
		} else ok = false;

		new Control.Tabs(el);

		if (ok) Control.Tabs.findByTabId(cn).setActiveTab(cn);  
	});

//	dbg('tabInit');
}

