var currentPage = 1;
var pageHeight = 176;
var totalPage = 1;
var scrolling = false;

function init() {
	var contentHeight = $('solution_content').offsetHeight;
	totalPage = Math.ceil(contentHeight/pageHeight)
}

function MoveDown() {
	if(!scrolling) {
		if(currentPage < totalPage) {
			new Effect.Move('solution_content', 
			{x:0, 
			y:-pageHeight, 
			mode: 'relative', 
			transition: Effect.Transitions.sinoidal, 
			beforeStart: function() { scrolling=true; },
			afterFinish: function() { scrolling=false; }
			});
			currentPage++;
		}
	}
}

function MoveUp() {
	if(!scrolling) {
		if(currentPage > 1) {
			new Effect.Move('solution_content', 
			{x:0, 
			y:pageHeight, 
			mode: 'relative', 
			transition: Effect.Transitions.sinoidal, 
			beforeStart: function() { scrolling=true; },
			afterFinish: function() { scrolling=false; }
			});

			currentPage--;
		}
	}
}

function showVideo() {
	new Effect.Parallel(
		[ 
		 	new Effect.Opacity('videoPlayer', { duration:10, from: 0, to:1 }),
		 	new Effect.BlindDown('videoPlayer', { duration: 2.5})]
	);
}

function hideVideo() {
	new Effect.Parallel(
		[ 
			new Effect.Opacity('videoPlayer', { duration: 10, from: 1.0, to: 0 }),
			new Effect.BlindUp('videoPlayer', { duration: 2.5})]
	);
}


