
function setHeightOld()
{
    /**
     * Why does IE always need a workaround?
     */
    var iHeight;
    if (window.innerHeight)
        iHeight = window.innerHeight;
    else if (document.documentElement && document.documentElement.clientHeight)
        iHeight = document.documentElement.clientHeight;
    else if (document.body)
        iHeight = document.body.clientHeight;
    else
        return;

    //alert(iHeight);
    //alert(document.getElementById("wrapper").offsetHeight);

    if(iHeight > (
        document.getElementById("wrapper").offsetHeight)) {

        newHeight = iHeight -
            document.getElementById("logoRow").offsetHeight -
            document.getElementById("navRow").offsetHeight -
            document.getElementById("footer").offsetHeight;

        flashRow = document.getElementById("flashRow");

        if(null != flashRow) {
            newHeight = newHeight - document.getElementById("flashRow").offsetHeight;
        }

        newHeight = newHeight / 1.04;
        document.getElementById("rightSection").style.height = newHeight + "px";

        /**
         * Yet another one for IE :(
         */
        if (document.getElementById("rightSection").offsetHeight < document.getElementById("mainContent").offsetHeight) {
            document.getElementById("rightSection").style.height = document.getElementById("mainContent").offsetHeight + "px";
        }
    }
}

function setHeight(element)
{
    /**
     * Why does IE always need a workaround?
     */
    var iHeight;
    if (window.innerHeight)
        iHeight = window.innerHeight;
    else if (document.documentElement && document.documentElement.clientHeight)
        iHeight = document.documentElement.clientHeight;
    else if (document.body)
        iHeight = document.body.clientHeight;
    else
        return;

    //alert(iHeight);
    //alert(document.getElementById("wrapper").offsetHeight);
    newHeight = iHeight;
    if(iHeight > (
        document.getElementById("wrapper").offsetHeight)) {

        newHeight = iHeight -
            document.getElementById("logoRow").offsetHeight -
            document.getElementById("navRow").offsetHeight -
            document.getElementById("footer").offsetHeight;

        flashRow = document.getElementById("flashRow");

        if(null != flashRow) {
            newHeight = newHeight - document.getElementById("flashRow").offsetHeight;
        }

        newHeight = newHeight / 1.04;
        //alert(newHeight);
    }

    document.getElementById(element).style.height = newHeight + "px";

    /**
     * Yet another one for IE :(
     */
    if (document.getElementById(element).offsetHeight < document.getElementById("mainContent").offsetHeight) {
        document.getElementById(element).style.height = document.getElementById("mainContent").offsetHeight + "px";
    }
}


var maxHeight = 330;
var maxWidth = 469;

function getImageWidth(path) {
    //alert(path);
    //alert(maxWidth / maxHeight);
    image = new Image();
    image.src = path;

    width = image.width;
    height = image.height;

    //alert(image.width);
    //alert(image.height);

    if(height > width) {
        newWidth = (maxHeight * width / height);
        //alert('New Width ' + newWidth);
        return newWidth;
    }
    //alert('Width ' + maxWidth);
    return maxWidth;
}

function getImageHeight(path) {
    //alert(path);
    //alert(maxWidth / maxHeight);
    image = new Image();
    image.src = path;

    width = image.width;
    height = image.height;

    //alert(image.width);
    //alert(image.height);

    if(width > height) {
        newHeight = (maxWidth * height / width);
        //alert("new height: " + newHeight);
        return newHeight;
    }

   // alert("Height: " + maxHeight);

    return maxHeight;
}