jQuery(document).ready(function () {

	jQuery('#featuredEvents').cycle({ 
	    fx:    'fade', 
	    speed:  2000,
		timeout: 6000
	});


	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
		var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
	  
		if ( ieversion < 7 )
			jQuery.facebox("<div style='font-size:16px; text-align:center;width:750px;height:350px;line-height:350px;font-weight:bold;'>Your browser is not supported by this website.  Please <a href='http://www.microsoft.com/windows/downloads/ie/getitnow.mspx' target='_blank'><strong>upgrade</strong></a> to Internet Explorer 7 or above.</div>");	
	}

	
	jQuery(".dropdown li:even").addClass("alt");
	jQuery(".dropdown2 li:even").addClass("alt");
	jQuery(".dropdown3 li:even").addClass("alt");
	jQuery(".dropdown4 li:even").addClass("alt");
	jQuery(".dropdown5 li:even").addClass("alt");
	jQuery(".dropdown6 li:even").addClass("alt");
	jQuery(".dropdown7 li:even").addClass("alt");
	

	jQuery('#link_home').hover(function () {
		jQuery('#home_submenu').slideDown('fast');
		jQuery("#link_home a.nav").attr("style", "background-position: -200px -35px;");
	}, function () {	
			if ( jQuery('#home_submenu').length )
				jQuery('#home_submenu').slideUp('fast', function() {jQuery('#link_home a.nav').removeAttr("style");});	
			else
				jQuery('#link_home a.nav').removeAttr("style");
	});
	
	jQuery('#link_about').hover(function () {
		jQuery('#about_submenu').slideDown('fast');
		jQuery("#link_about a.nav").attr("style", "background-position: -271px -35px");
	}, function () {
			if ( jQuery('#about_submenu').length )
				jQuery('#about_submenu').slideUp('fast', function() {jQuery('#link_about a.nav').removeAttr("style");});	
			else
				jQuery('#link_about a.nav').removeAttr("style");
	});
	
	jQuery('#link_volunteer').hover(function () {
		jQuery('#volunteer_submenu').slideDown('fast');
		jQuery("#link_volunteer a.nav").attr("style", "background-position: -367px -35px");
	}, function () {
			if ( jQuery('#volunteer_submenu').length )
				jQuery('#volunteer_submenu').slideUp('fast', function() {jQuery('#link_volunteer a.nav').removeAttr("style");});	
			else
				jQuery('#link_volunteer a.nav').removeAttr("style");
	});
	
	jQuery('#link_donate').hover(function () {
		jQuery('#donate_submenu').slideDown('fast');
		jQuery("#link_donate a.nav").attr("style", "background-position: -468px -35px;");
	}, function () {
			if ( jQuery('#donate_submenu').length )
				jQuery('#donate_submenu').slideUp('fast', function() {jQuery('#link_donate a.nav').removeAttr("style");});	
			else
				jQuery('#link_donate a.nav').removeAttr("style");
	});
	
	jQuery('#link_success').hover(function () {
		jQuery('#success_submenu').slideDown('fast');
		jQuery("#link_success a.nav").attr("style", "background-position: -550px -35px;");
	}, function () {
			if ( jQuery('#success_submenu').length )
				jQuery('#success_submenu').slideUp('fast', function() {jQuery('#link_success a.nav').removeAttr("style");});	
			else
				jQuery('#link_success a.nav').removeAttr("style");
	});
	
	jQuery('#link_events').hover(function () {		
		jQuery('#events_submenu').slideDown('fast');
		jQuery("#link_events a.nav").attr("style", "background-position: -692px -35px;");
	}, function () {
			if ( jQuery('#events_submenu').length )
				jQuery('#events_submenu').slideUp('fast', function() {jQuery('#link_events a.nav').removeAttr("style");});	
			else
				jQuery('#link_events a.nav').removeAttr("style");
	});
	
	jQuery('#link_forms').hover(function () {
		jQuery('#forms_submenu').slideDown('fast');
		jQuery("#link_forms a.nav").attr("style", "background-position: -827px -35px;");
	}, function () {
			if ( jQuery('#forms_submenu').length )
				jQuery('#forms_submenu').slideUp('fast', function() {jQuery('#link_forms a.nav').removeAttr("style");});	
			else
				jQuery('#link_forms a.nav').removeAttr("style");
	});
});
