/*
 * Для подсказок на полях ввода
 * При фокусе исчезает
 * При потере фокуса появляется
 */

jQuery.fn.inputtip = function(options){

  var options = jQuery.extend({
      'text' : 'text',
      'text_color' : 'gray'
  },options);

  var $this = $(this);
  
  var original_color = $this.css('color');

  var blurFunction = function(){
      if ($.trim($this.val()).length == 0) {
          $this.css('color', options.text_color);
          $this.val(options.text);
      }
  }

    blurFunction();

  

  $this.focus(function(){
      if ($this.val() == options.text) {      
      $this.css('color', original_color);
      $this.val('');
      }
  });

  $this.blur(function(){
      blurFunction();
  });
	  
};
