/*
	Class:    	dwFadingLinks
	Author:   	David Walsh
	Website:    http://davidwalsh.name
	Version:  	1.0.0
	Date:     	10/08/2008
	Built For:  jQuery 1.2.6
*/

jQuery.fn.dwFadingLinks = function(params) {
        // Supply some defaults
        var defaults = {
		duration: 50
	};
        // Override any defaults with user settings
	var settings = jQuery.extend(defaults, params);
	return this.each(function() {
            // Save reference to this
            var $elem = jQuery(this);
            //Get this elements original color
            var original = $elem.css('color');
            // Get this elements color once we add the on class
            $elem.addClass('on');
            var fadeColor = $elem.css('color');
            $elem.removeClass('on');
            // make a function to run on mouseenter
	    $elem.mouseenter(function() { $elem.stop().animate({ color: fadeColor },settings.duration); } );
            // and mouseout
	    $elem.mouseout(function() { $elem.animate({ color: original },settings.duration); } );
	});
};

