
	
	$(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
				
					var href = window.location.toString();
					var str = window.location.hash;
					var exploded = str.split('/');
						
					if (window.location.hash=='') {
						href = (href+"gallery/image/"+exploded[3]+"/");
					} else {
						href = (href.substr(0,href.indexOf("#"))+"gallery/image/"+exploded[3]+"/");
					}
					
					href = href+window.location.hash;				
						
														
					$('#addthis_toolbox').empty();	
					var a = document.createElement('a');
					a.setAttribute('class', 'addthis_button_compact');
					a.setAttribute('addthis:url', href);
					a.setAttribute("onmouseover", "return addthis_open(this, '', '"+href+"', '')");
					a.setAttribute("onclick", "return addthis_sendto()");
					a.setAttribute("onmouseout", "addthis_close()");
					a.innerHTML = '<img src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" />';
					document.getElementById('addthis_toolbox').appendChild(a);
					
					// 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
					)
				}
			});	
	}
	