var xmlHttp

function ajax_contact(def)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	} 
	var url="../steamsun_lib/contact_action_lib.php";
	//url=url+"?do="+def;
// 	url=url+"&l="+limit;
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("POST",url,true);
	//document.write(document.regform.u_name.value);
	//var k = getElementById("u_name");
	var params = "u_name="+document.regform.u_name.value+"&lorem=ipsum&name=binny";
	
	xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(params);
}

function stateChanged() 
{ 
	if (xmlHttp.readyState==4)
	{ 
		document.getElementById("cont").innerHTML=xmlHttp.responseText;
	}
	else
	{ 
		document.getElementById("cont").innerHTML='<hr /><h3>Loading please wait...</h3><img src="steamsun_images/lightbox/ajax-loader.gif" width="220" height="10">' ;
	}
}

function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	{
  // Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
  // Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}

