var currentModule;

function module_tab_object(id, modules, def) {
	this.id			= id;
	this.modules	= modules;
	this.def		= def;

	this.element	= $('id');
	this.current	= 0;

    var self    	= this;

	$(this.id).childElements().each(function(li, i) {
        li.observe('mouseover', function(event) {
			change_module(self, i);
        });
    });

	currentModule = self;
}

function change_module(module_object, i) {
	try {
		if (!module_object.modules[i]) return;

		$(module_object.modules[module_object.current]).hide();
		with ($(module_object.id).down('li', module_object.current)) {
			className	= className.sub('-hover', '');
		}

		with ($(module_object.id).down('li', i)) {
			className	= className + '-hover';
		}
		$(module_object.modules[i]).show();

		module_object.current = i;

		try {
			ScrollbarGroup.init([$(module_object.modules[i]).down('tbody').down('tr').down('td.content').down('div').down('div').id]);
		} catch(e) {}

	} catch(e) {};
}

function next_module_page() {
	change_module(currentModule, currentModule.current+1);
}