var popupImageHandle = null;
function popupImage(sender,event,src,title,w,h) {
  //if (event && document.all?event.shiftKey:event.ctrlKey) { sender.target='_blank'; sender.href=src; return }
  var opera = navigator.appName.indexOf("Opera")>-1;
  if (!opera && popupImageHandle && !popupImageHandle.closed) popupImageHandle.close();
  var s = 'toolbar=no,menubar=no,location=no,personalbar=no,scrollbars=no,directories=no,status=no,resizable=no,width='+w+',height='+h;
  var img = '<a href="javascript:window.close()" title="Zamknij"><img src="'+src+'" border=0 width='+w+' height='+h+'></a>';
  var win = window.open('about:blank','popupImage',s);
  win.document.open();
//alert( escape(title) );
  win.document.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1250"><title>'+unescape(title)+'</title></head><body style="margin:0;padding:0;overflow:hidden" onkeypress="if (event && event.keyCode==27) self.close()">'+img+'</body></html>');
  win.document.close();
  win.focus();
  popupImageHandle = win;
}

function PlaySound() {
  if (!document._sounddiv) {
    div = document.createElement('DIV');
    document.body.appendChild(div);
    if (document.all) {
      div.style.display = 'none';
    } else {
      div.style.position = 'absolute';
      div.style.top = '-9999';
    }
    var path = 'sound/playmp3.swf?fn='+document._mp3;
    div.innerHTML = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="50" HEIGHT="50" ALIGN=""> <PARAM NAME=movie VALUE="'+path+'"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="'+path+'" quality=high bgcolor=#FFFFFF  WIDTH="50" HEIGHT="50" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';
    document._sounddiv = div;
  }
}
function onImageLoad() {
  document._imagesCount--;
  if (document._imagesCount==0)
    setTimeout('PlaySound()', 1000);
    //PlaySound();
}
function LoadSound(mp3) {
  document._mp3 = mp3;
  document._imagesCount = document.images.length;
  for (var i=0; i<document.images.length; i++) {
    document.images[i].onLoad = onImageLoad();
  }
}
//setTimeout('document.body.onLoad = LoadSound("")', 1000);

