/* MAIN NAVIGATION
---------------------------------------------------------- */
jQuery(document).ready( function(){    	
   	$('.homepage').click(function(){
	    $('.section1').addClass("selected");
	    $('.section2').removeClass("selected");
	    $('.section3').removeClass("selected");
	    $('.section4').removeClass("selected");
	    $('#about').fadeOut("10").fadeIn("2500");
	});	
   	
	$('.section1').click(function(){
	    $('.section1').addClass("selected");
	    $('.section2').removeClass("selected");
	    $('.section3').removeClass("selected");
	    $('.section4').removeClass("selected");
	    $('#about').fadeOut("10").fadeIn("2500");
	});	

	$('.section2').click(function(){
	    $('.section2').addClass("selected");
	    $('.section1').removeClass("selected");
	    $('.section3').removeClass("selected");
	    $('.section4').removeClass("selected");
	    $('#about').fadeOut("10").fadeIn("2500");
	});
	
	$('.section3').click(function(){
	    $('.section3').addClass("selected");
	    $('.section1').removeClass("selected");
	    $('.section2').removeClass("selected");
	    $('.section4').removeClass("selected");
	    $('#about').fadeOut("10").fadeIn("2500");
	}); 
	
	$('.section4').click(function(){
	    $('.section4').addClass("selected");
	    $('.section1').removeClass("selected");
	    $('.section2').removeClass("selected");
	    $('.section3').removeClass("selected");
	    $('#about').fadeOut("10").fadeIn("2500");
	}); 
});


/* ABOUT PAGE - NAVIGATION & LOADING CONTENT
---------------------------------------------------------- */
$(function()
    {

       // Initialize jScrollPane
       $('#scroll_content').jScrollPane();    

       // Always scroll on top 
       $('#first_page, #second_page, #third_page, #fourth_page').bind(
                    'click',
                    function()
                    {
                        $('#scroll_content')[0].scrollTo(0);
                        return false;
                    }
                );

        // Click function            
        $('#first_page').click(function(){
            $('#first_page').addClass("active");
            $('#second_page').removeClass("active");
            $('#third_page').removeClass("active");
            $('#fourth_page').removeClass("active");
            $('.first_page').fadeIn("slow");
            $('.second_page').fadeOut("slow");
            $('.third_page').fadeOut("slow");
            $('.fourth_page').fadeOut("slow");
        });    

        $('#second_page').click(function(){
            $('#second_page').addClass("active");
            $('#first_page').removeClass("active");
            $('#third_page').removeClass("active");
            $('#fourth_page').removeClass("active");
            $('.second_page').fadeIn("slow");
            $('.first_page').fadeOut("slow");
            $('.third_page').fadeOut("slow");
            $('.fourth_page').fadeOut("slow");
        });        

        $('#third_page').click(function(){
            $('#third_page').addClass("active");
            $('#first_page').removeClass("active");
            $('#second_page').removeClass("active");
            $('#fourth_page').removeClass("active");
            $('.third_page').fadeIn("slow");
            $('.first_page').fadeOut("slow");
            $('.second_page').fadeOut("slow");
            $('.fourth_page').fadeOut("slow");
        });

        $('#fourth_page').click(function(){
            $('#fourth_page').addClass("active");
            $('#first_page').removeClass("active");
            $('#second_page').removeClass("active");
            $('#third_page').removeClass("active");
            $('.fourth_page').fadeIn("slow");
            $('.first_page').fadeOut("slow");
            $('.second_page').fadeOut("slow");
            $('.third_page').fadeOut("slow");
        });

});        	


/* SLIDESHOW - using jquery.cycle.all.min.js plugin
---------------------------------------------------------- */
$(document).ready(function() {
    $('#featured').cycle({ 
        fx:      'fade', 
        speed:    2500, 
        timeout:  2000 
    });

	$('#work_slideshow').cycle({ 
			fx:     'scrollHorz', 
			speed:  'fast',
			timeout: 0, 
			next:   '#next', 
			prev:   '#prev' 
		});

	$('#info').cycle({ 
			fx:    'scrollVert', 
			speed:  'fast', 
			timeout: 0, 
			next:   '#next', 
			prev:   '#prev'  
		});
		
});	

	

/* LIGHTBOX - using jquery.lightbox-0.5.min.js plugin
---------------------------------------------------------- */
$(document).ready(function() {
	$(function() {
				$('#work_slideshow .large_preview').lightBox({fixedNavigation:true});
			});		
	});	
