$(document).ready(function () {
	
	//home page news ticker
    $('#news-ticker').cycle({ 
        fx:     'scrollLeft', 
        speed:   500, 
        timeout: 5000, 
    }); 

	// Menu stuff
	// disable links on any nav items with href="#" (base href caused them to go to the home page)
	$('#menu li a[href="#"]').click(function() {
		return false;
	});
	
	//show arrows on any top level nav items with a submenu
	$('#menu li ul').parent('li').addClass('hasSubMenu');
	$('#menu li.hasSubMenu a.fly').parent('li').removeClass('hasSubMenu');

	//JQuery rebuild of the accordion (was using prototype but that was causing conflicts with Jquery
	$('.msdsnestedcontent, .msdscontent, #msdsnestedaccordion, .faqcontent').hide();
	
	$('.msdstitle, .faqtitle').click(function() {
		if ($(this).hasClass('msdstitle_active')) {
			$(this).removeClass('msdstitle_active').parent().children('.msdscontent, #msdsnestedaccordion, .faqcontent').slideUp(250);
		} else {
			$('.msdstitle_active').removeClass('msdstitle_active').parent().children('.msdscontent, #msdsnestedaccordion, .faqcontent').slideUp(250);
			$(this).addClass('msdstitle_active').parent().children('.msdscontent, #msdsnestedaccordion, .faqcontent').slideDown(250);
		}
	});
	
	$('.msdsnestedtitle').click(function() {
		if ($(this).hasClass('msdsnestedtitle_active')) {
			$(this).removeClass('msdsnestedtitle_active').next('.msdsnestedcontent').slideUp(250);
		} else {
			$('.msdsnestedtitle_active').removeClass('msdsnestedtitle_active').next('.msdsnestedcontent').slideUp(250);
			$(this).addClass('msdsnestedtitle_active').next('.msdsnestedcontent').slideDown(250);
		}
	});


	
});


