/**
* 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
* JavaScript - zbiór funkcji
* wersja: 1.1
*/

/**
*	Obsługa menu górnego
*/
var selMenu; 	//id zaznaczonej pozycji menu
var selSubMenu; //id zaznaczonej pozycji submenu
function sMenu(id, sel) {
	if (id!=selMenu) { 
		$(id).src='/images/layout/'+id+'_'+sel+'.gif'; 
	}
}
function initMenu() {
	if (selMenu!='') { $(selMenu).src='/images/layout/'+selMenu+'_on.gif'; }
	if (selSubMenu!='') { $(selSubMenu).className='position over'; }
}
function sSubMenu(element, sel) {
	if (element.id!=selSubMenu) {
		if (sel=='on') { $(element.id).className='position over'; }
		else { $(element.id).className='position'; }
	}
}


//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=yes,"
        +"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;
}