$(document).ready(function(){

		 
$('#illustration_box').addClass('begin');
$('#illustration_box').addClass('show_on');

			$("a.right_arrow").click(function () { 
     			 $.fancybox.next();
     			 
    			});
    			
    		$("#list_items a").click(function () { 
    			 $(this).siblings().removeClass('active_header');
     			 $(this).addClass('active_header');
     			 
    			});
    		

			$("#page_prev").click(function () { 
     			 
     			 $('#header').animate({backgroundPosition: '150px 0px'});    
    			});
    			
    			$("#page_next").click(function () { 
     			 
     			 $('#header').animate({
     			 	backgroundPosition: '-290px 0px'},
     			 	{
        			 duration: 1000, // how fast we are animating
       				 easing: 'easeInOutQuad', // the type of easing
        			 
     			 	
     			 	});    
    			});
    				
    				
			$("a.left_arrow").click(function () { 
     			 $.fancybox.prev();
     			    
    			});

			$("a.grouped_elements").fancybox({
				'overlayColor'		: '#000',
				'overlayOpacity'	: 0.6
				});
	

$("ul#page_wrapper").cycle({
	fx: 'scrollHorz',
 	timeout:0,
	prev: '#page_prev',
	next: '#page_next',
	easing: "easeInOutQuad",
	cleartypeNoBg :  "true",
	pager:  '#nav', 
    pagerAnchorBuilder: function(idx, slide) { 
        // return selector string for existing anchor 
        return '#nav li:eq(' + idx + ') a'; 
    }
 });

$('a#list_work').click(function() { 
	$('#header').animate({
     			 	backgroundPosition: '-550 0px'},
     			 	{
        			 duration: 1300, // how fast we are animating
       				 easing: 'easeInOutQuad', // the type of easing
        			 
     			 	
     			 	});  
    $('#nav li:eq(1) a').trigger('click'); 
    return false; 
});
	 
	  		
$('a#list_hello').click(function() { 
      $('#header').animate({
     			 	backgroundPosition: '0px 0px'},
     			 	{
        			 duration: 1300, // how fast we are animating
       				 easing: 'easeInOutQuad', // the type of easing
        			 
     			 	
     			 	});      
   
    	$('#nav li:eq(0) a').trigger('click'); 
       	return false; 
       }); 	
    

$('a#list_me').click(function() { 
       $('#header').animate({
     			 	backgroundPosition: '-900px 0px'},
     			 	{
        			 duration: 1300, // how fast we are animating
       				 easing: 'easeInOutQuad', // the type of easing
        			 
     			 	
     			 	});    
   
    	$('#nav li:eq(2) a').trigger('click'); 
       	return false; 
       }); 	


});
 


$.fn.delay = function(time, callback){
    // Empty function:
    jQuery.fx.step.delay = function(){};
    // Return meaningless animation, (will be added to queue)
    return this.animate({delay:1}, time, callback);
}

function slideSwitch() {
    var $active2 = $('#slideshow DIV.active');

    if ( $active.length == 0 ) $active = $('#slideshow DIV:last');

    // use this to pull the divs in the order they appear in the markup
    var $next2 =  $active.next().length ? $active.next()
        : $('#slideshow DIV:first');

    // uncomment below to pull the divs randomly
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
         $(this).effect("bounce", { direction:'top', times:5 }, 300);
            $active.removeClass('active last-active');
       
}


 

