function ajax_create() {
	var xmlHttp;
	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		// Internet Explorer
		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 ajax_send(script, attributes, return_fun) {
	var url, xmlHttp, params="", key;

	url = "scripts/" + script;
	for (key in attributes) {
		params = addPostParam(params, key, attributes[key]);
	}

	xmlHttp = ajax_create();
	if (return_fun != null && return_fun != undefined) {
		xmlHttp.onreadystatechange = function() {
										if (xmlHttp.readyState==4) {
											return_fun(xmlHttp.responseText);
										}
									}
	}
	xmlHttp.open("POST", url, true);
	//Send the proper header information along with the request
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(params);
}

function addPostParam(params, param, value) {
	var result = params;
	if (result.length > 0)
		result += "&";
	result += param + "=" + strip_special(value);
	
	return result;
}