function updtElem2 (URL,obj,callback,el){
o=document.getElementById('eventi');
//alert(o);
updtElem(URL,obj,callback,o);
}

//updtElem('/chat/checkchat',buddyobj,'getList()',o);
function updtElem (URL,obj,callback,o)
{
var xmlHttp;
var retVal;
	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;
			}
		}
	}
	xmlHttp.onreadystatechange=function()
	{
		if(xmlHttp.readyState==4)
		{
			if(xmlHttp.status== 200) {
				ans=xmlHttp.responseText;
				ans=JSON.parse(xmlHttp.responseText);
				
				if (ans.status == 600) {
					/*if (ans.action)
						if (ans.action == 'myhome') {
							alert('sessione scaduta');
							window.location.href='/';
						}
					*/
					_nav.timeout();
					//alert ('Sessione scaduta!');
				}	
				//alert(xmlHttp.responseText);
				else {
					callback_f='obj.'+callback+'('+'xmlHttp.responseText'+','+'o'+')';
					eval(callback_f);
				}	
				//retVal=xmlHttp.responseText;
				//document.getElementById(element_id).innerHTML=document.getElementById(element_id).innerHTML+retVal+'<br>';
				//document.getElementById(element_id).innerHTML=retVal;
			}
		}
	}
	xmlHttp.open("GET",URL,true);
	xmlHttp.send(null);
}

function updtElem3 (URL,obj,callback)
{
var xmlHttp;
var retVal;
	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;
			}
		}
	}

	xmlHttp.onreadystatechange=function()
	{
		if(xmlHttp.readyState==4)
		{
			if(xmlHttp.status== 200) {
				ans=xmlHttp.responseText;
				ans=JSON.parse(xmlHttp.responseText);
				
				if (ans.status == 600) {
					/*if (ans.action)
						if (ans.action == 'myhome') {
							alert('sessione scaduta');
							window.location.href='/';
						}
					*/
					_nav.timeout();
					//alert ('Sessione scaduta!');
				}	
				//alert(xmlHttp.responseText);
				else {
					callback_f='obj.'+callback+'('+'xmlHttp.responseText'+')';
					eval(callback_f);
				}	
				//alert(xmlHttp.responseText);
				//retVal=xmlHttp.responseText;
				//document.getElementById(element_id).innerHTML=document.getElementById(element_id).innerHTML+retVal+'<br>';
				//document.getElementById(element_id).innerHTML=retVal;
			}
		}
	}
	xmlHttp.open("GET",URL,true);
	xmlHttp.send(null);
}







function updtElem32 (URL,obj,callback)
{
var xmlHttp;
var retVal;
	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;
			}
		}
	}

	xmlHttp.onreadystatechange=function()
	{
		if(xmlHttp.readyState==4)
		{
			if(xmlHttp.status== 200) {
				ans=xmlHttp.responseText;
				ans=JSON.parse(xmlHttp.responseText);
				
				if (ans.status == 600) {
					/*if (ans.action)
						if (ans.action == 'myhome') {
							alert('sessione scaduta');
							window.location.href='/';
						}
					*/
					_nav.timeout();
					//alert ('Sessione scaduta!');
				}	
				//alert(xmlHttp.responseText);
				else {
					//callback_f='obj.'+callback+'('+'xmlHttp.responseText'+')';
					//eval(callback_f);
				}	
				
 				//document.write (xmlHttp.responseText);
 				document.getElementById("farloc").value="BU";
 				var str =xmlHttp.responseText;
				//alert(str);
       	getFlashMovie("pepecrawl3").sendTextToFlash(str);     
       	//SendDataToFlashMovie("CEPPAZZA");
       	//thisMovie("pepecrawl3").sendToActionScript("CEPPAZZA");

				//return str;
				
				//retVal=xmlHttp.responseText;
				//document.getElementById(element_id).innerHTML=document.getElementById(element_id).innerHTML+retVal+'<br>';
				//document.getElementById(element_id).innerHTML=retVal;
			}
		}
	}
	xmlHttp.open("GET",URL,true);
	xmlHttp.send(null);
}
  function getFlashMovie(movieName) {
    var isIE = navigator.appName.indexOf("Microsoft") != -1;
    alert(document[movieName].name);
    return (isIE) ? window[movieName] : document[movieName];  
  }  

