var xmlhttp = null; 

function getAjaxHandler()
{
	var http = null; 
	
	if(window.XMLHttpRequest)
	{
		http = new XMLHttpRequest();
		
	}
	else
	{
		if(window.ActiveXObject) //for IE6 and IE5.5
		{
			http = new ActiveXObject('MSXML2.XMLHTTP.3.0'); 	
		}
	}	
	
	return http;
}

function showAlarisAboutContent()
{
	xmlhttp.onreadystatechange=updateAboutContent;
	xmlhttp.open("GET", "alarisContent.php", true);
	xmlhttp.send(null);
}

function showSealundAboutContent()
{
	xmlhttp.onreadystatechange=updateAboutContent;
	xmlhttp.open("GET", "sealundContent.php", true);
	xmlhttp.send(null);
}

function showMCCContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "mccContent.php", true);
	xmlhttp.send(null);
}

function showUCSContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "ucsContent.php", true);
	xmlhttp.send(null);
}

function showUCRContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "ucrContent.php", true);
	xmlhttp.send(null);
}

function showCABContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "cabContent.php", true);
	xmlhttp.send(null);
}

function showUMPContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "umpContent.php", true);
	xmlhttp.send(null);
}

function showESGContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "esgContent.php", true);
	xmlhttp.send(null);
}

function showESLContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "eslContent.php", true);
	xmlhttp.send(null);
}

function showID101Content()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "id101Content.php", true);
	xmlhttp.send(null);
}

function showDDIDContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "ddidContent.php", true);
	xmlhttp.send(null);
}

function showRYIDContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "ryidContent.php", true);
	xmlhttp.send(null);
}

function showVLEContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "vleContent.php", true);
	xmlhttp.send(null);
}

/* Created by Congruent for Bundle packages*/
function showCMCContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "cmcContent.php", true);
	xmlhttp.send(null);
}

function showBCContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "bcContent.php", true);
	xmlhttp.send(null);
}

function showITCContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "itcContent.php", true);
	xmlhttp.send(null);
}

/* Ends here */ 

/* LIBRARY UPDATE */

function showLCContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "lcContent.php", true);
	xmlhttp.send(null);
}

function updateAboutContent()
{
	if(xmlhttp.readyState == 4)
	{	
		document.getElementById('theAboutContentArea').innerHTML = xmlhttp.responseText;
	}
}

function updateOnlineCoursesContent()
{	
	if(xmlhttp.readyState == 4)
	{	
		document.getElementById('onlineCoursesContent').innerHTML = xmlhttp.responseText;
		addLightBox();
	}
}

function addLightBox()
{
	$('a.lightbox').lightBox({fixedNavigation:true}); // Select all links with lightbox class
}


/*********************************************************

	DEBT MANAGEMENT FUNCTIONS

*********************************************************/

function showMMDContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "mmdContent.php", true);
	xmlhttp.send(null);
}

function showRAEDContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "raedContent.php", true);
	xmlhttp.send(null);
}

function showCMDContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "cmdContent.php", true);
	xmlhttp.send(null);
}

function showCBContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "cbContent.php", true);
	xmlhttp.send(null);
}

function showDMCContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "dmcContent.php", true);
	xmlhttp.send(null);
}

/*********************************************************

	MONEY MANAGEMENT FUNCTIONS

*********************************************************/

function showSSGContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "ssgContent.php", true);
	xmlhttp.send(null);
}

function showSSMContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "ssmContent.php", true);
	xmlhttp.send(null);
}

function showUIContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "uiContent.php", true);
	xmlhttp.send(null);
}

function showDNWContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "dnwContent.php", true);
	xmlhttp.send(null);
}

function showMMCContent()
{
	xmlhttp = getAjaxHandler(); 
	xmlhttp.onreadystatechange=updateOnlineCoursesContent;
	xmlhttp.open("GET", "mmcContent.php", true);
	xmlhttp.send(null);
}

