$(document).ready(function(){
	//References
	var sections = $("#menu li");
	//var sections = $("# container");
	//var loading = $("#loading");
	var content = $("#content");
	
	$(document).ready(function(){
			$("#content").load("news.html");
							   
							   });
				/*switch(this.id){
					case sections.ready():
				
					content.load("news.html", hideLoading);
			
					break;
							 }});*/
	
	//Manage click events
	sections.click(function(){
		//show the loading bar
		//showLoading();
		//load selected section
		switch(this.id){
			case "home":
				content.load("news.html", hideLoading);
				break;
			case "history":
				content.load("history.html", hideLoading);
				break;
			case "values":
				content.load("values.html", hideLoading);
				break;
			case "recruitment":
				content.load("recruitment.html", hideLoading);
				break;
			case "scholarship":
				content.load("scholarship.html", hideLoading);
				break;
			case "officers":
				content.load("officers.html", hideLoading);
				break;
			case "cur_bro":
				content.load("current_brothers.html", hideLoading);
				break;
			case "programming":
				content.load("programming.html", hideLoading);
				break;
			case "com_serv":
				content.load("community_service.html", hideLoading);
				break;
			case "calendar":
				content.load("calendar.html", hideLoading);
				break;
			case "pictures":
				content.load("pictures.html", hideLoading);
				break;
			case "grad_events":
				content.load("grad_events.html", hideLoading);
				break;
			case "owl_letter":
				content.load("owl_letter.html", hideLoading);
				break;
			case "links":
				content.load("links.html", hideLoading);
				break;
			case "contact":
				content.load("contact.html", hideLoading);
				break;
			default:
				//hide loading bar if there is no selected section
				hideLoading();
				break;
		}
	});

	//show loading bar
	function showLoading(){
		loading
			.css({visibility:"visible"})
			.css({opacity:"1"})
			.css({display:"block"})
		;
	}
	//hide loading bar
	function hideLoading(){
		loading.fadeTo(1000, 0);
	};
});