function squeeze()
{
	var ankerauslesen = location.href.split('#')[1];
	
	/* var windowheight = window.innerHeight;
	var windowwidth = window.innerWidth; */
	
	var windowheight = document.documentElement.clientHeight;
	var windowwidth = document.documentElement.clientWidth;
	
	var zehnprozent = Math.round(windowwidth/10);
	
	var contentwidth = (windowwidth-zehnprozent);
	var differenz = windowwidth-contentwidth;
	
	// schriftgröße und navigation anpassen
	
	var ofontsize = 14;
	var ofontlineheight = 19;

	var minwidth = 970;
	var minheight = 540;
	var maxwidth = 1800;
	
	var maxfontsize = 20;
	var maxfontlineheight = 25;
	
	var prozentfontsize = contentwidth/970;
	var varfontsize = Math.round((prozentfontsize)*ofontsize);
	var varfontlineheight = Math.round((prozentfontsize)*ofontlineheight);
	
	var imggroesse;
	
	// $('konsequent').style.width = $('htmlswitcher').offsetWidth+"px";
	
	// horizontaler slider
	
	if ( $('horizontalslider_container') == "[object HTMLDivElement]" || $('horizontalslider_container') == "[object]")
	{
		
		var fadecontainer = new Fx.Morph($('horizontalslider_container'), {duration: 5000, transition: Fx.Transitions.Expo.easeInOut, onComplete: function(){ }});
		fadecontainer.start({ 'opacity': 100 });
		
		var horizontalsliderwidth = windowwidth;
		var anzahlcontainer = 10;
		
		
		if ( contentwidth > minwidth )
		{
			var horizontalsliderheight = Math.floor(windowwidth/2.73);		// höhe ermitteln und abrunden
			var horizontalsliderwidth = contentwidth;
		}
		else
		{
			var horizontalsliderheight = Math.floor(minwidth/2.73);		// höhe ermitteln und abrunden
			var horizontalsliderwidth = minwidth;
		}
		
		
		if ( contentwidth > 1800 )
		{
			var horizontalsliderwidth = 1800;
		}
		
		$('horizontalslider_container').style.height = horizontalsliderheight+"px";
		$('horizontalslider_complete_container').style.width = (windowwidth*anzahlcontainer)+"px";
		// $$('.horizontalslider_point')[0].style.width = horizontalsliderwidth+"px";
		
		for ( var navirechtsii = 0; navirechtsii < $$('.horizontalslider_point').length; navirechtsii++ )
			{
				$$('.horizontalslider_point')[navirechtsii].style.width = horizontalsliderwidth+"px";
			}
		
		for ( var horizontalsliderimgi = 0; horizontalsliderimgi < $$('div#horizontalslider_complete_container img').length; horizontalsliderimgi++ )
		{
			$$('div#horizontalslider_complete_container img')[horizontalsliderimgi].style.width = horizontalsliderwidth+"px";
		}
		
		// cursor ändern
		
		function cursorchangeover()
		{
			$$('body')[0].style.cursor = "pointer";
		}
		
		function cursorchangeout()
		{
			$$('body')[0].style.cursor = "default";
		}
		
		if ( $$('.navi_rechts')[0] == "[object HTMLDivElement]" || $$('.navi_rechts')[0] == "[object]" )
		{
			for ( var navirechtsi = 0; navirechtsi < $$('.navi_rechts').length; navirechtsi++ )
			{
				$$('.navi_rechts')[navirechtsi].onmouseover = cursorchangeover;
				$$('.navi_rechts')[navirechtsi].onmouseout = cursorchangeout;
			}
		}
		
		if ( $$('.navi_links')[0] == "[object HTMLDivElement]" || $$('.navi_links')[0] == "[object]" )
		{
			for ( var navilinksi = 0; navilinksi < $$('.navi_links').length; navilinksi++ )
			{
				$$('.navi_links')[navilinksi].onmouseover = cursorchangeover;
				$$('.navi_links')[navilinksi].onmouseout = cursorchangeout;
			}
		}
		 
	}
		
	// if ( contentwidth > minwidth && contentwidth <= maxwidth ) 
	if ( contentwidth > minwidth && windowheight > minheight ) 
	{ 
		if ( varfontsize < maxfontsize ) { $$('body')[0].style.fontSize = varfontsize+"px"; $$('body')[0].style.lineHeight = varfontlineheight+"px"; }
		if ( varfontsize > maxfontsize ) { $$('body')[0].style.fontSize = maxfontsize+"px"; $$('body')[0].style.lineHeight = maxfontlineheight+"px"; }
		$('navigation').style.height = Math.ceil(prozentfontsize*136)+"px";
		
		$('logo').style.height = Math.ceil(prozentfontsize*150)+"px";
		$('eniso_logo').style.width = Math.ceil(prozentfontsize*220)+"px";
		$('eniso_logo').style.height = Math.ceil(prozentfontsize*150)+"px";
				
		$('eniso_holder').style.width = (windowwidth-zehnprozent)+"px";
		$('content').style.width = (windowwidth-zehnprozent)+"px";
		
	}
	if ( contentwidth > minheight && contentwidth > minwidth ) 
	{
		$('eniso_holder').style.width = (windowwidth-zehnprozent)+"px";
		$('content').style.width = (windowwidth-zehnprozent)+"px";
		$$('body')[0].style.fontSize = varfontsize+"px";
		$$('body')[0].style.lineHeight = varfontlineheight+"px";
		
		$('navigation').style.height = Math.ceil(prozentfontsize*136)+"px";
		$('logo').style.height = Math.ceil(prozentfontsize*150)+"px";
		$('eniso_logo').style.width = Math.ceil(prozentfontsize*220)+"px";
		$('eniso_logo').style.height = Math.ceil(prozentfontsize*150)+"px";
		
		for ( bodyimgi = 0; bodyimgi < $$('body img').length; bodyimgi++ )
		{
			if ( $$('body img')[bodyimgi].get('class') == 'menuimg' ) 
			{
				$$('body img')[bodyimgi].setAttribute("width", Math.ceil(163*prozentfontsize));
				$$('body img')[bodyimgi].setAttribute("height", Math.ceil(24*prozentfontsize));
			}
		}	
			
		if ( $$('.navi_rechts')[0] == "[object HTMLDivElement]" || $$('.navi_rechts')[0] == "[object]" )
		{
			$$('.navi_rechts')[0].style.width = 404+"px";
			$$('.navi_rechts')[0].style.height = 22+"px";
		}
		
		if ( $$('.navi_links')[0] == "[object HTMLDivElement]" || $$('.navi_links')[0] == "[object]" )
		{
			$$('.navi_links')[0].style.width = 404+"px";
			$$('.navi_links')[0].style.height = 22+"px";
		}
	}
	if ( contentwidth < minwidth ) 
	{
		$$('body')[0].style.fontSize = ofontsize+"px";
		$$('body')[0].style.lineHeight = ofontlineheight+"px";
		
		$('eniso_holder').style.width = 970+"px";
		$('content').style.width = 970+"px";
		
		$('navigation').style.height = Math.ceil(prozentfontsize*136)+"px";
		// $('logo').style.height = Math.ceil(prozentfontsize*150)+"px";
		// $('eniso_logo').style.width = Math.ceil(prozentfontsize*220)+"px";
		// $('eniso_logo').style.height = Math.ceil(prozentfontsize*150)+"px";
	}
	if ( contentwidth > 1800 ) 
	{
		var prozentbeimaxwidth = (1800)/970;
		
		$$('body')[0].style.fontSize = (ofontsize*prozentbeimaxwidth)+"px";
		$$('body')[0].style.lineHeight = (ofontlineheight*prozentbeimaxwidth)+"px";
		
		$('eniso_holder').style.width = (1800)+"px";
		$('content').style.width = (1800)+"px";
		
		//$$('.navi_rechts')[0].style.width = 40+"%";
		//$$('.navi_rechts')[0].style.height = (22*1.4)+"px";
		
		for ( var test = 0; test < $$('.navi_rechts').length; test++ )
		{
			$$('.navi_rechts')[test].style.height = (22*1.4)+"px";
			$$('.navi_links')[test].style.height = (22*1.4)+"px";
		}
		
		//alert($$('.navi_rechts').length);
		
		//$$('.navi_links')[0].style.width = 40+"%";
		//$$('.navi_links')[0].style.height = (22*1.4)+"px";
		
		//$$('.navi_links')[0].style.fontSize = 80+"%";
		
		//alert($$('.navi_rechts')[0].innerWidth);
		
		$('navigation').style.height = Math.ceil((prozentbeimaxwidth*136))+"px";
		$('logo').style.height = Math.ceil((prozentbeimaxwidth*150))+"px";
		$('eniso_logo').style.width = Math.ceil((prozentbeimaxwidth*220))+"px";
		$('eniso_logo').style.height = Math.ceil((prozentbeimaxwidth*150))+"px";
		
		/*for ( bodyimgi = 1; bodyimgi < $$('body img').length; bodyimgi++ )
		{
			if ( $$('body img')[bodyimgi].get('class') == 'menuimg'  ) $$('body img')[bodyimgi].style.width = Math.ceil(163*prozentbeimaxwidth)+"px";
			if ( $$('body img')[bodyimgi].get('class') == 'menuimg' ) $$('body img')[bodyimgi].style.height = Math.ceil(24*prozentbeimaxwidth)+"px";
		} */
		
	}
	
	var navigationsheight = 130;
	var navigationsheight = $('navigation').clientHeight;
	var logoheight = 200;
	var logoheight = $('navigation').clientHeight;
	
	var flashheight = windowheight - navigationsheight - logoheight - 20;
				
	if ( flashheight > 230 )
	{
		$('flash2').style.height = flashheight+"px";
		$('flash2').style.padding = 10+"px";
		$('eniso_flash').setAttribute("height", flashheight);
		$('eniso_flash').setAttribute("width", (windowwidth-zehnprozent)-19);
		$('eniso_flash').style.width = (windowwidth-zehnprozent)-19+"px";
		$('eniso_flash').style.height = flashheight+"px";
		austauschen('flash');
	}
	else
	{
		$('flash2').style.height = "230px";
		$('flash2').style.padding = 10+"px";
		$('eniso_flash').setAttribute("height", flashheight);
		$('eniso_flash').setAttribute("width", (windowwidth-zehnprozent)-19);
		$('eniso_flash').style.width = (windowwidth-zehnprozent)-19+"px";
		$('eniso_flash').style.height = flashheight+"px";
		austauschen('flash');
	}
				
	if ( ankerauslesen == "html" ) 
	{
		$('flash2').style.height = 0;
		$('flash2').style.padding = 0;
		
		austauschen('html');

	}
		
	// ausrechnen des formats
	
	var formatbreite = 16;
	var formathoehe = 9;
	
	var ausgangbreite = 1280;
	var ausganghoehe = 720;
	
	// url auslesen, anker erkennen und den content nach oben verschieben

	// movecontenttotop(ankerauslesen);
	// austauschen(ankerauslesen);
}

