/// Autor: Mirosław Kuduk -  mkuduk@interia.pl

  oknoRysunek=''
function okno1(plik1, oknow,oknoh,pozt,pozl)
{

 oknoRysunek = window.open(plik1, "oknoRys","scrollbars=0, status=0, resizable=1, width="+oknow+", height="+oknoh+" , Top="+pozt+", left="+pozl)
 oknoRysunek.resizeTo(oknow,oknoh);
 oknoRysunek.focus()
}
function okno2(plik1, oknow,oknoh,pozt,pozl)
{
 oknoRysunek = window.open(plik1, "oknoRys","scrollbars=1, status=1, resizable=1, width="+oknow+", height="+oknoh+" , Top="+pozt+", left="+pozl)
 oknoRysunek.resizeTo(oknow,oknoh);
 oknoRysunek.focus()

}

function okno3(plik1, oknow,oknoh,pozt,pozl)
{


 oknoRysunek = window.open(plik1, "oknoRys","scrollbars=1, menubar=1, status=1, resizable=1, width="+oknow+", height="+oknoh+" , Top="+pozt+", left="+pozl)
 oknoRysunek.resizeTo(oknow,oknoh);
 oknoRysunek.focus()

}

function oryginalnep(kto,napis)
{

//tmp= new Date();
//tmp=tmp.getTime();
document.zdjecieor.src='sisgrafika/laduj.gif'
 // oknow=500
 // oknoh=450
//  rysunek=kto
//  oknoRysunek = window.open('', "oknoRys","scrollbars=yes, status=yes, resizable=yes, width="+oknow+", height="+oknoh+" , Top=10, left=10")
//  oknoRysunek.document.open(); kolor=document.body.bgColor; tlo=document.body.background;
//  oknoRysunek.document.writeln("<html><LINK href='styl1.css'   rel=stylesheet type=text/css>")
//  oknoRysunek.document.write(" <body background='sisgrafika/tlo01.gif' style='background-repeat: no-repeat; background-position: left top'  ")
//  oknoRysunek.document.write("  OnLoad=\"JavaScript:resizeTo(document.zdjecie.width+100,document.zdjecie.height+120);\"><center>")
//   oknoRysunek.document.writeln("<a title='Zamknij'  href='javascript:window.close()'  ><img name='zdjecie' border=1 src='"+rysunek+"'></a>")
 // oknoRysunek.document.writeln("<br><span class='artykolty'>"+napis+"</span></center></body></html>")
 //  oknoRysunek.document.close()
// oknoRysunek.focus()

//tmp= new Date();
//tmp=tmp.getTime();
//document.body.clientHeight
//document.body.scrollTop self
document.zdjecieor.src=kto+'?'+'tmp'
document.getElementById('tytulz').innerHTML=napis
//window.scrollMaxX
//pokazdiv('zdjecieodiv',0,0,document.width,document.height)
  document.getElementById('divtlos').style.width=document.body.scrollLeft+screen.width+100
 document.getElementById('divtlos').style.height=document.body.scrollTop+screen.height+1200




// alert(document.body.offsetWidth)
//alert(document.body.offsetHeight)               // 
 // alert(document.body.scrollHeight)
 //alert(document.body.scrollWidthMax)

  document.getElementById('divtlos').style.visibility='visible'
pokazdiv('zdjecieodiv',0,0,screen.width-100,200)
//  pokazdiv('zdjecieodiv',0,0,screen.width,screen.height)
 //document.getElementById('zdjecieodiv').style.top=document.body.scrollTop+top1;
// document.getElementById('zdjecieodiv').style.left=document.body.scrollLeft+left1;
 
}
///////////////////////


function decyzja1(komunikat,plik1, oknow,oknoh,pozt,pozl,okno)
{
if(confirm(komunikat))
 {



  if( okno==1) { okno1(plik1, oknow,oknoh,pozt,pozl)}
  else
  if( okno==2) { okno2(plik1, oknow,oknoh,pozt,pozl)}
 


 }

}

///////
function zamknijp()
{

if (oknoRysunek) 
{ 

oknoRysunek.close();

}
}
function bobjekt()
{
 if (window.XMLHttpRequest)
  {
     ObiektXMLHttp = new XMLHttpRequest(); }
   else if (window.ActiveXObject)
      {
     ObiektXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
 }
}


function wpiszp(aa,cc)
{
  bobjekt()
   tmp = new Date();
   tmp=tmp.getTime();
   zrodlo=aa+'&t='+tmp+'aa'
   if(ObiektXMLHttp)
  {
   var cel = document.getElementById(cc);
   ObiektXMLHttp.open("GET", zrodlo);
   ObiektXMLHttp.setRequestHeader("Content-Type",'text/xml')
   ObiektXMLHttp.onreadystatechange = function()
  {
   if (ObiektXMLHttp.readyState == 4)
   {
     cel.innerHTML = ObiektXMLHttp.responseText;
     window.focus();
   }
}
 ObiektXMLHttp.send(null); }
}


///////////////////////

function pokazdiv(kto1,top1,left1,width1,height1)
{
//dialog1
///<a href="JavaScript:pokazdiv('dialog1',0,0,screen.width,screen.height)">tutaj</a>
// document.getElementById(kto1).style.width=screen.width
// document.getElementById(kto1).style.height=screen.height
 document.getElementById(kto1).style.width=width1
 document.getElementById(kto1).style.height=height1

 document.getElementById(kto1).style.top=document.body.scrollTop+top1;
 document.getElementById(kto1).style.left=document.body.scrollLeft+left1;
 document.getElementById(kto1).style.visibility='visible'
}

function ukryjdiv(kto1)
{
 document.getElementById(kto1).style.visibility='hidden'
document.zdjecieor.src='sisgrafika/laduj.gif';
}

/////////
 oknoh=''
function hlacze(fa1,fa2)
{
  oknow=800
  oknoh=350
  oknoh= window.open("", "oknohp","scrollbars=yes, status=yes, resizable=yes, width="+oknow+", height="+oknoh+" , Top=10, left=10")
 oknoh.document.writeln("<html><head><meta http-equiv='Content-Language' content='pl'>")
  oknoh.document.writeln("<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=iso-8859-2'>");
 oknoh.document.writeln("<LINK href='styl1.css'   rel=stylesheet type=text/css>")
 oknoh.document.writeln("</head><body class='okno1' >")
 oknoh.document.writeln("<p align='right' ><input type='button' value=' X ' class='button1'  OnClick='JavaScript:window.close()'  >&nbsp;&nbsp;</p>")
 oknoh.document.writeln("<p class='sekcja1' > &nbsp;Hiperłącze do strony </p>")
////
 oknoh.document.writeln("<p>");
 oknoh.document.write("&lt;a   href=\"JavaScript:lacz('"+fa1+"')\" &gt;"+fa2+"&lt;/a&gt;")
 oknoh.document.writeln(" <p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p></body></html>")
 oknoh.document.close()
  oknoh.focus()

};



