function Popup(szer,wys,img) {
    tytul="DRUKSERVICE Materiały Poligraficzne";
    var szer1 = parseInt(szer) + 28;
    var wys1 = parseInt(wys) + 28;
    szer1 = (szer1 < screen.availWidth) ? szer1 : screen.availWidth;
    wys1 = (wys1 < screen.availHeight) ? wys1 : screen.availHeight;
    var winl = (screen.availWidth - szer1) / 2;
    var wint = (screen.availHeight - wys1) / 2;
    
    w=window.open("","","width="+szer1+",height="+wys1+",top="+wint+",left="+winl+",toolbar=no,scrollbars=yes,resizable=no,status=no,location=no,menubar=no,");
    
    w.document.write("<HTML><HEAD><TITLE>"+tytul+"</TITLE></HEAD>");
    w.document.write("<BODY leftMargin=0 topMargin=0 marginwidth=0 marginheight=0 style=\"background-color: #000000; overflow: auto;\"><table cellpadding=0 cellspacing=0 style=\"height: 100%; width: 100%\" border=0><tr><td style=\"height: 100%; text-align: center; vertical-align: middle\" valign=\"middle\"><a href=\"javascript: self.close()\" title=\"zamknij okno\"><IMG src=\"_vars/gfx/"+img+".jpg\" galleryimg='no' style=\"border: 2px solid #505050; margin: auto\" height=\""+wys+"\" width=\""+szer+"\"></a></td></tr></table>");
    w.document.write("</BODY></HTML>");
    w.document.close();
}

function PopupImage(img,szer,wys) {
    tytul="DRUKSERVICE Materiały Poligraficzne";
    var szer1 = parseInt(szer) + 28;
    var wys1 = parseInt(wys) + 28;
    szer1 = (szer1 < screen.availWidth) ? szer1 : screen.availWidth;
    wys1 = (wys1 < screen.availHeight) ? wys1 : screen.availHeight;
    var winl = (screen.availWidth - szer1) / 2;
    var wint = (screen.availHeight - wys1) / 2;
    
    w=window.open("","","width="+szer1+",height="+wys1+",top="+wint+",left="+winl+",toolbar=no,scrollbars=yes,resizable=no,status=no,location=no,menubar=no,");
    
    w.document.write("<HTML><HEAD><TITLE>"+tytul+"</TITLE></HEAD>");
    w.document.write("<BODY leftMargin=0 topMargin=0 marginwidth=0 marginheight=0 style=\"background-color: #000000; overflow: auto;\"><table cellpadding=0 cellspacing=0 style=\"height: 100%; width: 100%\" border=0><tr><td style=\"height: 100%; text-align: center; vertical-align: middle\" valign=\"middle\"><a href=\"javascript: self.close()\" title=\"zamknij okno\"><IMG src=\""+img+"\" galleryimg='no' style=\"border: 2px solid #505050; margin: auto\" height=\""+wys+"\" width=\""+szer+"\"></a></td></tr></table>");
    w.document.write("</BODY></HTML>");
    w.document.close();
}

function submit_find(which) {
    if (which.find.value == "") {
        alert ("Pole \"SZUKAJ\" jest puste.");
        which.find.focus();
        
        return false;
    } else if (which.find.value.length > 40) {
        alert ("Wpisany ciąg znaków w polu \"SZUKAJ\"\njest dłuższy niż 40 znaków.");
        which.find.focus();
        
        return false;
    } else return true;
}

function submit_news(which) {
	var re = new RegExp(/^[\w\-\.&]+@([a-z0-9\-]+\.)+[a-z]{2,4}$/);
	if (which.mail.value == "") {
        alert ("Pole \"NEWSLETTER\" jest puste.");
        which.mail.focus();
        
        return false;
    } else if (which.mail.value.length > 50) {
        alert ("Wpisany email w polu \"NEWSLETTER\"\njest dłuższy niż 50 znaków.");
        which.mail.focus();
        
        return false;
    } else if(!re.test(which.mail.value)){
	 alert ("Wpisany adres email jest nieprawidłowy.");
        which.mail.focus();
        
        return false;
	 }
	 else return true;
}