function movecontenttotop(anker)
{
	
	var windowheight = document.documentElement.clientHeight;
			
	var navigationsheight = 136;
	var navigationsheight = $('navigation').clientHeight;
	var logoheight = 200;
	var logoheight = $('navigation').clientHeight;
	
	var flashheight = windowheight - navigationsheight - logoheight - 20;
	
	var ankerauslesen = location.href.split('#')[1];
	
	if ( anker == "html" )
	{
		austauschen('html');
		
		var flashheight2 = new Fx.Morph($('flash2'), {duration: 1000, transition: Fx.Transitions.Expo.easeOut, onComplete: function(){ }});
		flashheight2.start({ 'height': [$('flash2').clientHeight, 0] });
		$('flash2').style.padding = 0+"px";
		
		$('eniso_flash').setAttribute("height", 0);
		$('eniso_flash').style.height = 0+"px";
	
		$$('div#htmlswitcher .flashactive').set('class', 'flash');
		$$('div#htmlswitcher .information').set('class', 'informationactive');
		
		for ( var lihauptmenui = 0; lihauptmenui < $$('li.hauptmenu').length; lihauptmenui++ )
		{
			$$('li.hauptmenu')[lihauptmenui].set('onclick', "movecontenttotop('html')");
			
			getlink = $$('li.hauptmenu')[lihauptmenui].firstChild.get("href");
			getlink2 = getlink.split("#");
			
			$$('li.hauptmenu')[lihauptmenui].firstChild.set('href', getlink2[0]+"#html");
		}
				
	}
	if ( anker == "flash" )
	{		
		austauschen('flash');
		
		$('flash2').style.padding = 10+"px";
		var flashheight2 = new Fx.Morph($('flash2'), {duration: 1000, transition: Fx.Transitions.Expo.easeOut, onComplete: function(){ }});
		flashheight2.start({ 'height': [$('flash2').clientHeight, flashheight+"px"] });
		
		$('eniso_flash').setAttribute("height", flashheight);
		$('eniso_flash').style.height = flashheight+"px";
		
		$$('div#htmlswitcher .flash').set('class', 'flashactive');
		$$('div#htmlswitcher .informationactive').set('class', 'information');
		
		for ( var lihauptmenui = 0; lihauptmenui < $$('li.hauptmenu').length; lihauptmenui++ )
		{
			$$('li.hauptmenu')[lihauptmenui].set('onclick', "movecontenttotop('flash')");
			
			getlink = $$('li.hauptmenu')[lihauptmenui].firstChild.get("href");
			getlink2 = getlink.split("#");
			
			$$('li.hauptmenu')[lihauptmenui].firstChild.set('href', getlink2[0]+"#flash");
		}
		
	} 
}

