// JavaScript Document
	function NewWin(adr){
		var leftO = (winW()/2)-300;
		var topO = (winH()/2)-200;
		var adresa = adr;
            Win = window.open(adresa, 'Banner',
              'toolbar=no,menubar=no,location=no,directories=no,'+
              'scrollbars=yes,resizable=yes,status=no,'+
              'width=630,height=600,top=' + topO + ',left=' + leftO);
	Win.document.close();
	Win.focus();
      }
      function winH() {
	if (window.innerHeight) return window.innerHeight;
	else if (document.documentElement && document.documentElement.clientHeight)
		return document.documentElement.clientHeight;
	else if (document.body && document.body.clientHeight)
		return document.body.clientHeight;
	else return null;
	}
function winW() {
	if (window.innerWidth) return window.innerWidth;
	else if (document.documentElement && document.documentElement.clientWidth)
		return document.documentElement.clientWidth;
	else if (document.body && document.body.clientWidth)
		return document.body.clientWidth;
	else return null;
	}


// JavaScript Document
function oWin(pFileName, i_width, i_height, pTitle, pClose) {
  var swidth=screen.width, sheight=screen.height;
  var min_x=100, min_y=100, max_x=swidth-10, max_y=sheight-190;
  var owidth=i_width>max_x?max_x:i_width<min_x?min_x:i_width, oheight=i_height>max_y?max_y:i_height<min_y?min_y:i_height;
  if ((owidth!=i_width) || (oheight!=i_height))

    photoWin = window.open( "", "", "width="+(owidth+3)+",height="+(oheight+100)+",resizable,scrollbars,screenX=20,screenY=40,left=20,top=40");
  else
    photoWin = window.open( "", "", "width="+(owidth+3)+",height="+(oheight)+",screenX=20,screenY=40,left=20,top=40");

  photoWin.document.write('<html><head><title>' + pTitle + '</title>');
  photoWin.document.write('</head>');
  photoWin.document.write('<body style="margin:0;">');
  photoWin.document.write('<a class="window" href="javascript:self.close()">');
  photoWin.document.write('<img src="' + pFileName + '" width="' + i_width + '" height="' + i_height + '" border="1" alt="' + pClose + '" />');
  photoWin.document.write('</a></div>');
  photoWin.document.write('</body></html>');
  photoWin.document.close();
        photoWin.focus();
  
}