function xhp()
{
	var xmlHttp;
	try
	{
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
	return xmlHttp;
}

function sub_page(url){
	scroll(0,0);
	var height = document.getElementById('div_main').offsetHeight;
	if(height<screen.height){
		height=screen.height;
	}
	else{
		height=height+20;
	}
	document.getElementById('loadImg').style.display='inline';
	document.getElementById('loadImg').style.height=height;
	top.location = url;
}

function ajaxFunction(page,title,other)
{
	var xmlHttp = xhp();
	if(other==null)
	{
		url='pages/'+page+'.php';
	}
	else
	{
		url='pages/'+page+'.php?id='+other;
	}
	document.getElementById('loadImg').style.display='inline';
	xmlHttp.onreadystatechange=function()
	{
		if(xmlHttp.readyState==4)
		{
			document.getElementById('T1').innerHTML=xmlHttp.responseText;
			document.getElementById('H1').innerHTML=title+'<a id="loadImg" style="display:none"><img src="loading.gif" alt="" /></a>';
			document.getElementById('loadImg').style.display='none';
		}
	}
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);
}