/***************************************************************************************************
 * FUNCTION: showDiv(url, hDiv)
 * PURPOSE:  To send a request to a url, to asyncronously load data.
 * RETURNS:
 * ADDITIONAL NOTES: This function causes a blank div to show, which will be
 *					populated by the requested url.  
 *
 * AUTHOR:  Justin Fluhmann  -  2/19/2008
 **************************************************************************************************/

var xmlhttp;   //variable to contain the XMLHttpRequest

function showDiv(url, hDiv) {				//the url is the page that the function will request, and the
							//hDiv is the hidden Div to be displayed.
	if(window.XMLHttpRequest) {
		// code for IE7, Firefox, Opera, etc.
		xmlhttp=new XMLHttpRequest();
	}
	else if(window.ActiveXObject) {
		//code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	if (xmlhttp!=null) {
		//get the request
		xmlhttp.open("GET",url,false);  	//using a get method to pull information from the url
		xmlhttp.send(null);

		//insert the text into the div
		document.getElementById(hDiv).innerHTML=xmlhttp.responseText;
		//make the div visible
		document.getElementById(hDiv).style.display='block';
		document.getElementById(hDiv).style.left=(document.body.clientWidth/2 - 200) + 'px'; //400 is the width of the div.
		document.getElementById('dimmer').style.height=document.body.clientHeight +'px';
		document.getElementById('dimmer').style.display='block';
		document.getElementById('dimmer').style.position='absolute';
		document.getElementById('dimmer').style.left='0';
		document.getElementById('dimmer').style.top='0';
		document.getElementById('dimmer').style.background='#000000';
		document.getElementById('dimmer').style.filter='alpha(opacity=80)';
		document.getElementById('dimmer').style.opacity='0.8';
	}
	else {
		alert("Your browser does not support AJAX.");
	}
	return 0;
}

function hideDiv(div) {
	document.getElementById(div).style.display='none';
	document.getElementById('dimmer').style.display='none';
	document.getElementById('dimmer').style.position='';
	document.getElementById('dimmer').style.left='';
	document.getElementById('dimmer').style.top='';
	document.getElementById('dimmer').style.background='';
	document.getElementById('dimmer').style.filter='';
	document.getElementById('dimmer').style.opacity='';
}