// JavaScript Document

var msg1="Nie wypełniłeś pola \"Adres e-mailowy\".";
var msg2="Nie wypełniłeś pola \"Hasło\".";
var msg3="Podałeś zły adres e-mailowy. Sprawdź czy wpisałeś '@' małpę.";
var msg4="Podałeś zły adres e-mailowy. Sprawdź poprawność adresu (.pl, .com.pl, .com, .net, itd.).";
var msg5="W polu \"Adres e-mailowy\" możesz użyć tylko tych znaków: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-@._";
var msg6="Wystarczy kliknąć tylko raz!";
var msg7="Podany adres e-mailowy nie jest identyczny. Sprawdź dokładnie czy podałeś poprawnie adresy e-mailowy. Jeżeli adres e-mailowy zostanie wpisany błędnie nie zalogujesz się na swoje konto!";
var msg8="Zaznacz czy akceptujesz Regulamin serwisu www.fasole.pl."
var msg9="Przepisz kontrolny kod."
var msg10="Napisz komentarz do swojej oceny."
var msg11="Wybierz ocenę: pozytywną, neutralną lub negatywną."
var msg12="Nie wypełniłeś pola \"Imię\"."
var msg13="Nie wypełniłeś pola \"Nazwisko\"."
var msg14="Nie wypełniłeś pola \"Ulica\"."
var msg15="Nie wypełniłeś pola \"Miasto\"."
var msg16="Nie wypełniłeś pola \"Kod pocztowy\"."
var msg17="W polu \"Kod pocztowy\" możesz wpisać tylko liczby i '-' ! (1234567890-)"
var msg18="Zły kod pocztowy."
var msg19="Tu napisz komentarz do swojej oceny"
var msg20="Nie wypełniłeś pola \"Nazwa kampanii\"."
var msg21="Nie wypełniłeś pola \"Opis kampanii\"."
var msg22="Nie wypełniłeś pola \"Adres www\"."
var msg23="Minimalny limit to 1 fasola za 1 czynność."
var msg24="Minimalny wkład do kampanii to 1 000 fasoli."
var msg25="Maksymalny limit to 1 000 000 fasoli za 1 czynność."
var msg26="W polu dodawania fasoli możesz wpisać tylko liczby bez spacji! (1234567890)"
var msg27="Minimalnie możesz ustawić 100 fasoli dziennie. Jeżeli nie chcesz mieć ograniczeń zbierania w kampanii, ustaw 0 (zero)."
var msg28="Minimalny limit to 1 godzina."
var msg29="Maksymalny limit to 120 godzin (5 dni)."
var msg30="Nie wypełniłeś pola \"Ilość sztuk\"."
var msg31="Nie wypełniłeś pola \"Cena za sztukę\"."
var msg32="Nie wypełniłeś pola \"TEKST\"."
var msg33="Nie wypełniłeś pola \"Odbiorca Fasoli\"."
var msg34="Nie wypełniłeś pola \"Przelew Fasoli\"."
var msg35a="Maksymalnie możesz przelać "
var msg35b=" fasoli."
var msg36="W polu \"Przelew Fasoli\" możesz wpisać tylko liczby bez spacji! (1234567890)"
var msg37="Wybierz najpierw plik z twardego dysku za pomocą przyciusku \"Przeglądaj\"."
var msg38="Obrazek może być tylko w formatach JPG, GIF lub PNG!"
var msg39="Minimalny wkład do kampanii to 100 fasoli."
var msg40="Maksymalny limit to 100 000 fasoli za 1 czynność."
var msg41="Data ważności kampanii kuponowej nie może być krótsza niż dzisiejsza data."
var msg42="Nie wypełniłeś pola \"Nazwa\"."
var msg43="Nie wypełniłeś pola \"Adres WWW promowanej strony\"."
var msg44="Nie wypełniłeś pola \"Opis\"."
var msg45="Nie wypełniłeś pola \"NAZWA FIRMY\"."
var msg46="Nie wypełniłeś pola \"NIP\"."
var msg47="W polu NIP możesz wpisać tylko liczby bez spacji! (1234567890)"
var msg48="Abyśmy się mogli z Państwem kontaktować muszą Państwo podać poprawny adres e-mailowy. W naszym serwisie nie ma usługi darmowych maili xxxxx@fasole.pl !"
var msg49="Prosimy zaznaczyć czy akceptują Państwo Regulamin programu fasole.pl dla firm."
var msg50="Wypełnij nazwę."
var msg51="Wybierz kategorię."
var msg52="Nie wypełniłeś pola \"Nick\"."
var msg53="Najpierw wybierz plik z dysku."
var msg54="Musisz załadować przynajmniej jedną emotikonę."
var msg55="Emotikona może być tylko w formacie GIF"
var msg56="Nie wypełniłeś pola \"URL\"."
var msg57="W polu \"URL\" możesz użyć tylko tych znaków: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-._/:~=?;"
var msg58="Nie wypełniłeś pola \"Mój opis\"."
var msg59="Wybierz \"Odbiorcę\"."
var msg60="Napisz \"Temat wiadomości\"."
var msg61="Napisz \"Tekst wiadomości\"."
var msg62="Napisz e-mail \"Odbiorcy\"."
var msg63="Podane hasła nie są identyczne."
var msg64="Aby aktywować konto należy podać prawidłowy adres e-mailowy. W naszym serwisie nie ma usługi darmowych maili xxxxx@fasole.pl !"
var msg65="Nie podawaj adresu e-mail prowadzonego u operatora sieci komórkowej. Nie dojdzie do Ciebie nasz mail."
var msg66="Nie wypełniłeś pola \"HASŁO\"."
var msg67="Naprawdę chcesz zmienić emotikony na stare? Te obecne zostaną usunięte z serweru."
var msg68="Najpierw dodaj do kampanii fasole (przycisk EDYTUJ)."
var msg69="Wypełnij składniki."
var msg70="Wybierz sposób przygotowania."
var msg71="Napište jaké služby nebo produkty hodláte přes náš systém propagovat."
var msg72="Napište WWW adresu(y) vašich stránek."



