function liquid() {	
	positionBottomNav();
	box = $('photo');
	isoHoehe = document.documentElement.clientHeight;
	isoBreite = document.documentElement.clientWidth + 20;
	isoVerhaeltnis = isoBreite/isoHoehe;
	if(isoVerhaeltnis<=1.49){
		box.setStyle('width', isoHoehe*1.49);
		box.setStyle('height', isoHoehe);
	}else{
		box.setStyle('width', isoBreite);
		box.setStyle('height', isoBreite/1.49);
	}
}

function positionBottomNav(){
	$('containerBottomNav').setStyle('width', window.getWidth() + 88);
	contentHeight = $('contentTop').getStyle('margin-top').toInt() + $('content').getHeight();
	if ($('subcontentContainer')) { // Wenn dieser Container existiert, also nicht im Template gelöscht wurde
		subContentHeight = $('subcontentContainer').getStyle('margin-top').toInt() + $('subcontentContainer').getHeight();
		contentHeight > subContentHeight ? containerBottomTop = contentHeight  : containerBottomTop = subContentHeight;
	} else containerBottomTop = contentHeight;

	containerBottomTop += 40;
	if(containerBottomTop < 730){
		containerBottomTop = 730;
	}
	$('containerBottomNav').setStyle('top', containerBottomTop);
	$('containerBottomNav').setStyle('z-index', '1000');
	$('containerBottomNav').setStyle('visibility', 'visible');
}
	
function inIt () {
	$j('#photo').load(function(){ 
		liquid();
		if(!ie6){
			var myEffect = new Fx.Morph($('photo'), {delay: 2000, duration: '18000', transition: Fx.Transitions.linear});
			myEffect.start.delay(2000,myEffect, {
				'height': $('photo').getHeight() + 100, //Morphs the height from the current to 100px.
			    'width': $('photo').getWidth() + 67   //Morphs the width from the current to 300px.
			});
		}
	});	
}

function recalc () {
 	//if (Weite != window.getWidth() || Hoehe != window.getHeight() )
	liquid();
}

function shakeass(wachstH, wachstB){
	box = $('photo');
	wachstH = box.height + 100;
	wachstB = box.width + 67;	
	/*
	var fx = box.effects({duration: 9000, transition: Fx.Transitions.linear});
	fx.start.delay(2000,fx, {
		'width': wachstB,
		'height': wachstH
	})	
	*/
}

window.addEvent('domready', function() {
	Weite = window.getWidth() ;
	Hoehe = window.getHeight() ;
	inIt();	
	var myTimer = recalc.delay(2000);
});

window.addEvent('resize',function(e){
	Weite = window.getWidth() ;
	Hoehe = window.getHeight() ;
	recalc();
});

if (!window.Weite && window.innerWidth) {
  window.onresize = recalc;
  Weite = window.getWidth();
  Hoehe = window.getHeight();
}
