/* Put class="hint" to provide functionality */

function HintInput() {

  $('input.hint,textarea.hint').each(function() {
    $(this)
      .data('default', $(this).val())
      .addClass('inactive')
      .focus(function() {
        $(this).removeClass('inactive');
        if($(this).val() == $(this).data('default') || '') {
				$(this).animate({
					color: "#fff"
				}, 100, function() {
					$(this).animate({ color: "#000" }, 0);
					$(this).val('');
  				});
        }
      })
      .blur(function() {
        var default_val = $(this).data('default');
        if($(this).val() == '') {
          $(this).addClass('inactive');

				$(this).animate({ color: "#fff" }, 0);
          		$(this).val($(this).data('default'));

				$(this).animate({
					color: "#999999"
				}, 500);
        }
      });
  });

}

$(document).ready(function() {
	HintInput()
});