function smoothscrolling()
{

	$('ausgabe').innerHTML = $('navigation').scrollTop;

}

function highlightleftmenu(section)
{
	var sectionkl = section.toLowerCase();
	var sectiongr = section.toUpperCase();
		
	$('menu_'+sectionkl).src = "inc/mainmenu_pics_halfactive.php?mainmenutext="+sectiongr;
	
}

stepsi = 0;

function movehorizontalslider(direction)
{


	var steps = $$('.horizontalslider_point')[stepsi].clientWidth;
	var position = $('horizontalslider_complete_container').offsetLeft;
						
	var nachrechts = "";
	var nachlinks = "";
	
		
	if ( direction == "start" )	
	{
		nachrechts = new Fx.Morph($('horizontalslider_complete_container'), {duration: 900, transition: Fx.Transitions.linear.easeOut, onComplete: function(){ }});
		nachrechts.start({ 'left': 0+"px" });
	}
		
	if ( direction == "rechts" )	
	{
		stepsi++;
	
		/* nachrechts = new Fx.Morph($('horizontalslider_complete_container'), {duration: 900, transition: Fx.Transitions.linear.easeOut, onComplete: function(){ }});
		nachrechts.start({ 'left': (position)-steps+"px" }); */
		
		$$('.horizontalslider_point')[stepsi-1].fade(0);
		$$('.horizontalslider_point')[stepsi].fade(1);
		
	}
	
	if ( direction == "links" )	
	{
		stepsi--;
			
		/* nachlinks = new Fx.Morph($('horizontalslider_complete_container'), {duration: 900, transition: Fx.Transitions.linear.easeOut, onComplete: function(){ }});
		nachlinks.start({ 'left': (position)+steps+"px" }); */
		
		$$('.horizontalslider_point')[stepsi+1].fade(0);
		$$('.horizontalslider_point')[stepsi].fade(1);
	}
	
		positionnew = stepsi*steps;
		
		nachlinks = new Fx.Morph($('horizontalslider_complete_container'), {duration: 900, transition: Fx.Transitions.linear.easeOut, onComplete: function(){ }});
		nachlinks.start({ 'left': -(positionnew)+"px" });

	
}

window.addEvent('domready',function() { 
	//smooooooth scrolling enabled
	new SmoothScroll({ duration:500,  transition: Fx.Transitions.Quint.easeInOut }, window); //700 milliseconds to get there 
		
	// DYNAMISCHE EINTEILUNG DER WEBSEITE
	squeeze();
	window.onresize = squeeze;
	
	if ( $('horizontalslider_container') == "[object HTMLDivElement]" || $('horizontalslider_container') == "[object]" )
	{
		movehorizontalslider("start");
	}
});
