﻿$().ready(function(){
	var content = $("#content");
	var contentSection = $("#content > div");
	var menuSections = $("#newss ul li");
	var areaLogistics = $("#areaLogistics");
	var areaAwards = $("#areaAwards");
	var areaNews = $("#areaNews");
	var areaClient = $("#areaClient");
	
	//current section
	var currentSection = $("#news");
	var currentMenu = "news";
	
	menuSections.click(function(){
		//change section if it's different than current
		if(currentMenu != this.id){
			//menu style
			$(this).addClass("active");
			currentSection.removeClass("active");
			currentSection = $(this);
			currentMenu = this.id;
			
			//activate the new selected section
			switch(this.id){
				case "logistics":
					content.fadeTo("slow", 0.0,
						function(){
							contentSection.css({display:"none"});
							areaLogistics.css({display:"block"});}
					);
					content.fadeTo("slow", 1.0);
				break;
				case "awards":
					content.fadeTo("slow", 0.0,
						function(){
							contentSection.css({display:"none"});
							areaAwards.css({display:"block"});}
					);
					content.fadeTo("slow", 1.0);
				break;
				case "news":
					content.fadeTo("slow", 0.0,
						function(){
							contentSection.css({display:"none"});
							areaNews.css({display:"block"});}
					);
					content.fadeTo("slow", 1.0);
				break;
				case "client":
					content.fadeTo("slow", 0.0,
						function(){
							contentSection.css({display:"none"});
							areaClient.css({display:"block"});}
					);
					content.fadeTo("slow", 1.0);
				break;
			}
		}
	});
});