	function GetXmlHttpObject()
	{
		var xmlHttp = null;
		try {
	  		xmlHttp = new XMLHttpRequest();
		} catch (e) {  
	  		try {
	    		xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	  		} catch (e) {
	    		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
	  	}
		return(xmlHttp);
	} /*used to detect if the current browser supports the XMLHttpRequest object (used for Ajax functionality)*/
	
	function addReportComment(r_id)
	{
		var xmlHttp;
		xmlHttp = GetXmlHttpObject();
		
		document.getElementById("comments").innerHTML = "Loading...";
		if (xmlHttp!=null)
		{
		 	xmlHttp.onreadystatechange = function()
		    {
				if (xmlHttp.readyState==4)
					document.getElementById("comments").innerHTML = xmlHttp.responseText;
			}
			
			fullname = document.forms['commentform'].fullname.value;
			email = document.forms['commentform'].emailaddress.value;
			descrip = document.forms['commentform'].description.value;
			xmlHttp.open("GET","admin/_modules/reports/front/ajax/reports.php?r_id=" +r_id + "&fullname=" +fullname + "&email=" +email + "&description=" +descrip + "&mode=add",true);
		    xmlHttp.send(null);			
		}
		else
			document.getElementById("comments").innerHTML = "Your current browser is not compatible with this comment system. You should consider upgrading before proceeding.";
	} /*adds an item to the oil industry signs quotation, Ajax functionality encapsulated in reports.php*/	
	
	function checkReportsComments(r_id)
	{
	  	var xmlHttp;
		xmlHttp = GetXmlHttpObject();
		
		document.getElementById("comments").innerHTML = "Loading...";
		if (xmlHttp!=null)
		{
		 	xmlHttp.onreadystatechange = function()
		    {
				if (xmlHttp.readyState==4)
					document.getElementById("comments").innerHTML = xmlHttp.responseText;
			}
			
			xmlHttp.open("GET","admin/_modules/reports/front/ajax/reports.php?r_id=" +r_id + "&mode=comment_check",true);
		    xmlHttp.send(null);			
		}
		else
			document.getElementById("comments").innerHTML = "Your current browser is not compatible with this comment system. You should consider upgrading before proceeding.";
	} /*checks for the current report for comments, Ajax functionality encapsulated in reports.php*/		
	
	function emptyInputBoxes()
	{
		alert("Hello World");
	}