﻿function SetFooterPosition() {

    var div = document.getElementById('divMiddle');
    var height = parseInt(div.offsetHeight);

    var footer = document.getElementById('divFooter');
    var newHeight = 0;

    // test for IE Browser
    if (/MSIE (\d+\.\d+);/.test(navigator.userAgent))
        newHeight = (height + 60);
    else 
        newHeight = (height + 40);

    if (newHeight < 580)
        if (navigator.userAgent.toLowerCase().indexOf('chrome') >= 0)
            newHeight = 680;

    footer.style.top = String(newHeight.toString() + 'px');
}

function showMessage(msg, redirectUrl)
{
    var divModal = document.getElementById('divModal');
    var divModalCont = document.getElementById('divModalCont');
    var divModalMsg = document.getElementById('divModalMsg');
    var divModalBtn = document.getElementById('divModalBtn');

    if (divModal != undefined && divModalCont != undefined)
    {
        divModalMsg.innerHTML = msg;
        divModalMsg.innerHTML += "";

        if (redirectUrl != null && redirectUrl != '')
            divModalBtn.onclick = function() { location.href = redirectUrl; };
        else
            divModalBtn.onclick = function() { location.href = location.href; };

        divModal.style.display = '';
        divModalCont.style.display = '';
    }
}
