// JavaScript Document

 
window.addEvent('domready', function(){
	var scroller = new Fx.Scroll('main_text1', {
		wait: false,
		duration: 5000,
		transition: Fx.Transitions.Quad.easeInOut,
		offset: {'x':0, 'y':0}
	});
	
	$('up').addEvent('click', function(event) {
		event = new Event(event).stop();
		//scroller.toElement('content1');
		scroller.toTop();
	});
	
	$('up').addEvent('mouseover', function(event) {
		event = new Event(event).stop();
		//scroller.toElement('content1');
		scroller.toTop();
	/*	
		var scrollPos = $('main_text1').getScroll();
		if(scrollPos.y== 0) {
			document.all.up_arrow.style.visibility='hidden';
			document.all.down_arrow.style.visibility='visible';
		}
		else {
			document.all.up_arrow.style.visibility='visible';
			document.all.down_arrow.style.visibility='visible';
		}
	*/
	});
	
	$('up').addEvent('mouseout', function(event) {
		scroller.cancel();
	/*
		var scrollPos = $('main_text1').getScroll();
		if(scrollPos.y== 0) document.all.up_arrow.style.visibility='hidden';
	*/
	});
	 
	$('down').addEvent('click', function(event) {
		event = new Event(event).stop();
		//scroller.toElement('content2');
		scroller.toBottom();
	});
	$('down').addEvent('mouseover', function(event) {
		event = new Event(event).stop();
		//scroller.toElement('content2');
		scroller.toBottom();
		/*
		var scrollCoords = $('main_text1').getCoordinates();
		var scrollPos = $('main_text1').getScroll();
		if(scrollPos.y>=scrollCoords.height) {
			document.all.up_arrow.style.visibility='visible';
			document.all.down_arrow.style.visibility='hidden';
		}	
		else {
			document.all.up_arrow.style.visibility='visible';
			document.all.down_arrow.style.visibility='visible';
		 }
		 */
	});
	
	$('down').addEvent('mouseout', function(event) {
		scroller.cancel();
		/*
		var scrollCoords = $('main_text1').getCoordinates();
		var scrollPos = $('main_text1').getScroll();
		if(scrollPos.y>=scrollCoords.height) document.all.down_arrow.style.visibility='hidden';
		*/
	});
	
});
 
