hs.graphicsDir = '/img/u/highslide/';
hs.align = 'center';
hs.transitions = ['expand', 'crossfade'];
//hs.transitions = ['fade'];
hs.fadeInOut = true;
hs.outlineType = 'rounded-white';
hs.wrapperClassName = 'white';
hs.headingOverlay.position = "above";
hs.headingEval = 'this.a.title';
//hs.numberPosition = 'caption';
//hs.useBox = true;
//hs.width = 656;
//hs.height = 480;
hs.dimmingOpacity = 0.6;	
hs.showCredits = false;
hs.preserveContent = false;


// Add the slideshow providing the controlbar and the thumbstrip
/*
hs.addSlideshow({
	slideshowGroup: 'group1',
	interval: 5000,
	repeat: false,
	useControls: false,
	fixedControls: 'fit',
	overlayOptions: {
		position: 'bottom center',
		opacity: .75,
		hideOnMouseOut: true
	},
	thumbstrip: {
		position: 'below',
		mode: 'horizontal',
		relativeTo: 'expander'
	}
});
*/

hs.registerOverlay({
	thumbnailId: null,
	html: '<a href="#" onclick="return hs.close(this)" class="close-button">'+locale['close']+'</a>',
	position: 'top right',
	useOnHtml: true
});

hs.onDimmerClick = function() {
	return false;
}



/* controls */
function hideControl() {
	jQuery(".highslide-previous, .highslide-next").hide();
}

var str = '	<a href="#" onclick="hideControl(); return hs.previous(this)" title="'+locale['prev']+'" class="highslide-previous"><span>'+locale['prev']+'</span></a>';
str += '	<a href="#" onclick="hideControl(); return hs.next(this)" title="'+locale['next']+'" class="highslide-next"><span>'+locale['next']+'</span></a>';

hs.Expander.prototype.onAfterExpand = function(sender) {
	var h = jQuery(".controlbar").parent("div").parent("div").parent("div").css("height");
	var w = jQuery(".controlbar").parent("div").parent("div").parent("div").css("width");
	if (typeof((jQuery(".controlbar").parent("div").parent("div").attr("id"))) != "undefined") {
		if (((jQuery(".controlbar").parent("div").parent("div").attr("id")).indexOf("hsId")) == 0) {
			jQuery(".controlbar").parent("div").css( { "height" : h , "width" : w, "position" : "relative"} );
		}
	}
	jQuery(".highslide-previous, .highslide-next").fadeIn("200");
	//jQuery(".close-button").css("visibility", "visible");
}

hs.registerOverlay({
		thumbnailId: null,
		overlayId: 'controlbar',
		position: 'top left',
		hideOnMouseOut: false,
		html: '<div id="controlbar" class="controlbar">'+str+'</div>'
});

hs.Expander.prototype.onCreateOverlay = function (sender, e) {
	if (e.overlay.className.indexOf("highslide-heading") > -1) {
		e.overlay.style.backgroundImage = "url('/img/u/car-marks/hs/{headingIcon}"+jQuery(sender.a).attr('rel')+".png')";
	}
};

hs.Expander.prototype.onAfterGetHeading = function () {
	if (typeof(this.custom) != "undefined" && typeof(this.custom.headingIcon) != "undefined") {
		this.heading.style.backgroundImage = this.heading.style.backgroundImage.replace("{headingIcon}", this.custom.headingIcon);
	} else {
		this.heading.style.backgroundImage = this.heading.style.backgroundImage.replace("{headingIcon}", "");
	}
}
/*
hs.Expander.prototype.onBeforeClose = function (sender) {
   $(".close-button").css("visibility", "hidden");
}
*/
