// Verifikace formuare pro odeslani dotazu
function verifyQuestionForm(questionForm) {
  var why = "";

  if(questionForm.name.value == ""){
    why += "Před odesláním zadejte Vaše jméno.\n";
  }
  if((questionForm.phone.value == "") && (questionForm.email.value == "")){
    why += "Před odesláním zadejte Váš telefon nebo e-mailovou adresu, abychom Vás mohli kontaktovat.\n";
  }
  if(questionForm.text.value == ""){
    why += "Před odesláním zadejte text Vašeho dotazu.\n";
  }
  StrLen = questionForm.code.value.length;
  if(StrLen!=2){
    why += "Před odesláním opište potvrzovací kód (2 znaky před tlačítkem odeslat).\n";
  }
  if (questionForm.email.value != ""){
	  why += checkEmail(questionForm.email.value);
  }

  if (why != ""){
    alert(why);
    return false;
  }

  return true;
}

// Kontrola formatu emailu
function checkEmail (strng) {
  var error = "";

  var emailFilter=/^.+@.+\..{2,4}$/;
  if (!(emailFilter.test(strng))) {
    error += "Zadaná e-mailová adresa nemá platný formát.\n";
  }

  var illegalChars= /[\(\)\<\>\,\;\:\\\\[\]]/
  if (strng.match(illegalChars)) {
    error += "Zadaná e-mailová adresa obsahuje nepovolené znaky.\n";
  }
  return error;
}


function writeEmbedFlash(file, width, height)
{
  document.write('<embed src="'+file+'" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent"></embed>');
}

