/**
 * @see http://github.com/NV/placeholder.js
 */

jQuery.fn.textPlaceholder=function(){return this.each(function(){var a=this;if(a.placeholder&&'placeholder'in document.createElement(a.tagName))return;var b=a.getAttribute('placeholder');var c=jQuery(a);if(a.value===''||a.value==b){c.addClass('text-placeholder');a.value=b}c.focus(function(){if(c.hasClass('text-placeholder')){this.value='';c.removeClass('text-placeholder')}});c.blur(function(){if(this.value===''){c.addClass('text-placeholder');this.value=b}else{c.removeClass('text-placeholder')}});a.form&&jQuery(a.form).submit(function(){if(c.hasClass('text-placeholder')){a.value=''}})})};

/*
jQuery.fn.textPlaceholder = function () {

	return this.each(function(){

		var that = this;

		if (that.placeholder && 'placeholder' in document.createElement(that.tagName)) return;

		var placeholder = that.getAttribute('placeholder');
		var input = jQuery(that);

		if (that.value === '' || that.value == placeholder) {
			input.addClass('text-placeholder');
			that.value = placeholder;
		}

		input.focus(function(){
			if (input.hasClass('text-placeholder')) {
				this.value = '';
				input.removeClass('text-placeholder')
			}
		});

		input.blur(function(){
			if (this.value === '') {
				input.addClass('text-placeholder');
				this.value = placeholder;
			} else {
				input.removeClass('text-placeholder');
			}
		});

		that.form && jQuery(that.form).submit(function(){
			if (input.hasClass('text-placeholder')) {
				that.value = '';
			}
		});

	});

};

*/

