//sections/pages of the site
var sections = ['dialogue','logos','print','web','packaging','marketing','contact'];

jQuery.fn.hideTitlesDescriptions = function(clicked) {
	  $.each(sections, function(index, value) { 
	  	$('#title-'+value+'').hide();
	  	$('#description-'+value+'').hide();
	  });
		$('#title-'+clicked+'').delay(800).fadeIn(400);
		$('#description-'+clicked+'').delay(800).fadeIn(1000);
};

jQuery(function() {
	
	$.each(sections,function(index,value) {
		$('.nav-'+value+'').click(function(){
			$(this).hideTitlesDescriptions(value);
		});
	});
	
	$('#coda-slider').codaSlider({
	 		dynamicArrows: false,
	 		dynamicTabs: false,
			autoHeight: false
	 });
	
	$("a.grouped_elements").fancybox({
			'transitionIn'	:	'elastic',
			'transitionOut'	:	'fade',
			'speedIn'		:	600, 
			'speedOut'		:	500, 
			'overlayColor' : 'black',
			'overlayOpacity' : '0.8',
			'hideOnOverlayClick' : true,
			'hideOnContentClick' : true,
			'titlePosition'  : 'over',
			'overlayColor'	: '#000',
			'overlayOpacity' : .75,
			'onComplete'	:	function() {
					$("#fancybox-wrap").hover(function() {
						$("#fancybox-title").show();
					}, function() {
						$("#fancybox-title").hide();
					});
				},
			'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
				currentArray.length > 1 ? gallery_helper = '<br/ ><span class="image_number">Image ' +  (currentIndex + 1) + ' of ' + currentArray.length + ' : Click on left or right of image to view more photos' : gallery_helper = '';
				return '<span id="fancybox-title-over">'+ title + gallery_helper +'</span>';
			}
		});
		
		$(".smcf-bottom a").hide();
	
		$('a.new-window').live("click", function(e){
			window.open(this.href);
			return false;
		 });

});



