/**
* SoftCOM Spółka jawna - http://www.softcom.wroc.pl
* @author SoftCOM Spółka jawna <biuro@softcom.wroc.pl>
* @copyright Copyright (c) 2007-2008, SoftCOM Spółka jawna
* 
* JS Core
*
*/
var mgSel = "";
function mg(obj, show) {
	if (show==1) { $(obj.id).src = "/images/layout/"+obj.id+"_on.gif"; }
	else {
		if (mgSel!=obj.id) {
			$(obj.id).src = "/images/layout/"+obj.id+".gif";	
		}
	}
}



//funcja otwierająca okno
function aTarget(el, name, w, h)
{
 if(window.screen) {
  aw = screen.availWidth;
  ah = screen.availHeight;
 } else {
  aw = 1024;
  ah = 768;
 }
 
 settings =
        "left="+(aw-w)/2+","
        +"top="+(ah-h)/2+","
        +"screenX="+(aw-w)/2+","
        +"screenY="+(ah-h)/2+","
        +"width="+w+","
        +"height="+h+","
        +"toolbar=no,"
        +"location=no,"
        +"directories=no,"
        +"status=no,"
        +"menubar=no,"
        +"scrollbars=yes,"
        +"resizable=yes";
 var wnd = window.open(typeof el == 'string' ? el : el.getAttribute('href'), typeof name != 'undefined' ? name : '', settings);
 if (!wnd) return false;
 wnd.focus();
 return true;
}


/**
*	Funkcja wyświetla komunikat w podanej warstwie (divAppError, divAppWarning, divAppInformation)
*/
function showMessage(divName, message) {
	$(divName).update(message);
	$(divName).show();
	delayedHideMessages();
}

/**
*	Funkcja ukrywa warstwy komunikatów (divAppError, divAppWarning, divAppInformation)
*/
function hideMessages() {
	$("messageError").hide();
	$("messageWarning").hide();
	$("messageInfo").hide();
}


/**
*	Ukrywa komunikaty po 5 sekundach
*/
function delayedHideMessages() {
	window.setTimeout(hideMessages, 5000);
}


delayedHideMessages();