hs.graphicsDir = '/addbeheer/themes/addsite/images/highslide/';
hs.align = 'center';
hs.showCredits = false;
hs.transitions = ['expand', 'crossfade'];
hs.outlineType = 'rounded-white';
hs.fadeInOut = true;
hs.dimmingOpacity = 0.55;

hs.onSetClickEvent = function ( sender, e ) {
   // set the onclick for the element, output the group name to the caption for debugging
   e.element.onclick = function () {
		return hs.expand(this, { 
			slideshowGroup: this.parentNode.id
		 });
   }
   // return false to prevent the onclick being set once again
   return false;
}

function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp('(^|\\\\s)'+searchClass+'(\\\\s|$)');
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

window.onload = function(){
	var els = getElementsByClass('slidegroup');
	for (var i = 0; i < els.length; i++) 
	{
		slidegroup = els[i].id;

		hs.addSlideshow({
			slideshowGroup: slidegroup,
			autoplay: false,
			interval: 5000,
			repeat: true,
			useControls: true,
			fixedControls: true,
			overlayOptions: {
				opacity: .6,
				position: 'top center',
				hideOnMouseOut: true
			}
		});
	}
}

