var xmlHttp

function showResult(str)
{
if (str.length==0)
 { 
 document.getElementById("livesearch").
 innerHTML="";
 document.getElementById("livesearch").
 style.border="0px";
 return
 }
///------------------------


xmlHttp=GetXmlHttpObject() //See if it works with users browser.

	var url = RootPath + "www/ajaxindex.php?pag=ajaxphp/livesearch.php";
	var params = Array();
	
	params.push('q='+ str);
	var mypars=params.join("&");
	
	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", mypars.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.onreadystatechange=function(){
										if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
											 { 
											   	 document.getElementById("livesearch").innerHTML=xmlHttp.responseText;
												 document.getElementById("livesearch").style.border="5px solid #ac9877";
												 document.getElementById("livesearch").style.width="380px";
											 } 
										};
	xmlHttp.send(mypars);
}

function changenews(lang,id){

	xmlHttp=GetXmlHttpObject() //See if it works with users browser.

	var url = RootPath + "www/ajaxindex.php?pag=ajaxphp/newspanel.php";
	var params = Array();
	
	params.push('idnews='+ id);
	params.push('lang='+ lang);
	var mypars=params.join("&");
	
	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", mypars.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.onreadystatechange=function(){
										if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
											 { 
											   	 document.getElementById("newspanel").innerHTML = xmlHttp.responseText;
											 } 
										};
	xmlHttp.send(mypars);
}