function winPop(url, name, w, h) {
	var l = screen.width / 2 - w / 2;
	var t = screen.height / 2 - h / 2;
	var Win = window.open(url, name, 'width=' + w + ', height=' + h + ', left=' + l + ', top=' + t);
	Win.resizeTo(w + 10, h + 30);
	Win.moveTo(l, t);
}


function winPop2(img)
{
  foto1= new Image();
  foto1.src=(img);
  check(img);
}

function check(img)
{
  if((foto1.width!=0)&&(foto1.height!=0)){
    viewFoto(img);
  }
  else{
    func="check('"+img+"')";
    interval=setTimeout(func,20);
  }
}

function viewFoto(img)
{
  w = foto1.width + 7; //- mozi
  h = foto1.height + 7;
  var l = screen.width / 2 - w / 2;
  var t = screen.height / 2 - h / 2;

	
	
  string="width="+w+",height="+h+",left="+l+",top="+t;
  //result=window.open(img,"",string);


  string="width="+w+",height="+h;+",toolbar=no,menubar=no, location=no, personalbar=no, status=no, resizable=no, scrollbars=no, copyhistory=no, left=" + l + ", top=" + t;
  handle=window.open(img,"",string);
  handle.document.write("<html><head><title>www.winchester.pl - podgl±d</title><style>html,body{height:100%}body{margin:0px;padding:0;border:0;background-color:#FFFFFF;}.table{height:100%;width:100%} .ramka{border: solid 1px; border-color: #598901;  padding: 0px; margin:0px;}</style></head>");
  handle.document.write('<body><table cellpadding=0 cellspacing=0 border=0 class="table"><tr><td align=center><a href="javascript:self.close();" title="zamknij okno"><img src='+img+' class="ramka"></a></td></tr></table></body></html>');
  handle.moveTo(l, t);

}
