// Set dialog window position.
function SetDialogPosition()
{
    return;
    var dialog_height;
    var dialog_top;

    // Get dialog window height.
    if (document.getElementById("tabAgreement").style.display != "none")
        dialog_height = document.getElementById("tabAgreement").clientHeight;

    // Set dialog window position.
    dialog_top = parseInt(document.documentElement.clientHeight / 2) + document.documentElement.scrollTop - parseInt(dialog_height / 2)

    if (document.getElementById("divBackDialog") != null) {
        document.getElementById("divBackDialog").style.width = parseInt(document.documentElement.scrollWidth) + "px";
        document.getElementById("divBackDialog").style.height = parseInt(document.documentElement.scrollHeight) + "px";
    }
    
    if (document.getElementById("divContainer") != null && dialog_top > 0)
        document.getElementById("divContainer").style.top = dialog_top + "px";
}

// Show agreement.
function ShowAgreement(_path)
{
    var xmlHTTP = null;
    var _container = null;
    var _content;
    
    _container = document.getElementById("divAgreementContent");

    if (_container != null)
    {
        _content = "<table cellpadding='0' cellspacing='0' width='100%' style='margin: 5px 5px 5px 5px; height: 400px'>";
        _content += "<tr>";
        _content += "<td style='text-align: center; vertical-align: middle'>";
        _content += "<img src='images/ajax-loader.gif' alt='' title='' />";
        _content += "</td>";
        _content += "</tr>";
        _content += "</table>";

        _container.innerHTML = _content;
    }

    document.getElementById("tabAgreement").style.display = "";

    ShowDialog();

    xmlHTTP = getXmlHTTP();

    xmlHTTP.onreadystatechange = function() {
        if (xmlHTTP.readyState == 4 && _container != null)
            _container.innerHTML = xmlHTTP.responseText;
    }

    xmlHTTP.open("POST", _path + "&random=" + Math.random(), true);
    xmlHTTP.send(null);
}

// Get XML HTTP object.
function getXmlHTTP() {
    var xmlHTTP = null;

    try { xmlHttp = new XMLHttpRequest(); }
    catch (e) {
        try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); }
        catch (e) {
            try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); }
            catch (e) { alert("Your browser does not support AJAX!"); return false; }
        }
    }

    return xmlHttp;
}

// Hide agreement.
function HideAgreement() {
    document.getElementById("tabAgreement").style.display = "none";

    HideDialog();
}

// Show dialog window.
function ShowDialog() {
    SetDialogPosition();

    document.getElementById("divBackDialog").style.display = "block";
}

// Hide dialog window.
function HideDialog() {
    document.getElementById("divBackDialog").style.display = "none";
}

