hs.graphicsDir = '/edee/content/sysutf/pol/img/highslide/';
hs.transitions = ['expand', 'crossfade'];
hs.objectLoadTime = 'before'; // Load iframes 'before' or 'after' expansion.
hs.outlineType = 'white-blue';
hs.align = 'center';
hs.dimmingOpacity = 0.5;

// credits off
hs.showCredits = false;
hs.creditsHref = '';
hs.lang.creditsText = '';
hs.lang.creditsTitle = '';
hs.marginBottom = 30;
hs.marginTop = 55;

if (hs.registerOverlay) {
	hs.registerOverlay({
		fade: 2,
		hideOnMouseOut: false,
		html: '<div class="closebutton" onclick="return hs.close(this)" title="Blisko"></div>',
		position: 'top right',
		useOnHtml: true,
		offsetX: 20,
		offsetY: -20
	});
}

hs.Expander.prototype.onAfterGetHeading = function (sender) {
	if (sender.custom && sender.custom.headingFromH2) {
		var parentDiv = $(sender.custom.senderObject).parents("div:first");
		sender.heading.innerHTML = $("h2", parentDiv).text();
	} else if (sender.custom && sender.custom.headingNoChange) {
		return true;
	} else {
		sender.heading.innerHTML = "&nbsp;";
	}
};

hs.Expander.prototype.onBeforeExpand = function (sender) {

	//jen pro obrazky
	if (sender.a.className.indexOf("hs-htmlExpand") < 0) {
	
		// dynamicka navigace mezi fotkami
		// vytvoření elementu vrstvy a naplnění obsahem
			var arrowLeft = document.createElement('div');
			arrowLeft.className = "controlbar disabled";
			arrowLeft.innerHTML = '<a href="#" onclick="return hs.previous(this)" title="Poprzednie (strzałka w lewo)" class="previous"><span class="hidden">Poprzednie (strzałka w lewo)</span></a>';

			var arrowRight = document.createElement('div');
			arrowRight.className = "controlbar disabled";
			arrowRight.innerHTML = '<a href="#" onclick="return hs.next(this)" title="Następne (strzałka w prawo)" class="next"><span class="hidden">Następne (strzałka w prawo)</span></a>';

			// kontrola, zda existuje předchozí obrázek
			if(sender.getAdjacentAnchor(-1)){
				arrowLeft.className = "controlbar";
			}
			// kontrola, zda existuje následující obrázek
			if(sender.getAdjacentAnchor(1)){
				arrowRight.className = "controlbar";
			}
			// samotné přiřazení vrstvy
			if (arrowLeft.innerHTML != "") {
				sender.createOverlay( { overlayId: arrowLeft, position: "middle left", hideOnMouseOut: true, opacity: 1, width: 'auto', fade: 2 } );
			}
			if (arrowRight.innerHTML != "") {
				sender.createOverlay( { overlayId: arrowRight, position: "middle right", hideOnMouseOut: true, opacity: 1, width: 'auto', fade: 2 } );
			}
	}
};
hs.lang= {
	restoreTitle: 'Kliknij w obrazek, aby zamknąć.Kliknij i przeciągnij, aby przenieść plik. Aby przejść do poprzedniego / następnego obrazu, należy użyć strzałek.',
	loadingText: 'Ładowanie...',
	previousText: 'Poprzednie',
	nextText: 'Następne',
	moveText: 'Přesunout',
	closeText: 'Blisko',
	closeTitle: 'Blisko [ESC]',
	previousTitle: 'Poprzednie [strzałka w lewo]',
	nextTitle: 'Następne [strzałka w prawo]'
};
