// JavaScript Document

			//Gets the browser specific XmlHttpRequest Object
			function getXmlHttpRequestObject() {
				if (window.XMLHttpRequest) {
					//document.getElementById('p_status').innerHTML = "normal";
					return new XMLHttpRequest();
				} else if(window.ActiveXObject) {
					//document.getElementById('p_status').innerHTML = "normal";
					return new ActiveXObject("Microsoft.XMLHTTP");
				} else {
					alert('Status: Cound not create XmlHttpRequest Object.  Consider upgrading your browser.');
				}
			}
			
			//Gets the current messages from the server
			function getChatText( command, url, receiveReq, xml ) {
				
				//alert(receiveReq)

				if ( (receiveReq.readyState == 4 || receiveReq.readyState == 0 ) && command!=null && command!="" && url!=null && url!="") {
					receiveReq.abort();
					if (command!="")
						url = url + "?" + command + "&" + Math.random()
					else
						url = url + "?" + Math.random()
					//alert(url)
					receiveReq.open("POST", url, false);
					receiveReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
					receiveReq.send() //(command);
					//ritorna html o xml
					//alert(receiveReq.responseText)
					if (xml)
						return receiveReq.responseXML;
					else
						return receiveReq.responseText;
					
					
				}else
					return ""
				
			}			
