<!--
var httpObject = null;
var templateURL = null;
var headerPath = null;
var headerExt = null;

// For the Header Loading function
//var headerLoader = document.getElementById("HeaderLoading").style;


// set the template location
function initHeaderInfo(template_url, header_path, ext)
{
	templateURL = template_url;
	headerPath = header_path;
	headerExt = ext;
}

// Get the HTTP Object
function getHTTPObject()
{
	try
	{
		// Firefox, Opera 8.0+, Safari
		return new XMLHttpRequest();
	}
	catch(e)
	{
		// Internet Explorer
		try
		{
			return new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				return new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e)
			{
				return null;
			}
		}
	}
}

// Change the value of the outputText field
function changeHeader()
{
	if(httpObject.readyState == 4)
	{
		//document.getElementById('outputText').value = httpObject.responseText;
		
		// dynamically change the header when the user click the header on the sidebar
		document.getElementById('HeaderWrapper').style.backgroundImage = "url('" + templateURL + headerPath + httpObject.responseText + headerExt + "')";	
	}
}

// Send request to the PHP to set the change the header
function setHeader(header_id)
{
	httpObject = getHTTPObject();
	
	if (httpObject != null)
	{
		httpObject.open("GET", templateURL + "/changeHeader.php?h=" + header_id, true);
		
		httpObject.onreadystatechange = changeHeader;

		// this must be after the onreadystatechange
		httpObject.send(null);
	}
}

function hideHeaderLoader()
{


	document.getElementById("HeaderLoading").style.display="none";
}

function showHeaderLoader()
{


	document.getElementById("HeaderLoading").style.display="inline";
}

//-->