function checkForm119(theForm)
{
	var submit = true;
	
	if (submit && !checkRadioButtons(theForm.gender))
	{
		alert('Označte pohlavie!');
		submit = false;
	}
	
	if (submit && theForm.first_name.value == '')
	{
		alert('Zadajte svoje meno!');
		theForm.first_name.focus();
		submit = false;
	}
	
	if (submit && theForm.surname.value == '')
	{
		alert('Zadajte svoje priezvisko!');
		theForm.surname.focus();
		submit = false;
	}

	if (submit && theForm.e_mail.value == '')
	{
		alert('Zadajte svoj e-mail!');
		theForm.e_mail.focus();
		submit = false;
	}

	if (submit && !checkEmailAddress(theForm.e_mail.value))
	{
		alert('Zadaný e-mail má nesprávny formát!');
		theForm.e_mail.focus();
		submit = false;
	}
	
	if (submit && theForm.ulica.value == '')
	{
		alert('Zadajte ulicu!');
		theForm.ulica.focus();
		submit = false;
	}
	
	if (submit && theForm.psc.value == '')
	{
		alert('Zadajte PSČ!');
		theForm.psc.focus();
		submit = false;
	}
	
	if (submit && theForm.mesto.value == '')
	{
		alert('Zadajte mesto!');
		theForm.mesto.focus();
		submit = false;
	}
	
	if (submit && theForm.krajina.selectedIndex == 0)
	{
		alert('Vyberte krajinu!');
		theForm.krajina.focus();
		submit = false;
	}
	
	if (submit && theForm.telefon.value == '')
	{
		alert('Zadajte telefón!');
		theForm.telefon.focus();
		submit = false;
	}
	
	/*
	if (submit && theForm.fax.value == '')
	{
		alert('Zadajte fax!');
		theForm.fax.focus();
		submit = false;
	}
	*/
	
	if (submit && theForm.password.value == '')
	{
		alert('Zadajte prihlasovacie heslo!');
		theForm.password.focus();
		submit = false;
	}

	if (submit && theForm.password_again.value == '')
	{
		alert('Zadajte svoje prihlasovacie heslo znovu!');
		theForm.password_again.focus();
		submit = false;
	}
	
	if (submit && theForm.password_again.value != theForm.password.value)
	{
		alert('Zadané heslá niesu rovnaké!');
		theForm.password.focus();
		submit = false;
	}
	
	if (submit)
	{
		disableSubmitButton(document.getElementById('submitButton'), 'Prosím čakajte');
	}
	
	return submit;
}

function checkForm351(theForm)
{
	var submit = true;

	if (submit && !checkRadioButtons(theForm.gender))
	{
		alert('Označte pohlavie!');
		submit = false;
	}

	if (submit && theForm.first_name.value == '')
	{
		alert('Zadajte svoje meno!');
		theForm.first_name.focus();
		submit = false;
	}
	
	if (submit && theForm.surname.value == '')
	{
		alert('Zadajte svoje priezvisko!');
		theForm.surname.focus();
		submit = false;
	}

	if (submit && theForm.e_mail.value == '')
	{
		alert('Zadajte svoj e-mail!');
		theForm.e_mail.focus();
		submit = false;
	}

	if (submit && !checkEmailAddress(theForm.e_mail.value))
	{
		alert('Zadaný e-mail má nesprávny formát!');
		theForm.e_mail.focus();
		submit = false;
	}
	
	if (submit && theForm.ulica.value == '')
	{
		alert('Zadajte ulicu!');
		theForm.ulica.focus();
		submit = false;
	}
	
	if (submit && theForm.psc.value == '')
	{
		alert('Zadajte PSČ!');
		theForm.psc.focus();
		submit = false;
	}
	
	if (submit && theForm.mesto.value == '')
	{
		alert('Zadajte mesto!');
		theForm.mesto.focus();
		submit = false;
	}
	
	if (submit && theForm.krajina.selectedIndex == 0)
	{
		alert('Vyberte krajinu!');
		theForm.krajina.focus();
		submit = false;
	}
	
	if (submit && theForm.telefon.value == '')
	{
		alert('Zadajte telefón/mobil!');
		theForm.telefon.focus();
		submit = false;
	}
	
	if (submit && theForm.password.value == '')
	{
		alert('Zadajte prihlasovacie heslo!');
		theForm.password.focus();
		submit = false;
	}

	if (submit && theForm.password_verify.value == '')
	{
		alert('Zadajte svoje prihlasovacie heslo znovu!');
		theForm.password_verify.focus();
		submit = false;
	}
	
	if (submit && theForm.password_verify.value != theForm.password.value)
	{
		alert('Zadané heslá nie sú rovnaké!');
		theForm.password.focus();
		submit = false;
	}

  if (submit && !checkMarketing(theForm))
  {
    submit = false;
  }

	if (submit)
	{
		disableSubmitButton(document.getElementById('submitButton'), 'Prosím čakajte');
		theForm.username.value=theForm.e_mail.value;
	}

	return submit;
}

