hs.showCredits = false;
hs.lang = {
   cssDirection:     'ltr',
   loadingText :     'Lade...',
   loadingTitle :    'Klick zum Abbrechen',
   focusTitle :      'Klick um nach vorn zu bringen',
   fullExpandTitle : 'Zur Originalgröße erweitern',
   fullExpandText :  'Vollbild',
   creditsText :     'Powered by <i>Highslide JS</i>',
   creditsTitle :    'Gehe zur Highslide JS Homepage',
   previousText :    'Voriges',
   previousTitle :   'Voriges (Pfeiltaste links)',
   nextText :        'Nächstes',
   nextTitle :       'Nächstes (Pfeiltaste rechts)',
   moveTitle :       'Verschieben',
   moveText :        'Verschieben',
   closeText :       'Schließen',
   closeTitle :      'Schließen (Esc)',
   resizeTitle :     'Größe wiederherstellen',
   playText :        'Abspielen',
   playTitle :       'Slideshow abspielen (Leertaste)',
   pauseText :       'Pause',
   pauseTitle :      'Pausiere Slideshow (Leertaste)',
   number :          'Bild %1/%2',
   restoreTitle :    'Klick um das Bild zu schließen, klick und ziehe um zu verschieben. Benutze Pfeiltasten für vor und zurück.'
};
hs.align = 'center';
hs.dimmingOpacity = 0.75;
hs.transitions = ['expand', 'crossfade'];
hs.captionEval = 'this.thumb.alt';
//hs.headingEval = 'this.a.title';
hs.wrapperClassName = 'highslide-white';
hs.spaceForCaption = 30;
hs.outlineType = 'rounded-white';

/*************************/
// A navigation bar in the top right
var controlbarRound = '<div class="controlbar"><a href="#" class="previous" onclick="return hs.previous(this)" title="Previous (left arrow key)"></a><a href="#" class="next" onclick="return hs.next(this)" title="Next (right arrow key)"></a><a href="#" class="highslide-move" onclick="return false" title="Click and drag to move"></a><a href="#" class="close" onclick="return hs.close(this)" title="Close"></a></div>';
var controlbarRoundOverlay = {
	thumbnailId: null,
	overlayId: 'controlbarRound',
	html: controlbarRound,
	position: 'top right',
	hideOnMouseOut: true
};
//hs.registerOverlay( controlbarRoundOverlay ); //defined for all hs.. we do this inline

var controlbarRoundCenter = '<div class="controlbar2"><a href="#" class="previous" onclick="return hs.previous(this)" title="Previous (left arrow key)"></a><a href="#" class="next" onclick="return hs.next(this)" title="Next (right arrow key)"></a><a href="#" class="highslide-move" onclick="return false" title="Click and drag to move"></a><a href="#" class="close" onclick="return hs.close(this)" title="Close"></a></div>';
var controlbarRoundCenterOverlay = {
	thumbnailId: null,
	overlayId: 'controlbarRoundCenter',
	html: controlbarRoundCenter,
	position: 'bottom center',
	hideOnMouseOut: true
};
//hs.registerOverlay( controlbarRoundCenterOverlay ); //defined for all hs.. we do this inline

// The simple semitransparent close button overlay
var closeButton = '<div class="closebutton"	onclick="return hs.close(this)" title="Close"></div>';
closeButtonOverlay = {
	thumbnailId: null,
	overlayId: 'closeButton',
	html: closeButton,
	position: 'top right',
	fade: 2 // fading the semi-transparent overlay looks bad in IE
};
//hs.registerOverlay( closeButtonOverlay ); //defined for all hs.. we do this inline

//a slideshow with navigation
var slideshowOverlay = {
		slideshowGroup: 'minigallery',
		interval: 5000,
		repeat: false,
		useControls: true,
		fixedControls: 'fit',
		overlayOptions: {
			opacity: .75,
			position: 'bottom center',
			hideOnMouseOut: true
		}
	};
hs.addSlideshow(slideshowOverlay);

//a gallery with thumbnails
var galleryOverlay = {
		slideshowGroup: 'gallery',
		interval: 5000,
		repeat: false,
		useControls: true,
		overlayOptions: {
			opacity: .75,
			position: 'bottom center',
			hideOnMouseOut: true
		},
		thumbstrip: {
			position: 'bottom center',
			mode: 'horizontal',
			relativeTo: 'viewport'
		}
	};
