var IPOPUP_DEFAULT_TITLE = 'Notification'; function iPopup_show(html, title) { iPopup_center(); jQuery("#iPopup_content").html(html); if (title != undefined) jQuery("#iPopup_title").html(title); jQuery("#iPopup").show(); } function iPopup_close() { jQuery("#iPopup").hide(); } function iPopup_center() { var windowSize = getWindowSize(); var pageScroll = getPageScroll(); var clientSize = {width: jQuery('#iPopup').width(), height: jQuery('#iPopup').height()}; jQuery('#iPopup').css({ left: (windowSize.width - clientSize.width) / 2 + pageScroll.left, top: (windowSize.height - clientSize.height) / 2 + pageScroll.top }); } // adapted from getPageScroll() by quirksmode.com function getPageScroll() { var xScroll, yScroll; if (self.pageYOffset) { yScroll = self.pageYOffset; xScroll = self.pageXOffset; } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict yScroll = document.documentElement.scrollTop; xScroll = document.documentElement.scrollLeft; } else if (document.body) {// all other Explorers yScroll = document.body.scrollTop; xScroll = document.body.scrollLeft; } return {left: xScroll, top: yScroll}; } // adapted from getPageSize() by quirksmode.com function getWindowSize() { var windowWidth, windowHeight; if (self.innerHeight) { // all except Explorer windowHeight = self.innerHeight; windowWidth = self.innerWidth; } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode windowHeight = document.documentElement.clientHeight; windowWidth = document.documentElement.clientWidth; } else if (document.body) { // other Explorers windowHeight = document.body.clientHeight; windowWidth = document.body.clientWidth; } return {width: windowWidth, height: windowHeight}; }