
// mb slider from mbtools.com

$(document).ready(function(){
						   
    $('#slider').mbSlider({
         autoplay: true,
		 continuous: true,
		 slideDuration: 14000,
		 pauseOnHover: true,
		 showControls: { 
						next: true, 
						prev: true, 
						play: false, 
						pause: false, 
						first: false, 
						last: false 
					}
    });


	
	$("a[rel=slider], a[rel=identity],a[rel=corporate], a[rel=bespoke], a[rel=publication], a[rel=calendars]").fancybox({
		'titlePosition' : 'outside',
		'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
	return '<span id="fancybox-title-over">' + title + '<span class="imglist">Image ' +  (currentIndex + 1) + ' / ' + currentArray.length + '</span></span>';  
		},
		onComplete: function(){
			var slider = $('#slider'); 
			if( slider.length > 0 ){
				slider.get(0).mbSlider.pause();
			}
		},
		onClosed: function(){
			var slider = $('#slider'); 
			if( slider.length > 0 ){
				slider.get(0).mbSlider.play();
			}
		}	
	});
				
	$("a[rel=plant]").fancybox({ 
		'width'				: 500,
		'height'			: '80%',
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	
	$("a[rel=map]").fancybox({ 
		'width'				: 720,
		'height'			: 420,
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	
	
	
	
				
});


