$(document).ready(function() {

$('a').focus( function() {
	$(this).blur();				   
});


var menuStart = $('#showMenu');
var menuElements = $('li.menuli');
var menuArray = $(menuElements).length;
var menuCount = -1;


$(menuElements).hide(); //hide all menu elements
          
$(menuStart).click(function displayPanel() {
	if (menuCount < menuArray) {
		$(menuElements).eq(++menuCount).fadeIn(750, function() { 
		displayPanel();
		
		if (menuCount == menuArray) {
			$(menuStart).html("- Menu");
			$('li.menuli a.btn').animate({ opacity: "0.8" }, 750);
			}
		});
	}
});

$('li.menuli a.btn').each(function(i) {
	$(this).hover(function() {
		$(this).stop().animate({ opacity: "1" }, 250);
		},		
		function(){
		$(this).stop().animate({ opacity: "0.8" }, 250);
		});
	});


$(menuStart).click(function hidePanel() {
	if (menuCount >= 0) {
		$(menuElements).eq(--menuCount).fadeOut(500, function() {
        hidePanel();
        });
        
        if (menuCount < 0) {
        	$(menuStart).html("+ Menu");
            menuCount = -1;
            }
		}
	});


});