function reportsProcess(url, vars){
			$.post(
				url, 
				vars,
				function(xmlResponse){
		    		var root = xmlResponse.getElementsByTagName('root');
					var err = xmlResponse.getElementsByTagName('error')[0].childNodes[0].nodeValue;
					var msg = xmlResponse.getElementsByTagName('message')[0].childNodes[0].nodeValue;
					
					if(err == 'true'){
						alert('Error - Please try again later');
					}
					else{
						$('#report_message').html(msg);
						$('#report_comments').val('');
						$('#report_review_box form').css('display', 'none');
					}
					
					hideWait();
				}, 
				"xml"
			);
		}
		
		$(document).ready(function(){
			$('#report_review').click(function(){
				$('#report_review_box form').css('display', 'block');
				$('#report_message').html('');
				return false;
			});	
			
			$('#cancel_report_button').click(function(){
				$('#report_comments').val('');
				$('#report_review_box form').css('display', 'none');
			});
			
			$('#add_report_button').click(function(){
				if($('#report_comments').val().replace(/\s+/g,'').length == 0){
					alert('Please enter your comments!');
					$('#report_comments').focus();
				}
				else{
					var url = 'ajax/reports.php';
					var comments = encodeURIComponent($('#report_comments').val());
					var review_id = encodeURIComponent($('#report_review_id').val());
					
					vars = addslashes('comments=' + comments + '&review_id=' + review_id);
					
					showWait();
					
					setTimeout("reportsProcess('" + url + "', '" + vars + "')", 1000);
				}
			});
		});