function ValidatorLogin(theFormLogin) {
 with (document.theFormLogin) {
  if (UsrName.value == "")
  { alert(msg1);
    UsrName.focus();
    return (false);
  }
  if (pass.value == "")
  { alert(msg2);
    pass.focus();
    return (false);
  }
  txt=UsrName.value.toLowerCase();
  if (txt.indexOf("@")<1){
  alert(msg3);
  UsrName.focus();
  return (false);
  }
  if (txt.indexOf(".")<1){
  alert(msg4);
  UsrName.focus();
  return (false);
  }
  var checkOK = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-@._";
  var checkStr = UsrName.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;
    }
    if (ch == ",")
    { allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  { alert(msg5);
    UsrName.focus();
    return (false);
  }
  if (decPoints > 1)
  { alert(msg5);
    UsrName.focus();
    return (false);
  }
 return (true);
 }
}


function ValidatorLP(theFormLP) {
 with (document.theFormLP) {
  if (UsrName.value == "")
  { alert(msg1);
    UsrName.focus();
    return (false);
  }
  txt=UsrName.value.toLowerCase();
  if (txt.indexOf("@")<1){
  alert(msg3);
  UsrName.focus();
  return (false);
  }
  if (txt.indexOf(".")<1){
  alert(msg4);
  UsrName.focus();
  return (false);
  }
  var checkOK = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-@._";
  var checkStr = UsrName.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;
    }
    if (ch == ",")
    { allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  { alert(msg5);
    UsrName.focus();
    return (false);
  }
  if (decPoints > 1)
  { alert(msg5);
    UsrName.focus();
    return (false);
  }
 return (true);
 }
}


function ValidatorRegister(theFormRegister) {
 with (theFormRegister) {
  if (cliema.value == "")
  { alert(msg1);
    cliema.focus();
    return (false);
  }
  txt=cliema.value.toLowerCase();
  if (txt.indexOf("@")<1){
  alert(msg3);
  cliema.focus();
  return (false);
  }
  if (txt.indexOf(".")<1){
  alert(msg4);
  cliema.focus();
  return (false);
  }
  var checkOK = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-@._";
  var checkStr = cliema.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;
    }
    if (ch == ",")
    { allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  { alert(msg5);
    cliema.focus();
    return (false);
  }
  if (decPoints > 1)
  { alert(msg5);
    cliema.focus();
    return (false);
  }
  if (cliema.value != cliema2.value)
  { alert(msg7)
    cliema2.focus()
    return (false)
  }
  if (!accept[0].checked && !accept[1].checked)
  { alert(msg8);
    accept[0].focus();
    return (false);
  }
  if (kodAS.value == "")
  { alert(msg9);
    kodAS.focus();
    return (false);
  }
 return (true);
 }
}


function ValidatorRegisterActivation(theForm) {
  if (theForm.nick2.value == "")
  { alert(msg52);
    theForm.nick2.focus();
    return (false);
  }
if (theForm.sbirani[0].checked) {
 if (theForm.clinam.value == "")
  { alert(msg12);
    theForm.clinam.focus();
    return (false);
  }
  if (theForm.clisur.value == "")
  { alert(msg13);
    theForm.clisur.focus();
    return (false);
  }
  if (theForm.clistr.value == "")
  { alert(msg14);
    theForm.clistr.focus();
    return (false);
  }
  if (theForm.clicit.value == "")
  { alert(msg15);
    theForm.clicit.focus();
    return (false);
  }
  if (theForm.clizip.value == "")
  { alert(msg16);
    theForm.clizip.focus();
    return (false);
  }
  var checkOK = "0123456789-";
  var checkStr = theForm.clizip.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;
    }
    if (ch == ",")
    { allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  { alert(msg17);
    theForm.clizip.focus();
    return (false);
  }
}
return (true);
}


