/**
 * Highslide configuration with galery.
 * 
 * For more information see: http://www.sylinx.de/
 * 
 * @author Lothar Jenisch <info@sylinx.de>
 * @version $Id: highslide.cfg.js 3943 2011-06-15 14:40:07Z lothar $
 * @package SyShop
 */

// 53c148af8cb1d36a03ee302eca8df8f2
hs.graphicsDir = 'highslide/graphics/';
hs.showCredits = false;
hs.align = 'center';
hs.transitions = [ 'expand', 'crossfade' ];
hs.outlineType = 'rounded-white';
hs.fadeInOut = true;
hs.numberPosition = 'caption';
hs.wrapperClassName = 'draggable-header';
hs.dimmingOpacity = 0.50;
hs.width = 650;

// Prevent clicking the background
hs.onDimmerClick = function() {
	return false;
};

// Add the controlbar
if (hs.addSlideshow)
	hs.addSlideshow({
		slideshowGroup : [ 'image', 'text' ],
		interval : 5000,
		repeat : false,
		useControls : true,
		fixedControls : 'fit',
		overlayOptions : {
			opacity : .75,
			position : 'bottom center',
			hideOnMouseOut : true
		}
	});

// add another controlbar
// if (hs.addSlideshow) hs.addSlideshow({
// slideshowGroup: 'group1',
// interval: 5000,
// repeat: false,
// useControls: true,
// fixedControls: 'fit',
// overlayOptions: {
// opacity: .100,
// position: 'bottom center',
// hideOnMouseOut: true
// }
// });

// close on mouse out
hs.Expander.prototype.onMouseOut = function(sender) {
	if (sender.a.rel == 'highslide_mouseover') {
		sender.close();
	}
};

// hs.Expander.prototype.onAfterExpand = function(sender) {
// if (!sender.mouseIsOver) {
// // console.log('onAfterExpand');
// sender.close();
// }
// };

hs.onSetClickEvent = function(sender, e) {
	// return false to prevent the onclick being set once again
	return false;
};

/**
 * Zoom
 */
var hsOpenPreview = function() {
	return hs.expand(this, {
		// anchor : 'bottom left',
		align : 'auto',
		// align : 'bottom left',
		dimmingOpacity : 0.0,
		numberPosition : null,
		ooutlineType : null
	});
};

/**
 * Set events
 */
hs.isUnobtrusiveAnchor = function(el) {
	// check if rel starts with 'highslide'
	if (el.rel.substr(0, 9) == 'highslide') {
		var event = el.rel.substr(10);
		if (event == 'click') {
			el.onclick = hsOpenPreview;
		} else if (event == 'mouseover') {
			el.onmouseover = hsOpenPreview;
		} else {
			return '';
		}
		//el.className = 'highslide'; // for the zoom-in cursor
		return 'image';
	}
	return '';
};

