// Set jQuery in no conflict mode
jQuery.noConflict();

// Create our own, custom JavaScript object
jQuery.mainObject = {
	// Initialize the main object
	init: function() {
		// Create a slideshow for the front page intro
		jQuery('#introSlides') 
			.before('<div id="slideNavigation">')
			.cycle({ 
				fx:      'fade',
				speed:   1000,
				timeout: 10000,
				pager:   '#slideNavigation'
			})
		;
		
		// Enable tabbed navigation
		jQuery('#schedule').tabs({
			selected: 1
		});
		
		// Make the higlights column (homepage) behave like an accordion
		jQuery('#highlights').accordion({
			header: '.itemHeader',
			autoHeight: false,
			event: 'mouseover'
		});
		
		// Enable drop down menus for the main navigation on mouseover
		jQuery('#mainNavigation ul li').hover(
			function() {
				jQuery(this).addClass('showSubNavigation');
			},
			function() {
				jQuery(this).removeClass('showSubNavigation');
			}
		);
	}
};

// Replace headers with Cufon
// This has to be done before document.ready, to prevent headers from flashing (IE bug)
Cufon.replace('h1')('h2')('h3')('#mainNavigation a.main')('#mainNavigation strong');

// Initialize the main object, which handles all website initialization
jQuery(document).ready(function() {
	// Initialize the main object
	jQuery.mainObject.init();
});
