function on(imgName)  {
  if (version == "OK")   {
    imgOn = eval(imgName + "on.src");
    document [imgName].src = imgOn;
  }
}

function off(imgName)   {
  if (version == "OK") {
    imgOff = eval(imgName + "off.src");
    document [imgName].src = imgOff;
  }
}

 browserName = navigator.appName;          
 browserVer = parseInt(navigator.appVersion);  
 if (browserName == "Netscape" && browserVer >= 3) version = "OK";
 else if (browserName == "Microsoft Internet Explorer" && browserVer >= 4) version = "OK";
 else if (browserName == "Microsoft Internet Explorer" && browserVer >= 2) version = "";
 else version = "";

function InitImg(ktory) {
  if (version == "OK") {
    p0on = new Image();
    p0on.src = "img/"+ktory+"-ogalerii-1.gif";
    p0off = new Image();
    p0off.src = "img/"+ktory+"-ogalerii-0.gif";
    p0href = "./info.php";

    p1on = new Image();
    p1on.src = "img/"+ktory+"-wern-1.gif";
    p1off = new Image();
    p1off.src = "img/"+ktory+"-wern-0.gif";
    p1href = "./wern.php";

    p2on = new Image();
    p2on.src = "img/"+ktory+"-art-1.gif";
    p2off = new Image();
    p2off.src = "img/"+ktory+"-art-0.gif";
    p2href = "./art.php";

    p3on = new Image();
    p3on.src = "img/"+ktory+"-wydarzenia-1.gif";
    p3off = new Image();
    p3off.src = "img/"+ktory+"-wydarzenia-0.gif";
    p3href = "./?id=wazne";

    p4on = new Image();
    p4on.src = "img/"+ktory+"-main-1.gif";
    p4off = new Image();
    p4off.src = "img/"+ktory+"-main-0.gif";
    p4href = "/";
  }
}

function RysujImg(i) {
  document.write("<a href="+eval("p"+i+"href")+" onMouseover=on('p"+i+"') onMouseout=off('p"+i+"')>" );
  document.write("<img name='p"+i+"' src='"+eval("p"+i+"off.src")+"' border=0>");
  document.write("</a><br>");
}
