// JavaScript Document

function GetXmlHttpObject()
{
	if (window.XMLHttpRequest)
		return (new XMLHttpRequest());
	else if (window.ActiveXObject)
		return (new ActiveXObject("Microsoft.XMLHTTP"));
}

function ajax(url,divid)
{
	var xmlHttp = false;
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
		alert ("Browser does not support HTTP Request");
	else
	{
		xmlHttp.onreadystatechange=
			function ()
				{
				if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
					document.getElementById(divid).innerHTML=xmlHttp.responseText;
					};
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
	
}
function toggle(toggleId, e)
{
	if (!e)
	e = window.event;
	if (!document.getElementById)	return false;
	
	var body = document.getElementById(toggleId);
	
	if (!body)	return false;
	
	if (body.style.display == "none")
		body.style.display = "block";
	else	body.style.display = "none";
	
	if (e)
	{
	// Stop the event from propagating, which would cause the regular HREF link to be followed, ruining our hard work.
		e.cancelBubble = true;
		if (e.stopPropagation)	e.stopPropagation();
	}
}
