?//
// Configuration
//
var LoadingImage = "images/loading3.gif";
var LoadingText = '<img src="'+LoadingImage+'">';
var http = createRequestObject();
var ajaxid = 0;
var plus = '';
//
imgLoading = new Image();
imgLoading.src = LoadingImage;

function createRequestObject()
{
var req;
	if(window.XMLHttpRequest)
	{
		req = new XMLHttpRequest();
	} else if(window.ActiveXObject) {
		req = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
		alert('Error! ...Try again');
	}
return req;
}

function ajax_request(act, id)//sendRequestGet(act)
{
	ajaxid = parseInt(id);
	http.open('get', 'ajax.php?act='+act+'&id='+ajaxid, true);
	http.onreadystatechange = handleResponse;
	http.send(null);
}

function ajaxplus(p, s, id)
{
	ajaxid = parseInt(id);
	plus = s;
	http.open('get', 'ajaxplus.php?p='+p+'&s='+s+'&id='+ajaxid, true);

	if(s == 'info')
	{
		http.onreadystatechange = handleResponsePost;
	}else{
		http.onreadystatechange = handleResponsePlus;
	}
	http.send(null);
}
function ajaxpost(theform)
{
	var id = parseInt(theform.id.value);
	var act = theform.act.value;
	var info = theform.info.value;

	http.open('post', 'ajaxpost.php', true);
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.onreadystatechange = handleResponsePost;
	http.send('act='+act+'&id='+id+'&info='+info);
	return false;
}

function handleResponse()
{
	if(http.readyState == 4 && http.status == 200)
	{
		var response = http.responseText;
		if(response)
		{
			document.getElementById("ajax_"+ajaxid).innerHTML = response;
		}
	}

	if(http.readyState == 1)
	{
		document.getElementById("ajax_"+ajaxid).innerHTML = LoadingText;
	}
}

function handleResponsePost()
{
	if(http.readyState == 4 && http.status == 200)
	{
		var response = http.responseText;
		if(response)
		{
			document.getElementById("ajax_box").innerHTML = response;
		}
	}

	if(http.readyState == 1)
	{
		document.getElementById("ajax_box").innerHTML = LoadingText;
	}
}

function handleResponsePlus()
{
	if(http.readyState == 4 && http.status == 200)
	{
		var response = http.responseText;
		if(response)
		{
			document.getElementById("ajax_"+plus+"_"+ajaxid).innerHTML = response;
		}
	}

	if(http.readyState == 1)
	{
		document.getElementById("ajax_"+plus+"_"+ajaxid).innerHTML = LoadingText;
	}
}