function ValidatorOcena(theForm){
  if ((theForm.textin.value == "") || (theForm.textin.value == msg19))
  { alert(msg10);
    theForm.textin.focus();
    return (false);
  }
  if (!theForm.rating[0].checked && 
	!theForm.rating[1].checked && 
	!theForm.rating[2].checked)
  { alert(msg11);
    theForm.rating[0].focus();
    return (false);
  }
return (true);
}

function NoDouble(){
alert(msg6)
}


function ValidatorNewCampaign1(theForm)
{ if (theForm.CampTitl.value == "")
  { alert(msg20);
    theForm.CampTitl.focus();
    return (false);
  }
  if (theForm.CampDesc.value == "")
  { alert(msg21);
    theForm.CampDesc.focus();
    return (false);
  }
  if (theForm.ServAdd.value == "")
  { alert(msg22);
    theForm.ServAdd.focus();
    return (false);
  }
  if (theForm.CamLim.value < 1)
  { alert(msg23);
    theForm.CamLim.focus();
    return (false);
  }
  if (theForm.CamInv.value < 1000)
  { alert(msg24);
    theForm.CamInv.focus();
    return (false);
  }
  if (theForm.CamLim.value > 1000000)
  { alert(msg25);
    theForm.CamLim.focus();
    return (false);
  }
  var checkOK = "0123456789";
  var checkStr = theForm.CamInv.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;
    }
    if (ch == ",")
    { allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  { alert(msg26);
    theForm.CamInv.focus();
    return (false);
  }
  if (decPoints > 1)
  { alert(msg26);
    theForm.CamInv.focus();
    return (false);
  }

if (theForm.maxperday.value != "0") {
  if (theForm.maxperday.value < 100)
  { alert(msg27);
    theForm.maxperday.focus();
    return (false);
  }
  }

if (theForm.TimeLim.value == "6") {
  if (theForm.pauseint.value < 1)
  { alert(msg28);
    theForm.pauseint.focus();
    return (false);
  }
  if (theForm.pauseint.value > 120)
  { alert(msg29);
    theForm.pauseint.focus();
    return (false);
  }
  }
  return (true);
}


function ValidatorNewCampaign2(theForm)
{ if (theForm.CampTitl.value == "")
  { alert(msg20);
    theForm.CampTitl.focus();
    return (false);
  }
  if (theForm.CampDesc.value == "")
  { alert(msg21);
    theForm.CampDesc.focus();
    return (false);
  }

  if (theForm.CamLim[1].checked)
  {
  if (theForm.CamLim2.value == "")
  { alert(msg30);
    theForm.CamLim2.focus();
    return (false);
   }
  if (theForm.CampAct.value == "")
  { alert(msg31);
    theForm.CampAct.focus();
    return (false);
   }
   }
return (true);
}

function ValidatorRatingCompany(theForm)
{ if (theForm.response.value == "")
  { alert(msg32);
    theForm.response.focus();
    return (false);
  }
return (true);
}


function ValidatorManual(theForm,zbyva)
{ if (theForm.UserEmail.value == "")
  { alert(msg33);
    theForm.UserEmail.focus();
    return (false);
  }
  txt=document.theForm.UserEmail.value.toLowerCase();
  if (txt.indexOf("@")<1){
  alert(msg3);
  theForm.UserEmail.focus();
  return (false);
  }
  if (txt.indexOf(".")<1){
  alert(msg4);
  theForm.UserEmail.focus();
  return (false);
  }
  if (theForm.FazoleNo.value == "")
  { alert(msg34);
    theForm.FazoleNo.focus();
    return (false);
  }
  if (theForm.FazoleNo.value > zbyva)
  { alert(msg35a + zbyva + msg35b);
    theForm.FazoleNo.focus();
    return (false);
  }
  var checkOK = "0123456789";
  var checkStr = theForm.FazoleNo.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;
    }
    if (ch == ",")
    { allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  { alert(msg36);
    theForm.FazoleNo.focus();
    return (false);
  }
  if (decPoints > 1)
  { alert(msg36);
    theForm.FazoleNo.focus();
    return (false);
  }
return (true);
}

function ValidatorManualImport(theForm2)
{ if (theForm2.soubor.value == "")
  { alert(msg37);
    theForm2.soubor.focus();
    return (false);
  }
return (true);
}

function ValidatorPicCampaign(theForm2)
{ if (theForm2.soubor.value == "")
  { alert(msg37);
    theForm2.soubor.focus();
    return (false);
  }
	txt=document.theForm2.soubor.value.toLowerCase();
	if ((txt.indexOf(".jpg")<1) && (txt.indexOf(".gif")<1) && (txt.indexOf(".png")<1)){
	alert(msg38);
	theForm2.soubor.focus();
	return (false);
	}
return (true);
}


