(function ($) {

    $.menuUpdate = function (page) {
		$('.BottomButton').stopAll();
		$('.TopButton').stopAll();
//		var $currentPage = this.alt;
		var $currentPage = page
		if($currentPage=='galleryBase'||$currentPage=='gallery3d'||$currentPage=='gallery2d'||$currentPage=='galleryAnimation'){ 
				$('.TopButton').each(function(i){
			//alert(this.id);
				if(this.id!=$currentPage && $(this).css("top")!='11px'){
					$(this).animate({top: '11px'}, 250);
				} else if(this.id==$currentPage && $(this).css("top")!='20px'){
					$(this).animate({top: '20px'}, 500);
				}
			});
			
			$('.BottomButton').each(function(i){
				if(this.id!='galleryBase' && $(this).css("top")!='392px'){
					  $(this).animate({top: '392px'}, 250);
				} else if(this.id=='galleryBase' && $(this).css("top")!='380px') {
					$('#galleryBase').animate({top: '380px'}, 500);
				}
			});

		}
		else { //if any other bottom button is clicked
			$('.BottomButton').each(function(i){
				if(this.id!=$currentPage && $(this).css("top")!='392px'){
					  $(this).animate({top: '392px'}, 250);
				} else if(this.id==$currentPage && $(this).css("top")!='380px'){
					$(this).animate({top: '380px'}, 500);
				}
			});
			
			$('.TopButton').each(function(){
				if($(this).css("top")!='-10px'){
					  $(this).animate({top: '-10px'}, 250);
				}
			});
			
		}
		
		
		
		
		
		}
})(jQuery);

