(function($) {
	$.fn.placeholding = function() {
		this.find('input[type=text]').each(function() {
			var ph = $(this).attr('placeholder');
			if(typeof ph != 'undefined' 
				&& ph != ''
				&& $(this).val() == '') {
				this.placeholding = true;
				$(this).val(ph);
			}
			
			$(this).focus(function() {
				if(this.placeholding) {
					$(this).val('');
					this.placeholding = false;				
				}
			});
			
			$(this).blur(function() {
				if($(this).val() == '') {
					$(this).val(ph);
					this.placeholding = true;
				}
			});
		});
		
		this.find('form').submit(function(event) {
			$(this).find('input[type=text]').each(function() {
				if(this.placeholding) {
					$(this).val('');				
				}
			});
		});
	};
})(jQuery);