function ValidatorEdit1(theForm)
{ if (theForm.CampTitl.value == "")
  { alert(msg20);
    theForm.CampTitl.focus();
    return (false);
  }
  if (theForm.CampDesc.value == "")
  { alert(msg21);
    theForm.CampDesc.focus();
    return (false);
  }
  if (theForm.ServAdd.value == "")
  { alert(msg22);
    theForm.ServAdd.focus();
    return (false);
  }
  if (theForm.CamLim.value < 1)
  { alert(msg23);
    theForm.CamLim.focus();
    return (false);
  }
  if (theForm.CamInv.value !=0)  {
  if (theForm.CamInv.value < 100)
  { alert(msg39);
    theForm.CamInv.focus();
    return (false);
  }
  }
  if (theForm.CamLim.value > 100000)
  { alert(msg40);
    theForm.CamLim.focus();
    return (false);
  }
  var checkOK = "0123456789";
  var checkStr = theForm.CamInv.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;
    }
    if (ch == ",")
    { allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  { alert(msg36);
    theForm.CamInv.focus();
    return (false);
  }
  if (decPoints > 1)
  { alert(msg36);
    theForm.CamInv.focus();
    return (false);
  }

if (theForm.maxperday.value != "0") {
  if (theForm.maxperday.value < 100)
  { alert(msg27);
    theForm.maxperday.focus();
    return (false);
  }
  }

if (theForm.TimeLim.value == "6") {
  if (theForm.pauseint.value < 1)
  { alert(msg28);
    theForm.pauseint.focus();
    return (false);
  }
  if (theForm.pauseint.value > 120)
  { alert(msg29);
    theForm.pauseint.focus();
    return (false);
  }
  }

  return (true);
}



function ValidatorEdit2(theForm)
{ if (theForm.CampTitl.value == "")
  { alert(msg20);
    theForm.CampTitl.focus();
    return (false);
  }
  if (theForm.CampDesc.value == "")
  { alert(msg21);
    theForm.CampDesc.focus();
    return (false);
  }

  if (theForm.CamLim[1].checked)
  {
  if (theForm.CamLim2.value == "")
  { alert(msg30);
    theForm.CamLim2.focus();
    return (false);
   }
   }
return (true);
}


function ValidatorEdit3(theForm,JeKonec,tdate)
{ if (theForm.CampTitl.value == "")
  { alert(msg20);
    theForm.CampTitl.focus();
    return (false);
  }
  if (theForm.CampDesc.value == "")
  { alert(msg21);
    theForm.CampDesc.focus();
    return (false);
  }
 if (JeKonec!="") {
  var checkStr = theForm.yea2.value+theForm.mon2.value+theForm.day2.value;
  if (tdate > checkStr)
  { alert(msg41);
    return (false);
  }
	}
  return (true);
}


function ValidatorExist(theForm)
{ if (theForm.Exist.value == "")
  { alert(msg1);
    theForm.Exist.focus();
    return (false);
  }
  txt=document.theForm.Exist.value.toLowerCase();
  if (txt.indexOf("@")<1){
  alert(msg3);
  theForm.Exist.focus();
  return (false);
  }
  if (txt.indexOf(".")<1){
  alert(msg4);
  theForm.Exist.focus();
  return (false);
  }
  var checkOK = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-@._";
  var checkStr = theForm.Exist.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;
    }
    if (ch == ",")
    { allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  { alert(msg5);
    theForm.Exist.focus();
    return (false);
  }
  if (decPoints > 1)
  { alert(msg5);
    theForm.Exist.focus();
    return (false);
  }
return (true);
}


function ValidatorLinks(theForm)
{ if (theForm.A1.value == "")
  { alert(msg42);
    theForm.A1.focus();
    return (false);
  }
  if (theForm.A2.value == "")
  { alert(msg43);
    theForm.A2.focus();
    return (false);
  }
  if (theForm.A3.value == "")
  { alert(msg44);
    theForm.A3.focus();
    return (false);
  }
return (true);
}


function ValidatorCompanyRegistration(theForm,pravidla)
{ if (theForm.comnam.value == "")
  { alert(msg45);
    theForm.comnam.focus();
    return (false);
  }
  if (theForm.comid1.value == "")
  { alert(msg46);
    theForm.comid1.focus();
    return (false);
  }
  var checkOK = "0123456789";
  var checkStr = theForm.comid1.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;
    }
    if (ch == ",")
    { allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  { alert(msg47);
    theForm.comid1.focus();
    return (false);
  }
  if (decPoints > 1)
  { alert(msg47);
    theForm.comid1.focus();
    return (false);
  }
  if (theForm.comstr.value == "")
  { alert(msg14);
    theForm.comstr.focus();
    return (false);
  }
  if (theForm.comcit.value == "")
  { alert(msg15);
    theForm.comcit.focus();
    return (false);
  }
  if (theForm.comzip.value == "")
  { alert(msg16);
    theForm.comzip.focus();
    return (false);
  }
  var checkOK = "0123456789-";
  var checkStr = theForm.comzip.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;
    }
    if (ch == ",")
    { allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  { alert(msg17);
    theForm.comzip.focus();
    return (false);
  }
  if (decPoints > 1)
  { alert(msg17);
    theForm.comzip.focus();
    return (false);
  }
  if (theForm.clinam.value == "")
  { alert(msg12);
    theForm.clinam.focus();
    return (false);
  }
  if (theForm.clisur.value == "")
  { alert(msg13);
    theForm.clisur.focus();
    return (false);
  }
  if (theForm.cliema.value == "")
  { alert(msg1);
    theForm.cliema.focus();
    return (false);
  }
  txt=document.theForm.cliema.value.toLowerCase();
  if (txt.indexOf("@")<1){
  alert(msg3);
  theForm.cliema.focus();
  return (false);
  }
  if (txt.indexOf(".")<1){
  alert(msg4);
  theForm.cliema.focus();
  return (false);
  }
  if (txt.indexOf("@fasole.pl")>0){
  alert(msg48);
  theForm.cliema.focus();
  return (false);
  }

  var checkOK = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-@._";
  var checkStr = theForm.cliema.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;
    }
    if (ch == ",")
    { allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  { alert(msg5);
    theForm.cliema.focus();
    return (false);
  }
  if (decPoints > 1)
  { alert(msg5);
    theForm.cliema.focus();
    return (false);
  }

  if (theForm.pass.value == "")
  { alert(msg2);
    theForm.pass.focus();
    return (false);
  }
 if (pravidla!="") {
  if (!theForm.accept[0].checked && 
	!theForm.accept[1].checked)
  { alert(msg49);
    theForm.accept[0].focus();
    return (false);
  }
}
  if (theForm.text2.value == "")
  { alert(msg71);
    theForm.text2.focus();
    return (false);
  }
  if (theForm.text3.value == "")
  { alert(msg72);
    theForm.text3.focus();
    return (false);
  }
return (true);
}

