function openTopbarMenu(id) {
// Note: somehow, when opening, mouseout and mouseover events keep happening:
// as a result the opening 'hesitates'. We recalculate duration accordingly.
	var h=$(id).getStyle('height');
	h=(h?parseFloat(h):25);
	$(id).set('morph', {
		duration: Math.abs(170-h)/(170-25)*630,
		unit: 'px',
		fps: 15,
		transition: Fx.Transitions.Linear
	}).morph({
		height: [h, 170],
		'padding-top': 30
	});
}

function closeTopbarMenu(id) {  
	var h=$(id).getStyle('height');
	h=(h?parseFloat(h):25);
	$(id).set('morph', {
		duration: Math.abs(h-25)/(150-25)*630,
		unit: 'px',
		fps: 15,
		transition: Fx.Transitions.Linear
	}).morph({
		height: [h, 25],
		'padding-top': 0
	});
}

function startanimationPageimage(id) {
  $('pagecontents').set('morph', { transition: Fx.Transitions.Linear, duration: 1200});
  $('pagecontents').morph({ height: [0, 430] });
}

function openSidebarMenu(id,sidebarElement) {
	$(id).set('morph', { duration: '0'});
	$(id).morph({ width: [0, 150]});
	if (sidebarElement) {
		$(sidebarElement).set('morph', { duration: '0'});
		$(sidebarElement).morph({ width: [0, 150]});
		$(sidebarElement).fade('in');
	}
}

function closeSidebarMenu(id,sidebarElement) {  
	$(id).set('morph', { duration: '0'});
	$(id).morph({ width: [150, 0]});
	if (sidebarElement) {
		$(sidebarElement).set('morph', { duration: '0'});
		$(sidebarElement).morph({ width: [150, 0]});
		$(sidebarElement).fade('out');
	}
}

function initFlashMovies() {
	var flashvars = {
		wwwroot: wwwroot
	};
	var params = {
		wmode: 'transparent',
		quality: 'high',
		scale: 'noorder'
	};
	var attributes = {};
	swfobject.embedSWF(wwwroot+'/images/swf/standard.swf', 'backgroundFlash',
		'1000', '750', '9.0.0', false, flashvars, params, attributes);
	var flashvars2 = {
		wwwroot: '{wwwroot:j}/'
	};
	var params2 = {
		wmode: 'transparent',
		quality: 'high'
	};
	swfobject.embedSWF(wwwroot+'/images/swf/vogels01.swf', 'vogelsFlash',
		'720', '110', '9.0.0', false, flashvars2, params2, attributes);
	
	swfobject.embedSWF(wwwroot+'/images/swf/kippen_klein.swf', 'kippenkleinFlash',
		'335', '250', '9.0.0', false, flashvars2, params2, attributes);
}

