$().ready(function() {
	var clickCount = 0; // keep track of the clicks

	$("#btnSelectProcedure").click(function(){

	   clickCount++; // update clickCount to reflect user clicking

	   if(clickCount % 2 == 0){  // if the click is an even count hide the box
	       slideFadeDown("#proceduresBox");        
	   }
	   else { // else it's not an even click and we show
	        slideFadeUp("#proceduresBox");
	   }
	});

	$("#closeBox").click(function(){
	   clickCount++; // user chose to close the box clicking a link in the box, update clickCount
	   slideFadeDown("#proceduresBox");
	});
	
	// $("#galleryNav li").click(function() {
	// 		var clickedId = "#" + $(this).attr("id") + "List";
	// 		$("#galleryNav li").removeClass("selected");
	// 		$(this).addClass("selected");
	// 		$(".gallerySubNav").hide();
	// 		$(clickedId).show();
	// 	});
});

function slideFadeUp(element) {
    $(element).animate({
        top: '0px',
        opacity: 1
    }, 500);
}

function slideFadeDown(element) {
    
    $(element).animate({
        top: '240px',
        opacity: 0
    }, 500);
}