var tallent = {
	init: function() {
		
		//setup mouse events
		$("#add_event_a").click(function() {
			if($("#event_add_form_a").is(":hidden")) {
				$("#event_add_form_a").fadeIn(500);
			} else {
				$("#event_add_form_a").fadeOut(500);
			}
		});
		
		
        $("#menu_1").click(function() {
	        change_page("menu_1");
		});
		
		$("#menu_2").click(function() {
	        change_page("menu_2");
		});
		
		$("#menu_3").click(function() {
	        change_page("menu_3");
		});
		
		$("#menu_4").click(function() {
	        change_page("menu_4");
		});
		
	
		 $('#slideshow').cycle({
            sync: 1,     // true if in/out transitions should occur simultaneously 
            fx: 'fade',
            speed: 2000,
            timeout: 5000
        });
		
	}
	
	
}

jQuery(document).ready(function() {
	tallent.init();
});



function show_full_image(image_url) {
    //add the elements to the dom
    $("body").append('<div class="lb_overlay"></div>');
    $("#photos").prepend('<div id="lb_container"></div>');
    
    $("#lb_container").html('<img src="'+image_url+'" border="0" alt="" />');
    $("#lb_container").fadeIn(600);
    window.remove_overlay();
}

function remove_overlay() {
// allow users to be able to close the lightbox
	$("#lb_container, .lb_overlay").click(function() {
        $("#lb_container, .lb_overlay").fadeOut(600);
        $("#lb_container, .lb_overlay").remove();
	});
}



var page_name = "menu_1";


function change_page(new_page_name) {
    if (page_name != new_page_name) {
        $("#menu_container").fadeOut(
            function() {
                $("#menu_container").load("http://restauranttallent.com/include/"+new_page_name+".inc.php", {}, function() {
                    page_name = new_page_name;
                    $("#menu_container").fadeIn(900);
                    $("#menu_1").attr("class", "");
                    $("#menu_2").attr("class", "");
                    $("#menu_3").attr("class", "");
                    $("#menu_4").attr("class", "");
                    $("#"+new_page_name).attr("class","on");
                });
            }
        );
    }
}
