      jQuery(document).ready(function() {
        // slide show images
        jQuery('#slide_show').cycle({
          timeout: 8000,
          fx: 'fade',
          speed: 1500
        });

        // hide form input labels (watermark plugin will display labels if javascript is enabled)
        jQuery('label').css('display', 'none');

        // display event calendar
        jQuery.ajax({
          url: "/_event_dates.php",
          data: "action=showdates",
          dataType: "json",
          success: function(calendarEvents){
            jQuery("#datepicker").datepicker({
              onSelect: function(dateText, inst) { jQuery.colorbox({href:'/_events.php?d=' + dateText,transition:"elastic", width:"480", height:"450", initialWidth:"350", initialHeight:"350", iframe:true, current:""}); },
              // [rows, columns] if you want to display multiple calendars.                         
              numberOfMonths: [1, 1],
              showCurrentAtPos: 0,
//              changeMonth: true, // drop down to change the month
//              changeYear: true, // drop down to change the year
//              showButtonPanel: true, // button panel that show the today button
              beforeShowDay: function (date){

                for ( i = 0; i < calendarEvents.length; i++ ) {
                  if ( ( date.getMonth() == calendarEvents[i][0] - 1 ) && ( date.getDate() == calendarEvents[i][1] ) && ( date.getFullYear() == calendarEvents[i][2] ) ) {
                    //[disable/enable, class for styling appearance, tool tip]
                    return [true,"specialDate", calendarEvents[i][3]]; 
                  }
                }
                return [true, ""]; //enable all other days with no additional class for styling
              }
            });
          },
          error:function (xhr, ajaxOptions, thrownError){
            // if there is a problem getting event date, then just show the calendar with not highlighted event dates
            $("#datepicker").datepicker();
          }
        });

      });

	  // superfish menu
      jQuery(function(){
        jQuery('ul.sf-menu').superfish({ autoArrows: false, delay: 200, dropShadows: false });
      });

	  // preload images
	  function preload_images() {
	    MM_preloadImages(
			'/buttons/bt_home_ovr.jpg',
			'/buttons/bt_about_ovr.jpg',
			'/buttons/bt_savroty_ovr.jpg',
			'/buttons/bt_members_ovr.jpg',
			'/buttons/bt_contact_ovr.jpg',
			'/buttons/bt_joinus_ovr.jpg',
			'/buttons/bt_rotyinter_ovr.jpg',
			'/buttons/bt_rotyfound_ovr.jpg',
			'/buttons/bt_events_ovr.jpg',
			'/buttons/bt_history_ovr.jpg',
			'/buttons/bt_programs_ovr.jpg',
			'/buttons/bt_updinqry_ovr.jpg',
			'/buttons/bt_newsletters_ovr.jpg',
			'/buttons/bt_faqs_ovr.jpg',
			'/buttons/bt_board_ovr.jpg',
			'/buttons/bt_roster_ovr.jpg',
			'/buttons/bt_rosterpdf_ovr.jpg',
			'/buttons/bt_clubdocs_ovr.jpg',
			'/buttons/bt_constitution_ovr.jpg',
			'/buttons/bt_dismakeup_ovr.jpg',
			'/buttons/bt_distclubs_ovr.jpg',
			'/buttons/bt_contactinfo_ovr.jpg',
			'/buttons/bt_officers_ovr.jpg',
			'/buttons/bt_meetlocal_ovr.jpg',
			'/buttons/bt_membership_ovr.jpg' );
//		alert("images preloaded");
	  }
