  var server_name = 'www.hestia.pl';
  var LMeLi = new Array(); //["LMenu_1", ..."LMenu_xx"];
  var RMeLi = new Array(); //["RMenu_1", ..."RMenu_xx"];
  var TopMe = new Array();//["topMenuA", ..."topMenuXX"];
  var topMeOpen = false;
  var rootImg = 'pisc/';
  var doc = document;
  var ie = doc.all;
  var ns4 = doc.layers;
  var ns6 = (doc.getElementById&&!doc.all);
  var timerID = null;
  var timeout = 750;

  function pageMouseDown(event) {
    if (ie) var el = window.event.srcElement;
    else var el = (event.target.tagName ? event.target : event.target.parentNode);
    if(el.className == 'menugora' || el.className == 'topMeLOver' || el.className == 'topMeL') return true;
    hide_topMe();
  }
  function L_sh_block(obj){
    var obj2 = get_element( obj.id + '_node' );
    if (obj2 != null)
    {    
		var show = obj2.style.display != 'block';
	    for(i in LMeLi) hidden_block(LMeLi[i]);
		if(show) {
	      show_block(obj.id);
		  obj.onmouseover = function ()      {return false;}
	      obj.onmouseout  = function ()      {return false;}
		  obj.className=="Me_";
		}
    }
  }
  function R_sh_block(obj){
    var obj2 =get_element( obj.id + '_node' );
    if (obj2 != null)
    {    
		var show = obj2.style.display != 'block';
		for(i in RMeLi) hidden_block(RMeLi[i]);
	    if(show) {
		  show_block(obj.id);
	      obj.onmouseover = function ()      {return false;}
		  obj.onmouseout  = function ()      {return false;}
	      obj.className=="Me_";
		}
	}
  }
  function hidden_block(id_name){
    var obj = get_element( id_name + '_node' );
    if(obj != null)
	 {
		obj.style.display = 'none';
	    obj = get_element( id_name );
	    obj.onmouseover = function ()      {obj.className="Me_";}
	    obj.onmouseout  = function ()      {obj.className="Me";}
		obj.className = 'Me';
	 }
  }
  function show_block(id_name){
    var obj = get_element( id_name + '_node' );
    if(obj != null)
	{
		obj.style.display = 'block';
		obj = get_element( id_name );
	    obj.className = 'Me_';
	}
  }
  function shm(id_name){
    var obj = get_element( id_name );
    obj.className = obj.className != 'suMeLi_' ? 'suMeLi_' : 'suMeLi';

    obj = get_element( id_name+'se' );
    obj.className = obj.className != 'seMeLi_' ? 'seMeLi_' : 'seMeLi';
  }
  function hidden(id_name){
    var obj = get_element( id_name );
    obj.style.visibility = 'hidden';
  }
  function show(id_name){
    if(!topMeOpen){
      var obj = get_element( id_name );
      obj.style.visibility = 'visible';
      topMeOpen = true;
    } else { 
      topMeOpen = false;
      hidden(id_name);
    }
  }
  
  function hide_topMe(){
    for(var i in TopMe) hidden(TopMe[i]);
  }
  function sh(id_name){
    clearTimeout(timerID);
    hide_topMe();
//    if(topMeOpen) {
      var obj = get_element( id_name );
      obj.style.visibility = 'visible';
//    }
  }
  function link(url){
    window.location.href = url;
  }

  function topMeInit() {
    var all = document.getElementsByTagName( "*" );
    var l = all.length;
    var menuRe = /^topMeL/;
    var idRe = /^topMe/;
    var el, num;
    num = 0;
    for ( var i = 0; i < l; i++ ) {
      el = all[i]
      if(idRe.test(el.id)) TopMe.push(el.id);
      if ( el.className == "" ) continue;
      if (menuRe.test(el.className)) {
        num = num + 1;
        el.onmouseover = function ()    {this.className="topMeLOver"; clearTimeout(timerID);}
        el.onmouseout = function ()     {this.className="topMeL"; timerID=setTimeout('hide_topMe()',timeout);}
        el.onmousedown = function ()    {return false;}
        el.onmouseup = function ()      {return false;}
        el.ondragstart = function ()    {return false;}
        el.onsestart = function ()  {return false;}
//        el.onclick = function ()        {return false;}
      }
    }
  }
  function MeInit() {
    var all = document.getElementsByTagName( "DIV" );
    var l = all.length;
    var menuRe = /^Me/;
    var idRe = /^RMe/;
    var el, num;
    num = 0;
    for ( var i = 0; i < l; i++ ) {
      el = all[i]
      if ( el.className == "" ) continue;
      if (menuRe.test(el.className)) {
        num = num + 1;
        if ( el.className == "Me" ){
          el.onmouseover = function ()    {this.className="Me_";}
          el.onmouseout = function ()     {this.className="Me";}
        }
        el.onmousedown = function ()    {return false;}
        el.onmouseup = function ()      {return false;}
        el.ondragstart = function ()    {return false;}
        el.onsestart = function ()  {return false;}

        if (idRe.test(el.id)) {
          el.onclick = function ()        { R_sh_block(this);}
		  tmp = new Array(el.id);
		  RMeLi = RMeLi.concat(tmp);
        } else {
          el.onclick = function ()        { L_sh_block(this);}
		  tmp = new Array(el.id);
		  LMeLi =LMeLi.concat(tmp);
        }

      }
    }
  }
