/**
 * @author Peter Swan
 */
Event.observe(document, 'dom:loaded', function(){
	$$('a.scroll-to').each(function(a){
		var id = a.readAttribute('href').split('#').pop();
		var options = {
			duration: 0.5,
			transition: Effect.Transitions.sinoidal
		}
		if( !id ){
			a.observe('click', function(e){
				e.stop();
				PSWrap.WindowScrollManager.scrollTo(Object.extend(options, {
					x: 0,
					y: 0
				}));
			});
		}else{
			var elm = $(id);
			if( elm ){
				a.observe('click', function(e){
					e.stop();
					PSWrap.WindowScrollManager.scrollToElement(elm, options);
				});
			}
		}
	});
});
