/** -------------------------------------------------------
*** Author: gyoridavid
** ------------------------------------------------------- */
(function($) {
	$.fn.placeHolder = function(options) {
		var defaults = {
			
		};
		
		var opts = $.extend(defaults, options);
		opts.inputPlaceHolder = {};
		
		return this.each(function() {
			
			var _ = {};
			_.thisObject = $(this);
			
			opts.inputPlaceHolder[_.thisObject.attr("name")] = _.thisObject.val();
			_.thisObject.bind("focus blur", function(e) {
				switch(e.type) {
					case "focus":
						if (_.thisObject.val() == opts.inputPlaceHolder[_.thisObject.attr("name")]) {
							_.thisObject.val("");
						}
						break;
					case "blur":
						if (_.thisObject.val() == "") {
							_.thisObject.val(opts.inputPlaceHolder[_.thisObject.attr("name")]);
						}
						break;
				}
			});
						
			return _.thisObject;
			
		});
		
	};
})(jQuery);
