// People Scroller
window.addEvent('domready', function() {
	// js is enabled - hide the scroll bar.
	$('mousemove').setStyles('overflow:hidden; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0;');
	
	// initial location of scroller set to center on current profile
	var scroll = new Fx.Scroll('mousemove', {
		wait: false,
		duration: 0,
		offset: {'x': -200, 'y': 0}
	});
	var profileLocation = new String(document.location);
	var scrollElement = profileLocation.substring(profileLocation.indexOf("/people/")+8,profileLocation.indexOf(".shtml"));
	if ($(scrollElement)) {scroll.toElement(scrollElement);}
	
	// enable arrow image elements as scroller navigation elements
	var scroll1 = new Fx.Scroll('mousemove', {
		wait: false,
		duration: 500,
		offset: {'x': 0, 'y': 0},
		transition: Fx.Transitions.Quad.easeInOut
	});
	$('scroll-r').addEvent('click', function(event) {
		event = new Event(event).stop();
		var loc = $('mousemove').getSize();
		scroll1.scrollTo(loc['scroll']['x'].toInt()+450,0);
	});
	$('scroll-l').addEvent('click', function(event) {
		event = new Event(event).stop();
		var loc = $('mousemove').getSize();
		scroll1.scrollTo(loc['scroll']['x'].toInt()-450,0);
	});
	
	// create scroll feedback for mousing over faces
	var scroll2 = new Scroller('mousemove', {area: 250, velocity: 0.03});

	$('mousemove').addEvent('mouseenter', scroll2.start.bind(scroll2));
	$('mousemove').addEvent('mouseleave', scroll2.stop.bind(scroll2));
	
	// add tooltip quick info when mousing over faces
	var HoverInfo = new Tips($ES('img', 'mousemove'));
	
});