$(function() {
    
    //make header and main content invisible
	$('#mainContent, header').css('display','none');
	$('#mainContent, header, #whiteBg, #redBg').css({opacity:0, 'visibility':'visible'});
    
    /*** ÐÐÐÐÐ intro jQuery ÐÐÐÐÐ ***/
    
    //declare timer
	var timer;
        
    $(window).load(function(){
		$('#whiteBg').fadeTo(1500, 1, function(){
			$('#redBg').css('opacity','1');
	    	$('body').css('background-image','url(images/oed_bg.jpg)');
	    	timer = setTimeout(startAnimation, 1000);
		});
    });
    
	function startAnimation() {
	    clearTimeout(timer);
	    $('#whiteBg').fadeOut(1500, function() {
       		$('#mainContent, header').css('display','block').fadeTo(1500,1);
	    	$('#redBg').fadeOut(1500);
	    });
	}

	/*** ÐÐÐÐÐ end intro jQuery ÐÐÐÐÐ ***/
	
    //left navigation IDs connected with main content project IDs and credits IDs - show each page when hovered
    var projectId = 0;
    
    $('#secNavBox a').mouseenter(function(){
        $("#mainInfo .infoContent").hide();
        $("#creditsBox .creditsList").hide();
        projectId = this.id.slice(this.id.lastIndexOf('_')+1);
        $("#mainInfo #content_id_" + projectId).show();
        $("#creditsBox #credits_id_" + projectId).show();
    });
    
});
