window.addEvent('domready', function() {

	/* set up scrolling fx for the why resaas content */
    var whySlider = new Fx.Scroll($('whySlider').getElement('div.window'),{
    	wheelStops:false,
    	link:'cancel',
    	transition: Fx.Transitions.Quart.easeInOut
    });
    
    /* scroll to first content page */
    whySlider.toElement($('p1'));
    
    /* set first sub nav tab to selected state */
    $('whySlider').getElement('ul.menu a.first').getParent().addClass('selected');
	
	/* create an array from the sub nav links */
    var subNav = $$('#whySlider ul.menu a');
    
    /* loop through sub nav array and add events to buttons */
    subNav.each(function(item,index){
    	item.addEvent('click',function(e){
    		e.preventDefault();
    		$$('#whySlider ul.menu li').removeClass('selected');
    		item.getParent().addClass('selected');
    		whySlider.toElement($('p'+(index+1)));
    	});
    });
    
    /* tool tips */
    var acronymTips = new Tips('acronym');
    acronymTips.addEvent('show', function(tip){
    	tip.fade('in');
    });
    acronymTips.addEvent('hide', function(tip){
    	tip.fade('show').fade('out');
    });
    
});