function checkMarketing(theForm)
{
  var radio_choice = false;
	var return_value = true;
  
  if (typeof(theForm.marketing)!='undefined')
  {
    dlength=theForm.marketing.length;
  	
  	if(dlength)
  	{
  		for (index=0; index<dlength; index++)
  		{
  			if (theForm.marketing[index].checked)
  			{
  				radio_choice = true;
  			}
  		}
  		
  		if (radio_choice == false)
  		{
  			alert('Prosím vyberte jednu z možností!');
  			theForm.marketing[0].focus();
  		  return_value = false;
  		}	
  	}
  	else
  	{
  		if(theForm.marketing.checked==false)
  		{
  			alert('Prosím vyberte jednu z možností!');
  			theForm.marketing.focus();
  		  return_value = false;
  		}
  	}
  }

  return return_value;
}

function checkForm414(theForm)
{
	var submit = true;

	if (submit && theForm.e_mail.value == '')
	{
		alert('Zadajte svoj e-mail!');
		theForm.e_mail.focus();
		submit = false;
	}

	if (submit && !checkEmailAddress(theForm.e_mail.value))
	{
		alert('Zadaný e-mail má nesprávny formát!');
		theForm.e_mail.focus();
		submit = false;
	}
	
	if (submit)
	{
		disableSubmitButton(document.getElementById('submitButton'), 'Prosím čakajte');
	}

	return submit;
}

function checkForm4379(theForm)
{
	var submit = true;
	
	if (submit && theForm.produkt.value == '0')
	{
		alert('Vyberte produkt!');
		theForm.produkt.focus();
		submit = false;
	}

	if (submit && theForm.typ_registracie.value == '0')
	{
		alert('Vyberte typ registrácie!');
		theForm.typ_registracie.focus();
		submit = false;
	}

	if (submit && theForm.seriove_cislo.value == '')
	{
		alert('Zadajte sériové číslo!');
		theForm.seriove_cislo.focus();
		submit = false;
	}
	
	if (submit)
	{
		disableSubmitButton(document.getElementById('submit_button'), 'Prosím čakajte');
	}

	return submit;
}

function checkForm409(theForm)
{
	var submit = true;
	
	if (submit && !checkRadioButtons(theForm.gender))
	{
		alert('Označte pohlavie!');
		submit = false;
	}
	if (submit && theForm.first_name.value == '')
	{
		alert('Zadajte svoje meno!');
		theForm.first_name.focus();
		submit = false;
	}
	
	if (submit && theForm.surname.value == '')
	{
		alert('Zadajte svoje priezvisko!');
		theForm.surname.focus();
		submit = false;
	}

	if (submit && theForm.e_mail.value == '')
	{
		alert('Zadajte svoj e-mail!');
		theForm.e_mail.focus();
		submit = false;
	}

	if (submit && !checkEmailAddress(theForm.e_mail.value))
	{
		alert('Zadaný e-mail má nesprávny formát!');
		theForm.e_mail.focus();
		submit = false;
	}
	
	if (submit && theForm.ulica.value == '')
	{
		alert('Zadajte ulicu!');
		theForm.ulica.focus();
		submit = false;
	}
	
	if (submit && theForm.psc.value == '')
	{
		alert('Zadajte PSČ!');
		theForm.psc.focus();
		submit = false;
	}
	
	if (submit && theForm.mesto.value == '')
	{
		alert('Zadajte mesto!');
		theForm.mesto.focus();
		submit = false;
	}
	
	if (submit && theForm.krajina.selectedIndex == 0)
	{
		alert('Vyberte krajinu!');
		theForm.krajina.focus();
		submit = false;
	}
	
	if (submit && theForm.telefon.value == '')
	{
		alert('Zadajte telefón/mobil!');
		theForm.telefon.focus();
		submit = false;
	}
	
	if (submit && theForm.password_verify.value != theForm.password.value)
	{
		alert('Zadané heslá nie sú rovnaké!');
		theForm.password.focus();
		submit = false;
	}
	
	if (submit)
	{
		if(!theForm.mailing_list_dsi.checked) 
    {
      theForm.mailing_list_dsi.value = 'F';
      theForm.mailing_list_dsi.checked = true;
    }
		disableSubmitButton(document.getElementById('submitButton'), 'Prosím čakajte');
		theForm.username.value=theForm.e_mail.value;
	}

	return submit;
}

