var xmlHttp
var divname=""

<!-- livedeletepersonnote() -->
	function livedeletepersonnote(personid,userid,mydivname,myformname,personnoteid)
	{
		if (personid.length==0 && userid.length==0 && personnoteid.length==0)
		{ 
			document.getElementById(personnotes).innerHTML="";
			document.getElementById(personnotes).style.border="0px";
			return
		}
	
		xmlHttp=GetXmlHttpObject()
		
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		} 
		
		var url="live.deletepersonnote.php"
		url=url+"?personid="+personid
		url=url+"&userid="+userid
		url=url+"&personnoteid="+personnoteid
		url=url+"&sid="+Math.random()
		xmlHttp.onreadystatechange=stateChanged
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
		divname=mydivname
	} 

<!-- liveaddpersonnote() -->
	function liveaddpersonnote(personid,userid,mydivname,myformname)
	{
		if (personid.length==0 && userid.length==0)
		{ 
			document.getElementById(personnotes).innerHTML="";
			document.getElementById(personnotes).style.border="0px";
			return
		}
	
		xmlHttp=GetXmlHttpObject()
		
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		} 
		
		var newnote=document.getElementById(myformname).newnote.value;
		
		var url="live.addpersonnote.php"
		url=url+"?personid="+personid
		url=url+"&userid="+userid
		url=url+"&newnote="+newnote
		url=url+"&sid="+Math.random()
		xmlHttp.onreadystatechange=stateChanged
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
		divname=mydivname
	} 

<!-- stateChanged() -->
	function stateChanged() 
	{ 
		
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			document.getElementById(divname).innerHTML=xmlHttp.responseText;
			// show div
				$(".personnotes").fadeIn(800);
		} 
	}

<!-- GetXmlHttpObject() [The purpose of the function is to solve the problem of creating different XMLHTTP objects for different browsers.] -->
	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;
	}
