
/* Diface Flat-PopUp Script v 1.2 */
/*popup statyczny (podany rozmiar - większa dokładność)*/
function popup_writedoc(href,doc,alt,width,height) {
  _close='window.close()';
  doc.open();
  doc.write('<?xml version="1.0" encoding="ISO-8859-2" ?>');
  doc.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml11.dtd">');
  doc.write('<html xmlns="http://www.w3.org/1999/xhtml">');
  doc.write('<head><title>'+alt+'</title>');
  doc.write('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />');
  doc.write('<style type="text/css">body {margin: 0; padding: 0; background: #fff; cursor: pointer}</style>');
  doc.write('</head><body onclick="'+_close+'">');
  if (href.substring(href.lastIndexOf('.')+1)=='swf')
        popup_swf(doc,href,width,height)
  else
        popup_jpg(doc,href,alt);
  doc.write('<script src="js/main.js"></script></body></html>');
  doc.close();
}

function popup_jpg(doc,href,alt) {
  doc.write('<img src="'+href+'" alt="'+alt+'" title="Kliknij, aby zamknąć okno" />');
}

function popup_swf(doc,href,width,height) {
  doc.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+width+'" height="'+height+'" align="middle">');
  doc.write('<param name="allowScriptAccess" value="sameDomain" />');
  doc.write('<param name="movie" value="'+href+'" />');
  doc.write('<param name="quality" value="high" />');
  doc.write('<embed src="'+href+'" quality="high" width="'+width+'" height="'+height+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
  doc.write('</object>')
}


function popup(obj,width,height) {
  var alt = obj.getElementsByTagName('img')[0].getAttribute('alt');
  var winopts = "dependent=yes,toolbar=no,resizable=no,width="+width+",height="+height;
  if (win = window.open('about:blank','_blank',winopts)) {
     popup_writedoc(obj.href,win.document,alt,width,height);
     return false;
  }
  return true;
}

/*popup dynamiczny (bez podawania rozmiaru)*/
function popup_writedoc_nosize(href,doc,alt) {
  doc.open();
  doc.write('<?xml version="1.0" encoding="ISO-8859-2" ?>');
  doc.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml11.dtd">');
  doc.write('<html xmlns="http://www.w3.org/1999/xhtml">');
  doc.write('<head><title>'+alt+'</title>');
  doc.write('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />');
  doc.write('<style type="text/css">body {margin: 0; padding: 0; background: #fff; cursor: pointer; overflow: hidden; font-family: verdana,arial,sans-serif; font-size: 12px; text-align: center; font-weight: bold; color: black}');
  doc.write('img {display: none}')
  doc.write('li {float: left; margin: 0; padding: 0 4px}');
  doc.write('li#web {float: right}');
  doc.write('ul {list-style: none; margin: 0; padding: 0; display: block; padding-top: 6px; display: none}</style>');
  doc.write('</head><body onclick="window.close()" onload="obrazek()"><div style="padding-top: 40px">Ładuję...</div>');
  doc.write('<script src="js/resize.js"></script><div style="text-align:center;padding-top: 1px; padding-left: 1px;"><img onload="obrazek2()" id="img1" src="'+href+'" alt="'+alt+'" style="border-style:solid; border-width:1px; margin:auto" title="Kliknij, aby zamknąć okno" /></div><ul><li>'+alt+'</li></ul></body></html>');
  doc.close();
} 



function cala(zdj,x){
    var wynik = zdj;
    if (x==undefined) {x=''}
    if (win = window.open('about:blank','_blank',"menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,fullscreen=no,channelmode=no,width=100,height=100")){
       popup_writedoc_nosize(wynik,win.document,x);
       return false;}
    else return true;
}

window.onload = function() {
	/*var d = document.getElementById('main')
	if (d){
		d.style.border='1px solid #00255f';
	}*/
}