<!--
if (window!= top) top.location.href = location.href;

var last_id = "slider1";
var last_hash = "";
var main_hash = "";

function showload() {
	$('#main').html('<img style="margin-top: 100px;" src="images/spinner.gif" alt="Warten" />');
}

function showResponse() {
	main_hash = location.hash.substring(1);
	last_id = "slider1";
	EnableJsEffects();
	my_slider();
}

function EnableJsEffects() {
	$('*[href]').each(function() {
		if($(this)[0].href != null && $(this)[0].target != '_blank') {
			$(this)[0].href = $(this)[0].href.split('?ebene=').join('#');
		}

		$(this).unbind('click');
  		$(this).click( function() {
  			if($(this)[0].href.match('#') && $(this)[0].target != '_blank') {
  				showload();

  				hash = $(this)[0].href;
  				hash = hash.split('#')[1];
  				last_hash = hash;
  				response_history = 0;
				
				$('#main').load("index.php?js=1&ebene=" + hash, null, showResponse);
			}
  		});
	});
	$(function() {  $('.lightbox').lightBox();  });
}


function my_slider() {
	$('DIV.drawer DIV:not(#slider1)').next().hide();

	$('DIV.drawer-handle').unbind('mouseover');
    $('DIV.drawer-handle').mouseover(function () {
    		if(last_id != this.id) {
        		$('DIV.drawer DIV.drawer-text').hide();
        		$(this).next().show();
        		last_id = this.id;
        }
    });
}

function newsletter_send() {
		function showNewsletterResponse() {
		}
		function showNewsletterLoad() {
				//document.getElementById('newsletter_input').value = 'Ihre E-Mailadresse';
				$('#newsletter').html('<img style="margin-top: 15px; margin-left: 110px; float: left;" src="images/spinner_small.gif" alt="Warten" />');
		}
		var input = document.getElementById('newsletter_input').value;
		$('#newsletter').load("newsletter.php?email=" + input.replace (/^\s+/, '').replace (/\s+$/, ''), null, showNewsletterResponse);
		showNewsletterLoad();
}

function loadGivenUrl() {
	hash = location.hash.substring(1);
	if(hash.length > 1 && last_hash != hash && main_hash != hash) {
		//alert(hash.length);
		last_hash = hash;
		showload();

		$('#main').load("index.php?js=1&ebene=" + hash, null, showResponse);
	}
}
$(document).ready(function(){
	//location.href = location.href.split('?ebene=').join('#');
	
	loadGivenUrl();
	EnableJsEffects();
	my_slider();

	// PRELOAD SPINNER
	Bild01 = new Image();
	Bild01.src = "images/spinner.gif";
	Bild02 = new Image();
	Bild02.src = "images/spinner_small.gif";
	
	
	window.setInterval("loadGivenUrl()", 200);
	
 });