YUI({
	modules: {
		'gallery-yui-slideshow': {
			fullpath: 'js/gallery-yui-slideshow/gallery-yui-slideshow.js',
			requires: ['anim']
		}
	}
}).use(
	"gallery-yui-slideshow",
	"anim",
	"event-mouseenter",
	"widget",
	"widget-position",
	"widget-stack",
function(Y){

	function getHighestZIndex(){
		var zIndex = -9999999; //set to really low number
		Y.all('*').each(function(node, nodeIndex, nodeList){
			if ( parseInt( node.getStyle('zIndex'), 10 ) > zIndex ){
				zIndex = parseInt( node.getStyle('zIndex'), 10 );
			}
		}, this);
		return zIndex;
	}
	
	//slideshow
	var slides = Y.all( '#slides .makeslide' );
	
	if ( slides.size() > 1 ){

		slides.replaceClass('makeslide', 'slide'); 
		slides.setStyle('opacity', '0'); 
		
		var oSlideshow = new Y.Slideshow('#slides', {
			transIn: {
				from: {
					opacity: 1
				},
				to: {
					opacity: 1
				},
				duration: 2.5
			},
			transOut: {
				from: {
					opacity: 1
				},
				to: {
					opacity: 0
				},
				duration: 2.5
			},
			interval: 8000
		});
		
		
	}//endif
	
});
