/*
    placeholder 0.1
    A jQuery placeholder.

    Author: Websviewer
    Version: 0.1
*/

(function($) {

	$.fn.placeholder = function(options) {
	  
        // plugin defaults
        $.fn.placeholder.defaults = {
            defaultText:  "",
            passiveColor: "#CCC",
            activeColor: "#000"
        };		
		
		var opts = $.extend({}, $.fn.placeholder.defaults, options);
	
		return this.each(function() {
            
            $(this).css('color', opts.passiveColor); // init position 
            
            $(this).click(function(){ 
                $(this).css('color', opts.activeColor);              
                if($(this).val() == '' || $(this).val() == opts.defaultText){
                    // if  empty or default text = empty field
                    $(this).css('color', opts.activeColor).val("");              
                }
            }).blur(function(){
                
                $(this).css('color', opts.passiveColor);
                
                if($(this).val() == '' || $(this).val() == opts.defaultText){
                    $(this).val(opts.defaultText);
                }
            });    
        }); 
    }
})(jQuery);       