window.onerror=null; /** * neues fenster mit def. groesse, ohne statusbar oder navigation etc. **/ function openPopup(uri,sizex,sizey) { var ratio = 30; sizex = sizex*1+ratio; sizey = sizey*1+ratio; var path = uri+"&sizex="+sizex+"&sizey="+sizey; name = window.open(path,'new_win',"width=" + sizex + ",height=" + sizey + ",screenX=screen.width / 2 - sizex / 2,screenY=screen.height / 2 - sizey / 2,resizable=no,scrollbars"); } /** * farbaenderung von tabellenzeilen * strings: textfarbe, hintergrundfarbe, cursor-style **/ function hoverTD(obj, color, colorBg, cursor) { if (!(document.layers && !document.getElementById)) { if (colorBg != '') obj.style.backgroundColor = colorBg; if (cursor != '') obj.style.cursor = cursor; if (obj.children) obj.children[0].style.color = color; } } /** * Sichtbarkeit ändern **/ function setDisplayByElementId(id, vis_arg) { if(document.layers) document.layers[id].display = vis_arg; else if(document.all) document.all[id].style.display = vis_arg; else if(document.getElementById) document.getElementById(id).style.display = vis_arg; } /** * Bestaetigung bei Loeschvorgang * strings: textfarbe, hintergrundfarbe, cursor-style **/ function confirmDelete(url,text) { boole = confirm(text); if(boole) self.location.href = url; } /** * Aendert die `action` eines Formulares * * @param form_name Formular-Bezeichner * @param new_action Neue `action` */ function changeAction(form_name,new_action) { document.forms[form_name].action = new_action; } /** * Selektiert oder deselektiert alle Checkboxen eines Formulares * * @param string the form name * @param boolean whether to check or to uncheck the element * * @return boolean always true */ function setCheckboxes(the_form, the_checkboxes) { do_check = document.forms[the_form].elements['toggle'].checked; var boxes = document.forms[the_form].elements[the_checkboxes]; var boxes_cnt = (typeof(boxes.length) != 'undefined') ? boxes.length : 0; if (boxes_cnt) { for (var i = 0; i < boxes_cnt; i++) boxes[i].checked = do_check; } else boxes.checked = do_check; return true; } /** * ueberpruefung, ob fuer `formular` das objekt `objekt` (radiobutton oder * checkbox) angehakt/ausgewaehlt ist * * @param form_element Checkbox oder Radio-Button * @return boolean (true|false) **/ function checkFM(form_element, msg_) { if(form_element.checked) return true; else { alert(msg_); return false; } }