Ajax.Responders.register({
    onCreate : function() {document.getElementById('loading').style.display = 'block';},
    onComplete : function() {
	  document.getElementById('loading').style.display = 'none'; 
	  document.getElementById('google').style.display = 'block'; 
      var currentTime = new Date();
      googlead.location = "http://www.manicmayhem.co.uk/skratch/includez/googleads.php?s=" + currentTime.getTime(); }
  });
  
function show(id) { 
document.getElementById(id).style.display = 'block'; 
} 
function hide(id) { 
document.getElementById(id).style.display = 'none'; 
} 

function displayLoading()
	{
		document.getElementById('loading').style.display = 'block'; 
	}

function hideLoading ()
	{
		document.getElementById('loading').style.display = 'none'; 
	}
	
function showCombos(levelid)
	{
	var url = 'http://www.manicmayhem.co.uk/skratch/includez/combos.php';
    var pars = 'level=' + levelid;
		var myAjax = new Ajax.Updater(
					{success: 'combo-mainbox-content'}, 
					url, 
					{
						method: 'get', 
						parameters: pars, 
						onFailure: reportError
					});
		
	}
	
	function refreshRecent()
	{
	var url = 'http://www.manicmayhem.co.uk/skratch/includez/beatzbox.php';
    var pars = 'id=none';
		var myAjax = new Ajax.Updater(
					{success: 'combo-rightbox1'}, 
					url, 
					{
						method: 'get', 
						parameters: pars, 
						onFailure: reportError
					});
		
	}

	function reportError(request)
	{
		alert('Sorry. There was an error.');
	}