

  

  
function setImmediate(elName, srcUrl) {
	new Ajax.Request(srcUrl,
	  {
	    method:'get',
	    onSuccess: function(transport){
	      var response = transport.responseText || "no response text";
	      //alert("Success! \n\n" + response);
	      Element.update(elName, response);
	    },
	    onFailure: function(){  }
	  });
}

function setByFading(elName, srcUrl) {
	new Effect.Fade(elName, {
	queue: {position:'end', scope: 'off'},
	afterFinish: function() {
	new Ajax.Request(srcUrl,
	  {
	    method:'get',
	    onSuccess: function(transport){
	      var response = transport.responseText || "no response text";
	      //alert("Success! \n\n" + response);
	      Element.update(elName, response);
		  new Effect.Appear(elName, {
        	queue: {position:'end', scope: 'ajg'},
		    afterFinish: function() {
		    }
		  });
	    },
	    onFailure: function(){  }
	  });
	}
	});
  
}

function setByGrow(elName, srcUrl) {
	new Ajax.Request(srcUrl,
	  {
	    method:'get',
	    onSuccess: function(transport){
	      var response = transport.responseText || "no response text";
	      //alert("Success! \n\n" + response);
	      Element.update(elName, response);
		  new Effect.Grow(elName, {
	        queue: {position:'end', scope: 'ajg'},
		    afterFinish: function() {
		    }
		  });
	    },
	    onFailure: function(){  }
	  });
  
}


function resetAll() {
  $('detailpopup').hide();
  setImmediate('descbox','content/tagline.html');
  setByFading('leftbox','content/home.html');
  setImmediate('righttopbox','content/menu.html');
  setImmediate('rightmidbox','content/gallery.html');
  setImmediate('rightbottombox','content/ordering.html');
}

var count = 0;

function startPage() {
  resetAll();
  new PeriodicalExecuter(function () {
    if($('runslideshow').getValue() != null) {
      setImmediate('slot' + (count % 6), 'content/gallery' + (count % 17) + '.html');
      count++;
    }
  }, 3);
}

function showNextSet() {
  for (i=0;i<=6;i++)
  {
    setImmediate('slot' + (count % 6), 'content/gallery' + (count % 17) + '.html');
    count++;
  }
}

function sendForm(name) {
  $(name).request({
	    onSuccess: function(transport){
	      var response = transport.responseText || "no response text";
	      alert(response);
	    },
	    onFailure: function(){  }
	  });
}

function showDetail(srcUrl) {
  $('detailpopup').show();
	new Ajax.Request(srcUrl,
	  {
	    method:'get',
	    onSuccess: function(transport){
	      var response = transport.responseText || "no response text";
	      //alert("Success! \n\n" + response);
	      Element.update('detailcontent', response);
		  new Effect.SlideDown('detailcontent', {
	        queue: {position:'end', scope: 'ajg'},
		    afterFinish: function() {
		    }
		  });
	    },
	    onFailure: function(){  }
	  });
}

function hideDetail() {
  new Effect.SlideUp('detailcontent', {
	queue: {position:'end', scope: 'off'},
	afterFinish: function() {
      $('detailpopup').hide();
	}
  });
  
}

