////////////////////////////////////////////////

function CPageRenderer()
{
    this.m_htmlContainer = null;

    this.m_sType = 'Album';
    this.m_sAlbum = '';
    this.m_sPhotoID = null;
}

CPageRenderer.prototype.Initialise = function(htmlContainer)
{
    this.m_htmlContainer = htmlContainer;

    this._ReadProperties();
    return SW_OK;
}

CPageRenderer.prototype.Draw = function()
{
    // TODO read information about type from page

    var oPhotoBox = null;

    if(this.GetType() == 'Album')
    {
        oPhotoBox = new CPhotoBox();
    }
    else if(this.GetType() == 'AlbumLikeTest')
    {
        oPhotoBox = new CPhotoBoxLike();
    }
    else if(this.GetType() == 'PhotoOfTheDay')
    {
        oPhotoBox = new CPhotoBoxOfTheDay();
    }
    else
    {
        oPhotoBox = new CAutoPhotoBox();
    }

    oPhotoBox.Initialise(this.m_htmlContainer, g_PhotoManager.GetAlbumManager(), g_PhotoManager.GetInitialPhotoID());
    return SW_OK;
}

CPageRenderer.prototype._ReadProperties = function()
{
    this.m_sType = this.m_htmlContainer.getAttribute('Type');
    this.m_sAlbum = this.m_htmlContainer.getAttribute('Album');
    this.m_sPhotoID = this.m_htmlContainer.getAttribute('PhotoID');  // PHP ID
    return SW_OK;
}

CPageRenderer.prototype.GetType = function()
{
    return this.m_sType;
}

CPageRenderer.prototype.GetAlbum = function()
{
    return this.m_sAlbum;
}

CPageRenderer.prototype.GetID = function()
{
    return this.m_sPhotoID;
}

////////////////////////////////////////////////
