/*----------------------------------------------------------
	
	Class Campus
	Description:
		This class controlls all of the Ajax elements on
		the campus pages.	
	
----------------------------------------------------------*/

var Campus = new Class({

	/*------------------------------------------------------
		initialize()
		
		This method loads all of the various animations and
		AJAX requests that are used on the campus site.
	------------------------------------------------------*/
	initialize: function() {
		
		// Campus home animation
		if($('centerNav') && $('contentRight')) this.centerNav();
				
	},
	

	/*------------------------------------------------------
		centerNav()
	------------------------------------------------------*/
	centerNav: function() {
		var faq = new Accordion('div#centerNav li div.center', 'div#contentRight div.content', {
			opacity: 1,
			fixedWidth: '311px',
			fixedHeight: '285px',
			
			onActive: function(toggler, element){
			
				var arrow = toggler.getParent().getElement('.arrow');
				var icon = toggler.getElement('.icon');
				var header = toggler.getElement('h3');
								
				new Fx.Morph(toggler, Settings.centerNav.options).start(Settings.centerNav.active.nav);
				new Fx.Morph(header, Settings.centerNav.options).start(Settings.centerNav.active.header);
				new Fx.Morph(arrow, Settings.centerNav.options).start(Settings.centerNav.active.arrow);
				new Fx.Morph(icon, Settings.centerNav.options).start(Settings.centerNav.active.icon);
			},
			
			onBackground: function(toggler, element){
				var arrow = toggler.getParent().getElement('.arrow');
				var icon = toggler.getElement('.icon');
				var header = toggler.getElement('h3');
								
				new Fx.Morph(toggler, Settings.centerNav.options).start(Settings.centerNav.background.nav);
				new Fx.Morph(header, Settings.centerNav.options).start(Settings.centerNav.background.header);
				new Fx.Morph(arrow, Settings.centerNav.options).start(Settings.centerNav.background.arrow);
				new Fx.Morph(icon, Settings.centerNav.options).start(Settings.centerNav.background.icon);
			}
		}, $('centerNav'));
	}		
}); // End Campus Class


/*----------------------------------------------------------
	
	Initialize the class (which initializes the 
	any other used classes) when the DOM is ready.
	
----------------------------------------------------------*/
var campus;
window.addEvent('domready', function() {
    campus = new Campus();
});