var offsetWidth = 0;
var offsetHeight = 0;
var elementToResize = '';

function setDivParam(requiredOffSetWidth, requiredOffSetHeight, requiredElementToResize)
{
    offsetWidth = requiredOffSetWidth;
    offSetHeight = requiredOffSetHeight;
    elementToResize = requiredElementToResize;
}

function setDivFirstLoad()
{
    setDiv();
    this.frames.secondDiv.setDiv();
    LoadCluster();
}

function setDiv()
{
    var wh = 0;
    
    var d = document.getElementById(elementToResize); // Get div element
    
    if (offsetWidth > 0)
    {
        // Get required div width
        if (typeof(window.innerWidth) == 'number')
            ww = getWindowWidth() - offsetWidth;
        else
            ww = getWindowWidth() - offsetWidth;
        
        d.style.width = ww + 'px'; // Set div height to window width
    }
    
    if (offSetHeight > 0)
    {
        // Get required div height
        if (typeof(window.innerHeight) == 'number')
            wh = getWindowHeight() - offSetHeight;
        else
            wh = getWindowHeight() - offSetHeight;
            
        d.style.height = wh + 'px'; // Set div height to window height
    }

    this.frames.secondDiv.setDiv();
}

function setDiv2()
{
    setDiv();
    
    this.frames.secondDiv.setDiv();
}

function getWindowWidth()
{
    var windowWidth = 0;
    
    if (typeof(window.innerWidth) == 'number')
        windowWidth = window.innerWidth;
    else
    {
        if (document.documentElement && document.documentElement.clientWidth)
            windowWidth = document.documentElement.clientWidth;
        else
        {
            if (document.body && document.body.clientWidth)
                windowWidth = document.body.clientWidth;
        }
    }
    		
    return windowWidth;
}

function getWindowHeight()
{
    var windowHeight = 0;
    
    if (typeof(window.innerHeight) == 'number')
        windowHeight = window.innerHeight;
    else
    {
        if (document.documentElement && document.documentElement.clientHeight)
            windowHeight = document.documentElement.clientHeight;
        else
        {
            if (document.body && document.body.clientHeight)
                windowHeight = document.body.clientHeight;
        }
    }
    		
    return windowHeight;
}