/**
 * Zurücksetzen des Textfeldes von input und textarea
 * @author Christian
 * @version 0.1
 * @since 04.07.2009 
 * 
 * @param string text Standardtext der gelöscht werden soll aus dem Textfeld sobald reingeklickt wird oder es den focus erhält 
 * 
 * @example 
 * 		$('.ad_title').unsetTextfield({text:'enter'});
 * @return jQuery Object
 */

(function($) {
	
jQuery.fn.unsetTextfield = function(options) {
 var defaults = {
	 text: $(this).val()
 };
 var options = $.extend(defaults, options);

  return this.each(function(){

    //Textfeld erhält Focus
	$(this).bind('focus', function(event) {
		var textvalue = $(this).val();
		if (textvalue == options.text) {
			$(this).val('');
		}
	});

    //Textfeld verliert Focus
	$(this).bind('blur', function(event) {
		var textvalue = $(this).val();
		if (textvalue == '') {
			$(this).val(options.text);
		}
	});

  });
};

})(jQuery);