function getID(id,doc) { if (!doc) doc = document; if (document.all) return doc.all[id]; else return doc.getElementById(id); } function stopBubble(e) { if (e.stopPropagation) e.stopPropagation(); else e.cancelBubble = true; } function stopDefault(e) { if (e.preventDefault) e.preventDefault(); else e.returnValue = false; } /* opens window and cancels the event if successfull */ function openAWin(path,width,height,ev,namewin) { if (!ev) ev = window.event; if (!ev) { alert("No event in openAWin"); return false; } if (!openWin(path,width,height,namewin)) return null; stopDefault(ev); stopBubble(ev); return false; } /* opens full window and cancels the event if successfull*/ function openAWinF(path,width,height,ev,namewin) { if (!ev) ev = window.event; if (!ev) { alert("No event in openAWin"); return false; } if (!openWinF(path,width,height,namewin)) return null; stopDefault(ev); stopBubble(ev); return false; } function openWin(path,width,height,namewin) { if(window.anewWin) window.anewWin.close(); if(!namewin) namewin = 'nove_okno'; anewWin = window.open(path,namewin,"width="+width+",height="+height+",toolbar=0,directories=0,menubar=0,status=0,scrollbars=yes,resizable=yes"); return anewWin; } function openWinF(path,width,height,namewin) { if(window.anewWin) window.anewWin.close(); if(!namewin) namewin = 'nove_okno'; anewWin = window.open(path,namewin,'menubar=yes,toolbar=yes,location=yes,directories=yes,fullscreen=no,titlebar=yes,hotkeys=yes,status=yes,scrollbars=yes,resizable=yes'); return anewWin; } function targetBlank (url,ev) { if (!ev) ev = window.event; if (!ev) { alert("No event in targetBlank"); return false; } if (!window.open(url,'_blank','menubar=yes,toolbar=yes,location=yes,directories=yes,fullscreen=no,titlebar=yes,hotkeys=yes,status=yes,scrollbars=yes,resizable=yes')) return null; stopDefault(ev); stopBubble(ev); return false; } function hidde_objects(objects) { var h; var j = 0; this.hidde = new Array(); if (objects) for (var i =0; i 3) { var mod = number.length%3; var output = (mod > 0 ? (number.substring(0,mod)) : ''); for (i=0 ; i < Math.floor(number.length/3) ; i++) { if ((mod ==0) && (i ==0)) output+= number.substring(mod+3*i,mod+3*i+3); else output+= ' ' + number.substring(mod+3*i,mod+3*i+3); } return (output); } else return number; } function confirm_group_term () { idhg = getID("hromad_id_G"); if(!idhg.value) { alert('Vyberte cenovou skupinu!'); return false; } return confirm('Opravdu přiřadit cenovou skupinu ke všem termínům?') } function checkcaptchafill() { var c_id = getID("c"); var ct_id = getID("ct"); var alert_id = getID("captcha_alert"); // alert (MD5(ct_id.value)); if(!trim(ct_id.value)) { alert(alert_id.value); ct_id.focus(); return false; } if(MD5(trim(ct_id.value)) != c_id.value) { alert(alert_id.value); ct_id.focus(); return false; } return true; } function trim(s) { return rtrim(ltrim(s)); } function ltrim(s) { var l=0; while(l < s.length && s[l] == ' ') { l++; } return s.substring(l, s.length); } function rtrim(s) { var r=s.length -1; while(r > 0 && s[r] == ' ') { r-=1; } return s.substring(0, r+1); }