	/*
	 * Highslide 
	*/
	
	// remove the registerOverlay call to disable the controlbar
	if (typeof hs !== 'undefined') {
		hs.registerOverlay(
			{
				thumbnailId: null,
				overlayId: 'controlbar',
				position: 'top right',
				hideOnMouseOut: true
			}
		);
		hs.graphicsDir = '/highslide/graphics/';
		hs.outlineType = 'rounded-white';
		// Tell Highslide to use the thumbnail's ALT for captions
		hs.captionEval = 'this.thumb.alt';
	}
	
	/*
	 * Banner Slideshow 
	*/
	
	window.addEvent('domready', function() {

		var showDuration  = 5000;
		var container = $('header-middle');
		var images = container.getElements('img');
		var currentIndex = 0;
		var interval;
		
		images.each(function(img,i) {
			if (i > 0) {
				img.set('opacity',0);
			}
		});
			
		var show = function() {
			images[currentIndex].set('tween', {
				duration: 2000
			}).fade(0);
			
			images[currentIndex = currentIndex < images.length - 1 ? currentIndex+1 : 0].set('tween', {
				duration: 2000
			}).fade(1);
		};
		
		container.setStyle('visibility','visible');
		interval = show.periodical(showDuration);
	});