function ValidatorDF(theForm)
{ if (theForm.Title.value == "")
  { alert(msg50);
    theForm.Title.focus();
    return (false);
  }
  if (theForm.Category.value == "")
  { alert(msg51);
    theForm.Category.focus();
    return (false);
  }

  return (true);
}


function ValidatorSearchNick(theForm)
{ if (theForm.SearchNick.value == "")
  { alert(msg52);
    theForm.SearchNick.focus();
    return (false);
  }
return (true);
}


function barvatextu(){
	var color = window.showModalDialog('textcolor.html', 'window', 'dialogWidth:370px;dialogHeight:240px;help:no;scroll:no;status:no');
	theForm.fontcolor.value=color;
}

function barvatextu2(nazevformu) {
	var nazevformu2=eval('theForm.'+ nazevformu);
	var barva = window.showModalDialog('textcolor.html', 'window', 'dialogWidth:370px;dialogHeight:240px;help:no;scroll:no;status:no');
	nazevformu2.value=barva;
}

function ValidatorAdminProfil(theForm)
{ if (theForm.nick.value == "")
  { alert(msg52);
    theForm.nick.focus();
    return (false);
  }
return (true);
}

function ValidatorFile(frmMain)
{ if (frmMain.soubor.value == "")
  { alert(msg53);
    frmMain.soubor.focus();
    return (false);
   }
	txt=document.frmMain.soubor.value.toLowerCase();
	if ((txt.indexOf(".jpg")<1) && (txt.indexOf(".jpeg")<1) && (txt.indexOf(".gif")<1) && (txt.indexOf(".png")<1)){
	alert(msg38);
	frmMain.soubor.focus();
	return (false);
	}
return (true);
}


