//#### MODAL LAYER #### var Modal = new function() { this.show = function(content, width, height) { // Cut window and remove scrollbars var body = document.getElementsByTagName('body')[0]; body.style.height = "100%"; body.style.overflow = "hidden"; var html = document.getElementsByTagName('html')[0]; html.style.height = "100%"; html.style.overflow = "hidden"; // Create opacity overlay this.ol = el = document.createElement('DIV'); el.style.width = '110%'; el.style.height = '100%'; el.style.position = 'absolute'; //el.style.backgroundColor = 'gray'; el.style.filter = 'alpha(opacity=65)'; el.style.opacity = '0.65'; el.style.left = -document.body.style.marginLeft; el.style.top = -document.body.style.marginTop; el.style.zIndex = 10000; el.onclick = function() {Modal.close();}; el.id = 'Modal_overlay'; document.body.insertBefore(el, document.body.childNodes[0]); // Create window this.ow = el = document.createElement('DIV'); el.innerHTML = content; el.style.width = width + 'px'; el.style.height = height + 'px'; el.style.position = 'absolute'; el.style.left = parseInt((parseInt(document.body.clientWidth)-width)/2) + "px"; el.style.top = '100px'; el.style.zIndex = 10001; el.id = 'Modal_window'; document.body.insertBefore(el, document.body.childNodes[0]); this.handleSelects(false); document["onkeydown"] = Modal.keyPress; if (document.getElementById('Modal_focus')) document.getElementById('Modal_focus').focus(); body.style.margin = "0px 0px 0px 0px"; body.style.padding = "20px 10px 25px 10px"; } this.close = function() { if (this.ol) { document.body.removeChild(document.getElementById('Modal_overlay')); document.body.removeChild(document.getElementById('Modal_window')); this.ol = null; this.ow = null; document["onkeydown"] = null; // Cut window and remove scrollbars var body = document.getElementsByTagName('body')[0]; body.style.height = ''; body.style.overflow = ''; var html = document.getElementsByTagName('html')[0]; html.style.height = ''; html.style.overflow = ''; this.handleSelects(true); body.style.margin = "20px 10px 25px 10px"; body.style.padding = "0px 0px 0px 0px"; } } this.keyPress = function(e) { if (!e) e=event; var key = e.keyCode; switch(key) { case 9: return false; case 27: Modal.close(); return false; default: break; } return true; } this.handleSelects = function(show) { if (navigator.appVersion.match(/\bMSIE\b/)) { var selects = document.getElementsByTagName("select"); for(var i=0;iEn hurtig online analyse'; content += '
Vi håber, du vil hjælpe os med at besvare 4 – 5 hurtige spørgsmål om dit besøg på vores hjemmeside
'; content += '
Ja
Nej
'; content += '
'; window.onload = modalInit;