function showModal(id) { showCombos(false); centerObj(id); showOverlay(); zorder0(id); setVisible(id,true); } function showCombos(cod) { if((navigator.appVersion.indexOf("MSIE")!=-1)) { var selects = document.getElementsByTagName("select"); for (i = 0; i != selects.length; i++) { if(cod==true) { selects[i].style.visibility = "visible"; }else{ selects[i].style.visibility = "hidden"; } } } } function centerObj(obj) { if(typeof(obj)=="string") var obj = document.getElementById(obj); if(!obj) alert("centerObj nicht gefunden: '"+id+"'"); var arrayPageSize = getPageSize(); var arrayPageScroll = getPageScroll(); var wi = parseInt(obj.style.width); var he = parseInt(obj.style.height); if(!wi) { var wi = parseInt(obj.offsetWidth); var he = parseInt(obj.offsetHeight); } var screenWi = arrayPageSize[0]; var screenHe = arrayPageSize[3]; var posX = parseInt((screenWi - 20 - wi) / 2); var posY = parseInt((screenHe - 20 - he) / 2)+ arrayPageScroll[1] ; obj.style.position = "absolute"; obj.style.top = posY+"px"; obj.style.left = posX+"px"; } function showOverlay() { var divOverlay = document.getElementById("overlay"); if(!divOverlay) createOverlayDiv(); var divOverlay = document.getElementById("overlay"); var arrayPageSize = getPageSize(); var arrayPageScroll = getPageScroll(); divOverlay.style.height = (arrayPageSize[1] + 'px'); divOverlay.style.display = 'block'; } function hideOverlay() { setVisible("overlay",false); } function closeModal(id,obj) { hideOverlay(); obj = obj.parentNode; while(obj.getAttribute("id2") !== id) { obj = obj.parentNode; } setVisible(obj,false); } function getPageSize() { // Returns array with page width, height and window width, height var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = document.body.scrollWidth; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; } var windowWidth, windowHeight; if (self.innerHeight) { // all except Explorer windowWidth = self.innerWidth; windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { // other Explorers windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } // for small pages with total height less then height of the viewport if(yScroll < windowHeight){ pageHeight = windowHeight; } else { pageHeight = yScroll; } // for small pages with total width less then width of the viewport if(xScroll < windowWidth){ pageWidth = windowWidth; } else { pageWidth = xScroll; } arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) return arrayPageSize; } function getPageScroll() { // Returns array with x,y page scroll values. var yScroll; if (self.pageYOffset) { yScroll = self.pageYOffset; } else if (document.documentElement && document.documentElement.scrollTop){ // Explorer 6 Strict yScroll = document.documentElement.scrollTop; } else if (document.body) {// all other Explorers yScroll = document.body.scrollTop; } arrayPageScroll = new Array('',yScroll) return arrayPageScroll; } function createOverlayDiv() { var objBody = document.getElementsByTagName("body").item(0); var objOverlay = document.createElement("div"); objOverlay.setAttribute('id','overlay'); objOverlay.style.display = 'none'; objOverlay.style.position = 'absolute'; objOverlay.style.top = '0'; objOverlay.style.left = '0'; objOverlay.style.zIndex = '990'; objOverlay.style.width = '100%'; objBody.insertBefore(objOverlay, objBody.firstChild); } function zorder0(obj,zIndex) { if(typeof(obj)=="string") var obj = document.getElementById(obj); if(!zIndex) zIndex = 99999; obj.style.zIndex = zIndex; var objBody = document.getElementsByTagName("body").item(0); objBody.insertBefore(obj, objBody.firstChild); //objBody.appendChild(obj); }