function isNumberKey(evt) {
	var charCode = (evt.which) ? evt.which : event.keyCode
	if (charCode > 31 && (charCode < 48 || charCode > 57)) {
		return false;
	}
	return true;
}

function admindeletereport(id)
{
	msgQuestion = "Are you sure you want to delete this report?";
	userResponse = confirm(msgQuestion);
	if (userResponse == 1) {
		new Ajax.Request('bth/admin/deletecommentreport.php',
		{
			method: 'post',
			parameters: {id: id},
			onSuccess: function(transport)
					   {
								alert("Report Deleted");
								loadPage('bth/admin/commentreports.php');
					   }
		});	} else {
			return;
		}
}

function userdeletereport(id)
{
	msgQuestion = "Are you sure you want to delete this report?";
	userResponse = confirm(msgQuestion);
	if (userResponse == 1) {
		new Ajax.Request('bth/admin/deleteuserreport.php',
		{
			parameters: {id: id},
			onSuccess: function(transport)
					   {
							if(transport.responseText = "sucess")
							{
								alert("Report Deleted");
								loadPage('bth/admin/userreports.php');
							}
					   }
		});	} else {
			return;
		}
}

function popuplogs() {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open('bth/admin/viewlogs.php', '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=600,left = 540,top = 300');");
}

function delpoll(id)
{
	msgQuestion = "Are you sure you want to delete this poll?";
	userResponse = confirm(msgQuestion);
	if (userResponse == 1) {
		new Ajax.Request('bth/admin/deletepoll.php',
		{
			parameters: {id: id},
			onSuccess: function(transport)
					   {
							if(transport.responseText = "sucess")
							{
								alert("Poll Deleted");
								loadPage('bth/admin/polls.php');
							}
					   }
		});	} else {
			return;
		}
}