

function Kontrola ()
{

   if (document.formular.f_jmeno_a_prijmeni.value == "")
   {
      document.formular.f_jmeno_a_prijmeni.focus();
      alert ("Vyplňte prosím jméno a příjmení");
      return false;
   }
   if (document.formular.oprijmeni.value == "")
   {
      document.formular.oprijmeni.focus();
      alert ("Nezadali jste vaše příjmení");
      return false;
   }
   if (document.formular.oadresa.value == "")
   {
      document.formular.oadresa.focus();
      alert ("Nezadali jste vaši adresu");
      return false;
   }
   if (document.formular.opsc.value == "")
   {
      document.formular.opsc.focus();
      alert ("Nezadali jste vaše PSČ");
      return false;
   }
   if (document.formular.omesto.value == "")
   {
      document.formular.omesto.focus();
      alert ("Nezadali jste město");
      return false;
   }
   if (document.formular.otelefon.value == "")
   {
      document.formular.otelefon.focus();
      alert ("Nezadali jste Váš telefon");
      return false;
   }

   if (document.formular.oemail.value == "")
   {
      document.formular.oemail.focus();
      alert ("Nezadali jste váš e-mail");
      return false;
   }
   if (document.formular.oemail.value.indexOf("@") == -1)
   {
      document.formular.oemail.focus();
      alert ("Chybný formát e-mailu");
      return false;
   }
   if (document.formular.username.value == "")
   {
      document.formular.username.focus();
      alert ("Prosíme vyplňte uživatelské jméno / přihlašovací jméno");
      return false;
   }
   if (document.formular.password.value == "")
   {
      document.formular.password.focus();
      alert ("Prosíme vyplňte heslo");
      return false;
   }
   if (document.formular.password2.value == "")
   {
      document.formular.password2.focus();
      alert ("Prosíme vyplňte kontrolu hesla");
      return false;
   }

   if (document.formular.password.value != document.formular.password2.value )
   {
      document.formular.password.focus();
      document.formular.password.value="";
      document.formular.password2.value="";
      alert ("Hesla nesouhlasí, prosíme vyplňte je prosím pečlive. Děkujeme");
      return false;
   }

   if (document.formular.password.lenght <4)
   {
      document.formular.password.focus();
      document.formular.password.value="";
      document.formular.password2.value="";
      alert ("Heslo je moc krátké, pro Vaši bezpečnost je minimalní delka 4 znaky.");
      return false;
   }




}

      function cena(cislo,cisloo)
       {
         if (!document.getElementById) return;

	 ukazCenu="<b><font color=\"#189DE0\">" + cislo + " Kč";
         ukazCenu2="<font color=\"#189DE0\">"  + cisloo +" Kč";

         ukazCenu8=cisloo;

         if (document.getElementById) 
         {
           x = document.getElementById('cena');
           x2 = document.getElementById('cena2');
	   x4 = document.getElementById('postovne_form');
         }        
           x.innerHTML = ukazCenu;
           x2.innerHTML = ukazCenu2;
	   x4.value = ukazCenu8;	
         }





		/// DEFiNICE POSTOVNICH POPLATKU

cp1  = 90;
cpb2 = 110;
ppl3 = 80;

