function ajax(object,module)
{
	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;
      		}
    	}
  	}

	if (module)
		xmlHttp.open("POST",module+"/ajax.php",false);
	else
		xmlHttp.open("POST",document.location.href+"ajax.php",false);
	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
	
	postData='';
	for(var i in object) 
	{
		postData+=i+"="+escape(object[i])+"&";
	}
	
	xmlHttp.send(encodeURI(postData));
	return xmlHttp.responseText;
}

function getData(object,callback)
{
	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;}}}

	xmlHttp.onreadystatechange=function()
	{
		if(xmlHttp.readyState==4 && xmlHttp.status==200)
	    {
			var result;
			eval("result="+xmlHttp.responseText);
			callback(result);
	    }
	} 
	
	xmlHttp.open("POST","data.php",true);
	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
	postData='';
	for(var i in object) 
	{
		if ((typeof object[i])=="object")
		{
			for(var j in object[i])
			{
				postData+=i+"["+j+"]="+escape(object[i][j])+"&";
			}
		}
		else
		{
			postData+=i+"="+escape(object[i])+"&";
		}
	}
	xmlHttp.send(encodeURI(postData));	
}
