//Create Flash
function createFlash(movie, wdth, hght, bgnd, idName, cel, fVars) {
       obj_setFlash = document.getElementById(cel);
       objTag = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' style='z-index:1' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+wdth+"' height='"+hght+"' id='"+idName+"'>";
       objTag2 = "<object data='"+movie+"' type='application/x-shockwave-flash' width='"+wdth+"' height='"+hght+"' id='"+idName+"'>";
       paramTag = "<param name='movie' value='"+movie+"' /><param name='bgcolor' value='"+bgnd+"' /><param name='quality' value='high' /><param name='menu' value='false' /><param name='FlashVars' value='"+fVars+"' /></object>";

       obj_setFlash.innerHTML = objTag2+paramTag;
       
       return;
       
       if (typeof HTMLElement != "undefined") {
              obj = document.createElement("object");
              obj.setAttribute("data", movie);
              obj.setAttribute("type", "application/x-shockwave-flash");
              obj.setAttribute("width", wdth);
              obj.setAttribute("height", hght);
              obj.setAttribute("id", idName);
              par = document.createElement("param");
              par.setAttribute("name", "quality");
              par.setAttribute("value", "high");
              obj.appendChild(par);
              par = document.createElement("param");
              par.setAttribute("name", "wmode");
              par.setAttribute("value", "transparent");
              obj.appendChild(par);
              par = document.createElement("param");
              par.setAttribute("name", "bgcolor");
              par.setAttribute("value", bgnd);
              obj.appendChild(par);
              par = document.createElement("param");
              par.setAttribute("name", "menu");
              par.setAttribute("value", "false");
              obj.appendChild(par);
//              par = document.createElement("param");
//              par.setAttribute("name", "FlashVars");
//              par.setAttribute("value", fVars);
//              obj.appendChild(par);
              par = document.createElement("param");
              par.setAttribute("name", "pluginspage");
              par.setAttribute("value", "http://www.macromedia.com/go/getflashplayer");
              obj.appendChild(par);
              obj_setFlash.appendChild(obj);
       } else {
              obj_setFlash.insertAdjacentHTML('beforeEnd',objTag+paramTag);
       }
}

//Otwórz okno z flashem
function flash(URL,szer,wys) {
  nowe_okno=window.open("","_blank","toolbar=no,status=no,menu=no,scrollbars,resizable,width="+(szer+20)+",height="+wys+",top=30,left=30");
  nowe_okno.document.open();
  nowe_okno.document.writeln('<BODY topmargin=0 leftmargin=0 marginwidth=0 marginheight=0>');
  nowe_okno.document.writeln('<OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0 height='+wys+' width='+szer+' classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000>');
  nowe_okno.document.writeln('<PARAM NAME="Movie" VALUE="'+URL+'">');
  nowe_okno.document.writeln('<PARAM NAME="Src" VALUE="'+URL+'">');
  nowe_okno.document.writeln('<PARAM NAME="Play" VALUE="-1">');
  nowe_okno.document.writeln('<PARAM NAME="Loop" VALUE="-1">');
  nowe_okno.document.writeln('<PARAM NAME="Quality" VALUE="High">');
  nowe_okno.document.writeln('<embed src="'+URL+'" type="application/x-shockwave-flash" width="'+szer+'" height="'+wys+'" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" quality="best" play="true">');
  nowe_okno.document.writeln('</OBJECT>');
  nowe_okno.document.writeln('</BODY>');
  nowe_okno.document.close();
}

