var TB_HEIGHT; var TB_WIDTH; function gray(){ $("body").append("
"); try{ $(window).scroll(TB_position); } catch(e) {} TB_overlaySize(); } function TB_position() { var pagesize = TB_getPageSize(); var arrayPageScroll = TB_getPageScrollTop(); $("#bildpopup").css({top: (arrayPageScroll[1] + 20) +"px" }); TB_overlaySize(); } function TB_overlaySize(){ if (window.innerHeight && window.scrollMaxY) { yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac yScroll = document.body.scrollHeight; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari yScroll = document.body.offsetHeight; } $("#overlay").css("height",yScroll +"px"); } function TB_getPageScrollTop(){ var yScrolltop; if (self.pageYOffset) { yScrolltop = self.pageYOffset; } else if (document.documentElement && document.documentElement.scrollTop){ // Explorer 6 Strict yScrolltop = document.documentElement.scrollTop; } else if (document.body) {// all other Explorers yScrolltop = document.body.scrollTop; } arrayPageScroll = new Array('',yScrolltop) return arrayPageScroll; } function TB_getPageSize(){ var de = document.documentElement; var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth; var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight; arrayPageSize = new Array(w,h) return arrayPageSize; } function rmGray(){ var obj = document.getElementById('overlay'); if (obj){ document.body.removeChild(obj); } } function popupRemove() { if (document.getElementById('bildpopup')){ document.body.removeChild(document.getElementById('bildpopup')); } rmGray(); } function bildpopup(bildname, bild, caller){ gray(); var divObj = document.getElementById('bildpopup'); if (divObj){ document.body.removeChild(divObj); } divObj = document.createElement("div"); divObj.id = 'bildpopup'; divObj.style.zIndex="100000"; var imgNode = document.createElement("img"); imgNode.src=bild; var divO = document.createElement("div"); // CLOSE var divClose = document.createElement("div"); divClose.style.backgroundColor="black"; divClose.style.font="0/0 sans-serif"; divClose.style.display="block"; divClose.style.textAlign="right"; divClose.style.padding="4px"; var closeNode = document.createElement("a"); closeNode.style.font="0/0 sans-serif"; closeNode.onclick=function() { document.body.removeChild(divObj); rmGray(); }; $("#overlay").click(popupRemove); closeNode.href="javascript:void(0);"; var closeImg = document.createElement("img"); closeImg.src="http://www.pilotinnen.at/data/pop_close.gif"; closeImg.alt="close"; closeImg.border="0"; closeNode.appendChild(closeImg); closeNode.onmouseover=function() { closeImg.src="http://www.pilotinnen.at/data/pop_close_over.gif"; } closeNode.onmouseout=function() { closeImg.src="http://www.pilotinnen.at/data/pop_close.gif"; } divClose.appendChild(closeNode); // CLOSE - var bildNameNode = document.createElement("div"); bildNameNode.style.fontWeight="bold"; bildNameNode.style.marginTop="10px"; bildNameNode.appendChild(document.createTextNode(bildname)); // divO.appendChild(imgNode); divO.appendChild(bildNameNode); divO.style.padding="10px"; divO.style.backgroundColor="black"; divO.style.borderBottom="2px solid black"; divO.style.borderLeft="2px solid black"; divO.style.borderRight="2px solid black"; divObj.appendChild(divClose); divObj.appendChild(divO); divObj.style.position="absolute"; divObj.style.top = 18; divObj.style.left = 18; TB_HEIGHT = divObj.style.height; TB_WIDTH = divObj.style.width; document.body.appendChild(divObj); TB_position(); }