function checkForm4861()
{
	var theForm = document.getElementById('doprava-form');
	var submit = true;
	var radio_choice = false;
	
	dlength=theForm.dodavka.length;
	
	if(dlength)
	{
		for (index=0; index<dlength; index++)
		{
			if (theForm.dodavka[index].checked)
			{
				radio_choice = true;
			}
		}
		
		if (radio_choice == false && submit)
		{
			alert('Prosím vyberte spôsob odberu!');
			theForm.dodavka[0].focus();
			submit = false;
		}	
	}
	else
	{
		if(theForm.dodavka.checked==false)
		{
			alert('Prosím vyberte spôsob odberu!');
			theForm.dodavka.focus();
			submit = false;
		}
	}
	
	if (theForm.nazov.value == '' && submit)
	{
		alert('Prosím vyplňte meno a priezvisko/názov firmy!');
		theForm.nazov.focus();
		submit = false;
	}
	
	if(theForm.doklad_osoba.checked==false && theForm.doklad_firma.checked==false && submit)
	{
    alert('Prosím doplňte údaj!');
    theForm.doklad_osoba.focus();
    submit = false;
  }
  else
  {
    if(theForm.doklad_firma.checked==true)
    {
      if(theForm.ico.value == '')
      {
    		alert('Prosím vyplňte IČO!');
    		theForm.ico.focus();
    		submit = false;      
      }
      if(theForm.ico.value != '' && theForm.dic.value == '')
      {
    		alert('Prosím vyplňte DIČ!');
    		theForm.dic.focus();
    		submit = false;      
      }
    }
  }
	
	if (theForm.ulica.value == '' && submit)
	{
		alert('Prosím vyplňte ulicu!');
		theForm.ulica.focus();
		submit = false;
	}
	
	if (theForm.mesto.value == '' && submit)
	{
		alert('Prosím vyplňte mesto!');
		theForm.mesto.focus();
		submit = false;
	}
	
	if (theForm.psc.value == '' && submit)
	{
		alert('Prosím vyplňte PSČ!');
		theForm.psc.focus();
		submit = false;
	}

	if (theForm.krajina.value == '' && submit)
	{
		alert('Prosím vyplňte krajinu!');
		theForm.krajina.focus();
		submit = false;
	}

	if (theForm.check_email.value == '' && submit)
	{
		alert('Zadajte svoj e-mail!');
		theForm.check_email.focus();
		submit = false;
	}

	if (!checkEmailAddress(theForm.check_email.value) && submit)
	{
		alert('Zadaný e-mail má nesprávny formát!');
		theForm.check_email.focus();
		submit = false;
	}
	
	return submit;
}

function checkForm4862()
{
	var theForm = document.getElementById('platba-form');
	var submit = true;
	var radio_choice = false;
	
	dlength=theForm.platba.length;
	
	if(dlength)
	{
		for (index=0; index<dlength; index++)
		{
			if (theForm.platba[index].checked)
			{
				radio_choice = true;
			}
		}
		
		if (radio_choice == false && submit)
		{
			alert('Prosím vyberte spôsob platby!');
			theForm.platba[0].focus();
			submit = false;
		}	
	}
	else
	{
		if(theForm.platba.checked==false)
		{
			alert('Prosím vyberte spôsob platby!');
			theForm.platba.focus();
			submit = false;
		}
	}

	return submit;
}

function CheckFAQ()
{
	var theForm = document.getElementById('faq');
	var submit = true;
	
	if (theForm.name_author.value == '' && submit)
	{
		alert('Prosím vyplňte autora!');
		theForm.name_author.focus();
		submit = false;
	}
	
	if (theForm.author_e_mail.value == '' && submit)
	{
		alert('Prosím vyplňte email!');
		theForm.author_e_mail.focus();
		submit = false;
	}
	
	if (!isEmail(theForm.author_e_mail.value) && submit)
	{
		alert('Prosím vyplňte správny email!');
		theForm.author_e_mail.focus();
		submit = false;
	}

	if (theForm.question.value == '' && submit)
	{
		alert('Prosím vyplňte otázku!');
		theForm.question.focus();
		submit = false;
	}
	
  return submit;
}

