var t,c,tc;
var isPaused=false;
var current, next;

function SlideShow(target, child) {
	if ($.browser.opera) {
    	$.support.opacity = true;
	}
	t = target;
	c = child;
	tc = t+' '+c;
	
	if($.browser.msie) {
		$(tc).css("filter", "alpha(opacity=0)");
		$(tc+':first').css("filter", "alpha(opacity=100)");
	} else {
		$(tc).css({opacity: 0.0});
		$(tc+':first').css({opacity: 1.0});
	}
	
	$(tc+':first').addClass("show");
	
	setInterval('gallery()', 5000);	
}

function gallery() {
	if(!isPaused) {
		current = ($(tc+'.show') ?  $(tc+'.show') : $(tc+':first'));
		next = ((current.next().length) ? ((current.next().hasClass('caption')) ? $(tc+':first') :current.next()) : $(tc+':first'));
	
		if($.browser.msie) {
			next.css("filter", "alpha(opacity=0)").addClass('show').animate({opacity: 1.0}, 500);
		} else {
			next.css({opacity: 0.0}).addClass('show').animate({opacity: 1.0}, 500);
		}
		
		var bgSrc = current.children('img').attr("src");
		$(t).css('backgroundImage','url(' + bgSrc +')');
		current.removeClass('show');
	}
}

function show(id) {
	isPaused = true;
	
	if($.browser.msie) {
		$(tc).css("filter", "alpha(opacity=0)");
	} else {
		$(tc).css({opacity: 0.0});
	}
	
	var bgSrc = $(t+' #'+id).children('img').attr("src");
	$(t).css('backgroundImage','url(' + bgSrc +')');
}
function resume() {
	if($.browser.msie) {
		$(tc+'.show').css("filter", "alpha(opacity=100)");
	} else {
		$(tc+'.show').css({opacity: 1.0})
	}
	isPaused = false;
}
/*table booking*/
$(document).ready(function(){
  $("#i10booktable").click(function(){
	  
	  if ($("#i10livebookings").is(":hidden")) {
		  
		  $('#i10booktable').animate({  marginLeft:"-150",width:300}, 500, function() {
			  
		  	
			$("#i10livebookings").animate({  marginLeft:"-150"}, 500, function() {$("#i10livebookings").slideDown("slow");});
		  	$("#i10booktable").text('Hide Booking');
		
		  });

		  
	 } else {
		  
		  $('#i10booktable').animate({  marginLeft:"0",width:150}, 500, function() {
		  
		  $("#i10livebookings").hide();
		  $("#i10booktable").text('Book a table');
		  
		  });
	} });
});
