
function correctPNG()
  {
  for(var i=0; i<document.images.length; i++)
     {
  var img = document.images[i]
  var imgName = img.src.toUpperCase()
  if (imgName.substring(imgName.length-3, imgName.length) == "PNG" )
     {
  var imgID = (img.id) ? "id='" + img.id + "' " : ""
  var imgClass = (img.className) ? "class='" + img.className + "' " : ""
  var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
  var imgStyle = "display:inline-block;" + img.style.cssText
  if (img.align == "left") imgStyle = "float:left;" + imgStyle
  if (img.align == "right") imgStyle = "float:right;" + imgStyle
  if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
  var strNewHTML = "<span " + imgID + imgClass + imgTitle
  + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
     + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
  + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"

  img.outerHTML = strNewHTML
  i = i-1
     }
     }
  }
window.attachEvent("onload", correctPNG);




  function galery( gid, par, ln){
    url = "gal.php?id="+gid+"&par="+par+"&ln="+ln;
    specs = "toolbar=no,directories=no,menubar=no,scrollbars=yes,width=500,height=660";
    open(url, "", specs);
  }


  function galeria( gid, par, id, i, ln){
    document.location.href = "galeria.php?gid="+gid+"&par="+par+"&id="+id+"&i="+i+"&ln="+ln;
    //specs = "toolbar=no,directories=no,menubar=no,scrollbars=yes,width=550,height=660";
    //open(url, "", specs);
  }
  
  function druk(id){
    url     = 'druk.php?cid='+id;
    opcje   = "toolbar=no,directories=no,menubar=yes,scrollbars=yes,width=600,height=400";
    window.open(url, '', opcje);
  }

  function polec(cid, ctype, url, ln){
    url   = "polec.php?cid="+cid+"&ctype="+ctype+"&url="+url+"&ln="+ln;
	  specs = "toolbar=no,directories=no,menubar=no,scrollbars=auto,width=400,height=280";
    open(url, "", specs);
  }

  function prezentacja(){
    url   = "panorama/main.swf";
	  specs = "toolbar=no,directories=no,menubar=no,scrollbars=auto,width=467, height=350";
    open(url, "", specs);
  }

  
  function big(plik, szer, wys){  
    url   = "big.php?id="+plik+"&wys="+wys+"&szer="+szer;
    
    if(szer>700) szer = 700;
    if(wys>500) wys = 500;
    
	  specs = "resizable=yes,toolbar=no,directories=no,menubar=no,scrollbars=yes,width="+(szer+24)+",height="+(wys+24);
    open(url, "", specs);
  }
  
  
  function kopia_big(plik, szer, wys){  
    url   = "kopia_big.php?id="+plik+"&wys="+wys+"&szer="+szer;
    
    if(szer>700) szer = 700;
    if(wys>500) wys = 500;
    
	  specs = "toolbar=no,directories=no,menubar=no,scrollbars=yes,width="+(szer+24)+",height="+(wys+24);
    open(url, "", specs);
  }
  
  function big_opis(plik, szer, wys, opis){
    url   = "big.php?id="+plik+"&wys="+wys+"&szer="+szer+"&opis="+opis;
    
    if(szer>700) szer = 700;
    if(wys>500) wys = 500;
    
	  specs = "toolbar=no,directories=no,menubar=no,scrollbars=auto,width="+(szer+24)+",height="+(wys+64);
    open(url, "", specs);
  }

  function forum(){
    x = screen.availWidth;
    y = screen.availHeight;
    url     = 'admin/apps/forum/index.php';
    opcje   = "toolbar=no,directories=no,menubar=no,scrollbars=yes,width="+(x-50)+",height="+(y-50);
    window.open(url, '', opcje);
  }

  function search(){
    f = document.forms['search_form'];
    f.q.value = trim(f.q.value);
    if(f.q.value.length == 0){
      alert('Proszę podać słowa do wyszukania');
    } else {
      /*
      if(f.where[2].checked){
        url = 'http://www.google.com.pl/search?q='+f.q.value;
        win = window.open(url, "", "");
      } else if(f.where[0].checked){
      */
        f.kryt.value = 1;
        // f.action = 'index.php';
        f.submit();
      /*
      } else if(f.where[1].checked){
        f.kryt.value = 1;
        f.action = 'http://www.bip.powiat.wloclawski.pl/';
        f.submit();
      }
      */
    }
  } // search

  
  function trim(t){
    while(t.charAt(t.length-1) == ' '){
      t = t.substr(0, t.length-1);
    }
    while(t.charAt(0) == ' '){
      t = t.substr(1, t.length);
    }
    return t;
  } // trim


// window.onload=initClouds;


  function big_mapa(plik, szer, wys){
    url   = "mapa1.php?id="+plik+"&wys="+wys+"&szer="+szer;
    
    
	  specs = "toolbar=no,directories=no,menubar=no,scrollbars=auto,width="+szer+",height="+wys;
    open(url, "", specs);
  }

