var cUsporyZamestnavatele = function(){
	
	this.init = function(){
//		log('zamestnavatel');
	};
	
	this.calculate = function(){
		
	};
};


	var generated = false;
	var generated_pz = 0;
	var generated_pm = 0;
	var generated_prisp = 0;

	var koef_prispevek_zamestnavatele = 0.03;
	// var koef_socialni_pojisteni_zamestnanec = 8;
	var koef_socialni_pojisteni_zamestnanec = 6.5;
	// var koef_socialni_pojisteni_firma = 26;
	var koef_socialni_pojisteni_firma = 25;
	var koef_zdravotni_pojisteni_zamestnanec = 4.5;
	var koef_zdravotni_pojisteni_firma = 9;
	var koef_zaklad_dane = -3170;

	var K_pz_n_zp = 0; //
	
	function zformatuj(number)
	{
		return number_format( number, 0, ",", " " );
	}

	function number_format( number, decimals, dec_point, thousands_sep ) {
	    	var n = number, c = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals;
    		var d = dec_point == undefined ? "." : dec_point;
    		var t = thousands_sep == undefined ? "," : thousands_sep, s = n < 0 ? "-" : "";
    		var i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0;
    
    		return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
	}
	
	function is_number(s) {
		var r = new RegExp("^[0-9]+$");
		return (r.test(s));
	}

	function is_float_number(s) {
		var r = new RegExp("^[0-9]+([,.]?[0-9]+)?$");
		return (r.test(s));
	}

	function floor(num)
	{
		var s = num.toString();
		return s.replace(/\..*$/, "");
	}

	/**
	 * Get Value
	 *
	 * vraci hodnotu elementu ve formualri fomr_data
	 *
	 * (string) name  nazev elementu
	 *
	 **/
	function gV(name)
	{
		return $(name).val();
	}

	/**
	 * Set Value
	 *
	 * nastavi hodnotu elementu ve formualri fomr_data
	 *
	 * (string) name  nazev elementu
	 * (mixed) value  hodnota
	 *
	 **/
	function sV(name,value)
	{
		$(name).val(value);
	}

	/*
	function dbg(name)
	{
		$(name).style.border = '1px solid red';

	}
	*/

	function show_karta(helpID) {
		helpID = "#"+helpID;
		$("#karta_data_id").hide();
		$("#karta_nabidka_id").hide();
		$("#karta_detail_id").hide();

		// Overeni spravne zadanych hodnot
		if (is_number(gV('#pocet_zamestnancu'))      &&
		    is_number(gV('#prumerna_mzda'))          &&
		    (parseFloat(gV('#pocet_zamestnancu')) > 0) &&
		    (parseFloat(gV('#prumerna_mzda')) > 0)
		   ) {

			$(helpID).show();

			$("#karta_data_id_button").attr("class","top_button");
			$("#karta_detail_id_button").attr("class","top_button");
			$("#karta_nabidka_id_button").attr("class","top_button");
			
			$(helpID + "_button").attr("class","top_button_active");;

			// Overeni zdali se zmenili vstupni hodnoty
			if (gV('#pocet_zamestnancu') != generated_pz) { generated = false; }
			if (gV('#prumerna_mzda') != generated_pm) { generated = false; }
			if (gV('#prispevek_zamestnavatele') != generated_prisp) { generated = false; }
			// pokud ano pregenerovat formualr
			if (generated == false) { calc_detail(); }

		} else {
		// Zobrazeni v pripade spatne vyplneneho formulare
			$("#karta_data_id").show();
			alert("Počet zaměstnanců nebo průměrná mzda musí býl zadány jako celé číslo větší než 0!");
		}
	}


	/**
	 * Automaticke doplneni prispevku podle prumerne mzdy
	 *
	 *
	 **/
	function calc_prispevek_zamestnavatele_suma(suma) {
		var procenta = ((suma/gV('#prumerna_mzda'))*100);

		if (!is_float_number(procenta)) {
			window.alert("Zadejte prosím platný příspěvek zaměstnavatele.");
			document.form_data.prispevek_zamestnavatele.focus();
		} else if (gV('#prispevek_zamestnavatele') < 100) {
			window.alert("Příspěvek zaměstnavatele může činit nejméně 100 Kč.");
			sV('#prispevek_zamestnavatele', 100);
			document.form_data.prispevek_zamestnavatele.focus();
		} else if (gV('#prispevek_zamestnavatele') > 2000) {
			window.alert("Příspěvek zaměstnavatele může činit maximálně 2000 Kč.");
			sV('#prispevek_zamestnavatele', 2000);
			document.form_data.prispevek_zamestnavatele.focus();
		}
	}

