// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
function scrollOneUnitUp() {	
	//zoom all the way back if we're at the end
	if ($('testimonial-nav').offsetTop == (total_height - nav_unit_height) * -1) {
		var current_unit = 0;
		new Effect.MoveBy('testimonial-nav', total_height - nav_unit_height, 0, { duration: animation_duration, transition: Effect.Transitions.EaseFromTo	});
	} else {	
		var current_unit = (($('testimonial-nav').offsetTop / nav_unit_height) -1) * -1;
		new Effect.MoveBy('testimonial-nav', -1 * (visible_units * nav_unit_height), 0, { duration: animation_duration, transition: Effect.Transitions.EaseFromTo });
	}
}

function doSifr() {
	/* Replacement calls. Please see documentation for more information. */
	if(typeof sIFR == "function"){
		// This is the preferred "named argument" syntax
		//sIFR.replaceElement(named({sSelector:"#menu ul li span.active", sFlashSrc:"/flash/rotis.swf", sColor:"#003b82", sLinkColor:"#003b82", sBgColor:"#F3F4EE", nPaddingTop:0, nPaddingBottom:0}));
		//sIFR.replaceElement(named({sSelector:"#menu ul li span", sFlashSrc:"/flash/rotis.swf", sColor:"#2c2111", sLinkColor:"#2c2111", sBgColor:"#F3F4EE", nPaddingTop:0, nPaddingBottom:0}));
	};
}

function init() {
	nav_unit_height = 100;
	visible_units = 1;
	animation_duration = 0.5;
	total_units = $$('.testimonial').length;
	total_height = total_units * nav_unit_height;
	
	setInterval('scrollOneUnitUp()', 5000);
}
Event.observe(window, 'load', init);