function MM_jumpMenu(targ,selObj,restore){ //v3.0
 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
 if (restore) selObj.selectedIndex=0;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
 var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function nospam(user,domain) {
 locationstring = "mailto:" + user + "@" + domain;
 window.location = locationstring;
}

function Form_Validator(theForm)
{

 if (theForm.Grupa_Produktow.value == "Brak")
 {
 alert("Proszę wybrać grupę produktów.");
 theForm.Grupa_Produktow.focus();
 return (false);
 }

 if (theForm.Grupa_Produktow.value == "Inne" && theForm.Ewentualnie_Inne.value == "")
 {
 alert("Proszę wypełnić pole \"Inna grupa **\".");
 theForm.Ewentualnie_Inne.focus();
 return (false);
 }

if (theForm.Producent.value == "")
 {
 alert("Proszę wypełnić pole \"Producent\".");
 theForm.Producent.focus();
 return (false);
 }
 
 if (theForm.Typ.value == "")
 {
 alert("Proszę wpisać \"Typ\" sprzętu.");
 theForm.Typ.focus();
 return (false);
 }

 var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-";
 var checkStr = theForm.Typ.value;
 var allValid = true;
 for (i = 0; i < checkStr.length; i++)
 {
 ch = checkStr.charAt(i);
 for (j = 0; j < checkOK.length; j++)
  if (ch == checkOK.charAt(j))
  break;
 if (j == checkOK.length)
 {
  allValid = false;
  break;
 }
 }
 if (!allValid)
 {
 alert("Wpisany \"Typ\" nie jest prawidłowy.");
 theForm.Typ.focus();
 return (false);
 }

 if (theForm.Rok_Produkcji.value.length < 4)
 {
 alert("Proszę wpisać \"Rok produkcji\" sprzętu.");
 theForm.Rok_Produkcji.focus();
 return (false);
 }

 var checkOK = "0123456789-";
 var checkStr = theForm.Rok_Produkcji.value;
 var allValid = true;
 var decPoints = 0;
 var allNum = "";
 for (i = 0; i < checkStr.length; i++)
 {
 ch = checkStr.charAt(i);
 for (j = 0; j < checkOK.length; j++)
  if (ch == checkOK.charAt(j))
  break;
 if (j == checkOK.length)
 {
  allValid = false;
  break;
 }
 allNum += ch;
 }
 if (!allValid)
 {
 alert("Nieprawidłowo wypełnione pole \"Rok produkcji\".");
 theForm.Rok_Produkcji.focus();
 return (false);
 }

 if (theForm.M_H.value == "")
 {
 alert("Proszę wypełnić pole \"M-H\".");
 theForm.M_H.focus();
 return (false);
 }

 if (theForm.Proponowana_Cena.value.length < 1)
 {
 alert("Proszę wypełnić pole \"Proponowana cena\".");
 theForm.Proponowana_Cena.focus();
 return (false);
 }

 var checkOK = "0123456789,.";
 var checkStr = theForm.Proponowana_Cena.value;
 var allValid = true;
 var decPoints = 0;
 var allNum = "";
 for (i = 0; i < checkStr.length; i++)
 {
 ch = checkStr.charAt(i);
 for (j = 0; j < checkOK.length; j++)
  if (ch == checkOK.charAt(j))
  break;
 if (j == checkOK.length)
 {
  allValid = false;
  break;
 }
 allNum += ch;
 }
 if (!allValid)
 {
 alert("Nieprawidłowo wypełnione pole \"Proponowana cena\".");
 theForm.Proponowana_Cena.focus();
 return (false);
 }

 if (theForm.Waluta.value == "Brak")
 {
 alert("Proszę wybrać rodzaj waluy.");
 theForm.Waluta.focus();
 return (false);
 }

 if (theForm.Nazwisko.value == "")
 {
 alert("Proszę wypełnić pole \"Nazwisko\".");
 theForm.Nazwisko.focus();
 return (false);
 }

 if (theForm.Imie.value == "")
 {
 alert("Proszę wypełnić pole \"Imię\".");
 theForm.Imie.focus();
 return (false);
 }

 if (theForm.Ulica.value == "")
 {
 alert("Proszę wypełnić pole \"Ulica\".");
 theForm.Ulica.focus();
 return (false);
 }

 if (theForm.Miejscowosc.value == "")
 {
 alert("Proszę wypełnić pole \"Kod pocztowy, Miejscowość\".");
 theForm.Miejscowosc.focus();
 return (false);
 }

 if (theForm.Telefon.value == "")
 {
 alert("Proszę wypełnić pole \"Telefon\".");
 theForm.Telefon.focus();
 return (false);
 }

 var checkOK = "0123456789+()wp";
 var checkStr = theForm.Telefon.value;
 var allValid = true;
 var decPoints = 0;
 var allNum = "";
 for (i = 0; i < checkStr.length; i++)
 {
 ch = checkStr.charAt(i);
 for (j = 0; j < checkOK.length; j++)
  if (ch == checkOK.charAt(j))
  break;
 if (j == checkOK.length)
 {
  allValid = false;
  break;
 }
 allNum += ch;
 }
 if (!allValid)
 {
 alert("Nieprawidłowo wypełnione pole \"Telefon\".");
 theForm.Telefon.focus();
 return (false);
 }
 
 var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.@";
 var checkStr = theForm.Email.value;
 var allValid = true;
 var decPoints = 0;
 var allNum = "";
 for (i = 0; i < checkStr.length; i++)
 {
 ch = checkStr.charAt(i);
 for (j = 0; j < checkOK.length; j++)
  if (ch == checkOK.charAt(j))
  break;
 if (j == checkOK.length)
 {
  allValid = false;
  break;
 }
 allNum += ch;
 }
 if (!allValid)
 {
 alert("Nieprawidłowo wypełnione pole \"E-mail\".");
 theForm.Email.focus();
 return (false);
 }

 if (theForm.Kontakt_zwrotny.value == "Brak")
 {
 alert("Proszę wybrać formę kontaktu zwrotnego.");
 theForm.Kontakt_zwrotny.focus();
 return (false);
 }

 if (theForm.Kontakt_zwrotny.value == "Fax" && theForm.Fax.value == "")
 {
 alert("Proszę wypełnić pole \"Fax\".");
 theForm.Fax.focus();
 return (false);
 }
 
 var checkOK = "0123456789+()wp";
 var checkStr = theForm.Fax.value;
 var allValid = true;
 var decPoints = 0;
 var allNum = "";
 for (i = 0; i < checkStr.length; i++)
 {
 ch = checkStr.charAt(i);
 for (j = 0; j < checkOK.length; j++)
  if (ch == checkOK.charAt(j))
  break;
 if (j == checkOK.length)
 {
  allValid = false;
  break;
 }
 allNum += ch;
 }
 if (!allValid)
 {
 alert("Nieprawidłowo wypełnione pole \"Fax\".");
 theForm.Fax.focus();
 return (false);
 }

 if (theForm.Kontakt_zwrotny.value == "Email" && theForm.Email.value == "")
 {
 alert("Proszę wypełnić pole \"Adres e-mail\".");
 theForm.Email.focus();
 return (false);
 }

 var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.@";
 var checkStr = theForm.Email.value;
 var allValid = true;
 var decPoints = 0;
 var allNum = "";
 for (i = 0; i < checkStr.length; i++)
 {
 ch = checkStr.charAt(i);
 for (j = 0; j < checkOK.length; j++)
  if (ch == checkOK.charAt(j))
  break;
 if (j == checkOK.length)
 {
  allValid = false;
  break;
 }
 allNum += ch;
 }
 if (!allValid)
 {
 alert("Nieprawidłowo wypełnione pole \"E-mail\".");
 theForm.Email.focus();
 return (false);
 }

 if (!theForm.Accept_Dane.checked)
 {
 alert("Proszę wyrazić zgodę na przetwarzanie danych osobowych.");
 theForm.Accept_Dane.focus();
 return (false);
 }

return (true);
}

function Kontakt_Validator(theForm)
{

 if (theForm.Nazwisko.value == "")
 {
 alert("Proszę wypełnić pole \"Nazwisko\".");
 theForm.Nazwisko.focus();
 return (false);
 }

 if (theForm.Imie.value == "")
 {
 alert("Proszę wypełnić pole \"Imię\".");
 theForm.Imie.focus();
 return (false);
 }

 if (theForm.Telefon.value == "")
 {
 alert("Proszę wypełnić pole \"Telefon\".");
 theForm.Telefon.focus();
 return (false);
 }

 var checkOK = "0123456789+()wp";
 var checkStr = theForm.Telefon.value;
 var allValid = true;
 var decPoints = 0;
 var allNum = "";
 for (i = 0; i < checkStr.length; i++)
 {
 ch = checkStr.charAt(i);
 for (j = 0; j < checkOK.length; j++)
  if (ch == checkOK.charAt(j))
  break;
 if (j == checkOK.length)
 {
  allValid = false;
  break;
 }
 allNum += ch;
 }
 if (!allValid)
 {
 alert("Nieprawidłowo wypełnione pole \"Telefon\".");
 theForm.Telefon.focus();
 return (false);
 }

 var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.@";
 var checkStr = theForm.Email.value;
 var allValid = true;
 var decPoints = 0;
 var allNum = "";
 for (i = 0; i < checkStr.length; i++)
 {
 ch = checkStr.charAt(i);
 for (j = 0; j < checkOK.length; j++)
  if (ch == checkOK.charAt(j))
  break;
 if (j == checkOK.length)
 {
  allValid = false;
  break;
 }
 allNum += ch;
 }
 if (!allValid)
 {
 alert("Nieprawidłowo wypełnione pole \"E-mail\".");
 theForm.Email.focus();
 return (false);
 }

 if (theForm.Tresc.value == "")
 {
 alert("Proszę wypełnić pole \"Treść\".");
 theForm.Tresc.focus();
 return (false);
 }

 if (!theForm.Accept_Dane.checked)
 {
 alert("Proszę wyrazić zgodę na przetwarzanie danych osobowych.");
 theForm.Accept_Dane.focus();
 return (false);
 }

return (true);
}