hs.addSlideshow(galleryOverlay);
/******************/
//this is our overlay if option is checked
var navigationOverlay = controlbarRoundOverlay; //overlay for an imageset
var navigationOverlaySingle = closeButtonOverlay; //overlay for an single image . f.instc the close-button


/********AJAX*****/
//var ajaxContentWrapper = '<div class="highslide-html-content" id="highslide-html-ajax" style="width: 700px;"><div style="height: 18px"><div class="controlbar5"><a href="#" class="previous" onclick="return hs.previous(this)" title="Previous (left arrow key)"></a><a href="#" class="next" onclick="return hs.next(this)" title="Next (right arrow key)"></a><a href="#" class="highslide-move" onclick="return false" title="Click and drag to move"></a><a href="#" class="close" onclick="return hs.close(this)" title="Close"></a></div></div><div class="highslide-body" style="padding: 0 10px 10px 10px"></div><div class="highslide-footer"><div><span class="highslide-resize" title="{hs.lang.resizeTitle}"><span></span></span></div>';
var ajaxContentWrapper = '<div class="highslide-html-content draggable-header" id="highslide-html" style="width: 700px;">';
ajaxContentWrapper += '		<div class="highslide-header">';
ajaxContentWrapper += '		<ul>';
ajaxContentWrapper += '			<li class="highslide-previous"><a onclick="return hs.previous(this)" title="Previous (arrow left)" href="#"><span>Previous</span></a></li>';
ajaxContentWrapper += '			<li class="highslide-next"><a onclick="return hs.next(this)" title="Next (arrow right)" href="#"><span>Next</span></a></li>';
ajaxContentWrapper += '			<li class="highslide-move"><a onclick="return false" title="Move" href="#"><span>Move</span></a></li>';
ajaxContentWrapper += '			<li class="highslide-close"><a onclick="return hs.close(this)" title="Close (esc)" href="#"><span>Close</span></a></li>';
ajaxContentWrapper += '		</ul>';
ajaxContentWrapper += '		</div>';
ajaxContentWrapper += '		<div class="highslide-body" style="padding: 0 10px 10px 10px"></div>';
ajaxContentWrapper += '		<div class="highslide-footer"><div>';
ajaxContentWrapper += '		<span class="highslide-resize" title="{hs.lang.resizeTitle}"><span></span></span>';
ajaxContentWrapper += '		</div>';


jQuery(document).ready( function() {

	jQuery('body').append( ajaxContentWrapper );

	//define ajax popups
	jQuery('a.highslide-ajax, a.ajax').bind(
		'click',
		function() {		
			var href = jQuery(this).attr('href');
			aa = href.split('?');
			href = aa[0] + '?type=1161&' + aa[1];
			hs.htmlExpand( null, { 
					contentId: 'highslide-html',
					wrapperClassName: 'titlebar',
					src: href, 
					objectType: 'ajax',
					preserveContent: true,
					cacheAjax: false,
					headingText: jQuery(this).attr('title')
				} );
			return false;
		}
	);
	
	//define iframe popups
	jQuery('a.iframe').bind(
		'click',
		function() {
			var href = jQuery(this).attr('href');
			aa = href.split('?');
			href = aa[0] + '?type=1162&' + aa[1];
			hs.htmlExpand( null, { 
					contentId: 'highslide-html',
					wrapperClassName: 'titlebar',
					src: href, 
					objectType: 'iframe',
					preserveContent: true,
					cacheAjax: false,
					headingText: jQuery(this).attr('title')
				} );
			return false;
		}
	);
	
	//its not possible to define ajax-links and highslide images , this will fix it
	jQuery("a[target='thePicture']").attr('onclick','');
	jQuery("a[target='thePicture']").each( function(element) {
		var href = jQuery(this).attr('href');
			aa = href.split('file=');
			aa2 = aa[1].split('&');
			href = unescape(aa2[0]);
			jQuery(this).attr('href',href);
			jQuery(this).attr('rel',href);
			jQuery(this).attr('class','highslide');
			jQuery(this).click( function() { return hs.expand( this ); } );
		} );	

	//no groups are possible with jquery - for images we use a inline-js
	/*	
	jQuery('a.highslide-image').bind(
		'click',
		function() {
			var href = jQuery(this).attr('href');
			var group = jQuery(this).attr('rel');
			return hs.expand( jQuery(this), { src: href, slideshowGroup: 'first-group' } );
		}
	);	
	*/

} ); 
