/**
 * @author jeremy tarpley & ben liles
 */
function initializeMenu(){
    jQuery(document).ready(function(){
        //fadeToggle function
        jQuery.fn.fadeToggle = function(speed, easing, callback){
            return this.animate({
                opacity: 'toggle'
            }, speed, easing, callback);
        };
        
        jQuery.fn.slideFadeToggle = function(speed, easing, callback){
            return this.animate({
                opacity: 'toggle',
                height: 'toggle'
            }, speed, easing, callback);
        };
        
	jQuery("#home dl.globalNav dd").hide();
		
        // homepage nav
        jQuery("#home div.yui-u").hover(function(){
            jQuery(this).find(".globalNav dt a").addClass("current");
            jQuery(this).find(".globalNav dd").fadeIn("slow");
        }, function(){
            jQuery(this).find(".globalNav dt a").removeClass("current");
            jQuery(this).find(".globalNav dd").fadeOut();
        });
	
	jQuery("#secondary dl.globalNav:not(.active) dd").hide();
	jQuery("#secondary dl.globalNav:not(.active) dt").prepend('<a class="expand-nav">+</a>')
	jQuery("#secondary dl.globalNav.active dt").prepend('<a class="expand-nav">-</a>')
		
        // secondary page nav
        jQuery("#secondary dl.globalNav dt a.expand-nav").click(function(){
            if (jQuery(this).text() == '+') {
                jQuery(this).text('-');
            }
            else {
                jQuery(this).text('+');
            }
            jQuery(this).parent().parent().find("dd").slideFadeToggle("normal");
        });
	
	//tooltips - requires tooltipsy plugin http://tooltipsy.com/
	jQuery('.tooltip-header').tooltipsy({
	    offset: [0, 14]
	});
	
	//contact page - directions lightbox
	
	

    });
}


google.load("jquery", "1.5.2");
google.setOnLoadCallback(initializeMenu);
