(function($) {
	
	$.fn.placeholder = function(options) {
		var opts = $.extend({}, $.fn.placeholder.defaults, options);
		return this.each(function() {
			var $this = $(this);
			
			// build element specific options
			var o = $.metadata ? $.extend({}, opts, $this.metadata()) : opts;

			$this.blur(function() {
				if ($this.val() == o.placeholder || $this.val() == '') {
					$this.val(o.placeholder);
					$this.addClass('placeholder-active');
				}
			});
			$this.focus(function() {
				if ($this.val() == o.placeholder || $this.val() == '') {
					$this.val('');
					$this.removeClass('placeholder-active');
				}
			});

			$this.blur();
		});
	}
	
	$.fn.placeholder.defaults = { placeholder: '' };
	
	$(document).ready(function() {
		$(".placeholder").placeholder();
	});
	
})(jQuery);
