
/**
 * toggles left or right panel on and off
 */
toggle_panel = function(which) {
	with ($('layout')) {
		style.height = screen.availHeight + 'px';
	}

	with ($(which+'-panel')) {
		className = className != 'hidden' ? 'hidden' : '';
	}
}


mainmenu_setmod = function(modname)
{
	$('mod-' + modname).className = 'active';
}


/**
 * pagination tool
 */
turn_page = function(element, url)
{
	if (!arguments[2]) {
		page = parseInt($('page-num').value);
		if (isNaN(page)) {
			alert('Błędna wartość w polu strony docelowej.');
			return false;
		}
	} else {
		page = arguments[2];
	}

	params = 'page=' + page;

	if (arguments[3]) {
		params = params + '&size=' + arguments[3];
	}

	new Ajax.Updater(element, url, {
		method: 'get', parameters: params,
		evalScripts: true,
		onSuccess: function() {
		}
	});
}

