// Globale Parameter definieren
var globalVars=new Array();
var selector=new String();

if($.browser.msie && $.browser.version=='6.0')
{
	// Kein sIFR für den IE6
}
else
{
	// sIFR3: Initialisierung
	var marker={ src: '/assets/js/sifr3/fonts/sifr.swf' };
	sIFR.activate(marker);
	// sIFR3: Aktivierung Navigation
	sIFR.replace(marker, {
		selector: 'div.navigation span',
		transparent: true,
		selectable: false,
		css: [
			'.sIFR-root { leading: -2; color: #000000; font-size: 20px; cursor: pointer; }',
			'.sIFR-root a { color: #000000; text-decoration: none; }',
			'.sIFR-root a:hover { color: #000000; }',
			'.sIFR-root a:visited { color: #000000; }'
		],
		offsetTop: 5
	});
	// sIFR3: Aktivierung Meta-Navigation
	sIFR.replace(marker, {
		selector: 'div.meta_navigation li',
		transparent: true,
		selectable: false,
		css: [
			'.sIFR-root { leading: -2; color: #000000; font-size: 20px; cursor: pointer; }',
			'.sIFR-root a { color: #000000; text-decoration: none; }',
			'.sIFR-root a:hover { color: #000000; }',
			'.sIFR-root a:visited { color: #000000; }'	
		],
		offsetTop: 5
	});
	// sIFR3: Aktivierung Inhaltsüberschrift H3
	sIFR.replace(marker, {
		selector: 'div.main h3',
		transparent: true,
		css: [
			'.sIFR-root { leading: -2; color: #000000; font-size: 40px; }',
			'.sIFR-root a { color: #000000; text-decoration: none; }',
			'.sIFR-root a:hover { color: #000000; }',
			'.sIFR-root a:visited { color: #000000; }'
		],
		offsetTop: 5
	});
	// sIFR3: Aktivierung Inhaltsüberschrift H4
	sIFR.replace(marker, {
		selector: 'div.main h4',
		transparent: true,
		css: [
			'.sIFR-root { leading: -2; color: #000000; font-size: 25px; }',
			'.sIFR-root a { color: #000000; text-decoration: none; }',
			'.sIFR-root a:hover { color: #000000; }',
			'.sIFR-root a:visited { color: #000000; }'
		],
		offsetTop: 0
	});
}
$(document).ready(function() {
	
	//
	// DOM-Manipulationen Anfang
	//
	
		// Home-Link HTML: Auf Testseiten mit index.html anpassen
		$('a[href*='+window.location.protocol+'//'+window.location.hostname+'/]').click(function() { this.href=this.href+'index.php'; });
		
		// Navigation: Span-Tags ebenfalls klickbar machen
		$('div.navigation span').click(function(){
			window.location.href=$(this).find('a:first').attr('href');
		});
	
	//
	// DOM-Manipulationen Ende
	//
	
	
	//
	// jscrollpane Anfang
	//
		
		if($.browser.msie && $.browser.version=='6.0')
		{
			// Kein jScrollPane für den IE6
		}
		else
		{
			$('div.main div.content').jScrollPane({
				scrollbarWidth: 24,
				dragMinHeight: 80,
				dragMaxHeight: 80,
				showArrows: true
			});
		}
			
	//
	// jscrollpane Ende
	//
	
	
	//
	// jQuery-Tools Anfang
	//
	
		// Overlay-Initialisierung für Einzelbilder
		selector='div.content a.img_enlarge';
		if($(selector).length>0)
		{
			$('body').append('<div id="overlay_single" class="overlay"> <div class="info"></div> <img class="progress" src="assets/site/images/ajax-loader.gif"> </div>');
			$(selector).overlay({
				target: 'div#overlay_single',
				effect: 'default', // default | apple
				expose: {
					color: 'black',
					loadSpeed: 200,
					opacity: 0.7
				},
				speed: 200
			}).gallery({
				speed: 200,
				autohide: false,
				opacity: 0.7,
				template: '<p class="caption">${title}</p>'
			});
		}
	
		// Overlay-Initialisierung für Galerien
		selector='div.content p.img_list_box.img_enlarge a';
		if($(selector).length>0)
		{
			$('body').append('<div id="overlay_gallery" class="overlay"> <a class="prev"></a> <a class="next"></a> <div class="info"></div> <img class="progress" src="assets/site/images/ajax-loader.gif"> </div>');
			$(selector).overlay({
				target: 'div#overlay_gallery',
				effect: 'default', // default | apple
				expose: {
					color: 'black',
					loadSpeed: 200,
					opacity: 0.7
				},
				speed: 200
			}).gallery({
				speed: 200,
				autohide: false,
				opacity: 0.7,
				template: '<p class="caption">${title}</p> <p class="position">Bild ${index} von ${total}</p>'
			});
		}
		
	//
	// jQuery-Tools Ende
	//
	
	
	//
	// E-Mails entschlüsseln
	//
		$('a[href^=mailto:]').each(function() {
			this.href=this.href.split("?")[0].replace("ANTI[at]SPAMBOT", "@");
			$(this).html($(this).html().replace("TOBMAPS]ta[ITNA", "@"));
		});

});