var divHeight = 0; function getY( oElement ) { var iReturnValue = 0; while( oElement != null ) { iReturnValue += oElement.offsetTop; oElement = oElement.offsetParent; } return iReturnValue; } function getX( oElement ) { var iReturnValue = 0; while( oElement != null ) { iReturnValue += oElement.offsetLeft; oElement = oElement.offsetParent; } return iReturnValue; } function bigImg(topLeftIndex, topRightIndex, bottomLeftIndex, element) { divHeight = document.getElementById("galleryContainer").offsetHeight; var fn = element.src; fn = fn.substring(0,fn.length-7)+".jpg"; var topLeftImage = document.getElementById("galimg"+topLeftIndex); var topRightImage = document.getElementById("galimg"+topRightIndex); var bottomLeftImage = document.getElementById("galimg"+bottomLeftIndex); var top = getY(topLeftImage); var left = getX(topLeftImage)-1; var width = (getX(topRightImage)+topRightImage.width)-left; var height =(getY(bottomLeftImage)+topLeftImage.height)-top; var div = document.createElement('div'); div.setAttribute("id", "largeImgDiv"); div.innerHTML = "
close X 
 
"; document.getElementById("galleryContainer").appendChild(div); div.style.position = "relative"; div.style.top = -(height)+"px"; div.setAttribute("align", "center"); div.style.backgroundColor = "#ffffff"; div.style.width = width+'px'; div.style.minHeight = height+'px'; //document.write("Current Height: "+document.getElementById("galleryContainer").offsetHeight); //document.write("Insert Height: "+document.getElementById("largeImgDiv").offsetHeight); //document.write("Original Height: "+divHeight); document.getElementById("galleryContainer").style.height = divHeight+'px'; //document.getElementById("galleryContainer").style.height = document.getElementById("largeImgDiv").offsetHeight+'px'; } function closeBigImg() { var divInSitu = document.getElementById("largeImgDiv"); document.getElementById("galleryContainer").removeChild(divInSitu); document.getElementById("galleryContainer").style.height = divHeight+'px'; }