//   LMeLi.push(el.id);
  function setEvent(){
    if(ie){
      document.onmousedown = pageMouseDown;
    } else {
      document.addEventListener("mousedown", pageMouseDown, true);
    }
  }
  function clearEvent(){
    if(ie){
      document.onmousedown = function ()    {return false;}
    } else {
      document.removeEventListener("mousedown", pageMouseDown, true);
    }
  }
  function init(){
    setEvent();
    topMeInit();
    MeInit();
  }
    function get_element(s_id)
  {
  	return (document.all ? (document.all[s_id] == null? null:document.all[s_id]) : (document.getElementById(s_id) == null? null : document.getElementById(s_id)));
  }

function owu(windowURL) {
  window.name = 'parentWnd2';
  windowURL='www.SIG_Owu?NAZWA='+windowURL; 
  newWindow = window.open(windowURL,'OWU','width=800,height=600,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=yes,resize=1');
  newWindow.focus();
}

function new_owu(windowURL) {
  window.name = 'parentWnd2';
  windowURL='www.SIG_Owu?JAVA=1&NAZWA='+windowURL; 
  newWindow = window.open(windowURL,'OWU','width=800,height=600,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=yes,resize=1');
  newWindow.focus();
}

function agent_owu(windowURL) {
  window.name = 'parentWnd2';
  windowURL='www.SIG_AgentOwu?NAZWA='+windowURL; 
  newWindow = window.open(windowURL,'OWU','width=800,height=600,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=yes,resize=1');
  newWindow.focus();
}

function broker_owu(windowURL) {
  window.name = 'parentWnd2';
  windowURL='www.SIG_BrokerOwu?NAZWA='+windowURL; 
  newWindow = window.open(windowURL,'OWU','width=800,height=600,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=yes,resize=1');
  newWindow.focus();
}

var Okno = null;

// funkcja zwraca ustawienia okna
function ustawienia_okna(Width,Height,X,Y,scroll){
	return "width=" + Width + ","
	+ "height=" + Height + ","
	+ "location=no,"
	+ "menubar=no,"
	+ "resizable=no,"
	+ "scrollbars="+scroll+","
	+ "status=no,"
	+ "titlebar=no,"
	+ "toolbar=no,"
	+ "hotkeys=no,"
	+ "dependent=no,"
	+ "directories=no,"
	+ "fullscreen=no,"
	+ "channelmode=no,"
	+ "screenx=" + X + ","
	+ "screeny=" + Y + ","
	+ "left=" + X + ","
	+ "top=" + Y;
}


// funkcja otwiera nowe okno z podanym adresem
function okno(URL,Tytul,Width,Height,src,scroll,poz_x,poz_y){
	var Xokno;

	if(scroll==null) scroll = 1;
	if(poz_x==null) poz_x = 0;
	if(poz_y==null) poz_y = 0;

	if (navigator.appName == "Netscape" && eval(src) && eval(src +".closed")) eval(src +"=null");
	else 
	if ((navigator.appName != "Opera") && (eval(src)!=null) && (typeof(eval(src))!='object')) {eval(src+".close()");}

	poz_x = poz_x ? poz_x : (screen.width-Width)/2;
	poz_y = poz_y ? poz_y : (screen.height-Height)/2;
	poz_y -= 22;

	Xokno=window.open(URL,Tytul,ustawienia_okna(Width,Height,poz_x,poz_y,scroll));
//  Xokno.resizeTo(Width, Height);
//  Xokno.moveTo(poz_x, poz_y);
	Xokno.focus();
	eval(src +"=Xokno");
}

var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the FSCommand messages in a Flash movie.
function grafika_centralna_DoFSCommand(command, args) {
	var grafika_centralnaObj = isInternetExplorer ? document.all.grafika_centralna : document.grafika_centralna;
	//
  if (command == "mapa") {
    //    URL                              Width Height
    okno("www.SIG_Map","Hestia_Mapa","550","400","Okno",true);
  }
  if (command == "slownik") {
    //    URL                                 Width Height             X    Y
//    okno("www.SIG_Map","Hestia_Slownik","585","500","Okno",true,"750","50");
//	  okno("http://www2.hestia.pl/sigeh/servlet/www.SIG_Map","Hestia_Slownik","585","500","Okno",true,"750","50");
		okno("../../ppls/h/!slo.slownik","Hestia_Slownik","600","500","Okno",null,"150","50");
  }
	//
}
// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub grafika_centralna_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call grafika_centralna_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}
/*
function bot_DoFSCommand(command, args) {
	var botObj = isInternetExplorer ? document.all.bot : document.bot;
	//
  if (command == "bot") {
    //    URL                              Width Height
    okno("http://www.fido.pl/cgi-bin/hestia/hestia.cgi?ENTRY="+args,"Hestia_bot","218","460","Okno",false, screen.width-210, 120);
  }

	//
}
// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub bot_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call bot_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}
*/
//-->


