
		
	
	
	function reportItem(itemType, itemID)
	{	
		$("#report_reason").attr("value",defaulttext["report_reason"]);
		$("#report_reason").addClass("defaultinput");
		
		$("#reporting_type").text(itemType);
		$("#reporting_ID").text(itemID);
		
		preventSpam('report','centerPopup("#reportPopup"); loadPopup("#reportPopup");');
	}
	
	
	function submitReport()
	{
		if ( $("#report_reason").attr("value") == defaulttext["report_reason"] ) 
		{
			$("#report_error").css("display","block"); 
		}
		else 
		{
			itemType = $("#reporting_type").text();
			itemID = $("#reporting_ID").text();
			
			$.ajax({
				type: "GET",
				url: "addreport.php",
				data: "itemType="+ itemType +"&itemID=" + itemID + "&reason=" + $("#report_reason").attr("value"),
				success: function(resp){  
				
					if ( itemType == "post" ) 
					{ 
						updateInteraction(itemID); 
					}
					else if ( itemType == "comment" ) 
					{ 
						$("#commentreportlink"+itemID).text('Reported');
						$("#commentreportlink"+itemID).attr("href",false);
					}
				
					animatedcollapse.show('report_thanks');
					
					$("#report_error").css("display","none"); 
					
				}		
			});		
			
			
			
		}
	}
			
		