function GetXmlHttpObject()
{
  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;
}


/**
* If callback is not specified, do nothing
* If callback specified - pass responce to callback function
* If reRender specified, replace it's content with responce, and pass it to callback
* NOTE: use <code>void()</code> if you do not want callback, but want to rerender component 
*/
function ajaxAction(url, params, callback, reRender){
	xmlHttp=GetXmlHttpObject();
	
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4)
		{
			if (xmlHttp.status == 200){
				if(callback != null){
					if(reRender==null){
						var xmlDoc=xmlHttp.responseXML.documentElement;
						eval(callback + "(xmlDoc)" );
					}
					else{
						var htmlDoc =xmlHttp.responseText;
						document.getElementById(reRender).innerHTML = htmlDoc;
						eval(callback + "(htmlDoc)" );
					}
				}
			}else{
				alert("HttpError. Status="+xmlHttp.status + xmlHttp.responseText);
			}
		}
	}
	
	//action += '&inog=' + Math.random();
	
	xmlHttp.open("POST",url,true);
	
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
//	xmlHttp.setRequestHeader("Content-length", params.length);
//	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(params);
}