function cacheImages(il, p) { if (p == null) p = ''; var i = new Array(); for (var n = 0; n < il.length; n++) { i[n] = new Image(); i[n].src = p + il[n]; } }
function toggle_visibility(id) { var e = element(id); if (e.style.display == 'block') { e.style.display = 'none'; } else { e.style.display = 'block'; } }
function element(id) { e = document.getElementById(id); return e; }
function pass(f) { eval(f); }
function changeClass(id, c) { if ((element(id) != null) && (element(id) != undefined)) { element(id).className = c; } }
function ShowNew(uri) { var newWindow = null; var options = { url: uri, name: 'new', scrollbars: 'yes', resizable: 'yes', directories: 'yes', status: 'yes', locatation: 'yes', toolbar: 'yes' }; newWindow = popup(options); }
function ShowModal(uri, n, w, h) { var modalWindow = null; if (window.showModalDialog) { modalWindow = window.showModalDialog(uri, n, 'dialogWidth:' + w + 'px;dialogHeight:' + h + 'px;edge:raised;help:no;scroll=no;status:no;resizable:no;center:yes;'); } else { var options = { url: uri, name: n, width: w, height: h, modal: 'yes' }; modalWindow = popup(options); } }
function ShowPopup(uri, n, w, h) { var popupWindow = null; var options = { url: uri, name: n, width: w, height: h }; popupWindow = popup(options); }
function ShowHelp(uri) { var helpWindow = null; var options = { url: uri, name: 'Help', width: 500, height: 600, xpos: 'right', ypos: 'bottom', scrollbars: 'yes' }; helpWindow = popup(options); helpWindow.focus(); return false; }
var popup = function(o) { var cLp = -20; var cTp = -76; var dU = 'http://www.endon.nl/'; var dN = 'Popup window'; var dD = 'no'; var dSll = 'no'; var dR = 'no'; var dS = 'no'; var dL = 'no'; var dT = 'no'; var dM = 'no'; o.url = (typeof o.url == 'undefined') ? dU : o.url; o.width = (typeof o.width == 'undefined') ? screen.width / 2 : o.width; o.height = (typeof o.height == 'undefined') ? screen.height / 2 : o.height; if ((o.width <= 1) && (o.width > 0)) { o.width *= screen.width } if ((o.height <= 1) && (o.height > 0)) { o.height *= screen.height } o.xpos = (typeof o.xpos == 'undefined') ? (screen.width / 2) - (o.width / 2) : o.xpos; o.ypos = (typeof o.ypos == 'undefined') ? (screen.height / 2) - (o.height / 2) : o.ypos; o.xoffset = (typeof o.xoffset == 'undefined') ? 0 : o.xoffset; o.yoffset = (typeof o.yoffset == 'undefined') ? 0 : o.yoffset; o.name = (typeof o.name == 'undefined') ? dN : o.name; o.directories = (typeof o.name == 'undefined') ? dD : o.directories; o.scrollbars = (typeof o.scrollbars == 'undefined') ? dSll : o.scrollbars; o.resizable = (typeof o.resizable == 'undefined') ? dR : o.resizable; o.status = (typeof o.status == 'undefined') ? dS : o.status; o.location = (typeof o.location == 'undefined') ? dL : o.location; o.toolbar = (typeof o.toolbar == 'undefined') ? dT : o.toolbar; o.modal = (typeof o.modal == 'undefined') ? dM : o.modal; if (o.xpos == "left") { o.xpos = 0; } if (o.xpos == "right") { o.xpos = (screen.availWidth - o.width) + cLp; } if (o.ypos == "top") { o.ypos = 0; } if (o.ypos == "bottom") { o.ypos = (screen.availHeight - o.height) + cTp; } o.xpos += o.xoffset; o.ypos += o.yoffset; var sll = 'scrollbars = ' + o.scrollbars + ","; var r = 'resizable = ' + o.resizable + ","; var s = 'status = ' + o.status + ","; var d = 'directories = ' + o.status + ","; var l = 'location = ' + o.locat + ","; var t = 'toolbar = ' + o.toolbar + ","; var m = 'modal = ' + o.modal + ","; var f = sll + r + s + l + t + d + m + 'width = ' + o.width + ',height = ' + o.height + ',top = ' + o.ypos + ',left = ' + o.xpos; return window.open(o.url, o.name, f); }
function getScreenHeightWidth(w) { var mw = 0, mh = 0; if (typeof (window.innerWidth) == 'number') { mw = window.innerWidth; mh = window.innerHeight; } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { mw = document.documentElement.clientWidth; mh = document.documentElement.clientHeight; } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) { mw = document.body.clientWidth; mh = document.body.clientHeight; } if (w) { return mw; } else { return mh; } }
function addOnloadEvent(f){ var o = window.onload; if (typeof window.onload != 'function'){ window.onload = f;} else { window.onload = function() { if (o) { o(); } f(); }}}

