function CallPage(Method, Loc, Vars, DIV, divType)
{
	var page
	if (navigator.appName=="Microsoft Internet Explorer"){
		try{
			page = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(err){
			try{
				AJAXobj = new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch(err){
				alert("ActiveXObject for AJAX unavailable");
				page = false
			}
		}
	}
	else{
		try{
			page = new XMLHttpRequest;
		}
		catch(err){
			alert("AJAX could not be performed, request aborted");
			page = false
		}
	}
	if (!page)
	{
		return page
	}
	if (Method == "GET")
	{
		page.open(Method, Loc + "?" + Vars, true);
	}
	else
	{
		page.open(Method, Loc, true);
		page.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		page.setRequestHeader("Content-length", Vars.length);
		page.setRequestHeader("Connection", "close");
	}
	page.onreadystatechange = function() {
		if (page.readyState==4)
		{
			if (page.status==200)
			{
				document.getElementById(DIV).innerHTML = page.responseText;
			}
			else
			{
				document.getElementById(DIV).innerHTML = page.statusText + "<br><br>Please email the admin the details of this error";
			}
		}
		else
		{
			switch (divType)
			{
				case "static":
					string = document.getElementById(DIV).value;
				case "formSelect":
					string = "<option value='#'>Loading...</option>";
					break;
				default:
					string = "<img src='../image/ajax-loader.gif' alt='Loading...'>";
			}
			document.getElementById(DIV).innerHTML = string;
		}
	};
	if (Method == "GET")
	{
		page.send(null);
	}
	else
	{
		page.send(Vars);
	}
}

function ChangeText(text, DIV)
{
	document.getElementById(DIV).innerHTML = text;
}
function disable(ObjectID, state)
{
	document.getElementById(ObjectID).disabled = state;
}