cp21  = 9;
cpb22 = 9;
ppl23 = 29;
	     function dpost2(cislo,cisloo)
	       {


		   if (document.formular.cpb.checked=="1")
		   {
		 posta_balik_postovne =90;		
		 posta_balik_dobirka  = posta_balik_postovne + 0;


 	         aaa=  parseInt(document.formular.faktuznevim.value);
	         bbb=  aaa+posta_balik_dobirka;		


			if (!document.getElementById) return;
		        ukazCenu="<b><font color=\"#189DE0\">" + bbb + " Kč";
		        ukazCenu2="<font color=\"#189DE0\">"  + posta_balik_dobirka + "" +" Kč";


		         if (document.getElementById) 
		         {
		           x = document.getElementById('cena');
		           x2 = document.getElementById('cena2');
		         }        
		           x.innerHTML = ukazCenu;
		           x2.innerHTML = ukazCenu2;
		   }


		   if (document.formular.cpob.checked=="1")
		   {
		 posta_balik_postovne =110;		
		 posta_balik_dobirka  = posta_balik_postovne + 0;


 	         aaa=  parseInt(document.formular.faktuznevim.value);
	         bbb=  aaa+posta_balik_dobirka;		


			if (!document.getElementById) return;
		        ukazCenu="<b><font color=\"#189DE0\">" + bbb + " Kč";
		        ukazCenu2="<font color=\"#189DE0\">"  + posta_balik_dobirka + "" +" Kč";

		         if (document.getElementById) 
		         {
		           x = document.getElementById('cena');
		           x2 = document.getElementById('cena2');
		         }        
		           x.innerHTML = ukazCenu;
		           x2.innerHTML = ukazCenu2;
		   }


		   if (document.formular.ppl.checked=="1")
		   {
		 posta_balik_postovne =80;		
		 posta_balik_dobirka  = posta_balik_postovne + 0;


 	         aaa=  parseInt(document.formular.faktuznevim.value);
	         bbb=  aaa+posta_balik_dobirka;		


			if (!document.getElementById) return;
		        ukazCenu="<b><font color=\"#189DE0\">" + bbb + " Kč";
		        ukazCenu2="<font color=\"#189DE0\">"  + posta_balik_dobirka + "" +" Kč";

		         if (document.getElementById) 
		         {
		           x = document.getElementById('cena');
		           x2 = document.getElementById('cena2');
		         }        
		           x.innerHTML = ukazCenu;
		           x2.innerHTML = ukazCenu2;
		   }




		   if (document.formular.osob.checked=="1")
		   {
		 posta_balik_postovne =0;		
		 posta_balik_dobirka  = posta_balik_postovne + 0;


 	         aaa=  parseInt(document.formular.faktuznevim.value);
	         bbb=  aaa+posta_balik_dobirka;		


			if (!document.getElementById) return;
		        ukazCenu="<b><font color=\"#189DE0\">" + bbb + " Kč";
		        ukazCenu2="<font color=\"#189DE0\">"  + posta_balik_dobirka + "" +" Kč";

		         if (document.getElementById) 
		         {
		           x = document.getElementById('cena');
		           x2 = document.getElementById('cena2');
		         }        
		           x.innerHTML = ukazCenu;
		           x2.innerHTML = ukazCenu2;
		   }




		}

	     function dpost(cislo,cisloo)
	       {


		   if (document.formular.cpb.checked=="1")
		   {


		 posta_balik_postovne = cp1;		
		 posta_balik_dobirkovne  = cp21;  
		 posta_balik_dobirka  = posta_balik_postovne + cp21;


 	         aaa=  parseInt(document.formular.faktuznevim.value);
	         bbb=  aaa+posta_balik_dobirka;		


			if (!document.getElementById) return;




		        ukazCenu="<b><font color=\"#189DE0\">" + bbb + " Kč";
		        ukazCenu2="<font color=\"#189DE0\">"  + posta_balik_dobirka + "" +" Kč";

 		        ukazCenu8=posta_balik_dobirkovne;

		         if (document.getElementById) 
		         {
		           x = document.getElementById('cena');
		           x2 = document.getElementById('cena2');

			   x4 = document.getElementById('dobirka_form');
		         }        
		           x.innerHTML = ukazCenu;
		           x2.innerHTML = ukazCenu2;

			   x4.value = ukazCenu8;
		   }

		   if (document.formular.cpob.checked=="1")
		   {


		posta_balik_dobirkovne  = cpb22;  

		 posta_balik_postovne = cpb2;		

		 posta_balik_dobirka  = posta_balik_postovne + cpb22;


 	         aaa=  parseInt(document.formular.faktuznevim.value);
	         bbb=  aaa+posta_balik_dobirka;		


			if (!document.getElementById) return;
		        ukazCenu="<b><font color=\"#189DE0\">" + bbb + " Kč";
		        ukazCenu2="<font color=\"#189DE0\">"  + posta_balik_dobirka + "" +" Kč";
 		        ukazCenu8=posta_balik_dobirkovne;

		         if (document.getElementById) 
		         {
		           x = document.getElementById('cena');
		           x2 = document.getElementById('cena2');
			   x4 = document.getElementById('dobirka_form');
		         }        
		           x.innerHTML = ukazCenu;
		           x2.innerHTML = ukazCenu2;
			   x4.value = ukazCenu8;
		   }


		   if (document.formular.ppl.checked=="1")
		   {
		 posta_balik_postovne =ppl3;		
		 posta_balik_dobirkovne  = ppl23;  
		 posta_balik_dobirka  = posta_balik_postovne + ppl23;


 	         aaa=  parseInt(document.formular.faktuznevim.value);
	         bbb=  aaa+posta_balik_dobirka;		


			if (!document.getElementById) return;
		        ukazCenu="<b><font color=\"#189DE0\">" + bbb + " Kč";
		        ukazCenu2="<font color=\"#189DE0\">"  + posta_balik_dobirka + "" +" Kč";
 		        ukazCenu8=posta_balik_dobirkovne;

		         if (document.getElementById) 
		         {
		           x = document.getElementById('cena');
		           x2 = document.getElementById('cena2');
			   x4 = document.getElementById('dobirka_form');
		         }        
		           x.innerHTML = ukazCenu;
		           x2.innerHTML = ukazCenu2;
			   x4.value = ukazCenu8;
		   }

		   if (document.formular.osob.checked=="1")
		   {
		 posta_balik_postovne =0;		
		 posta_balik_dobirkovne  = 0;  
		 posta_balik_dobirka  = posta_balik_postovne + 0;


 	         aaa=  parseInt(document.formular.faktuznevim.value);
	         bbb=  aaa+posta_balik_dobirka;		


			if (!document.getElementById) return;
		        ukazCenu="<b><font color=\"#189DE0\">" + bbb + " Kč";
		        ukazCenu2="<font color=\"#189DE0\">"  + posta_balik_dobirka + "" +" Kč";
 		        ukazCenu8=posta_balik_dobirkovne;

		         if (document.getElementById) 
		         {
		           x = document.getElementById('cena');
		           x2 = document.getElementById('cena2');
			   x4 = document.getElementById('dobirka_form');
		         }        
		           x.innerHTML = ukazCenu;
		           x2.innerHTML = ukazCenu2;
			   x4.value = ukazCenu8;
		   }




		}
