/* returns box coordinates for an element */ BoxCoords = function (x1,y1,x2,y2) { this.x1 = x1 || 0; this.y1 = y1 || 0; this.x2 = x2 || 0; this.y2 = y2 || 0; return this; } function getBoxCoords(elemId) { var elemObj = document.getElementById(elemId); var elemLeft = 0, elemTop = 0; var elemWidth = elemObj.offsetWidth; var elemHeight = elemObj.offsetHeight; if (elemObj.offsetParent) { while (elemObj.offsetParent) { elemLeft += elemObj.offsetLeft; elemTop += elemObj.offsetTop; elemObj = elemObj.offsetParent; } } else if (elemObj.y) { elemLeft += elemObj.x; elemTop += elemObj.y; } var coords = new BoxCoords(); coords.x1 = elemLeft; coords.y1 = elemTop; coords.x2 = coords.x1 + elemWidth; coords.y2 = coords.y1 + elemHeight; return coords; } /* end box coordinates */ function loadCoords() { //check and see if there are both the related links and feature photo boxes if(document.getElementById("related_links") && document.getElementById("feature_photo")) { //get the coordinates of both boxes var featurephotoCoords = getBoxCoords("feature_photo"); var relatedlinksCoords = getBoxCoords("related_links"); //if the top of the related links box is higher than the bottom of the feature photo box //increase the right margin of the related links box if(relatedlinksCoords["y1"] <= (featurephotoCoords["y2"] + 1)) { document.getElementById("related_links").style.marginRight = (document.getElementById("feature_photo").offsetWidth + 10) + "px"; //Resize related links box document.getElementById("related_links").style.pixelHeight = 0 + "px"; } } if (document.getElementById("related_links") && document.getElementById("columnad")) { //get the coordinates of both boxes var rightcolCoords = getBoxCoords("columnad"); var relatedlinksCoords = getBoxCoords("related_links"); //if the top of the related links box is higher than the bottom of the right column box //increase the right margin of the related links box if(relatedlinksCoords["y1"] <= (rightcolCoords["y2"] + 1)) { document.getElementById("related_links").style.marginRight = (document.getElementById("columnad").offsetWidth + 0) + "px"; //Resize related links box document.getElementById("related_links").style.pixelHeight = 0 + "px"; } } } // Add the functions into the window.onload event addOnLoad(loadCoords); var hasFlash = function(){ var nRequiredVersion = 6; if ((navigator.platform.toLowerCase().indexOf("win") == -1 && navigator.platform.toLowerCase().indexOf("mac") == -1) || navigator.userAgent.toLowerCase().indexOf('opera') > -1 || (navigator.userAgent.toLowerCase().indexOf('msie') > -1 && navigator.appVersion.toLowerCase().indexOf("mac") > -1)) { return false; } if(navigator.appVersion.indexOf("MSIE") != -1 && navigator.appVersion.indexOf("Windows") > -1){ document.write('