function isEmail(address)
{
  var correct = true;
  var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;

  if(reg.test(address) == false)
  {
    correct = false;
  }
  
  return correct;
}

function checkForm4868(theForm)
{
	var submit = true;

  if (submit && !checkMarketing(theForm))
  {
    submit = false;
  }

	if (submit)
	{
		disableSubmitButton(document.getElementById('submitButton'), 'Prosím čakajte');
	}

	return submit;
}

function checkFormRSN(theForm)
{
	var submit = true;
		
	if (submit && theForm.name.value == '')
	{
		alert('Zadajte svoje meno!');
		theForm.name.focus();
		submit = false;
	}
	
	if (submit && theForm.surname.value == '')
	{
		alert('Zadajte svoje priezvisko!');
		theForm.surname.focus();
		submit = false;
	}
	
	if (submit && !checkRadioButtons(theForm.gender))
	{
		alert('Označte pohlavie!');
		submit = false;
	}
	
	if (submit && theForm.address.value == '')
	{
		alert('Zadajte adresu!');
		theForm.address.focus();
		submit = false;
	}
	
	if (submit && theForm.city.value == '')
	{
		alert('Zadajte mesto!');
		theForm.city.focus();
		submit = false;
	}
	
	if (submit && theForm.zip.value == '')
	{
		alert('Zadajte PSČ!');
		theForm.zip.focus();
		submit = false;
	}
	
	if (theForm.country.selectedIndex == 0 && submit)
	{
		alert('Prosím vyberte krajinu!');
		theForm.country.focus();
		submit = false;
	}
	
	if (submit && theForm.product_type.value == '')
	{
		alert('Zadajte typ autorádia!');
		theForm.product_type.focus();
		submit = false;
	}
	
	if (submit && theForm.registration_type.selectedIndex == 0)
	{
		alert('Vyberte typ registrácie!');
		theForm.registration_type.focus();
		submit = false;
	}
	
	if (submit && theForm.serial_number.value == '')
	{
		alert('Zadajte sériové číslo!');
		theForm.serial_number.focus();
		submit = false;
	}
	
	return submit;
}

function checkFormRWC(theForm)
{
	var submit = true;
		
	if (submit && theForm.name.value == '')
	{
		alert('Zadajte svoje meno!');
		theForm.name.focus();
		submit = false;
	}
	
	if (submit && theForm.surname.value == '')
	{
		alert('Zadajte svoje priezvisko!');
		theForm.surname.focus();
		submit = false;
	}
	
	if (submit && !checkRadioButtons(theForm.gender))
	{
		alert('Označte pohlavie!');
		submit = false;
	}
	
	if (submit && theForm.address.value == '')
	{
		alert('Zadajte adresu!');
		theForm.address.focus();
		submit = false;
	}
	
	if (submit && theForm.city.value == '')
	{
		alert('Zadajte mesto!');
		theForm.city.focus();
		submit = false;
	}
	
	if (submit && theForm.zip.value == '')
	{
		alert('Zadajte PSČ!');
		theForm.zip.focus();
		submit = false;
	}
	
	if (theForm.country.selectedIndex == 0 && submit)
	{
		alert('Prosím vyberte krajinu!');
		theForm.country.focus();
		submit = false;
	}
	
	if (submit && theForm.registration_type.selectedIndex == 0)
	{
		alert('Vyberte typ registrácie!');
		theForm.registration_type.focus();
		submit = false;
	}
	
	if (submit && theForm.winning_code.value == '')
	{
		alert('Zadajte výherný kód!');
		theForm.winning_code.focus();
		submit = false;
	}
	
	if (submit && theForm.e_mail.value == '')
	{
		alert('Zadajte svoj e-mail!');
		theForm.e_mail.focus();
		submit = false;
	}

	if (submit && !checkEmailAddress(theForm.e_mail.value))
	{
		alert('Zadaný e-mail má nesprávny formát!');
		theForm.e_mail.focus();
		submit = false;
	}
	
	return submit;
}
