hs.align = 'center';
hs.restoreCursor = '';
hs.transitions = ['expand', 'crossfade'];
hs.fadeInOut = true;
hs.dimmingOpacity = 0.6;
hs.outlineType = 'rounded-white';
hs.showCredits = false;
hs.nextText = 'Neste';
hs.previousText = 'Forrige';
hs.captionEval = 'this.a.title';
hs.restoreTitle = '';
hs.previousTitle = '';
hs.nextTitle = '';

var addedSlideshows = [];

// Add the slideshow providing the controlbar and the thumbstrip
hs.Expander.prototype.doFullExpand = function() {
	window.open(this.src);
	return false;
}

hs.Expander.prototype.onAfterExpand = function(sender){
	if(sender.slideshowGroup === undefined || sender.slideshowGroup == null){ //not images (iframe etc..)
	    var height = sender.height;
	    var width = sender.width;
	    if(navigator.appVersion.indexOf("MSIE 7.0") > 0){
	    	height += 15;
	    	width +=5;
	    }
	    sender.resizeTo(width, height);
	}
}

//Only want to add slideshow for images
hs.Expander.prototype.onInit = function (sender) {
	if(sender.slideshowGroup === undefined || sender.slideshowGroup == null){ //not images (iframe etc..)
		hs.allowSizeReduction = false;
		hs.marginTop = 25;
		hs.marginBottom = 25;
		hs.outlineType = 'custom';
		hs.useBox = true;
		hs.width = sender.width;
		hs.height = sender.height;
		hs.maxWidth = sender.width;
		hs.maxHeight = sender.height;			
	}else if(!addedSlideshows[sender.slideshowGroup]){ //images
		//Avoid creating same slideshow more than once (generating multiple arrows)
		addedSlideshows[sender.slideshowGroup] = true;
		hs.marginBottom = 120;
		hs.addSlideshow({
			slideshowGroup: sender.slideshowGroup,
			interval: 5000,
			repeat: true,
			useControls: true,
			overlayOptions: {
				opacity: '0.7',
				position: 'bottom center',
				offsetX: '0',
				offsetY: '-50',
				relativeTo: 'viewport',
				hideOnMouseOut: false
			},
			thumbstrip: {
				position: 'bottom center',
				mode: 'horizontal',
				relativeTo: 'viewport'
			}
		});
	}
	return true;
}

hs.registerOverlay({
	html: '<div class="closebutton" onclick="return hs.close(this)" title="Close"></div>',
	position: 'top right',
	useOnHtml: true,
	fade: 2 // fading the semi-transparent overlay looks bad in IE
});


var config1 = {
	transitions: ['expand', 'crossfade']
};

hs.Expander.prototype.onImageClick = function (sender) {
   hs.next();
   return false;
}
