// Common settings for all galleries
hs.graphicsDir = 'http://www.roadrash.no/hswp/wp-content/plugins/highslide/graphics/';
hs.align = 'center';
hs.transitions = ['expand', 'crossfade'];
hs.wrapperClassName = 'borderless';
hs.fadeInOut = true; 


hs.registerOverlay({
	html: '<div class="closebutton" onclick="return hs.close(this)" title="Close"></div>',
	position: 'top right',
	useOnHtml: true,
        slideshowGroup: 'set_4',
	fade: 2 // fading the semi-transparent overlay looks bad in IE
});


// Controlbar for dark gallery
// SlideshowGroup must correspond with the slideshowGroup for the correct gallery
if (hs.addSlideshow) hs.addSlideshow({
	slideshowGroup: 'set_1',
	interval: 5000,
	repeat: false,
	useControls: true,
	fixedControls: 'fit',
	overlayOptions: {
		opacity: 0.75,
		position: 'bottom center',
		hideOnMouseOut: true
	}
});

// Controlbar and thumbstrip for gallery vertical thumbstrip and text controls 
// SlideshowGroup must correspond with the slideshowGroup for the correct gallery
if (hs.addSlideshow) hs.addSlideshow({
	slideshowGroup: 'set_3',
	interval: 5000,
	repeat: false,
	useControls: true,
	fixedControls: false,
	overlayOptions: {
		className: 'text-controls',
		position: 'bottom center',
		relativeTo: 'viewport',
		offsetY: -15

	},
	thumbstrip: {
		position: 'middle left',
		mode: 'vertical',
		relativeTo: 'viewport',
	}
});

// Controlbar for white gallery
// SlideshowGroup must correspond with the slideshowGroup for the correct gallery
hs.addSlideshow({
	slideshowGroup: 'set_6',
	interval: 5000,
	repeat: false,
	useControls: true,
	fixedControls: 'fit',
	overlayOptions: {
		opacity: '0.75',
		position: 'bottom center',
		offsetX: '0',
		offsetY: '-15',
		hideOnMouseOut: true
	}
});

// Add the slideshow controller for gallery id set_5
hs.addSlideshow({
	slideshowGroup: 'set_5',
	interval: 5000,
	repeat: false,
	useControls: true,
	fixedControls: false,
	overlayOptions: {
		className: 'controls-in-heading',
		opacity: '0.75',
		position: 'top right',
		offsetX: '1',
		offsetY: '-22',
		hideOnMouseOut: false
	}
});

// Add the slideshow controller
hs.addSlideshow({
	slideshowGroup: 'set_4',
	interval: 5000,
	repeat: false,
	useControls: true,
	fixedControls: false,
	overlayOptions: {
		className: 'text-controls',
		opacity: '1',
		position: 'bottom center',
		offsetX: '0',
		offsetY: '-60',
		relativeTo: 'viewport',
		hideOnMouseOut: false
	},
	thumbstrip: {
		mode: 'horizontal',
		position: 'bottom center',
		relativeTo: 'viewport'
	}
});

/*
 * Read the given slideshowGroup and apply other config options. This is
 * only an adaptation to the NextGenGallery plugin, it should not be done this
 * way if you have control over the onclick.
 */
hs.Expander.prototype.onInit = function() {
	var groupConfig = config[this.slideshowGroup];
	// apply it to this expander
	hs.extend(this, groupConfig);
	if (this.slideshowGroup == 'set_4')hs.marginBottom = 105;
};

// configuration hash 
var config = {
	// Specific settings for gallery dark
	// The first line below ('set_1') must correspond with the slideshowGroup for the correct gallery
	'set_1': {
		wrapperClassName: 'dark',
		outlineType: 'glossy-dark',
		numberPosition: 'caption',
		dimmingOpacity: 0.75,
		 captionEval: 'this.thumb.alt'
	},
	// Specific settings for gallery vertical thumbstrip and text controls
	// The first line below ('set_3') must correspond with the slideshowGroup for the correct gallery
	'set_3': {
		wrapperClassName: 'borderless floating-caption',
		outlineType: 'drop-shadow',
		numberPosition: 'caption',
		dimmingOpacity: 0.75,
		captionEval: 'this.thumb.alt'
	},
	// Specific settings for gallery dark
	// The first line below ('set_1') must correspond with the slideshowGroup for the correct gallery
	'set_6': {
		captionEval: 'this.a.title',
		outlineType: 'rounded-white'
	},
	// Specific settings for gallery id set_5
	// The first line below ('set_5') must correspond with the slideshowGroup for the correct gallery
	'set_5': {
		numberPosition: 'heading',
		outlineType: 'custom-set_5',
		captionEval: 'this.thumb.alt',
		wrapperClassName: 'set_5'
        },
	// Specific settings for gallery id set_4
	// The first line below ('set_5') must correspond with the slideshowGroup for the correct gallery
	'set_4': {
		numberPosition: 'caption',
		outlineType: 'custom-set_4',
		dimmingOpacity: 0.75,
		useBox: true,
		width: 600,
		height: 401,
		captionEval: 'this.a.title',
		captionOverlay: { position: 'leftpanel' },
		headingEval: 'this.thumb.alt',
		wrapperClassName: 'set_4' }
};
