﻿/**
*
* @summary Moves the grass correctly depending on the dimensions of the screen and of the height of the content
* @access public
* @return void
**/
function setHeight() {
    var contentHeight = document.getElementById("shadow").scrollHeight;
    var windowDimensionsObject = getWindowDimensions();
    var winHeight = windowDimensionsObject.height;

    if ((winHeight - 350) <= contentHeight) { document.getElementById("vbottom").style.bottom = 'auto'; document.getElementById("vbottom").style.top = (contentHeight + 225) + 'px'; }
    else { document.getElementById("vbottom").style.bottom = '0px'; document.getElementById("vbottom").style.top = 'auto'; }


}

function getWindowDimensions() {
    var windowWidth = 0;
    var windowHeight = 0;

    if ((document.documentElement) && (document.documentElement.clientWidth))
        windowWidth = document.documentElement.clientWidth;
    else if ((document.body) && (document.body.clientWidth))
        windowWidth = document.body.clientWidth;
    else if ((document.body) && (document.body.offsetWidth))
        windowWidth = document.body.offsetWidth;
    else if (window.innerWidth)
        windowWidth = window.innerWidth - 18;

    if ((document.documentElement) && (document.documentElement.clientHeight))
        windowHeight = document.documentElement.clientHeight;
    else if ((document.body) && (document.body.clientHeight))
        windowHeight = document.body.clientHeight;
    else if ((document.body) && (document.body.offsetHeight))
        windowHeight = document.body.offsetHeight;
    else if (window.innerHeight)
        windowHeight = window.innerHeight - 18;

    return { width: windowWidth, height: windowHeight };
}

function gotoURL(url) {
    document.location.href = url;
}