function switchMenu(obj, w)
{
    obj.style.backgroundPosition="0px "+(-21*w)+"px";
}

function showPic(picfile)
{
    win=window.open("","galwanizer","width=500,height=200");
    win.moveTo(0,0);
    win.document.close();
    win.document.open();
    win.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">');
    win.document.write('<html xmlns="http://www.w3.org/1999/xhtml"><head>');
    win.document.write('<meta http-equiv="content-type" content="text/html; charset=ISO-8859-2" />');
    win.document.write("<title>Galwanizer</title>");
    win.document.write("<style>");
    win.document.write("h1 {margin-top: 90px; text-align: center; font-size: 18px; font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;}");
    win.document.write("#imageMe {display: none; margin-left: auto; margin-right: auto; margin-top: 10px;}");
    win.document.write("body {background-color: #fff; margin: 0; padding: 0; text-align: center;}");
    win.document.write("img {margin: 0; padding: 0; border: 0; display: inline; cursor: pointer;}");
    win.document.write("</style>");
    win.document.write("</head>");
    win.document.write("<body><h1 id='h1'>trwa ładowanie zdjęcia...<br />copyright &copy; 2005 Galwanizer</h1>");
    win.document.write("<div id='imageMe'>");
    win.document.write("<img src='"+picfile+"' alt='' onclick='window.self.close();' onload='document.getElementById(\"imageMe\").style.display=\"block\"; document.getElementById(\"h1\").style.display=\"none\"; window.self.resizeTo(this.width+50, this.height+70); window.self.moveTo(Math.round((screen.availWidth-this.width)/2), Math.round((screen.availHeight-this.height)/2));' />");
    win.document.write("</div>");
    win.document.write("</body></html>");
    win.focus();
    win.document.close();
}

function checkKontaktForm()
{
    if (document.forms[0].nazwa.value.length<1)
    {
        alert("Nie podana nazwa firmy!");
        return;
    }
    if ((document.forms[0].telefon.value.length<1) && (document.forms[0].email.value.length<1))
    {
        alert("Nie podany telefon lub email!");
        return;
    }
    if (document.forms[0].tresc.value.length<1)
    {
        alert("Nie podana treść wiadomości!");
        return;
    }
    document.forms[0].submit();
}