function ValidatorSmiles(frmMain) { 
if ((frmMain.soubor1.value == "") && (frmMain.soubor2.value == "") && (frmMain.soubor3.value == "") && (frmMain.soubor4.value == "") && (frmMain.soubor5.value == "") && (frmMain.soubor6.value == "") && (frmMain.soubor7.value == "") && (frmMain.soubor8.value == "") && (frmMain.soubor9.value == "") && (frmMain.soubor10.value == "") && (frmMain.soubor11.value == "") && (frmMain.soubor12.value == "") && (frmMain.soubor13.value == "") && (frmMain.soubor14.value == "") && (frmMain.soubor15.value == "") && (frmMain.soubor16.value == "") && (frmMain.soubor17.value == "")) {
	alert(msg54);
	frmMain.soubor1.focus();
	return (false);
}
if (frmMain.soubor1.value != "") { 
	txt=document.frmMain.soubor1.value.toLowerCase();
	if (txt.indexOf(".gif")<1) {
	alert(msg55);
	frmMain.soubor1.focus();
	return (false);
	}
}
if (frmMain.soubor2.value != "") { 
	txt=document.frmMain.soubor2.value.toLowerCase();
	if (txt.indexOf(".gif")<1) {
	alert(msg55);
	frmMain.soubor2.focus();
	return (false);
	}
}
if (frmMain.soubor3.value != "") { 
	txt=document.frmMain.soubor3.value.toLowerCase();
	if (txt.indexOf(".gif")<1) {
	alert(msg55);
	frmMain.soubor3.focus();
	return (false);
	}
}
if (frmMain.soubor4.value != "") { 
	txt=document.frmMain.soubor4.value.toLowerCase();
	if (txt.indexOf(".gif")<1) {
	alert(msg55);
	frmMain.soubor4.focus();
	return (false);
	}
}
if (frmMain.soubor5.value != "") { 
	txt=document.frmMain.soubor5.value.toLowerCase();
	if (txt.indexOf(".gif")<1) {
	alert(msg55);
	frmMain.soubor5.focus();
	return (false);
	}
}
if (frmMain.soubor6.value != "") { 
	txt=document.frmMain.soubor6.value.toLowerCase();
	if (txt.indexOf(".gif")<1) {
	alert(msg55);
	frmMain.soubor6.focus();
	return (false);
	}
}
if (frmMain.soubor7.value != "") { 
	txt=document.frmMain.soubor7.value.toLowerCase();
	if (txt.indexOf(".gif")<1) {
	alert(msg55);
	frmMain.soubor7.focus();
	return (false);
	}
}
if (frmMain.soubor8.value != "") { 
	txt=document.frmMain.soubor8.value.toLowerCase();
	if (txt.indexOf(".gif")<1) {
	alert(msg55);
	frmMain.soubor8.focus();
	return (false);
	}
}
if (frmMain.soubor9.value != "") { 
	txt=document.frmMain.soubor9.value.toLowerCase();
	if (txt.indexOf(".gif")<1) {
	alert(msg55);
	frmMain.soubor9.focus();
	return (false);
	}
}
if (frmMain.soubor10.value != "") { 
	txt=document.frmMain.soubor10.value.toLowerCase();
	if (txt.indexOf(".gif")<1) {
	alert(msg55);
	frmMain.soubor10.focus();
	return (false);
	}
}
if (frmMain.soubor11.value != "") { 
	txt=document.frmMain.soubor11.value.toLowerCase();
	if (txt.indexOf(".gif")<1) {
	alert(msg55);
	frmMain.soubor11.focus();
	return (false);
	}
}

if (frmMain.soubor12.value != "") { 
	txt=document.frmMain.soubor12.value.toLowerCase();
	if (txt.indexOf(".gif")<1) {
	alert(msg55);
	frmMain.soubor12.focus();
	return (false);
	}
}
if (frmMain.soubor13.value != "") { 
	txt=document.frmMain.soubor13.value.toLowerCase();
	if (txt.indexOf(".gif")<1) {
	alert(msg55);
	frmMain.soubor13.focus();
	return (false);
	}
}

if (frmMain.soubor14.value != "") { 
	txt=document.frmMain.soubor14.value.toLowerCase();
	if (txt.indexOf(".gif")<1) {
	alert(msg55);
	frmMain.soubor14.focus();
	return (false);
	}
}
if (frmMain.soubor15.value != "") { 
	txt=document.frmMain.soubor15.value.toLowerCase();
	if (txt.indexOf(".gif")<1) {
	alert(msg55);
	frmMain.soubor15.focus();
	return (false);
	}
}
if (frmMain.soubor16.value != "") { 
	txt=document.frmMain.soubor16.value.toLowerCase();
	if (txt.indexOf(".gif")<1) {
	alert(msg55);
	frmMain.soubor16.focus();
	return (false);
	}
}
if (frmMain.soubor17.value != "") { 
	txt=document.frmMain.soubor17.value.toLowerCase();
	if (txt.indexOf(".gif")<1) {
	alert(msg55);
	frmMain.soubor17.focus();
	return (false);
	}
}
return (true);
}


function ValidatorProfilLink(theForm2)
{ if (theForm2.url2.value == "")
  { alert(msg56);
    theForm2.url2.focus();
    return (false);
  }
  var checkOK = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-._/:~=?;*";
  var checkStr = theForm2.url2.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;
    }
    if (ch == ",")
    { allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  { alert(msg57);
    theForm2.url2.focus();
    return (false);
  }
  if (decPoints > 1)
  { alert(msg57);
    theForm2.url2.focus();
    return (false);
  }
  if (theForm2.descin.value == "")
  { alert(msg58);
    theForm2.descin.focus();
    return (false);
  }
return (true);
}

function ValidatorWriteMess(theForm)
{ if (theForm.komu.value == "")
  { alert(msg59);
    theForm.komu.focus();
    return (false);
  }
  if (theForm.title.value == "")
  { alert(msg60);
    theForm.title.focus();
    return (false);
  }
  if (theForm.TextIn.value == "")
  { alert(msg61);
    theForm.TextIn.focus();
    return (false);
  }
return (true);
}


function ValidatorInvite(theForm)
{ if (theForm.komu.value == "")
  { alert(msg62);
    theForm.komu.focus();
    return (false);
  }
  if (theForm.TextIn.value == "")
  { alert(msg61);
    theForm.TextIn.focus();
    return (false);
  }
return (true);
}


