﻿// JScript File

function findPos(obj) {
    var curleft = curtop = 0;
    if (obj.offsetParent) {
	    curleft = obj.offsetLeft
	    curtop = obj.offsetTop
	    while (obj = obj.offsetParent) {
		    curleft += obj.offsetLeft
		    curtop += obj.offsetTop
	    }
    }
    return [curleft,curtop];
}    

function resizeOverlay()
{
    var content = document.getElementById("Middle");
    var overlay = document.getElementById("overlay");
    
    if (content != null && overlay != null)
    {
        var _width = content.offsetWidth;
        var _height = content.offsetHeight;
        overlay.style.width = _width + "px";
        overlay.style.height = _height + "px";
        
        var tempXY = findPos(content);
        overlay.style.top = tempXY[1] + "px";
        overlay.style.left = tempXY[0] + 1 + "px";
    }
}
    
    
//window.onload = function(){resizeOverlay();};
