function new_data(form, pole, fce){ // treti parametr je pripadna fce ktera spousti disablovani (false/string fce) if (eval("form."+ pole +".options[form."+ pole +".selectedIndex].value") == -1) { if (fce == false) { eval("form."+ pole +"_new.disabled = false;"); eval("form."+ pole +"_new.focus();"); } else { eval(fce +"(form, false);"); } } else { if (fce == false) { eval("form."+ pole +"_new.value = '';"); eval("form."+ pole +"_new.disabled = true;"); } else { eval(fce +"(form, true);"); } } } function kontrola_num(form, vstup){ eval("var bunka = form."+ vstup +".value;"); eval("var prevod = parseFloat(form."+ vstup +".value);"); if (bunka != "" && bunka != prevod){ window.alert("pouze čísla !!!"); eval("form."+ vstup +".select();"); return false; } } function kontrola_cislo(form, vstup){ eval("var bunka = form."+ vstup +".value;"); eval("var prevod = parseFloat(form."+ vstup +".value);"); if (bunka != "" && bunka != prevod){ window.alert("pouze čísla, nebo s desetinou tečkou"); eval("form."+ vstup +".select();"); return false; } } function jump_field(hodnota, podminka, pole) { if (hodnota.length >= podminka){ document.getElementById(pole).focus(); document.getElementById(pole).select(); } } function date_doplication_plus(date_in, date_out, days) { dat_in = new Date(parseFloat(document.getElementById(date_in +'_rok').value), parseFloat(document.getElementById(date_in +'_mes').value), parseFloat(document.getElementById(date_in +'_den').value)); ms_in = dat_in.getTime(); ms_out = ms_in + (days * 24 * 60 * 60 * 1000); dat_out = new Date(ms_out); document.getElementById(date_out +'_rok').value = add_zero(dat_out.getYear()); document.getElementById(date_out +'_mes').value = add_zero(dat_out.getMonth()); document.getElementById(date_out +'_den').value = add_zero(dat_out.getDate()); } function add_zero(num) { var str = ""+ num; if (str.length == 1) {str = "0"+ str} return str; } function select_doplication(select_in, select_out) { index = document.getElementById(select_in).selectedIndex; document.getElementById(select_out).selectedIndex = index; }