
	
	$(document).ready(function(){
							   
		var counter = 0
	    divs = $('#one, #two, #three');
	

    function showDiv () {
        divs.fadeOut(0) // hide all divs
            .filter(function (index) { return index == counter % 3; }) // figure out correct div to show
			.fadeIn('slow');
													   
			
        counter++;

    }; // function to loop through divs and show correct div
	

    showDiv();

    setInterval(function () {
        showDiv(); // show next div
    }, 10 * 1000); // do this every 10 seconds   
		   
							   
							   
							   

		$("#bar").click(function(){
			location.href='/bar/';					 
		});
		
		$("#restaurant").click(function(){
			location.href='/restaurant/';					 
		});
		
		$("#bar").mouseover(function(){
			$("#bar .slidePush").stop().animate({ 
				height: "130px"
			}, 100 );
		 	$("#bar .slide").stop().animate({ 
				height: "112px"
			}, 100 );
		});
		
		$("#bar").mouseout(function(){
			$("#bar .slidePush").stop().animate({ 
				height: "200px"
			}, 50 );
		 	$("#bar .slide").stop().animate({ 
				height: "42px"
			}, 50 );
		});
		
		$("#restaurant").mouseover(function(){
			$("#restaurant .slidePush").stop().animate({ 
				height: "130px"
			}, 100 );
		 	$("#restaurant .slide").stop().animate({ 
				height: "112px"
			}, 100 );
		});
		
		$("#restaurant").mouseout(function(){
			$("#restaurant .slidePush").stop().animate({ 
				height: "200px"
			}, 50 );
		 	$("#restaurant .slide").stop().animate({ 
				height: "42px"
			}, 50 );
		});
		
		
		$("#aboutSub, #aboutTab").mouseover(function(){
			$(".aboutTab").css({'background-color' : '#fff'});
			$(".aboutTab").css({'color' : '#000'});	
		});
		$("#aboutSub, #aboutTab").mouseout(function(){
			$(".aboutTab").css({'background-color' : 'transparent'});	
			$(".aboutTab").css({'color' : '#fff'});	
		});
		
		$("#menuSub, #menuTab").mouseover(function(){
			$(".menuTab").css({'background-color' : '#fff'});
			$(".menuTab").css({'color' : '#000'});	
		});
		$("#menuSub, #menuTab").mouseout(function(){
			$(".menuTab").css({'background-color' : 'transparent'});	
			$(".menuTab").css({'color' : '#fff'});	
		});
		
			$("#bmenuSub, #bmenuTab").mouseover(function(){
			$(".bmenuTab").css({'background-color' : '#fff'});
			$(".bmenuTab").css({'color' : '#000'});	
		});
		$("#bmenuSub, #bmenuTab").mouseout(function(){
			$(".bmenuTab").css({'background-color' : 'transparent'});	
			$(".bmenuTab").css({'color' : '#fff'});	
		});
	});
	
	function gallery() {
		$('ul.gallery').galleria({
				history   : true, // activates the history object for bookmarking, back-button etc.
				clickNext : true, // helper for making the image clickable
				insert    : '#main_image', // the containing selector for our main image
				onImage   : function(image,caption,thumb) { // let's add some image effects for demonstration purposes
					
					// fade in the image & caption
					if(! ($.browser.mozilla && navigator.appVersion.indexOf("Win")!=-1) ) { // FF/Win fades large images terribly slow
						image.css('display','none').fadeIn(1000);
					}
					caption.css('display','none').fadeIn(1000);
					
					// fetch the thumbnail container
					var _li = thumb.parents('li');
					
					// fade out inactive thumbnail
					_li.siblings().children('img.selected').fadeTo(500,0.3);
					
					// fade in active thumbnail
					thumb.fadeTo('fast',1).addClass('selected');
					
					// add a title for the clickable image
					image.attr('title','Next image >>');
				},
				onThumb : function(thumb) { // thumbnail effects goes here
					
					// fetch the thumbnail container
					var _li = thumb.parents('li');
					
					// if thumbnail is active, fade all the way.
					var _fadeTo = _li.is('.active') ? '1' : '0.3';
					
					// fade in the thumbnail when finnished loading
					thumb.css({display:'none',opacity:_fadeTo}).fadeIn(1500);
					
					// hover effects
					thumb.hover(
						function() { thumb.fadeTo('fast',1); },
						function() { _li.not('.active').children('img').fadeTo('fast',0.3); } // don't fade out if the parent is active
					)
				}
			});	
	}
	