var tIn = -1;
var tOut = -1;
var pn = null;
var przyc_dokuj_panel = null;
var menu_podr = null;


// Obs³uga zdarzeñ
function DoScroll()
{
  pn.style.top = parseInt(document.body.scrollTop) + 100 + 'px';
}

// function DocLoad()
// {
//  pn = document.getElementById("panel");
//  przyc_dokuj_panel = document.getElementById('przyc_dokuj_panel');
//  pn.panel_locked = false;
//  pn.onmouseover = PanelMOver;
//  pn.onmouseout = PanelMOut;
//  window.onscroll = DoScroll;
//  ZmienStanMenuPodr('menu_podr_id_0');
//  DoScroll();
//  loop2;
// }

function openwindow(){
 window.open ("","Help","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=600,height=400");
}

function launch(URL, newName, newFeatures, orgName) {
  var remote = open(URL, newName, newFeatures);
  if (remote.opener == null)
    remote.opener = window;
  remote.opener.name = orgName;
  return remote;
}

function openWindow(URL) {
  Popup = launch(URL, 'popup', 'dependent=0,height=600,width=900,screenX=200,left=50,screenY=200,top=50,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0', 'launcher');
}

function launch(URL, newName, newFeatures, orgName) {
  var remote = open(URL, newName, newFeatures);
  if (remote.opener == null)
    remote.opener = window;
  remote.opener.name = orgName;
  return remote;
}

function openWindow(URL) {
  Popup = launch(URL, 'popup', 'dependent=0,height=600,width=900,screenX=200,left=50,screenY=200,top=50,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0', 'launcher');
}
// Rózne funkcje
function galeria(href, szer, wys)
{
  var scrBars;
  var nazwa = 'Podgl±d';
  if ((wys > screen.availHeight) || (szer > screen.availWidth))
  {
    var ratio = Math.min((screen.availHeight-40) / wys, (screen.availWidth-40) / szer);
    scrBars = 'yes';
    wys = Math.round(wys * ratio);
    szer = Math.round(szer * ratio);
  }
  else
    srcBars = 'no';
  var cont = '<html><head><title>'+ nazwa +
  '</title></head><body style="margin: 0; padding: 0"><a href="javascript:self.close()" title="Kliknij, ¿eby zamkn±æ..."><img src="' + href +
  '" alt="Kliknij, ¿eby zamkn±æ..." border="0" /></a></body></html>';
  var attr = 'height=' + wys + ', width=' + szer +
  ',left=' + (screen.availWidth - szer >> 1) +
  ',top=' + (screen.availHeight - wys >> 1) +
  ',menubar=no,status=no,toolbar=no,scrollbars=' + scrBars +
  ',resizable=no';
  var w = window.open("","",attr);
  if (w)
  {
    w.document.open();
    w.document.write(cont);
    w.document.close();
    w.focus();
  }
}

var popWindow;
function noweOkno(winID, szer, wys)
{
  var scrBars;
  var nazwa = 'Wa¿ne informacje';
  // sprawdzic czemu nie przenosi parametru
  var winURL = "newWindow.php?winID=" + winID;
  if ((wys > screen.availHeight) || (szer > screen.availWidth))
  {
    var ratio = Math.min((screen.availHeight-40) / wys, (screen.availWidth-40) / szer);
    scrBars = 'yes';
    wys = Math.round(wys * ratio);
    szer = Math.round(szer * ratio);
  }
  else
    srcBars = 'no';
 // var cont = '<html><head><title>'+ nazwa + '</title></head><body style="margin: 0; padding: 0"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><? INCLUDE("$href"); ?></td></tr><tr><td><a href="javascript:self.close()" title="Kliknij, ¿eby zamkn±æ...">Kliknij, ¿eby zamkn±æ...</a>  </td></tr></table></body></html>';
  var attr = 'height=' + wys + ', width=' + szer +
  ',left=' + (screen.availWidth - szer >> 1) +
  ',top=' + (screen.availHeight - wys >> 1) +
  ',menubar=no,status=no,toolbar=no,scrollbars=' + scrBars +
  ',resizable=no';

  if (!popWindow || popWindow.closed)
  {
	popWindow = window.open(winURL,'popWindow',attr);
  }
  else{
		popWindow.focus();
		popWindow.location = winURL;
  }
}




// window.onload = DocLoad;

