/* Edited 051110 by RD */





$(function() {

	// if the function argument is given to overlay,
	// it is assumed to be the onBeforeLoad event listener
	$("a[rel]").overlay({

		mask: '#257A27',
		effect: 'apple',

		onBeforeLoad: function() {

			// grab wrapper element inside content
			var wrap = this.getOverlay().find(".contentWrap");

			// load the page specified in the trigger
			wrap.load(this.getTrigger().attr("href"));
		}

	});
});





/*
----------------------------------------------------------------------------------
START Scrolling Navigation System Config
----------------------------------------------------------------------------------
*/

// wait until document is fully scriptable
$(function() {

	// select #content and make it scrollable. use circular and navigator plugins
	$("#content").scrollable({ circular: false, mousewheel: false }).navigator({
	
		// select #main-nav to be used as navigator
		navi: "#main-nav",
		
		// select A tags inside the navigator to work as items (not direct children)
		naviItem: 'a',
		
		// assign "current" class name for the active A tag inside navigator
		activeClass: 'current',
		
		// make browser's back button work
		history: true
	
	});
});

/*
----------------------------------------------------------------------------------
END Scrolling Navigation System Config
----------------------------------------------------------------------------------
*/


/*
----------------------------------------------------------------------------------
START Fading In and Out Code Between Sections
----------------------------------------------------------------------------------
*/

$(function() {
    $('.logo a, .next, .prev, #nav-home, #nav-strategy, #nav-creative, #nav-technology, #nav-contact, #nav-careers').click(function() {																											   
        $(".section").css("display","none");
        $('.section').fadeIn(750);
    });
});
						
/*
----------------------------------------------------------------------------------
END Fading In and Out Code Between Sections
----------------------------------------------------------------------------------
*/


/*
----------------------------------------------------------------------------------
START Lightbox Config
----------------------------------------------------------------------------------
*/

$(function() {
    // if the function argument is given to overlay, it is assumed to be the onBeforeLoad event listener
    $("a[rel]").overlay({
        effect: 'apple',
    
        onBeforeLoad: function() {
            // grab wrapper element inside content
            var wrap = this.getOverlay().find(".contentWrap");

            // load the page specified in the trigger
            wrap.load(this.getTrigger().attr("href"));
        }
	
    });
});

/*
----------------------------------------------------------------------------------
END Lightbox Config
----------------------------------------------------------------------------------
*/