if (!window.console) { (function() { var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; window.console = {}; for (var i = 0; i < names.length; ++i) window.console[names[i]] = function(data) {} })(); } ilUtil = { ajaxReplace: function(url, el_id) { this.sendAjaxGetRequestToUrl (url, {}, {el_id: el_id, inner: false}, this.ajaxReplaceSuccess) }, ajaxReplaceInner: function(url, el_id) { this.sendAjaxGetRequestToUrl (url, {}, {el_id: el_id, inner: true}, this.ajaxReplaceSuccess) }, ajaxReplaceSuccess: function(o) { // perform page modification if(o.responseText !== undefined) { if (o.argument.inner) { $('#' + o.argument.el_id).html(o.responseText); } else { $('#' + o.argument.el_id).replaceWith(o.responseText); } } }, sendAjaxGetRequestToUrl: function(url, par, args, succ_cb) { var cb = { success: succ_cb, failure: this.handleAjaxFailure, argument: args }; for (k in par) { url = url + "&" + k + "=" + par[k]; } var request = YAHOO.util.Connect.asyncRequest('GET', url, cb); }, // FailureHandler handleAjaxFailure: function(o) { console.log("ilNotes.js: Ajax Failure."); } } ilObject = { url_redraw_ah: "", url_redraw_li: "", setRedrawAHUrl: function(url) { this.url_redraw_ah = url; }, getRedrawAHUrl: function() { return this.url_redraw_ah; }, redrawActionHeader: function() { var ah = document.getElementById("il_head_action"); if (this.url_redraw_ah && ah != null) { ilUtil.ajaxReplaceInner(this.url_redraw_ah, "il_head_action"); } }, setRedrawListItemUrl: function(url) { this.url_redraw_li = url; }, getRedrawListItemUrl: function() { return this.url_redraw_li; }, redrawListItem: function(ref_id) { var li = document.getElementById("lg_div_" + ref_id); if (this.url_redraw_li && li != null) { ilUtil.ajaxReplace(this.url_redraw_li + "&child_ref_id=" + ref_id, "lg_div_" + ref_id); } }, togglePreconditions: function(link, id, txt_show, txt_hide) { var li = document.getElementById("il_list_item_precondition_obl_" + id); if(li != null) { if(li.style.display == "none") { li.style.display = ""; $(link).html("» "+txt_hide); } else { li.style.display = "none"; $(link).html("» "+txt_show); } } li = document.getElementById("il_list_item_precondition_opt_" + id); if(li != null) { if(li.style.display == "none") { li.style.display = ""; $(link).html("» "+txt_hide); } else { li.style.display = "none"; $(link).html("» "+txt_show); } } } } /** * Adds a function to the window onload event */ function ilAddOnLoad(func) { if (!document.getElementById | !document.getElementsByTagName) return; var oldonload=window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { oldonload(); func(); } } } /** * Adds a function to the window unonload event */ function ilAddOnUnload(func) { if (!document.getElementById | !document.getElementsByTagName) return var oldonunload = window.onunload if (typeof window.onunload != 'function') { window.onunload = func } else { window.onunload = function() { oldonunload(); func() } } } // The following functions have been in /functions.js before. // @todo Revision of javascript function names and usage function popup_window(url, x1, x2, y1, y2) { var xpos; xpos = screen.availWidth / 100 * x1; ypos = screen.availHeight / 100 * y1; xwidth = (screen.availWidth / 100 * (x2 - x1)) - 5; yheight = (screen.availHeight / 100 * (y2 - y1)) - 30; window.open(url,"list","height=" + yheight + ",width=" + xwidth + ",left=" +xpos + ",ScreenX=" + xpos + ",ScreenY=" + ypos + ",top=" + ypos + ",resizable=yes,menubar=no,status=no,directories=no,toolbar=no,scrollbars=yes"); return false; } function CheckAll() { if(document.cmd.all) { var c = document.cmd.all.checked; } for (var i=0;i