$.fn.placeholder = function(opts) {

	
	var selectedOpts = $.extend({}, $.fn.placeholder.defaults, opts);
	
	if(selectedOpts.text != null)
		$(this).attr(selectedOpts.attrName, selectedOpts.text);
	
	$(this).each(function() {
	
		$(this).focus(function() {
	
			if($(this).val() == $(this).attr(selectedOpts.attrName)) {
				$(this).val('');
				$(this).removeClass(selectedOpts.className);
			}
			
		});
		
		$(this).blur(function() {
			
			if($(this).val() == '' || $(this).val() == $(this).attr(selectedOpts.attrName)) {
				$(this).val($(this).attr(selectedOpts.attrName));
				$(this).addClass(selectedOpts.className);
			}
			
		});
		
		$(this).blur();
	});
}

$.fn.placeholder.defaults = {
		text:null,
		className:'placeholder',
		attrName:'placeholder'
	}


