var myLayout = null;
var nWidth, nHeight;

/////////////////////////////////////////////////////////////////////
// Do some Layout Sizing before initialization...
function PageInit(sTitle) {
    // Resize our div elements
    doResize();

    myLayout = new dhtmlXLayoutObject("containerId", "2U", "dhx_black");
    if (sTitle == null || sTitle == "")
        myLayout.cells("a").hideHeader();
    else
        myLayout.cells("a").setText(sTitle);
    
    // Attach content object
    myLayout.cells("a").attachObject("contentId");
    
    // Attach featured object
    myLayout.cells("b").hideHeader();
    myLayout.cells("b").attachObject("featuredId");
    myLayout.cells("b").setWidth(255);

    // Pop-up Contact Us Info    
    displayContactUsPopUpDialog(nWidth-255-340-40, nHeight-335);
}

/////////////////////////////////////////////////////////////////////
// Do some Layout Sizing before initialization...
function doResize() {
    nWidth  = document.documentElement.clientWidth;
    nHeight = document.documentElement.clientHeight;
    if (nWidth == 0 && nHeight == 0) {
        nWidth  = document.body.clientWidth;
        nHeight = document.body.clientHeight+100;
    }
    
    //alert("Client Size = ("+nWidth+", "+nHeight+")");
    var containerDiv = document.getElementById('containerId');
    if (containerDiv != null) {
        // Height
        if (nHeight > 530) {
            containerDiv.style.height = (nHeight - 190) + 'px';    
        } else if (nHeight == 0 && nWidth == 0) {
            alert("Whoa");
            containerDiv.style.height = "80%";
        } else {          
            containerDiv.style.height = '530px'; // We won't accept anything smaller because it looks bad
        }
    }    
}