function ValidatorChange(theForm)
{ var password1, password2;

  password1 = theForm.pass1.value
  password2 = theForm.pass2.value
  if (password1 != password2)
  { alert(msg63)
    theForm.pass2.focus()
    return (false)
  }
  if (theForm.cliema.value == "")
  { alert(msg1);
    theForm.cliema.focus();
    return (false);
  }
  txt=document.theForm.cliema.value.toLowerCase();
  if (txt.indexOf("@")<1){
  alert(msg3);
  theForm.cliema.focus();
  return (false);
  }
  if (txt.indexOf(".")<1){
  alert(msg4);
  theForm.cliema.focus();
  return (false);
  }
  var checkOK = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-@._";
  var checkStr = theForm.cliema.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;
    }
    if (ch == ",")
    { allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  { alert(msg5);
    theForm.cliema.focus();
    return (false);
  }
  if (decPoints > 1)
  { alert(msg5);
    theForm.cliema.focus();
    return (false);
  }
  if (txt.indexOf("@fasole.pl")>0){
   alert(msg64);
   theForm.cliema.focus();
   return (false);
  }
  if ((txt.indexOf("@vodafonemail.cz") || (txt.indexOf("@e-email.cz")))>0){
   alert(msg65);
   theForm.cliema.focus();
   return (false);
  }

  cliema1 = theForm.cliema.value
  cliema2 = theForm.cliema2.value
  if (cliema1 != cliema2)
  { alert(msg7)
    theForm.cliema2.focus()
    return (false)
  }
  if (theForm.pass1.value == "")
  { alert(msg66);
    theForm.pass1.focus();
    return (false);
  }
  if (theForm.pass2.value == "")
  { alert(msg66);
    theForm.pass2.focus();
    return (false);
  }
return (true);
}


function PoslatZnovu(){
	for (var i=0;i<document.email_folder.messid.length;i++)
	{
		var e=document.email_folder.messid[i];
		if (e.checked==true) location.href='pozvanky.asp?akce=nova&id=' + document.email_folder.messid[i].value;
	}
}


function DelSmiles() {
if(confirm(msg67)) document.location.href='smiles.asp?del=True'; 
return false; 
}


function Aktivovat(){
if (theForm.zbyva.value == "0")
  { alert(msg68);
    return (false);
 }
javascript:parent.location.href='kampdet.asp?aktivovat=<%=uidkampane%>&uid=<%=uid%>'
}





function CheckAllEmails() {
	for (var i=0;i<document.email_folder.messid.length;i++)
	{
		var e=document.email_folder.messid[i];
		e.checked=document.email_folder.allmessid.checked;
	}
}


function openWindow() {
window.open("","Photogalery",'toolbar=0,location=0,scrollbars=0,width=20,height=20,resizable=1,top=30,left=30');
}

function checkKeycode(e) {
document.onkeydown = checkKeycode
if (window.event.keyCode == 13)
	document.Form1.submit();
}


function galerie(nazevobr) {
imgOn = (nazevobr);
document.hlavni.src = imgOn;
}


function SmazatFoto(tmp){
	if(confirm('Opravdu chcete smazat tuto fotogalerii včetně všech fotek?')) document.location.href='fotogalerie.asp?del='+ tmp +''; 
	return false;
}

function ValidatorFoto(theForm)
{ if (theForm.name.value == "")
  { alert("Nevyplnili jste pole \"Název fotogalerie\".");
    theForm.name.focus();
    return (false);
  }
return (true);
}


function ValidatorPlatek(theForm)
{ if (theForm.titulek.value == "")
  { alert("Nevyplnili jste pole \"Titulek\".");
    theForm.titulek.focus();
    return (false);
  }
  if (theForm.descin.value == "")
  { alert("Nevyplnili jste pole \"Text\".");
    theForm.descin.focus();
    return (false);
  }
return (true);
}

function Balicek(){
	if(theForm.typakce[0].selected){
	theForm.nocred.value=0;
	theForm.nocred2.value=2000;
	}
	if(theForm.typakce[1].selected){
	theForm.nocred.value=0;
	theForm.nocred2.value=2000;
	}
	if(theForm.typakce[2].selected){
	theForm.nocred.value=0;
	theForm.nocred2.value=2000;
	}
	if(theForm.typakce[3].selected){
	theForm.nocred.value=0;
	theForm.nocred2.value=2000;
	}
	if(theForm.typakce[4].selected){
	theForm.nocred.value=0;
	theForm.nocred2.value=2000;
	}
	if(theForm.typakce[5].selected){
	theForm.nocred.value=0;
	theForm.nocred2.value=25000;
	}
	if(theForm.typakce[6].selected){
	theForm.nocred.value=0;
	theForm.nocred2.value=2000;
	}
	if(theForm.typakce[7].selected){
	theForm.nocred.value=3000;
	theForm.nocred2.value=600;
	}
}


