function setTop(element, pos)
{
    YAHOO.util.Dom.setY(element, pos);
}

function setHeight(element, height)
{
    YAHOO.util.Dom.setStyle(element, "height", height);
}

function arrange(element, pos, height)
{
    YAHOO.util.Dom.setY(element, pos);
    YAHOO.util.Dom.setStyle(element, "height", height);
}

function arrangeMenuLeft(els)
{
    arrange(els.menuLeftDiv, els.contentTop, els.menuHeight);
}

function arrangeContent(els)
{
    if ( isDefined('userLoggedIn') ) // unlock the middle width if user is signed in.
    {
        YAHOO.util.Dom.setStyle("middleColumn", "width", "100%");
        YAHOO.util.Dom.setStyle("middleRightColumn", "width", "100%");
    }

    // arrange banner content area
    if ( els.bannerContentDiv != null )
        arrange(els.bannerContentDiv, els.bannerTop, els.bannerHeight);

    if ( els.photoContentDiv != null && trim(els.photoContentDiv.innerHTML) != "" )
    {
        arrange(els.photoContentDiv, els.contentTop, els.menuHeight);

        if ( els.photoImageBox != null )
            setHeight(els.photoImageBox, (els.menuHeight-75));

        if ( els.photoImage != null )
            setHeight(els.photoImage, (els.menuHeight-75));

        if ( els.mainContentDiv != null )
            els.arrangeMainContent(els.endMenuTop, els.maxHeight);

        // additions for slideshow support...
        if ( els.slideshowImageBox != null )
            setHeight(els.slideshowImageBox, (els.menuHeight-75));

        if ( els.slideshowImage0 != null )
            arrange(els.slideshowImage0, els.contentTop, (els.menuHeight-75));

        if ( els.slideshowImage1 != null )
            arrange(els.slideshowImage1, els.contentTop, (els.menuHeight-75));
    }
    else if ( els.mainContentDiv != null )
    {
        // additions for full width mode (only supported when there's no main photo.
        if ( els.mainContentFullwidthDiv != null )
            els.arrangeFullWidthContent(els.contentTop, els.maxHeightWithMenu);
        else
            els.arrangeMainContent(els.contentTop, els.maxHeightWithMenu);
    }
}

function arrangeRightColumn(els)
{
    if ( els.photoRightDiv != null && trim(els.photoRightDiv.innerHTML) != "" )
    {
        var topHeight = els.menuHeight-100;
        var barHeight = 25;
        var boxHeight = 75;

        arrange(els.photoRightDiv, els.contentTop, els.menuHeight);

        if ( els.photoRightTextDiv != null )
            setHeight(els.photoRightText, topHeight);

        if ( els.photoRightBarDiv != null )
            arrange(els.photoRightBarDiv, els.contentTop+topHeight, barHeight);

        if ( els.photoRightBoxDiv != null )
            arrange(els.photoRightBoxDiv, els.contentTop+topHeight+barHeight, boxHeight);

        els.arrangeBottomRight(els.endMenuTop, els.maxHeight);
    }
    else
    {
        if ( els.mainContentFullwidthDiv != null )
            els.arrangeBottomFull(els.contentTop, els.maxHeightWithMenu);
        else
            els.arrangeBottomRight(els.contentTop, els.maxHeightWithMenu);
    }
}

