///////////////////////////////////////////////////////////////
// Utility Functions
///////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////
//
// InitAjax()
//
// This function initializes the ajaxRequest object used by 
// nearly every other function.  It performs the appropriate 
// logic to determine the user's browser and loads the object 
// accordingly.
//
///////////////////////////////////////////////////////////////

function InitAjax()
{
	var ajaxRequest;
	
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	}
	catch (e)
	{
	// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	return ajaxRequest;
}

///////////////////////////////////////////////////////////////
//
// $(id)
//
// This is just a fast way to call document.getElementById() 
// and is more for convenience than anything else.
//
///////////////////////////////////////////////////////////////

function $(id)
{
	return document.getElementById(id);
}

///////////////////////////////////////////////////////////////
// News Page Functions
///////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////
//
// ajaxLoadNews()
//
// This function loads the output of news.php into the div
// 'contentMain' and is invoked when a user clicks the news
// button on the flash navigation bar.
//
/////////////////////////////////////////////////////////////// 

function loadContent(id, page, captionID, caption, captionIDtwo, captionTwo){
	var mainDiv = $(id);
	if (mainDiv)
	{
		mainDiv.innerHTML = "<img src='" + page + "' height=339 width=428 border=0 >";
	}
	else
	{
		alert("Failed");
	}

	mainDiv = $(captionID);
	if (mainDiv)
	{
		mainDiv.innerHTML = caption;
		
	}
	else
	{
		alert("Failed");
	}
	
	mainDiv = $(captionIDtwo);
	if (mainDiv)
	{
		mainDiv.innerHTML = captionTwo;
		
	}
	else
	{
		alert("Failed");
	}

}


