(function($) {

/* ============== [ Konami Code ] ============== */

	jQuery.fn.konami = function(callback, code) {
		if(code == undefined) code = "38,38,40,40,37,39,37,39,66,65";
		
		return this.each(function() {
			var kkeys = [];
			$(this).keydown(function(e){
				kkeys.push( e.keyCode );
				if ( kkeys.toString().indexOf( code ) >= 0 ){
					$(this).unbind('keydown', arguments.callee);
					callback(e);
				}
			}, true);
		});
	}

/* ============== [ href colour fade ] ============== */

	jQuery.fn.dwFadingLinks = function(settings) {
		settings = jQuery.extend({
			color: '#ff8c00',
			duration: 500
		}, settings);
		return this.each(function() {
			var original = $(this).css('color');
			$(this).mouseover(function() { $(this).animate({ color: settings.color },settings.duration); });
			$(this).mouseleave(function() { $(this).stop(settings.duration); });
			$(this).mouseout(function() { $(this).animate({ color: original },settings.duration); });		
		});
	};

})(jQuery);
