(function($, window, undefined){
	
	$.fn.startPulsate = function() {
		
		var opacityIn = function() {
			this.animate({opacity:1}, 600, 'linear', $.proxy(opacityOut, this));
		}
		
		var opacityOut = function() {
			var pm = this.data().pm;
			if (pm.pulsating)
				this.animate({opacity:0.5}, 600, 'linear', $.proxy(opacityIn, this));
		}
		
		return function() {
			var pm = this.data().pm;
			if (!pm) {
				pm = {};
				this.data().pm = pm;
			}
			pm.pulsating = true;
			opacityOut.apply(this);
			return this;
		}
	}();
	
	$.fn.stopPulsate = function() {
		this.data().pm.pulsating = false;
		return this;
	};
	
})(jQuery, window);
