PositionX = 10;
PositionY = 10;
defaultWidth  = 600;
defaultHeight = 400;

//kinda important
var AutoClose = false;

//don't touch
function popImage(imageURL,imageTitle){
  var imgWin = window.open('','_blank','scrollbars=no,resizable=1,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY);
  if( !imgWin ) { return true; } //popup blockers should not cause errors
  
  
  
  
  
  
  
  if (imageURL=='obrazki/strona/kontakt/modlinska2.jpg' || imageURL=='obrazki/strona/kontakt/latchorzew2.jpg')  
	{
		imgWin.document.write('<html><head><title>'+imageTitle+'<\/title><style>body{margin:0px;}</style><script type="text\/javascript">\n');
	}
	else if  (imageURL=='obrazki/strona/kontakt/gdansk2.jpg')
	{
		imgWin.document.write('<html><head><title>'+imageTitle+'<\/title><style>body{margin:0px;}</style><script type="text\/javascript">\n');

	}
	else {

		imgWin.document.write('<html><head><META HTTP-EQUIV="imagetoolbar" CONTENT="no"><title>'+imageTitle+'<\/title><style>body{margin:0px;}</style><script type="text\/javascript">\n');


	}


  
  
  
  
  
  
  
  //imgWin.document.write('<html><head><title>'+imageTitle+'<\/title><script type="text\/javascript">\n');
  imgWin.document.write('function resizeWinTo() {\n'+
    'if( !document.images.length ) { document.images[0] = document.layers[0].images[0]; }'+
    'var oH = document.images[0].height, oW = document.images[0].width;\n'+
    'if( !oH || window.doneAlready ) { return; }\n'+ //in case images are disabled
    'window.doneAlready = true;\n'+ //for Safari and Opera
    'var x = window; x.resizeTo( oW + 200, oH + 200 );\n'+
    'var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;\n'+
    'if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }\n'+
    'else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }\n'+
    'else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }\n'+
    'if( window.opera && !document.childNodes ) { myW += 16; }\n'+
    'x.resizeTo( oW = oW + ( ( oW + 200 ) - myW ), oH = oH + ( (oH + 200 ) - myH ) );\n'+
    'var scW = screen.availWidth ? screen.availWidth : screen.width;\n'+
    'var scH = screen.availHeight ? screen.availHeight : screen.height;\n'+
    'if( !window.opera ) { x.moveTo(Math.round((scW-oW)/2),Math.round((scH-oH)/2)); }\n'+
    '}\n'+
    '<\/script>'+
    '<\/head><body oncontextmenu="return false" onselectstart="return false" onselect="return false" oncopy="return false" ondragstart="return false" ondrag="return false" onload="resizeWinTo();"'+(AutoClose?' onblur="self.close();"':'')+'>'+
    (document.layers?('<layer left="0" top="0">'):('<div style="position:absolute;left:0px;top:0px;display:table;">'))+
    '<img src='+imageURL+' alt="Loading image ..." title="" onload="resizeWinTo();">'+
    (document.layers?'<\/layer>':'<\/div>')+'<\/body><\/html>');
  imgWin.document.close();
  if( imgWin.focus ) { imgWin.focus(); }
//  return false;
}


function gorne_divy() { 
  	var lewa_gora = document.getElementById('lewa_gora'); 
	  var prawa_gora = document.getElementById('prawa_gora'); 
	  var menu_gorne = document.getElementById('menu_gorne'); 
	  menu_gorne.style.height = 245 + "px"; 

	  var l = lewa_gora.offsetHeight;
	  var p = prawa_gora.offsetHeight;

	  if (l>p)
	   {
	   prawa_gora.style.height = l - 14 + "px";
     	}
     
    if (p>l)
	   {
	   lewa_gora.style.height = p + 13 + "px";
     	} 
 
} 


function gorne_divy_page() { 
  	  var lewa = document.getElementById('lewa_kolumna'); 
	  var prawa_gora = document.getElementById('prawa_gora'); 
	  var lewa_podmenu = document.getElementById('pod_menu_page');
	 
	//  tele_adres_page
	  
	  var l = lewa.offsetHeight;
	  var p = prawa_gora.offsetHeight;
	  var l_p = lewa_podmenu.offsetHeight;

	  l_p=p - (l -l_p) +13;	
			  
	  if (l>p)
	   {
	   prawa_gora.style.height = l - 13 + "px";
     }
     
    if (p>l)
	   {
	//   lewa_gora.style.height = p + 13 + "px";
	   lewa_podmenu.style.height = l_p + "px";
     } 
     
  //  menu_gorne.style.height = 540 + "px"; 
     
} 


function dolne_divy() { 
  	var lewa_dol = document.getElementById('lewa_dol'); 
	  var prawa_dol = document.getElementById('prawa_dol'); 
	  
	  var l = lewa_dol.offsetHeight;
	  var p = prawa_dol.offsetHeight;
	  
	  if (l>p)
	   {
	   prawa_dol.style.height = l + "px";
     }
     
    if (p>l)
	   {
	   lewa_dol.style.height = p + "px";
     } 
} 


function kolumna_prawa() { 
    var m = document.getElementById('tresc'); 
	  var n = document.getElementById('prawa_gora'); 
	  var y = document.getElementById('prawa_dol'); 
//    m.style.height='auto'; 
    var x = m.offsetHeight-n.offsetHeight; 
    y.style.height = x + "px"; 
} 


function ImgWinOpen(file,title,w,h)
{
     look='';
     sbars = 0;
     resize = 0;
     if(w > screen.availWidth)
     {
     		w = screen.availWidth-30;
     		sbars = 1;
     		resize = 1;
     }
     if(h > screen.availHeight)
     {
     		h = screen.availHeight-60;
     		sbars = 1;
     		resize = 1;
     }
     
	  look = 'scrollbars='+sbars+', resizable='+resize+', width='+w+',height='+h+'';
     newWin = window.open(file,'newWindow','toolbar=0,location=0,'+look);
	  newWin.document.write("<html><head><title>"+title+"</title></head>");
	  newWin.document.write("<body leftmargin=0 rightmargin=0 topmargin=0 bottommargin=0 marginwidth=0 marginheight=0 margin=0 onClick='window.close();' style='cursor:pointer;'><img src=" +file+ " / alt='Kliknij, aby zamkn±c okno'>");
	  newWin.document.write("</body></html>");
	 
}



// PUT THE URL'S OF YOUR IMAGES INTO THIS ARRAY...
var Slides = new Array('historia_klubu/1.jpg',
'historia_klubu/2.jpg',
'historia_klubu/3.jpg',
'historia_klubu/4.jpg',
'historia_klubu/5.jpg',
'historia_klubu/6.jpg',
'historia_klubu/7.jpg',
'historia_klubu/8.jpg',
'historia_klubu/9.jpg',
'historia_klubu/10.jpg',
'historia_klubu/11.jpg',
'historia_klubu/12.jpg',
'historia_klubu/13.jpg',
'historia_klubu/14.jpg',
'historia_klubu/15.jpg',
'historia_klubu/17.jpg',
'historia_klubu/18.jpg',
'historia_klubu/19.jpg',
'historia_klubu/20.jpg',
'historia_klubu/21.jpg',
'historia_klubu/22.jpg',
'historia_klubu/23.jpg',
'historia_klubu/24.jpg',
'historia_klubu/25.jpg',
'historia_klubu/26.jpg',
'historia_klubu/27.jpg',
'historia_klubu/28.jpg',
'historia_klubu/29.jpg',
'historia_klubu/30.jpg',
'historia_klubu/31.jpg',
'historia_klubu/32.jpg',
'historia_klubu/33.jpg',
'historia_klubu/34.jpg',
'historia_klubu/35.jpg',
'historia_klubu/36.jpg',
'historia_klubu/37.jpg',
'historia_klubu/38.jpg',
'historia_klubu/39.jpg',
'historia_klubu/40.jpg',
'historia_klubu/41.jpg',
'historia_klubu/42.jpg',
'historia_klubu/43.jpg',
'historia_klubu/44.jpg',
'historia_klubu/45.jpg',
'historia_klubu/46.jpg',
'historia_klubu/47.jpg',
'historia_klubu/48.jpg',
'historia_klubu/49.jpg',
'historia_klubu/50.jpg',
'historia_klubu/51.jpg',
'historia_klubu/52.jpg',
'historia_klubu/53.jpg',
'historia_klubu/54.jpg',
'historia_klubu/55.jpg',
'historia_klubu/56.jpg',
'historia_klubu/57.jpg',
'historia_klubu/58.jpg',
'historia_klubu/59.jpg',
'historia_klubu/60.jpg',
'historia_klubu/61.jpg',
'historia_klubu/62.jpg',
'historia_klubu/63.jpg',
'historia_klubu/64.jpg',
'historia_klubu/65.jpg',
'historia_klubu/66.jpg',
'historia_klubu/67.jpg',
'historia_klubu/68.jpg',
'historia_klubu/69.jpg',
'historia_klubu/70.jpg',
'historia_klubu/71.jpg',
'historia_klubu/72.jpg',
'historia_klubu/73.jpg',
'historia_klubu/74.jpg',
'historia_klubu/75.jpg',
'historia_klubu/76.jpg',
'historia_klubu/77.jpg',
'historia_klubu/78.jpg',
'historia_klubu/79.jpg');

// DO NOT EDIT BELOW THIS LINE!
function CacheImage(ImageSource) { // TURNS THE STRING INTO AN IMAGE OBJECT
   var ImageObject = new Image();
   ImageObject.src = ImageSource;
   return ImageObject;
}

function ShowSlide(Direction) {
   if (SlideReady) {
      NextSlide = CurrentSlide + Direction;
      // THIS WILL DISABLE THE BUTTONS (IE-ONLY)
      document.SlideShow.Previous.disabled = (NextSlide == 0);
      document.SlideShow.Next.disabled = (NextSlide == 
(Slides.length-1));    
 if ((NextSlide >= 0) && (NextSlide < Slides.length)) {
            document.images['Screen'].src = Slides[NextSlide].src;
            CurrentSlide = NextSlide++;
            Message = 'Picture ' + (CurrentSlide+1) + ' of ' + 
Slides.length;
            self.defaultStatus = Message;
            if (Direction == 1) CacheNextSlide();
      }
      return true;
   }
}

function Download() {
   if (Slides[NextSlide].complete) {
      SlideReady = true;
      self.defaultStatus = Message;
   }
   else setTimeout("Download()", 100); // CHECKS DOWNLOAD STATUS EVERY 100 MS
   return true;
}

function CacheNextSlide() {
   if ((NextSlide < Slides.length) && (typeof Slides[NextSlide] == 
'string'))
{ // ONLY CACHES THE IMAGES ONCE
      SlideReady = false;
      self.defaultStatus = '¦ci±gam obrazek...';
      Slides[NextSlide] = CacheImage(Slides[NextSlide]);
      Download();
   }
   return true;
}

function StartSlideShow() {
   CurrentSlide = -1;
   Slides[0] = CacheImage(Slides[0]);
   SlideReady = true;
   ShowSlide(1);
}