function ValidatorOrder(theForm)
{ if (theForm.comnam.value == "")
  { alert("Nevyplnili jste pole \"Název firmy\".");
    theForm.comnam.focus();
    return (false);
  }

  if (theForm.comid1.value == "")
  { alert("Nevyplnili jste pole \"IČO nebo RČ\".");
    theForm.comid1.focus();
    return (false);
  }

  if (theForm.comstr.value == "")
  { alert("Nevyplnili jste pole \"Sídlo firmy (ulice)\".");
    theForm.comstr.focus();
    return (false);
  }
  if (theForm.comcit.value == "")
  { alert("Nevyplnili jste pole \"Město\".");
    theForm.comcit.focus();
    return (false);
  }
  if (theForm.comzip.value == "")
  { alert("Nevyplnili jste pole \"PSČ\".");
    theForm.comzip.focus();
    return (false);
  }

	if (theForm.cliema.value == "") { 
	alert("Nevyplnili jste pole \"E-mail\".");
	theForm.cliema.focus();
	return (false);}

	if ((theForm.nocred2.value == "") || (theForm.nocred2.value == "0")) { 
		if (theForm.nocred.value < 3000){ 
		alert("Minimální objednávka je 3000 fazolí.");
		theForm.nocred.focus();
		return (false); }
	}

	if ((theForm.nocred.value == "") || (theForm.nocred.value == "0")) { 
		if (theForm.nocred2.value < 500){ 
		alert("Minimální objednávka je 500,- Kč.");
		theForm.nocred2.focus();
		return (false); }
	}

return (true);
}

function ProfilRating(theForm)
{

  if (!theForm.rating[0].checked && 
	!theForm.rating[1].checked)
  { alert("Zvolte hodnocení: kladné nebo negativní.");
    theForm.rating[0].focus();
    return (false);
  }

 if (theForm.textin.value == "")
  { alert("Nevyplnili jste pole \"Text\".");
    theForm.textin.focus();
    return (false);
  }
return (true);
}

function ValidatorRecepty(theForm)
{ if (theForm.title.value == "")
  { alert(msg50);
    theForm.title.focus();
    return (false);
  }
  if (theForm.idcat.value == "")
  { alert(msg51);
    theForm.idcat.focus();
    return (false);
  }
  if (theForm.prisady.value == "")
  { alert(msg69);
    theForm.prisady.focus();
    return (false);
  }
  if (theForm.postup.value == "")
  { alert(msg70);
    theForm.postup.focus();
    return (false);
  }
  return (true);
}


function ValidatorSMS(theForm)
{ if (theForm.predvolba.value == "")
  { alert("Vyberte předvolbu mobilního čísla příjemce.");
    theForm.predvolba.focus();
    return (false);
   }
  if (theForm.prijemce.value == "")
  { alert("Vyplňte mobilní číslo příjmece.");
    theForm.prijemce.focus();
    return (false);
   }
  if (theForm.descin.value == "")
  { alert("Napište text sms.");
    theForm.descin.focus();
    return (false);
   }
return (true);
}

function countit() {
	var str = document.theForm.descin.value;
	document.getElementById("charsWritten").innerHTML = str.length;
	document.getElementById("charsLeft").innerHTML = 151 - str.length;
}


function ValidatorSMSaddress(theForm)
{ if (theForm.predvolba.value == "")
  { alert("Vyberte předvolbu mobilního čísla kontaktu.");
    theForm.predvolba.focus();
    return (false);
   }
  if (theForm.prijemce.value == "")
  { alert("Vyplňte mobilní číslo kontaktu.");
    theForm.prijemce.focus();
    return (false);
   }
  if (theForm.name.value == "")
  { alert("Napište jméno kontaktu.");
    theForm.name.focus();
    return (false);
   }
return (true);
}

function ValidatorSMScoupon(theForm)
{ if ((theForm.smscode.value == "") || (theForm.smscode.value == "0"))
  { alert("Vyplňte šestimístný kód uvedený na sms kupónu.");
    theForm.smscode.focus();
    return (false);
   }
return (true);
}

function ValidatorSMSsetup(theForm)
{ if (theForm.clisms2.value != "")
  {
  if (theForm.clisms1.value == "")
  { alert("Vyberte \"předvolbu\" vašeho mobilního čísla.");
    theForm.clisms1.focus();
    return (false);
   }
   }
  if (theForm.clisms2.value == "")
  { alert("Vyplňte vaše \"číslo\".");
    theForm.clisms2.focus();
    return (false);
   }
return (true);
}


function ValidatorContact(theFormContact) {
 with (document.theFormContact) {
  if (email.value == "")
  { alert("Vyplňte emailovou adresu pro odpověď.");
    email.focus();
    return (false);
  }
  txt=email.value.toLowerCase();
  if (txt.indexOf("@")<1){
  alert(msg3);
  email.focus();
  return (false);
  }
  if (txt.indexOf(".")<1){
  alert(msg4);
  email.focus();
  return (false);
  }
  var checkOK = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-@._";
  var checkStr = 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;
    }
    if (ch == ",")
    { allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  { alert(msg5);
    email.focus();
    return (false);
  }
  if (decPoints > 1)
  { alert(msg5);
    email.focus();
    return (false);
  }
  if (textin.value == "")
  { alert("Vyplňte pole \"Wiadomość\".");
    textin.focus();
    return (false);
  }
  if (kodAS.value == "")
  { alert(msg9);
    kodAS.focus();
    return (false);
  }
 return (true);
 }
}

function RedirPage(theForm){
	parent.location.href=('zmena.asp?sirka=' + document.theForm.sirka.options[document.theForm.sirka.selectedIndex].value);
}