fadeDur = 0.15 // Fade out duration
AppearDur = 0.15 // Fade in duration
SlideDur = 0.5 // Panel slide duration

Effect.OpenAndCloseModule = function(detectId,openId,expandId,closeId) {
detectId = $(detectId); // So we can detect if the panel is currently visible or not before we run the condition
openId = $(openId); // The element we click on to open a panel, in this case the plus icon
expandId = $(expandId); // The panel we want to expand
closeId = $(closeId); // The element we click on to close a panel, in this case the plus icon

if(detectId.visible(detectId))
	Effect.Fade(closeId,{duration:fadeDur,afterFinish: function(){Effect.SlideUp(expandId,{duration:SlideDur, afterFinish: function(){Effect.Appear(openId, {duration:AppearDur})}})}});
	else
	new Effect.Fade(openId,{duration:fadeDur,afterFinish: function(){new Effect.SlideDown(expandId,{duration:SlideDur, afterFinish: function(){new Effect.Appear(closeId, {duration:AppearDur})}})}});
}

printMe = function(){
	window.print();
	expose();
	
};


function expose(){
Effect.Appear('dummy',{duration:1.3,afterFinish: function(){apptitude()}});
}

Effect.Print = function(detectId,openId,expandId,closeId) {
detectId = $(detectId); // So we can detect if the panel is currently visible or not before we run the condition
openId = $(openId); // The element we click on to open a panel, in this case the plus icon
expandId = $(expandId); // The panel we want to expand
closeId = $(closeId); // The element we click on to close a panel, in this case the plus icon

if(detectId.visible(detectId))
	new Effect.Fade(openId,{duration:fadeDur,afterFinish: function(){new Effect.SlideDown(expandId,{duration:SlideDur, afterFinish: function(){new Effect.Appear(closeId, {duration:AppearDur})}})}});
	else
	new Effect.Fade(openId,{duration:fadeDur,afterFinish: function(){new Effect.SlideDown(expandId,{duration:SlideDur, afterFinish: function(){new Effect.Appear(closeId, {duration:AppearDur})}})}});
}

function rollOut(){
	Effect.Fade(open1,{duration:.15,afterFinish: function(){new Effect.SlideDown(stage1,{duration:.9, afterFinish: function(){new Effect.Appear(close1, {duration:.15})}})}});
	Effect.Fade(open2,{duration:.15,afterFinish: function(){new Effect.SlideDown(stage2,{duration:.9, afterFinish: function(){new Effect.Appear(close2, {duration:.15})}})}});
	Effect.Fade(open3,{duration:.15,afterFinish: function(){new Effect.SlideDown(stage3,{duration:.9, afterFinish: function(){new Effect.Appear(close3, {duration:.15})}})}});
	Effect.Fade(open4,{duration:.15,afterFinish: function(){new Effect.SlideDown(stage4,{duration:.9, afterFinish: function(){new Effect.Appear(close4, {duration:.15})}})}});
	Effect.Fade(open5,{duration:.15,afterFinish: function(){new Effect.SlideDown(stage5,{duration:.9, afterFinish: function(){new Effect.Appear(close5, {duration:.15})}})}});
	Effect.Fade(open6,{duration:.15,afterFinish: function(){new Effect.SlideDown(stage6,{duration:.9, afterFinish: function(){new Effect.Appear(close6, {duration:.15})}})}});
		Effect.Appear('dummy',{duration:1.2,afterFinish: function(){printMe()}});
};
	

function apptitude(){
	Effect.SlideRight('s27',{duration:Math.floor(Math.random()*4)+1});
	Effect.SlideRight('s28',{duration:Math.floor(Math.random()*4)+1});	
	Effect.SlideRight('s29',{duration:Math.floor(Math.random()*4)+1});	
	Effect.SlideRight('s33',{duration:Math.floor(Math.random()*4)+1});	
	Effect.SlideRight('s32',{duration:Math.floor(Math.random()*4)+1});	
	Effect.SlideRight('s1',{duration:Math.floor(Math.random()*4)+1});
	Effect.SlideRight('s2',{duration:Math.floor(Math.random()*4)+1});
	Effect.SlideRight('s3',{duration:Math.floor(Math.random()*4)+1});
	Effect.SlideRight('s4',{duration:Math.floor(Math.random()*4)+1});
	Effect.SlideRight('s5',{duration:Math.floor(Math.random()*4)+1});
	Effect.SlideRight('s6',{duration:Math.floor(Math.random()*4)+1});
	Effect.SlideRight('s7',{duration:Math.floor(Math.random()*4)+1});
	Effect.SlideRight('s8',{duration:Math.floor(Math.random()*4)+1});
	Effect.SlideRight('s9',{duration:Math.floor(Math.random()*4)+1});
	Effect.SlideRight('s11',{duration:Math.floor(Math.random()*4)+1});
	Effect.SlideRight('s13',{duration:Math.floor(Math.random()*4)+1});
	Effect.SlideRight('s14',{duration:Math.floor(Math.random()*4)+1});
	Effect.SlideRight('s15',{duration:Math.floor(Math.random()*4)+1});
	Effect.SlideRight('s17',{duration:Math.floor(Math.random()*4)+1});
	Effect.SlideRight('s18',{duration:Math.floor(Math.random()*4)+1});
	Effect.SlideRight('s19',{duration:Math.floor(Math.random()*4)+1});
	Effect.SlideRight('s20',{duration:Math.floor(Math.random()*4)+1});
	Effect.SlideRight('s21',{duration:Math.floor(Math.random()*4)+1});
	Effect.SlideRight('s22',{duration:Math.floor(Math.random()*4)+1});
	Effect.SlideRight('s23',{duration:Math.floor(Math.random()*3)+1});
	Effect.SlideRight('s24',{duration:Math.floor(Math.random()*3)+1});
	Effect.SlideRight('s25',{duration:Math.floor(Math.random()*3)+1});
	Effect.SlideRight('s26',{duration:Math.floor(Math.random()*3)+1});
	Effect.Appear('key');
};
