

function show_ris(id)
{
	document.getElementById('panel_ins').style.display='none';
	document.getElementById('panel_ris').style.display='block';
	document.getElementById('panel_msg').style.display='none';
	
	xmlHttp.open('POST', 'showris_ajax.php?id='+id, true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xmlHttp.onreadystatechange = stateChangedse2; 
														
		xmlHttp.send(null);
}



function stateChangedse2() {

	if(xmlHttp.readyState == 4) 
	{
	
		//Stato OK
		if (xmlHttp.status == 200) 
		{
			
			var risp = xmlHttp.responseText;
			
			if(risp!="")
			{
				risp=risp.replace(/^\s*/gi,"");
				
				//Le coppie di valori nella stringa di risposta sono separate da ;
				var values = risp.split(';');
				var limit = values.length-1;
				
				document.getElementById('rispondo').innerHTML = values[0];
				document.getElementById('titolo_ris').value = ' Re:'+values[1];
				document.getElementById('parent_ris').value = values[3];
				document.location.href="#div_ris";
		
			}
			
		} 
		else 
		{
			alert(xmlHttp);
		}
	}
}


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;
}

