// JavaScript Document
function sendReport(sharetype,relid)
{
	//alert(sharetype);alert(relid);
	
	if(myId=="")
	{
			alert("Please Login to report");return false;
	}
/*	if(Flag==false) { return false; }
	Flag=false;*/
	try {
		xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");
	 } 
	 catch (e) 
	 { 
		// browser doesn't support ajax. handle however you want
	 }
	 xmlhttp.onreadystatechange = function()
	 {
	 	if(xmlhttp.readyState==4)
		{
			//alert(xmlhttp.responseText);
			rval=xmlhttp.responseText;
			document.getElementById("reprot_id").innerHTML=rval;
			//if(typeof(document.getElementById("reprot_id1"))!="undefined")
			if(document.getElementById("reprot_id1"))
			{
				document.getElementById("reprot_id1").innerHTML=rval;	
			}
		}
		else
		{
			document.getElementById("reprot_id").innerHTML='Reporting...';
			//if(typeof(document.getElementById("reprot_id1"))!="undefined")
			if(document.getElementById("reprot_id1")) 
			{
				document.getElementById("reprot_id1").innerHTML='Reporting...';
			}
		}
	 } 
	 //The following will send the request to the PHP file using the POST method:
	 xmlhttp.open('post',  "../shared-items/share_report.php");
	 xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	 xmlhttp.send('mode=report&sharetype='+sharetype+"&relid="+relid); 
}
