function getBody(w){
    return (w.document.compatMode && w.document.compatMode == "CSS1Compat") ? w.document.documentElement : w.document.body || null;
}

function showInlineIFrame(src, width, height, color){
    //delete existing mask
    var mask;
    if(mask = document.getElementById("bodyMask")){
        mask.parentNode.removeChild(mask);
    }
	
	var avail_height = window.innerHeight?window.innerHeight:getBody(window).clientHeight;
	
    //new masl
    var mask = document.createElement("div");
    mask.id = "bodyMask";
    mask.style.position = "absolute";
    mask.style.top = "0px";
    mask.style.left = "0px";
    mask.style.width = "100%";
    mask.style.height = avail_height + "px";
    mask.style.backgroundColor = color;
    mask.style.opacity = 0.8;
    mask.style.filter = "Alpha(Opacity=80)";
    mask.style.zIndex = 10000;
	mask.onclick = function(){
		removeInlineIFrame();	
	}
    document.body.appendChild(mask);
    
    var iframeParent = document.createElement("div");
    iframeParent.id = "iframeParent";
    iframeParent.style.position = "absolute";
    iframeParent.style.top = "50%";
    iframeParent.style.left = "50%";
    iframeParent.style.width = width + "px";
    iframeParent.style.height = height + "px";
    iframeParent.style.marginLeft = width/2*-1 + "px";
    iframeParent.style.marginTop = height/2*-1 + "px";
    //iframeParent.style.border = "5px solid #666666";
    iframeParent.style.backgroundColor = "#FFFFFF";
    iframeParent.style.zIndex = 10001;
    
    var iframe = document.createElement("iframe");
    iframe.id = "inlineIFrame";
    iframe.width = width;
    iframe.height = height;
    iframe.src = src;
    iframe.border = 0;
    iframe.frameBorder = 0;    
    
    iframeParent.appendChild(iframe);
    
    document.body.appendChild(iframeParent);
	
    
    
}

function removeInlineIFrame(reload){
    var mask, iframe;
    if(mask = document.getElementById("bodyMask")){
        mask.parentNode.removeChild(mask);
    }
    if(iframe = document.getElementById("iframeParent")){
        iframe.parentNode.removeChild(iframe);
    }
	document.body.onclick = null;
    if(reload){
        window.location.reload();
    }
}





