//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>600) w=600;
if(h>500) h=500;
//Pętla opóźnaijąca
nowe_okno=window.open("","_blank","toolbar=no,status=no,menu=no,scrollbars=yes,resizable,width="+(w+20)+",height="+h+",top=30,left=30");
nowe_okno.document.open();
nowe_okno.document.writeln('<SCRIPT language=Javascript>');
nowe_okno.document.writeln('function wymiary() { ');
nowe_okno.document.writeln('w=document.zdjecie.width; h=document.zdjecie.height; if(w>710) w=710; if(h>510) h=510;');
nowe_okno.document.writeln('window.resizeTo(w+40,h+40);');
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('<IMG src='+URL+' border=0 name=zdjecie>');
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;
}
//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>";
       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);
       }
}


//Wyślij formularz z wykorzuystaniem xajxa/jquery
//Patrz folder przyklady/xajax_form.html
function xajax_form_wyslij(options) {
    if(!options.form) {
      alert("ERR:xajax_form_wyslij.options.form");
      return false;
    }//if(!options.form) {
    if(!options.action) {
      alert("ERR:xajax_form_wyslij.options.action");
      return false;
    }//if(!options.action) {
    
    if(options.start) options.start();

    $.ajax({
      type: "POST",
      url: ""+options.action+"",
      data: ""+$(options.form).serialize()+"",
      dataType: "xml",
      cache: false,
      success: function (xml,textStatus) {
        rezultat = $(xml).find("rezultat:first").text();
        if(options.end) options.end(rezultat);
      }//function (xml,textStatus) {
    });
    return false;
}//function xajax_form_wyslij(options) {
