<!--
/* Long and Ugle (but necessary) cross platform javascript
 * Looks at the height of the 'main' DIV, and then sets the
 * top for the 'breadCrumb' and 'footer' DIVs so they sit
 * right below 'main';   DGM
 */

var isNS4 = (document.layers) ? 1 : 0;
var isIE4 = (document.all) ? 1 : 0;
var isW3C = (document.getElementById && !document.all) ? 1 : 0;

function getCalculatedProperty(objName, property) {
var cssp;
    // ***** W3C Compatible DOM (NN6, Mozilla 16, etc.) *****
    if (isW3C) {
        var docObj = document.getElementById(objName);
	
        if (property == "visibility") {
	    cssp = docObj.style.visibility;
	    return (cssp == "") ? "inherit" : cssp;
	}
	if (property == "clip") {
	    cssp = docObj.style.clip;
	    if (cssp == "") {
		cssStr = "rect(0px "; 
		cssStr += getCalculatedProperty(objName, "width") + " ";
		cssStr += getCalculatedProperty(objName, "height") + " ";
		cssStr += "0px)";
		return cssStr;
	    }
	    return cssp;
	}
	if (property == "zIndex") {
	    cssp = docObj.style.zIndex;
	    return (cssp == "") ? "inherit" : cssp;
	}
	cssp = document.defaultView.getComputedStyle(docObj, "").getPropertyValue(property);
	return (cssp == "") ? "unknown" : cssp;
    }


    // ***** Netscape Navigator 4+ DOM *****
    if (isNS4) {
	docObj = document.layers[objName];
	if (property == "visibility") {
	    cssp = docObj.visibility;
	    return (cssp == "hide") ? "hidden" : (cssp == "show") ? "visible" : "inherit";
        }
        if (property == "clip") {
            cssStr = "rect(" + docObj.clip.top + "px ";
            cssStr += docObj.clip.right + "px ";
            cssStr += docObj.clip.bottom + "px ";
            cssStr += docObj.clip.left + "px)";
            return cssStr;
        }
        if ((property == "width") || (property == "height")) {
            return eval("docObj.clip." + property) + "px";
        }
        if (property == "top") property = "pageY";
        if (property == "left") property = "pageX";
        cssp = eval("docObj." + property);
        if (property != "zIndex") cssp += "px";
        return cssp;
    }

    // ***** Internet Explorer 4+ DOM *****
    if (isIE4) {
        if (property == "width") return eval(objName + ".offsetWidth") + "px";
        if (property == "height") return eval(objName + ".offsetHeight") + "px";
        if (property == "clip") {
            cssp = eval(objName + ".style.clip");
            if (cssp == "") {
                cssStr = "rect(0px ";
                cssStr += getCalculatedProperty(objName, "width") + " ";
                cssStr += getCalculatedProperty(objName, "height") + " ";
                cssStr += "0px)";
                return cssStr;
            }
            return cssp;
        }
        if (property == "top") return eval(objName + ".offsetTop") + 'px';
        if (property == "left") return eval(objName + ".offsetLeft") + 'px';

        // Else, use 'currentStyle' to find the rest
        return eval(objName + ".currentStyle." + property);
    }
}

function setBottomDivLocations ()
{
        var objBreadcrumbLayer=document.getElementById('breadCrumbs');
        var objFooterLayer=document.getElementById('footer');

        var strMainLayerHeight=new String();
        var strMainLayerTop=new String();
        var intBlah=new Number;

        // Returns the values in the format 'XXXpx'
        strMainLayerHeight.value=getCalculatedProperty('main','height');
        strMainLayerTop.value=getCalculatedProperty('main','top');

        // Return the integer portion of the height and top values of main,
        // add them together, add 4, and then store it in intTotalOffset
        var intTotalOffset=parseInt(strMainLayerHeight.value) + parseInt(strMainLayerTop.value) + 4;
        objBreadcrumbLayer.style.top=intTotalOffset+'px';

        // Account for breadCrumb DIV height when setting top for footer
        intTotalOffset+=parseInt(getCalculatedProperty('breadCrumbs','height'));
        objFooterLayer.style.top=intTotalOffset+'px';
}
//-->
