// retorna a altura da janela aonde se encontra o documento HTML
function windowHeight()
{
    h = 0;
    if (typeof(window.innerHeight) == 'number')
        h = window.innerHeight;
    else if (document.documentElement && document.documentElement.clientHeight)
        h = document.documentElement.clientHeight;
    else if (document.body && document.body.clientHeight)
        h = document.body.clientHeight;

    return h;
}
// retorna a largura da janela aonde se encontra o documento HTML
function windowWidth()
{
    w = 0;
    if (typeof(window.innerWidth) == 'number')
        w = window.innerWidth;
    else if (document.documentElement && document.documentElement.clientWidth)
        w = document.documentElement.clientWidth;
    else if (document.body && (document.body.clientWidth || document.body.clientHeight))
        w = document.body.clientWidth;

    return w;
}
