﻿

var lastContentSection = null;

function ToggleLightBox(className, contentSection)
{
    var divLightBox = GetObject('divLightBox');
    var divAreaContainer = GetObject('divAreaContainer');
    
    contentSection = GetObject(contentSection);
    
    
    if (divLightBox)
    {
        if (divLightBox.className.indexOf('show') == -1)
        {
            divLightBox.style.height = document.body.clientHeight + 'px';
            divLightBox.style.width = document.body.clientWidth + 'px';
            
            divLightBox.className = divLightBox.className.replace('hide', 'show');
            
            if (className != undefined && parseInt(className.length) > 0)
                divAreaContainer.className = className;
            
            if (contentSection)
            {
                contentSection.className = contentSection.className.replace("hide", "show");
                
                lastContentSection = contentSection;
            }
        }
        else
        {
            divLightBox.className = divLightBox.className.replace('show', 'hide');
            divAreaContainer.className = ''
            
            if (lastContentSection)
                lastContentSection.className = lastContentSection.className.replace('show', 'hide');
        }
    }
    
    return;
}


function ToggleVideo(objVideo, url)
{
    objVideo = GetObject(objVideo);
    
    objVideo.URL = url;

    return;
}



// --- HELPER METHODS --- //
function GetObject(obj)
{
    return ((typeof(obj) != 'object') ? document.getElementById(obj) : obj);
}