
			String.prototype.Trim = function() {
				return this.replace(/(^\s*)|(\s*$)/g, "");
			} 
			$('#report-content').keyup(function(event) { 
				var length = 200 - $(this).val().length;  
				if(length <=0) { 
					maxVal = $(this).val().substring(0,200);
					$(this).val(maxVal);
				} 
			});
			function adjust_report_box() { 
				var position = $("#featured-topic .options").position(); 
				t = position.top - $("#report-box").height() - 8;
				l = position.left + 135;
				$("#report-box").css({ 'left' : l +'px', 'top' : t+'px' }); 
			}
			function report_box() {
				$("#report-box").toggle(); 
				adjust_report_box(); 
			} 
			function close_report() {
				$("#loading-row").hide();
				$("#result-row").hide();
				$("#subject-row").show();
				$("#content-row").show();
				$("#ftr-row").show();
				$("#report-box").hide(); 
			} 
			function submit_report() {
				subject = $("#report-subject").val();
				cont = $("#report-content").val().Trim(); 
				if(cont.length > 0) { 
					$("#loading-row").show();
					$("#subject-row").hide();
					$("#content-row").hide();
					$("#ftr-row").hide();
					adjust_report_box(); 
					$.ajax({
						type: "POST",
						url: site_dir +"/lib/report/"+uID,
						data: "subject="+subject+"&content="+cont+"&t="+topicID,
						success: function(msg) {
							$("#report-content").val("");
							$("#loading-row").hide();
							$("#result-row").show();
							setTimeout("close_report()",1500);
						}
					}); 
				}
				else {
					$("#report-content").val("");
					alert("Please fill in some content.");
				}
			}

