var pictureIsShown = false;
function initPage(){
	correctPNG();
	if($('aboutImageLink') != null)	$('aboutImageLink').onclick = showThePicture;
	if($('closeImageLink') != null)	$('closeImageLink').onclick = hideThePicture;
	
	if($('picturePanel') != null) $('picturePanel').hide();
}

function showThePicture(){
	if(!pictureIsShown){
		pictureIsShown = true;
		$('aboutImage').hide();
		Effect.Fade('horizontalPicture', {afterFinish:showThePictureStep2});
	}
	
	return false;
}

function showThePictureStep2(){
	new Effect.Scale('headerImage', 412, {scaleX:false,afterFinish:showThePictureStep3});
}

function showThePictureStep3(){
	//$('picturePanel').style.display = "block";
	Effect.Appear('picturePanel');
}

function hideThePicture(){
	if(pictureIsShown){
		pictureIsShown = false;
		Effect.Fade('picturePanel', {afterFinish:hideThePictureStep2});
	}
	return false;
}

function hideThePictureStep2(){
	new Effect.Scale('headerImage', 24, {scaleX:false,afterFinish:hideThePictureStep3});
}

function hideThePictureStep3(){
	$('headerImage').style.height = "95px";
	Effect.Appear('horizontalPicture');
	$('aboutImage').show();
}

addLoadEvent(initPage);

