﻿var count = 0;
function Anthem_PreCallBack() { 
    count++;
    setTimeout("CallBackStarted()", 500); 
}
function Anthem_PostCallBack() { CallBackFinished(); }

function CallBackStarted() {
    if (count > 0) {
        var item = document.getElementById('wait');
        var item1 = document.getElementById('quotetitle');
        var item2 = document.getElementById('quotewrapper');
        if ((!window.XMLHttpRequest) && (document.documentElement)) {
            item.style.position = 'absolute';
            //code to make ie6 behave
            if (document.documentElement.scrollTop) {
                item.style.top = document.documentElement.scrollTop + 15;
            }
            else { item.style.top = 15; }
            item.style.right = 15;
        }
        if (item != null) {
            item.style.display = 'block';
        }
        if (item1 != null) {
            item1.setAttribute('class', 'wait');
        }
        if (item2 != null) {
            item2.style.display = 'block';
        }
    }
}

function CallBackFinished() {
    count--;
    if (count == 0) {
        var item = document.getElementById('wait');
        if (item != null) {
            item.style.display = 'none';
        }
        var item1 = document.getElementById('quotetitle');
        if (item1 != null) {
            item1.setAttribute('class', 'qquote');
        }
        var item2 = document.getElementById('quotewrapper');
        if (item2 != null) {
            item2.style.display = 'none';
        }
    }
}