/*	function calc_prispevek_zamestnavatele_percent(procenta)
	{
		if (!is_float_number(procenta)) {
			window.alert("Zadejte platn slo prosm.");
		} else if (procenta > 3 || procenta < 1) {
			window.alert("Pspvek zamstnavatele me init minimln 1% a maximln 3%.");
		} else {
			//cislo = Math.round(((procenta.replace(",", ".")*100) * document.form_data.prumerna_mzda.value))/10000;
			cislo = Math.round((((procenta.replace(",", ".")/100) * document.form_data.prumerna_mzda.value)));
			document.form_data.prispevek_zamestnavatele.value = cislo;
		}
	}
*/



	function calc_prispevek_zamestnavatele(prumerna_mzda) {

		if (is_number(prumerna_mzda)) {
			if (prumerna_mzda < 11000){
				alert("Prmrn mzda mus bt alespo 11000");
				sV('#prumerna_mzda' , 11000);
			}
			/*
			sV('#prispevek_zamestnavatele',floor(koef_prispevek_zamestnavatele * prumerna_mzda));
			if (gV('#prispevek_zamestnavatele') < 100)
				sV('#prispevek_zamestnavatele', 100);
			if (gV('#prispevek_zamestnavatele') > 2000)
				sV('#prispevek_zamestnavatele' , 2000);
			sV('#prispevek_zamestnavatele_proc', (koef_prispevek_zamestnavatele * 100));
										   */
		} else {
			alert("Průměrná mzda musí být alespoň 11000");
		}
	}


	function calc_clear_all()
	{
		sV('#det_phmzpp', "");
		sV('#det_pznpp_kc', "");
		sV('#det_zpz', "");
		sV('#det_phmz', "");
		sV('#det_vhm', "");
		sV('#det_pznpp_proc', "");
		sV('#det_spvmzam', "");
		sV('#det_spvmfir', "");
		sV('#det_zpvmzam', "");
		sV('#det_zpvmfir', "");
		sV('#det_cnfvm', "");
		sV('#det_spppzam', "");
		sV('#det_spppfir', "");
		sV('#det_zpppzam', "");
		sV('#det_zpppfir', "");
		sV('#det_cnfpp', "");
		sV('#det_szdvm', "");
		sV('#det_szdpp', "");
		//sV('#det_pvydzpvm', "");
		//sV('#det_pvydzppp', "");
		//sV('#det_zndzpvm', "");
		//sV('#det_zndzppp', "");
		sV('#det_cmvm', "");
		sV('#det_cmpp', "");
		sV('#det_pznpppp', "");
		sV('#det_cpozvm', "");
		sV('#det_cpozpp', "");
		sV('#det_rpppz', "");
		sV('#det_rppjz', "");
		sV('#det_rppvz', "");
		sV('#det_rppvzr', "");
		sV('#det_rpppuz', "");
		sV('#det_rpppuzr', "");
		sV('#nab_hmz', "");
		sV('#nab_pzproc', "");
		sV('#nab_pz', "");
		sV('#nab_poz', "");
		sV('#nab_hmz_hm', "");
		sV('#nab_hmz_hmp', "");
		sV('#nab_pzh', "");
		sV('#nab_sp_hm', "");
		sV('#nab_sp_hmp', "");
		sV('#nab_sp_uonm', "");
		sV('#nab_sp_uonk', "");
		sV('#nab_zp_hm', "");
		sV('#nab_zp_hmp', "");
		sV('#nab_zp_uonm', "");
		sV('#nab_zp_uonk', "");
		sV('#nab_cdn_hm', "");
		sV('#nab_cdn_hmp', "");
		sV('#nab_cdn_uonm', "");
		sV('#nab_cdn_uonk', "");
		sV('#nab_xpzm', "");
		sV('#nab_xpzk', "");
		sV('#nab_txt1', "");
		sV('#nab2_hmz', "");
		sV('#nab2_pzproc', "");
		sV('#nab2_pz', "");
		sV('#nab2_hmvs', "");
		sV('#nab2_hmn', "");
		sV('#nab2_vspp', "");
		sV('#nab2_pzh', "");
		sV('#nab2_cpzhmvs', "");
		sV('#nab2_cpzhmn', "");
		sV('#nab2_cpzvspp', "");
		sV('#nab2_rmhmp', "");
		sV('#nab2_rmvspp', "");
		sV('#nab2_rkhmp', "");
		sV('#nab2_rkvspp', "");
		sV('#nab2_vcco', "");
		sV('#nab2_txt1', "");
		sV('#nab2_txt2', "");
		sV('#nab2_txt3', "");
		sV('#nab2_txt4', "");
		sV('#nab2_txt5', "");
		sV('#det_cnfvm_round', "");
		sV('#det_cnfpp_round', "");


	}

	function calc_detail() {

		// vymazeme vsechny data
		calc_clear_all();


		// nastaveni hodnot
		generated_pz = gV('#pocet_zamestnancu');
		generated_pm = gV('#prumerna_mzda');
		generated_prisp = gV('#prispevek_zamestnavatele');



		// prevedeni ze zadanych hodnot
		sV('#det_phmzpp', gV('#prumerna_mzda'));
		sV('#det_pznpp_kc', gV('#prispevek_zamestnavatele'));
		sV('#det_zpz', gV('#prispevek_zamestnavatele'));
		//sV('#det_pznpp_proc', gV('#prispevek_zamestnavatele_proc'));
		sV('#det_rpppz',gV('#pocet_zamestnancu'));



		// sloupec prumerna hruba mzda zamestnance (Vyplata MZDY)
		// tmp1 = Vychozi hruba mzda

		var tmp1 = (parseFloat(gV('#det_phmzpp')) + parseFloat(gV('#det_pznpp_kc'))) + K_pz_n_zp;
		sV('#det_phmz',  tmp1);
		sV('#det_vhm', tmp1);


		// konstatny
		sV('#det_spzam', koef_socialni_pojisteni_zamestnanec);
		sV('#det_spfir', koef_socialni_pojisteni_firma);

		sV('#det_zpzam', koef_zdravotni_pojisteni_zamestnanec);
		sV('#det_zpfir', koef_zdravotni_pojisteni_firma);


		// socialni pojisteni  mzda
		sV('#det_spvmzam', ((-koef_socialni_pojisteni_zamestnanec * gV('#det_phmz')) / 100));
		sV('#det_spvmfir', ((koef_socialni_pojisteni_firma * gV('#det_phmz')) / 100));
		// zdravotni pojisteni mzda
		sV('#det_zpvmzam', ((-koef_zdravotni_pojisteni_zamestnanec * gV('#det_phmz')) / 100));
		sV('#det_zpvmfir', ((koef_zdravotni_pojisteni_firma * gV('#det_phmz')) / 100));


		// tmpA1 = celkova naklady zamestnanec
		tmpA1 = (parseFloat(tmp1) + parseFloat(gV('#det_spvmfir')) + parseFloat(gV('#det_zpvmfir')));
		sV('#det_cnzvm', tmpA1);

		// tmpA2 = celkova naklady firmy
		tmpA2 = (parseFloat(tmp1) + parseFloat(gV('#det_spvmfir')) + parseFloat(gV('#det_zpvmfir')));
		sV('#det_cnfvm', tmpA2);
		
		//zaokrouhleni na 100
		sV('#det_cnfvm_round', Math.ceil(tmpA2/100)*100);




		// socialni pojisteni vyplata mzdy + pp csob
		sV('#det_spppzam', ((-koef_socialni_pojisteni_zamestnanec * gV('#det_phmzpp')) / 100));
		sV('#det_spppfir', ((koef_socialni_pojisteni_firma * gV('#det_phmzpp')) / 100));
		// zdravotni pojisteni vyplata mzdy + pp csob
		sV('#det_zpppzam', ((-koef_zdravotni_pojisteni_zamestnanec * gV('#det_phmzpp')) / 100));
		sV('#det_zpppfir', ((koef_zdravotni_pojisteni_firma * gV('#det_phmzpp')) / 100));


		// tmpB celkove naklady firmy
		tmpB1 = (parseFloat(gV('#det_phmzpp')) + parseFloat(gV('#det_zpz')) + parseFloat(gV('#det_spppfir')) + parseFloat(gV('#det_zpppfir')));
		tmpB2 = (parseFloat(gV('#det_phmzpp')) + parseFloat(gV('#det_zpz')) + parseFloat(gV('#det_spppfir')) + parseFloat(gV('#det_zpppfir'))) - gV('#det_pznpp_kc');


		sV('#det_cnzpp', tmpB1);
		sV('#det_cnfpp', tmpB2);
		
		//zaokrouhleni na 100
		sV('#det_cnfpp_round', Math.ceil(tmpB2/100)*100);
		
		// Dan pred slevami
		sV('#det_dpsA', ( gV('#det_cnfvm_round') / 100 * 15  ));
		sV('#det_dpsB', ( gV('#det_cnfpp_round') / 100 * 15  ));



		// Zaklad pro vypocet
		var tmp2 = (parseFloat(tmp1) +
		            parseFloat(gV('#det_spvmzam')) +
		            parseFloat(gV('#det_zpvmzam')));
		sV('#det_szdvm',  tmp2 );

		var tmp3 = (parseFloat(gV('#det_phmzpp')) +
		            parseFloat(gV('#det_spppzam')) +
		            parseFloat(gV('#det_zpppzam')));
		sV('#det_szdpp', tmp3);

		/*
		document.form_detail.det_pvydzpvm.value = (Math.ceil(tmp2 / 100) * 100);
		document.form_detail.det_pvydzppp.value = (Math.ceil(tmp3 / 100) * 100);
		*/


		// var tmp4 = parseFloat(document.form_detail.det_pvydzpvm.value);
		/*
		var tmp5 = 0;

		if (tmp4 > 27600) { tmp5 = 5101 + ((tmp4 - 27600) * 0.32);
		} else if (tmp4 > 18200) { tmp5 = 2751 + ((tmp4 - 18200) * 0.25);
		} else if (tmp4 > 10100) { tmp5 = 1212 + ((tmp4 - 10100) * 0.19);
		} else { tmp5 = (tmp4 * 0.12); }

		tmp5 = -tmp5 + 1100;
		*/
		// document.form_detail.det_zndzpvm.value = tmp5;

		//var tmp6 = parseFloat(document.form_detail.det_pvydzppp.value);
		/*
		var tmp7 = 0;

		if (tmp6 > 27600) { tmp7 = 5101 + ((tmp6 - 27600) * 0.32);
		} else if (tmp6 > 18200) { tmp7 = 2751 + ((tmp6 - 18200) * 0.25);
		} else if (tmp6 > 10100) { tmp7 = 1212 + ((tmp6 - 10100) * 0.19);
		} else { tmp7 = (tmp6 * 0.12); }

		tmp7 = -tmp7 + 1100;

		document.form_detail.det_zndzppp.value = tmp7;
		*/

		// Nove pocitana Cista mzda
		sV('#det_cmvm', ( parseFloat(gV('#det_szdvm')) - parseFloat(gV('#det_dpsA')) + 2070 + 890));
		//(parseFloat(tmp1) + parseFloat(document.form_detail.det_spvmzam.value) + parseFloat(document.form_detail.det_zpvmzam.value) + parseFloat(document.form_detail.det_zndzpvm.value));
		sV('#det_cmpp', ( parseFloat(gV('#det_szdpp')) - parseFloat(gV('#det_dpsB')) +2070 + 890 ));
		//(parseFloat(document.form_detail.det_phmzpp.value) + parseFloat(document.form_detail.det_spppzam.value) + parseFloat(document.form_detail.det_zpppzam.value) + parseFloat(document.form_detail.det_zndzppp.value));

		sV('#det_pznpppp', gV('#det_pznpp_kc'));

		// celkovy prijem
		tmpC = gV('#det_cmvm');
		sV('#det_cpozvm', tmpC);
		tmpD = (parseFloat(gV('#det_cmpp')) + parseFloat(gV('#det_pznpppp')));
		sV('#det_cpozpp', tmpD);


		// todo
		sV('#det_rppjz',  (parseFloat(tmpA2) - parseFloat(tmpB2)));
		sV('#det_rppvz',  (gV('#det_rppjz') * gV('#det_rpppz')));
		sV('#det_rppvzr', (gV('#det_rppvz') * 12));

		sV('#det_rpppuz' , (parseFloat(tmpD) - parseFloat(tmpC)));
		sV('#det_rpppuzr',  (gV('#det_rpppuz') * 12));

		sV('#nab_hmz', gV('#prumerna_mzda'));
		sV('#nab_pzproc', gV('#prispevek_zamestnavatele_proc'));
		sV('#nab_pz', gV('#prispevek_zamestnavatele'));
		sV('#nab_poz', gV('#pocet_zamestnancu'));

		sV('#nab_hmz_hm',  tmp1);
		sV('#nab_hmz_hmp', gV('#det_phmzpp'));

		sV('#nab_pzh', gV('#nab_pz'));

		sV('#nab_sp_hm', gV('#det_spvmfir'));
		sV('#nab_sp_hmp', gV('#det_spppfir'));
		sV('#nab_sp_uonm',  (parseFloat(gV('#det_spvmfir')) - parseFloat(gV('#det_spppfir'))));
		sV('#nab_sp_uonk', (gV('#nab_sp_uonm') * 12));

		sV('#nab_zp_hm', gV('#det_zpvmfir'));
		sV('#nab_zp_hmp', gV('#det_zpppfir'));
		sV('#nab_zp_uonm', (parseFloat(gV('#det_zpvmfir')) - parseFloat(gV('#det_zpppfir'))));
		sV('#nab_zp_uonk', (gV('#nab_zp_uonm') * 12));

		sV('#nab_cdn_hm', (parseFloat(gV('#nab_hmz_hm')) + parseFloat(gV('#nab_sp_hm')) + parseFloat(gV('#nab_zp_hm'))));
		sV('#nab_cdn_hmp', (parseFloat(gV('#nab_hmz_hmp')) + parseFloat(gV('#nab_pzh')) + parseFloat(gV('#nab_sp_hmp')) + parseFloat(gV('#nab_zp_hmp'))));
		sV('#nab_cdn_uonm',  (parseFloat(gV('#nab_cdn_hm')) - parseFloat(gV('#nab_cdn_hmp'))));
		sV('#nab_cdn_uonk',  (gV('#nab_cdn_uonm') * 12));

		sV('#nab_xpzm', (gV('#nab_cdn_uonm') * gV('#nab_poz')));
		sV('#nab_xpzk', (gV('#nab_xpzm') * 12));

		sV('#nab_txt1', gV('#nab_xpzk'));
		
		sV('#nab2_hmz', gV('#prumerna_mzda'));
		sV('#nab2_pzproc', gV('#prispevek_zamestnavatele_proc'));
		sV('#nab2_pz', gV('#prispevek_zamestnavatele'));

		sV('#nab2_hmvs', gV('#det_phmzpp'));
		sV('#nab2_hmn', tmp1);
		sV('#nab2_vspp', gV('#det_phmzpp'));

		sV('#nab2_pzh', gV('#prispevek_zamestnavatele'));

		sV('#nab2_cpzhmvs', gV('#det_cmpp'));
		sV('#nab2_cpzhmn',gV('#det_cpozvm'));
		sV('#nab2_cpzvspp', gV('#det_cpozpp'));

		sV('#nab2_rmhmp', (parseFloat(gV('#nab2_cpzhmn')) - parseFloat(gV('#nab2_cpzhmvs'))));
		sV('#nab2_rmvspp', (parseFloat(gV('#nab2_cpzvspp')) - parseFloat(gV('#nab2_cpzhmvs'))));

		sV('#nab2_rkhmp', (gV('#nab2_rmhmp') * 12));
		sV('#nab2_rkvspp',  (gV('#nab2_rmvspp') * 12));

		sV('#nab2_vcco', (parseFloat(gV('#nab2_rkvspp')) - parseFloat(gV('#nab2_rkhmp'))));

		sV('#nab2_txt1', gV('#prispevek_zamestnavatele'));
		sV('#nab2_txt2', gV('#nab2_rmhmp'));
		sV('#nab2_txt3', gV('#prispevek_zamestnavatele'));
		sV('#nab2_txt4', gV('#nab2_vcco'));
		sV('#nab2_txt5', gV('#nab2_vcco'));

		document.form_detail.det_phmzpp.value = zformatuj(Math.round(document.form_detail.det_phmzpp.value));
		document.form_detail.det_pznpp_kc.value = zformatuj(Math.round(document.form_detail.det_pznpp_kc.value));
		document.form_detail.det_zpz.value = zformatuj(Math.round(document.form_detail.det_zpz.value));
		document.form_detail.det_phmz.value = zformatuj(Math.round(document.form_detail.det_phmz.value));
		document.form_detail.det_vhm.value = zformatuj(Math.round(document.form_detail.det_vhm.value));
		document.form_detail.det_pznpp_proc.value = zformatuj(Math.round(document.form_detail.det_pznpp_proc.value));
		document.form_detail.det_spvmzam.value = zformatuj(Math.floor(document.form_detail.det_spvmzam.value));
		document.form_detail.det_spvmfir.value = zformatuj(Math.round(document.form_detail.det_spvmfir.value));
		document.form_detail.det_zpvmzam.value = zformatuj(Math.floor(document.form_detail.det_zpvmzam.value));
		document.form_detail.det_zpvmfir.value = zformatuj(Math.round(document.form_detail.det_zpvmfir.value));
		document.form_detail.det_cnfvm.value = zformatuj(Math.round(document.form_detail.det_cnfvm.value));
		document.form_detail.det_spppzam.value = zformatuj(Math.round(document.form_detail.det_spppzam.value));
		document.form_detail.det_spppfir.value = zformatuj(Math.round(document.form_detail.det_spppfir.value));
		document.form_detail.det_zpppzam.value = zformatuj(Math.round(document.form_detail.det_zpppzam.value));
		document.form_detail.det_zpppfir.value = zformatuj(Math.round(document.form_detail.det_zpppfir.value));
		document.form_detail.det_cnfpp.value = zformatuj(Math.round(document.form_detail.det_cnfpp.value));
		document.form_detail.det_szdvm.value = zformatuj(Math.round(document.form_detail.det_szdvm.value));
		document.form_detail.det_szdpp.value = zformatuj(Math.round(document.form_detail.det_szdpp.value));
		//document.form_detail.det_pvydzpvm.value = zformatuj(Math.round(document.form_detail.det_pvydzpvm.value));
		//document.form_detail.det_pvydzppp.value = zformatuj(Math.round(document.form_detail.det_pvydzppp.value));
		//document.form_detail.det_zndzpvm.value = zformatuj(Math.round(document.form_detail.det_zndzpvm.value));
		//document.form_detail.det_zndzppp.value = zformatuj(Math.round(document.form_detail.det_zndzppp.value));

		document.form_detail.det_dpsA.value = zformatuj(Math.round(document.form_detail.det_dpsA.value));
		document.form_detail.det_dpsB.value = zformatuj(Math.round(document.form_detail.det_dpsB.value));

		document.form_detail.det_cmvm.value = zformatuj(Math.round(document.form_detail.det_cmvm.value));
		document.form_detail.det_cmpp.value = zformatuj(Math.round(document.form_detail.det_cmpp.value));
		document.form_detail.det_pznpppp.value = zformatuj(Math.round(document.form_detail.det_pznpppp.value));
		document.form_detail.det_cpozvm.value = zformatuj(Math.round(document.form_detail.det_cpozvm.value));
		document.form_detail.det_cpozpp.value = zformatuj(Math.round(document.form_detail.det_cpozpp.value));
		document.form_detail.det_rpppz.value = zformatuj(Math.round(document.form_detail.det_rpppz.value));
		document.form_detail.det_rppjz.value = zformatuj(Math.round(document.form_detail.det_rppjz.value));
		document.form_detail.det_rppvz.value = zformatuj(Math.round(document.form_detail.det_rppvz.value));
		document.form_detail.det_rppvzr.value = zformatuj(Math.round(document.form_detail.det_rppvzr.value));
		document.form_detail.det_rpppuz.value = zformatuj(Math.round(document.form_detail.det_rpppuz.value));
		document.form_detail.det_rpppuzr.value = zformatuj(Math.round(document.form_detail.det_rpppuzr.value));
		
		document.form_detail.det_cnzpp.value = zformatuj(Math.round(document.form_detail.det_cnzpp.value));
		document.form_detail.det_cnfvm_round.value = zformatuj(Math.round(document.form_detail.det_cnfvm_round.value));
		document.form_detail.det_cnzvm.value = zformatuj(Math.round(document.form_detail.det_cnzvm.value));
		document.form_detail.det_cnfpp_round.value = zformatuj(Math.round(document.form_detail.det_cnfpp_round.value));
		
		document.form_nabidka.nab_hmz.value = zformatuj(Math.round(document.form_nabidka.nab_hmz.value));
		document.form_nabidka.nab_pzproc.value = zformatuj(Math.round(document.form_nabidka.nab_pzproc.value));
		document.form_nabidka.nab_pz.value = zformatuj(Math.round(document.form_nabidka.nab_pz.value));
		document.form_nabidka.nab_poz.value = zformatuj(Math.round(document.form_nabidka.nab_poz.value));
		document.form_nabidka.nab_hmz_hm.value = zformatuj(Math.round(document.form_nabidka.nab_hmz_hm.value));
		document.form_nabidka.nab_hmz_hmp.value = zformatuj(Math.round(document.form_nabidka.nab_hmz_hmp.value));
		document.form_nabidka.nab_pzh.value = zformatuj(Math.round(document.form_nabidka.nab_pzh.value));
		document.form_nabidka.nab_sp_hm.value = zformatuj(Math.round(document.form_nabidka.nab_sp_hm.value));
		document.form_nabidka.nab_sp_hmp.value = zformatuj(Math.round(document.form_nabidka.nab_sp_hmp.value));
		document.form_nabidka.nab_sp_uonm.value = zformatuj(Math.round(document.form_nabidka.nab_sp_uonm.value));
		document.form_nabidka.nab_sp_uonk.value = zformatuj(Math.round(document.form_nabidka.nab_sp_uonk.value));
		document.form_nabidka.nab_zp_hm.value = zformatuj(Math.round(document.form_nabidka.nab_zp_hm.value));
		document.form_nabidka.nab_zp_hmp.value = zformatuj(Math.round(document.form_nabidka.nab_zp_hmp.value));
		document.form_nabidka.nab_zp_uonm.value = zformatuj(Math.round(document.form_nabidka.nab_zp_uonm.value));
		document.form_nabidka.nab_zp_uonk.value = zformatuj(Math.round(document.form_nabidka.nab_zp_uonk.value));
		document.form_nabidka.nab_cdn_hm.value = zformatuj(Math.round(document.form_nabidka.nab_cdn_hm.value));
		document.form_nabidka.nab_cdn_hmp.value = zformatuj(Math.round(document.form_nabidka.nab_cdn_hmp.value));
		document.form_nabidka.nab_cdn_uonm.value = zformatuj(Math.round(document.form_nabidka.nab_cdn_uonm.value));
		document.form_nabidka.nab_cdn_uonk.value = zformatuj(Math.round(document.form_nabidka.nab_cdn_uonk.value));
		document.form_nabidka.nab_xpzm.value = zformatuj(Math.round(document.form_nabidka.nab_xpzm.value));
		document.form_nabidka.nab_xpzk.value = zformatuj(Math.round(document.form_nabidka.nab_xpzk.value));
		
		document.form_nabidka.nab_txt1.value = Math.round(document.form_nabidka.nab_txt1.value);
		document.getElementById("nab_txt1_span").innerHTML = zformatuj(document.form_nabidka.nab_txt1.value);
		
		document.form_nabidka.nab2_hmz.value = zformatuj(Math.round(document.form_nabidka.nab2_hmz.value));
		document.form_nabidka.nab2_pzproc.value = zformatuj(Math.round(document.form_nabidka.nab2_pzproc.value));
		document.form_nabidka.nab2_pz.value = zformatuj(Math.round(document.form_nabidka.nab2_pz.value));
		document.form_nabidka.nab2_hmvs.value = zformatuj(Math.round(document.form_nabidka.nab2_hmvs.value));
		document.form_nabidka.nab2_hmn.value = zformatuj(Math.round(document.form_nabidka.nab2_hmn.value));
		document.form_nabidka.nab2_vspp.value = zformatuj(Math.round(document.form_nabidka.nab2_vspp.value));
		document.form_nabidka.nab2_pzh.value = zformatuj(Math.round(document.form_nabidka.nab2_pzh.value));
		document.form_nabidka.nab2_cpzhmvs.value = zformatuj(Math.round(document.form_nabidka.nab2_cpzhmvs.value));
		document.form_nabidka.nab2_cpzhmn.value = zformatuj(Math.round(document.form_nabidka.nab2_cpzhmn.value));
		document.form_nabidka.nab2_cpzvspp.value = zformatuj(Math.round(document.form_nabidka.nab2_cpzvspp.value));
		document.form_nabidka.nab2_rmhmp.value = zformatuj(Math.round(document.form_nabidka.nab2_rmhmp.value));
		document.form_nabidka.nab2_rmvspp.value = zformatuj(Math.round(document.form_nabidka.nab2_rmvspp.value));
		document.form_nabidka.nab2_rkhmp.value = zformatuj(Math.round(document.form_nabidka.nab2_rkhmp.value));
		document.form_nabidka.nab2_rkvspp.value = zformatuj(Math.round(document.form_nabidka.nab2_rkvspp.value));
		document.form_nabidka.nab2_vcco.value = zformatuj(Math.round(document.form_nabidka.nab2_vcco.value));
		document.form_nabidka.nab2_txt1.value = zformatuj(Math.round(document.form_nabidka.nab2_txt1.value));
		
		
		document.getElementById("nab2_txt1_span").innerHTML = zformatuj(document.form_nabidka.nab2_txt1.value);
		document.form_nabidka.nab2_txt2.value = Math.round(document.form_nabidka.nab2_txt2.value);
		document.getElementById("nab2_txt2_span").innerHTML = zformatuj(document.form_nabidka.nab2_txt2.value);
		document.form_nabidka.nab2_txt3.value = Math.round(document.form_nabidka.nab2_txt3.value);
		document.getElementById("nab2_txt3_span").innerHTML = zformatuj(document.form_nabidka.nab2_txt3.value);
		document.form_nabidka.nab2_txt4.value = Math.round(document.form_nabidka.nab2_txt4.value);
		document.getElementById("nab2_txt4_span").innerHTML = zformatuj(document.form_nabidka.nab2_txt4.value);
		document.form_nabidka.nab2_txt5.value = Math.round(document.form_nabidka.nab2_txt5.value);
		document.getElementById("nab2_txt5_span").innerHTML = zformatuj(document.form_nabidka.nab2_txt5.value);

		if (typeof pageTracker == 'undefined') {} else {pageTracker._trackPageview("/cs/informace/spocitejte-si/danove-uspory-zamestnavatele.html/spocitat/zamestnavatel/");}
		
		generated = true;
	}
