// JavaScript Document



// ** THESE TWO FUNCTIONS OPERATE THE FADE IN AND OUT OF DIVS *** 
function changeOpacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        //var hideit = document.getElementById(id).style.display="none";
				setTimeout("document.getElementById('" + id + "').style.display='none';",millisec);
				for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
				document.getElementById(id).style.display='BLOCK';
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
} 
// ****************************************************************


// this is the alert is called (using javascript) from vbscript in the footer.asp 
// include when message is passed to page from vb (in the URL variable or in VB
//this is also called by the jsAlert function
function showPageAlert(millsec) { 
	document.getElementById("pageAlert").style.display="BLOCK";
	changeOpacity('pageAlert', 0, 85,300);
	setTimeout("changeOpacity('pageAlert', 85, 0,300);",millsec);
}

function jsAlert(message) { // THIS is a way to call up the message alert from javascript
	document.getElementById('pageAlert').innerHTML = message;
	showPageAlert(4000);
}