function getNews(tbl,cat,date) {
	Ajax.Responders.register({
	  onCreate: showProcessing,
	  onComplete: hideProcessing
	});	
	new Ajax.Updater('leftcolumnnews', 'assets/scripts/actions.php',
					 {
						 method:'post',
						 parameters: { table: tbl , category: cat , h: date },
						 onFailure: function() {
							 alert("There was an error with the connection");
						 }
					 });
}
function showProcessing() {
  if(Ajax.activeRequestCount > 0) {
	document.getElementById('loadinghome').style.display = 'inline';
	document.getElementById('loadingnews').style.display = 'inline';
	document.getElementById('loadingphotos').style.display = 'inline';
	document.getElementById('loadingresources').style.display = 'inline';
	document.getElementById('loadingcontact').style.display = 'inline';
	}
}
function hideProcessing () {
  if(Ajax.activeRequestCount <= 0){
	document.getElementById('loadinghome').style.display = 'none'; 
	document.getElementById('loadingnews').style.display = 'none'; 
	document.getElementById('loadingphotos').style.display = 'none';
	document.getElementById('loadingresources').style.display = 'none';
	document.getElementById('loadingcontact').style.display = 'none';
	}
}

function getHome(tbl,cat) {
	Ajax.Responders.register({
	  onCreate: showProcessing,
	  onComplete: hideProcessing
	});	
	new Ajax.Updater('leftcolumnhome', 'assets/scripts/actions.php',
					 {
						 method:'post',
						 parameters: { table: tbl , category: cat },
						 onFailure: function() {
							 alert("There was an error with the connection");
						 }
					 });
}

function getPhotos(tbl,cat) {
	Ajax.Responders.register({
	  onCreate: showProcessing,
	  onComplete: hideProcessing
	});	
	new Ajax.Updater('leftcolumnphotos', 'assets/scripts/actions.php',
					 {
						 method:'post',
						 parameters: { table: tbl , category: cat },
						 onFailure: function() {
							 alert("There was an error with the connection");
						 }
					 });
}
function getResources(tbl,cat) {
	Ajax.Responders.register({
	  onCreate: showProcessing,
	  onComplete: hideProcessing
	});	
	new Ajax.Updater('leftcolumnresources', 'assets/scripts/actions.php',
					 {
						 method:'post',
						 parameters: { table: tbl , category: cat },
						 onFailure: function() {
							 alert("There was an error with the connection");
						 }
					 });
}
function getContact(tbl,cat) {
	Ajax.Responders.register({
	  onCreate: showProcessing,
	  onComplete: hideProcessing
	});	
	new Ajax.Updater('leftcolumncontact', 'assets/scripts/actions.php',
					 {
						 method:'post',
						 parameters: { table: tbl , category: cat },
						 onFailure: function() {
							 alert("There was an error with the connection");
						 }
					 });
}

function deleteItem(tbl,id)
{	
	Ajax.Responders.register({
	  onCreate: showProcessing,
	  onComplete: hideProcessing
	});	
	new Ajax.Updater('result', 'assets/scripts/delete.php',
					 {
						 method:'post',
						 parameters: { table: tbl , id: id },
						 onFailure: function() {
							 alert("There was an error with the connection");
						 },
						 onComplete: function() {
							 window.location = "http://www.mac-troop570.com/modify.php?notice=deleted";
						 }
					 });
	
}
