var xmlHttp;
function ConnectAjax()
{
	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;
		    }
	    }
	}
}

function GetValues()
{
	if(xmlHttp.readyState == 4)
	{
		HideLoading();
		document.getElementById('divFeatContent').innerHTML = xmlHttp.responseText;
	}
}

function AjaxMain(intState)
{
	var strURL = "featart.php?id=";
	
	if(intState == 0)
		strURL += document.getElementById('userid').value;
	else
		strURL += document.getElementById('currentid').value;
	
	if(intState == 1)
		strURL += "&state=next";

	if(intState == -1)
		strURL += "&state=prev";
	
	ShowLoading();
	ConnectAjax();
	xmlHttp.onreadystatechange = GetValues;
	xmlHttp.open("GET",strURL,true);
	xmlHttp.send(null);
	clearTimeout(tmeTime);
}

function ShowLoading()
{
	document.getElementById('imgLoading').style.display = 'block';
	document.getElementById('divFeatContent').style.display = 'none';
}

function HideLoading()
{
	document.getElementById('imgLoading').style.display = 'none';
	document.getElementById('divFeatContent').style.display = 'block';
}