var contentMorph = '';

function initIsolation()
{
	if (top.location.href != window.location.href )	// check if we are inside of an iframe
	{
		var elementsToHide = ['topbar','navi', 'logobar'];
			
		elementsToHide.each(function(element){
			$(element).setStyle('display', 'none');
		});
	}
}

function hideContents()
{
	if (contentMorph == '')
		contentMorph = new Fx.Morph($('contents'), {});
		
	contentMorph.set({'opacity' : 0});
//	$('contents').setStyle('opacity', 0);
}
function unhideContents()
{
//	$try(top.$('iframe').tween('opacity', 1));
//	if (top.location.href.indexOf('home.php') > 0)
//	if (top.location.href != window.location.href )	// check if we are inside of an iframe
//		$try(top.$('iframe').tween('opacity', 1));
//	alert(top.location.href);

	if (contentMorph == '')
		contentMorph = new Fx.Morph($('contents'), {});

	setTimeout(function(){
							contentMorph.start({'opacity' : 1}).chain(function(){
																			   	if($defined($('fixedimg')))
																				{
																					var fixedimgMorph = new Fx.Morph($('fixedimg'), {});
																					fixedimgMorph.start({'opacity': 1});
																				}
																				if($defined($$('.ajaxlinks')))
																				{
																					$$('.ajaxlinks').each(function(element){
																							var naviMorph = new Fx.Morph(element, {});
																							naviMorph.start({'opacity':1});
																					   });
																				}
																			   });
						}, 250);
}

// window.addEvent('domready', initIsolation);

window.addEvent('domready', hideContents);
window.addEvent('load', unhideContents);