req_popop_mask = new Image(); req_popop_mask.src = "/images/popoverMask.png";
function popover(src, width, height, isFormSubmission) {
var objBody = document.getElementsByTagName("body").item(0);
var src = src; var width = (width != undefined) ? width * 1 : 450 ; var height = (height != undefined) ? height * 1 : 250 ; var isFormSubmission = (isFormSubmission != undefined && isFormSubmission) ? true : false ;
if (navigator.userAgent.indexOf( 'MSIE' ) != -1) { var yPos = getScroll(); prepareIE('100%', 'hidden'); setScroll(0,0);
if (navigator.userAgent.indexOf( 'MSIE 7' ) == -1) { selects = document.getElementsByTagName("select"); for (i = 0; i != selects.length; i++) { if (selects[i].id.search(/(^|,)($|,)/) == -1) selects[i].style.visibility = "hidden"; } } }
if (document.getElementById('popoverMask')) { document.getElementById('popoverMask').style.display = 'block'; } else { var objMask = document.createElement("div"); objMask.setAttribute('id','popoverMask'); objMask.style.display = 'block'; objBody.insertBefore(objMask, objBody.firstChild); }
if (document.getElementById('popover')) { var objPopover = document.getElementById('popover'); objPopover.style.height = (height + 'px'); objPopover.style.width = (width + 'px'); objPopover.style.display = 'block'; objPopover.style.margin = '-' + (height / 2 + 5) + 'px 0 0 ' + '-' + (width / 2) + 'px'; } else { var objPopover = document.createElement("iframe"); objPopover.setAttribute('name','popover'); objPopover.setAttribute('id','popover'); objPopover.setAttribute('src','/blank.html'); objPopover.setAttribute('frameBorder','0'); objPopover.style.display = 'block'; objPopover.style.width = (width + 'px'); objPopover.style.height = (height + 'px'); objPopover.style.margin = '-' + (height / 2 + 5) + 'px 0 0 ' + '-' + (width / 2) + 'px'; objBody.insertBefore(objPopover, objBody.firstChild); }
if (isFormSubmission) {
eval("document." + src + ".target = 'popover'"); eval("document." + src + ".submit()"); } else {
objPopover.src = src; } }
function closePopover() {
document.getElementById('popoverMask').style.display = 'none'; document.getElementById('popover').style.display = 'none';
if (navigator.userAgent.indexOf( 'MSIE' ) != -1) { prepareIE("auto", "auto");
if (navigator.userAgent.indexOf( 'MSIE 7' ) == -1) { selects = document.getElementsByTagName("select"); for (i = 0; i != selects.length; i++) { if (selects[i].id.search(/(^|,)($|,)/) == -1) selects[i].style.visibility = "visible"; } } //setScroll(0,yPos); }
document.getElementById('popover').src = ''; }
function prepareIE(height, overflow) { bod = document.getElementsByTagName('body')[0]; bod.style.height = height; bod.style.overflow = overflow;
htm = document.getElementsByTagName('html')[0]; htm.style.height = height; htm.style.overflow = overflow; }
function getScroll() { 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; } return yScroll; }
function setScroll(x, y) { window.scrollTo(x, y); }
/*Resize me*/ function resizeMe(w,h) { var ifr = document.getElementById("popover"); ifr.style.width = w+"px"; ifr.style.height = h+"px"; ifr.style.margin = '-' + (h / 2 + 5) + 'px 0 0 ' + '-' + (w / 2) + 'px'; }