function adjustContentHeight()
{
    var LayoutColumn1 = document.getElementById("LayoutColumn1");
    var LayoutColumn3 = document.getElementById("LayoutColumn3");
    var MainContentContainer = document.getElementById("MainContentContainer");
    
    var heightLeft = 0;
    var heightRight = 0;
    
    if (LayoutColumn1)
    {
        heightLeft = getHeight(LayoutColumn1);
    }
    if (LayoutColumn3)
    {
        heightRight = getHeight(LayoutColumn3);
    }
    
    if (heightRight > heightLeft)
        heightLeft = heightRight;
        
    if (MainContentContainer)
    {
        MainContentContainer.style.minHeight = heightLeft + "px";
    }
    
}
function getXY(el)
{
    
    if (el.offsetParent == null) {
       return false;
    }
    
    var parentNode = null;
    var pos = [];
    var box;
    
    if (el.getBoundingClientRect) { // IE
       box = el.getBoundingClientRect();
       var doc = document;
       /*if ( !this.inDocument(el) && parent.document != document) {// might be in a frame, need to get its scroll
          doc = parent.document;
    
          if ( !this.isAncestor(doc.documentElement, el) ) {
             return false;
          }
    
       }*/
    
       var scrollTop = Math.max(doc.documentElement.scrollTop, doc.body.scrollTop);
       var scrollLeft = Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft);
    
       return [box.left + scrollLeft, box.top + scrollTop];
    }
    else { // safari, opera, & gecko
       pos = [el.offsetLeft, el.offsetTop];
       parentNode = el.offsetParent;
       if (parentNode != el) {
          while (parentNode) {
             pos[0] += parentNode.offsetLeft;
             pos[1] += parentNode.offsetTop;
             parentNode = parentNode.offsetParent;
          }
       }
       /*if (isSafari && el.style.position == 'absolute' ) { // safari doubles in some cases
          pos[0] -= document.body.offsetLeft;
          pos[1] -= document.body.offsetTop;
       }*/
    }
    
    if (el.parentNode) { parentNode = el.parentNode; }
    else { parentNode = null; }
    
    while (parentNode && parentNode.tagName.toUpperCase() != 'BODY' && parentNode.tagName.toUpperCase() != 'HTML')
    { // account for any scrolled ancestors
       if (parentNode.style.display != 'inline') { // work around opera inline scrollLeft/Top bug
          pos[0] -= parentNode.scrollLeft;
          pos[1] -= parentNode.scrollTop;
       }
    
       if (parentNode.parentNode) { parentNode = parentNode.parentNode; }
       else { parentNode = null; }
    }
    
    
    return pos;
}

function getWidth(obj)
{
    var width = obj.offsetWidth;
    if (width > 0)
        return width;
    if (!obj.firstChild)
        return 0;
    //return obj.parentNode.parentNode.offsetWidth;

    // use the left and right child instead
    return obj.lastChild.offsetLeft - obj.firstChild.offsetLeft + getWidth (obj.lastChild);
}

function getHeight(obj)
{
    var height = obj.offsetHeight;
    if (height > 0)
        return height;
    if (!obj.firstChild)
        return 0;
    // use the first child's height
    height = obj.firstChild.offsetHeight;
    if(!height)
        height = 0;
    return height;
}

function getX(el)
{
    return getXY(el)[0];
}

function getY(el)
{
    return getXY(el)[1];
}


function isGecko()
{
    return navigator.userAgent.toLowerCase().indexOf('gecko')>-1;
}
function isIE7()
{
    return navigator.userAgent.toLowerCase().indexOf('msie 7')>-1;
}

function isSafari()
{
    return navigator.userAgent.toLowerCase().indexOf('webkit')>-1;
}
function isIE()
{
    return window.ActiveXObject;
}