//Otwórz okno ze zdjeciem
function zdjecie(URL,w,h) {
  obrazek = new Image();
  obrazek.src = URL;
  if(w>screen.width-50) w=screen.width-50;
  if(h>screen.height-50) h=screen.height-50;
  wo=screen.width-50;
  ho=screen.height-50;
  t=parseInt((screen.height-h)/2);
  l=parseInt((screen.width-w)/2);
  //Pętla opóźnaijąca
  nowe_okno=window.open("","_blank","toolbar=no,status=no,menu=no,scrollbars,resizable,width="+w+",height="+h+",top="+t+",left="+l);
  nowe_okno.document.open();
  nowe_okno.document.writeln('<SCRIPT language=Javascript>');
  nowe_okno.document.writeln('function wymiary() { ');
  nowe_okno.document.writeln('wz=document.zdjecie.width+30; hz=document.zdjecie.height+30; if(wz>'+wo+') wz='+wo+'; if(hz>'+ho+') hz='+ho+';');
  nowe_okno.document.writeln('window.resizeTo(wz,hz);');
  nowe_okno.document.writeln('}');
  nowe_okno.document.writeln('</SCRIPT>');
  nowe_okno.document.writeln('<BODY topmargin=0 leftmargin=0 marginwidth=0 marginheight=0 onLoad="wymiary()">');
  nowe_okno.document.writeln('<A href="javascript:window.close()"><IMG src='+URL+' alt="Kliknij aby zamknąć" border=0 name=zdjecie></A>');
  nowe_okno.document.writeln('</BODY>');
  nowe_okno.document.close();
}

//Otwórz okno ze zdjeciem
function zdjecie_blank(URL,w,h) {
  obrazek = new Image();
  obrazek.src = URL;
  if(w>screen.width-50) w=screen.width-50;
  if(h>screen.height-50) h=screen.height-50;
  wo=screen.width-50;
  ho=screen.height-50;
  t=parseInt((screen.height-h)/2);
  l=parseInt((screen.width-w)/2);
  //Pętla opóźnaijąca
  nowe_okno=window.open("","_blank","toolbar=no,status=no,menu=no,scrollbars=no,resizable=no,width="+w+",height="+h+",top="+t+",left="+l);
  nowe_okno.document.open();
  nowe_okno.document.writeln('<SCRIPT language=Javascript>');
  nowe_okno.document.writeln('function wymiary() { ');
  nowe_okno.document.writeln('wz=document.zdjecie.width+30; hz=document.zdjecie.height+30; if(wz>'+wo+') wz='+wo+'; if(hz>'+ho+') hz='+ho+';');
  nowe_okno.document.writeln('window.resizeTo(wz,hz);');
  nowe_okno.document.writeln('}');
  nowe_okno.document.writeln('</SCRIPT>');
  nowe_okno.document.writeln('<BODY topmargin=0 leftmargin=0 marginwidth=0 marginheight=0 onLoad="wymiary()">');
  nowe_okno.document.writeln('<A href="javascript:window.close()"><IMG src='+URL+' alt="Kliknij aby zamknąć" border=0 name=zdjecie></A>');
  nowe_okno.document.writeln('</BODY>');
  nowe_okno.document.close();
}

//Otwórz okno z dokumentem (określ rozmiary)
function okno(URL,szer,wys) {
  nowe_okno=window.open(URL,"_blank","toolbar=no,status=no,menus=no,scrollbars,location=no,resizable,width="+szer+",height="+wys+",top=30,left=30");
  return;
}

//Otwórz okno z dokumentem (zasymuluj target=_blank)
function url(URL) {
  nowe_okno=window.open(URL,"_blank","toolbar,location,status,menubar,scrollbars,resizable,top=30,left=30,width=675,height=450");
  return;
}

function okno_blank(URL,szer,wys) {
  nowe_okno=window.open(URL,"_blank","toolbar=no,status=no,menus=no,scrollbars=no,resizable,width="+szer+",height="+wys+",top=30,left=30");
  return;
}

nn4 = (document.layers) ? true : false;
ie4 = (document.all) ? true : false;
ns6 = (document.getElementById) ? true : false;

function Pokaz(Blok, e) {
  if (nn4) {
    x=e.pageX+10;
    y=e.pageY+10;
  }
  if (ie4) {
    x=document.body.scrollLeft+event.clientX+10;
    y=document.body.scrollTop+event.clientY+10;
  }
  if(ns6&&!ie4) {
    x=e.pageX+10;
    y=e.pageY+10;
  }
  chmurka = document.getElementById('dymek');
  chmurka.style.left=x;
  chmurka.style.top=y;
  chmurka.innerHTML=Blok;
  chmurka.style.display='block';
  setTimeout("Ukryj()", 50000);
}//function Pokaz(Blok, e) {

function Ukryj() {
  chmurka = document.getElementById('dymek');
  chmurka.style.display='none';
}
