﻿$(document).ready(function(){
	//References
	var sections = $("#menu li");
	var sections2 = $("#menu2 li");
	var loading = $("#loading");
	var content = $("#content");
	

$("#menu li").click(function(){
        $("#menu li").removeClass("active")
        $(this).addClass("active");
        return false;                                                       
});
	
	//Manage click events
	sections.click(function(){
	 
		//show the loading bar
		showLoading();
		//load selected section
		switch(this.id){
			case "rbc":
				content.load("rbc.html", hideLoading);
				break;	
			case "rob":
				content.load("rob.html", hideLoading);
				break;				
			case "ftd5":
				content.load("ftd5.html", hideLoading);
				break;			
			case "advancedps":
				content.load("advancedps.html", hideLoading);
				break;
			case "ftd4":
				content.load("ftd4.html", hideLoading);
				break;
			case "impulse4":
				content.load("impulse4.html", hideLoading);
				break;
			case "impulse3":
				content.load("impulse3.html", hideLoading);
				break;
			case "computerarts":
				content.load("computerarts.html", hideLoading);
				break;
			case "maxima":
				content.load("maxima.html", hideLoading);
				break;
			case "nzz2":
				content.load("nzz2.html", hideLoading);
				break;
			case "nzz":
				content.load("nzz.html", hideLoading);
				break;
			case "ftd3":
				content.load("ftd3.html", hideLoading);
				break;
			case "impulse2":
				content.load("impulse2.html", hideLoading);
				break;
			case "impulse":
				content.load("impulse.html", hideLoading);
				break;
			case "ftd2":
				content.load("ftd2.html", hideLoading);
				break;
			case "eltern":
				content.load("eltern.html", hideLoading);
				break;
			case "ahofer":
				content.load("ahofer.html", hideLoading);
				break;
			case "spam":
				content.load("spam.html", hideLoading);
				break;
			case "madatoms":
				content.load("madatoms.html", hideLoading);
				break;
			case "ftd":
				content.load("ftd.html", hideLoading);
				break;
			case "dwg":
				content.load("dwg.html", hideLoading);
				break;
			case "mfg":
				content.load("mfg.html", hideLoading);
				break;
			case "artworks":
				content.load("artworks.html", hideLoading);
				break;
			case "contact":
				content.load("contact.html", hideLoading);
				break;		
			case "about":
				content.load("about.html", hideLoading);
				break;		
			
			
			
			default:
				//hide loading bar if there is no selected section
				hideLoading();
				break;
		}
	});


sections2.click(function(){
		//show the loading bar
		showLoading();
		//load selected section
		switch(this.id){
				case "rbc","rbc_":
				content.load("rbc.html", hideLoading);
				$("#rbc").addClass("active"); 
				break;
				case "rob","rob_":
				content.load("rob.html", hideLoading);
				$("#rob").addClass("active"); 
				break;				
				case "ftd5","ftd5_":
				content.load("ftd5.html", hideLoading);
				$("#ftd5").addClass("active"); 
				break;
				case "advancedps","advancedps_":
				content.load("advancedps.html", hideLoading);
				$("#advancedps").addClass("active"); 
				break;
				case "ftd4","ftd4_":
				content.load("ftd4.html", hideLoading);
				$("#ftd4").addClass("active"); 
				break;
				case "impulse4","impulse4_":
				content.load("impulse4.html", hideLoading);
				$("#impulse4").addClass("active"); 
				break;
				case "impulse3","impulse3_":
				content.load("impulse3.html", hideLoading);
				$("#impulse3").addClass("active"); 
				break;
				case "computerarts","computerarts_":
				content.load("computerarts.html", hideLoading);
				$("#computerarts").addClass("active"); 
				break;
				case "maxima","maxima_":
				content.load("maxima.html", hideLoading);
				$("#maxima").addClass("active"); 
				break;
				case "nzz2","nzz2_":
				content.load("nzz2.html", hideLoading);
				$("#nzz2").addClass("active"); 
				break;
				case "nzz","nzz_":
				content.load("nzz.html", hideLoading);
				$("#nzz").addClass("active"); 
				break;
				case "ftd3","ftd3_":
				content.load("ftd3.html", hideLoading);
				$("#ftd3").addClass("active"); 
				break;
				case "impulse2","impulse2_":
				content.load("impulse2.html", hideLoading);
				$("#impulse2").addClass("active"); 
				break;
				case "impulse","impulse_":
				content.load("impulse.html", hideLoading);
				$("#impulse").addClass("active"); 
				break;
				case "ftd2","ftd2_":
				content.load("ftd2.html", hideLoading);
				$("#ftd2").addClass("active"); 
				break;
				case "eltern","eltern_":
				content.load("eltern.html", hideLoading);
				$("#eltern").addClass("active"); 
				break;
				case "ahofer","ahofer_":
				content.load("ahofer.html", hideLoading);
				$("#ahofer").addClass("active"); 
				break;
				case "spam","spam_":
				content.load("spam.html", hideLoading);
				$("#spam").addClass("active"); 
				break;
				case "madatoms","madatoms_":
				content.load("madatoms.html", hideLoading);
				$("#madatoms").addClass("active"); 
				break;
				case "ftd","ftd_":
				content.load("ftd.html", hideLoading);
				$("#ftd").addClass("active"); 
				break;
    	   		case "dwg","dwg_":
				content.load("dwg.html", hideLoading);
				$("#dwg").addClass("active"); 
				break;
				case "mfg","mfg_":
				content.load("mfg.html", hideLoading);
				$("#mfg").addClass("active"); 
				break;
				case "artworks","artworks_":
				content.load("artworks.html", hideLoading);
				$("#artworks").addClass("active"); 
				break;
				case "contact":
				content.load("contact.html", hideLoading);
				$("#contact").addClass("active"); 
				break;
				case "about":
				content.load("about.html", hideLoading);
				$("#about").addClass("active"); 
				break;
								
       
        return false; 
			
			
			
			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);
	};
});

jQuery(document).ready(function(){
	$("#menu2 li").hover(function(){
	 	$(this).find("strong").attr({"style":'border-bottom:1px dotted #000;'});
	 	
		}, 
		function(){
		$(this).find("strong").attr({"style":'border-bottom:1px solid #000;'});
		
		    	}
			);
		});
