(function(jQuery) {
	jQuery.fn.customFadeIn = function(speed, callback) {
		jQuery(this).fadeIn(speed, function() {
			if(jQuery.browser.msie)
				jQuery(this).get(0).style.removeAttribute('filter');
			if(callback != undefined)
				callback();
		});
	};
	jQuery.fn.customFadeOut = function(speed, callback) {
		jQuery(this).fadeOut(speed, function() {
			if(jQuery.browser.msie)
				jQuery(this).get(0).style.removeAttribute('filter');
			if(callback != undefined)
				callback();
                jQuery(this).prev().addClass('contracted') 
		});
	};
})(jQuery);




jQuery(document).ready(function() {
  // set all <dt> elements CSS classes to contracted for icon
   // and hide their corresponding <dd> element
  jQuery('#FAQ-Accordion dt').addClass('contracted');
  jQuery('#FAQ-Accordion dd').hide();
  // set <dt> toggle function to expand/contract the following <dd> element
   // and toggle the contracted CSS class to switch the icon
  jQuery('#FAQ-Accordion dt').toggle(function() {
    jQuery(this).removeClass('contracted');
    jQuery(this).next().customFadeIn('fast')
  }, function() {
    jQuery(this).next().customFadeOut('normal',function() {
       jQuery(this).prev().addClass('contracted') // class is added in the callback to chain events
    });
  });

});