function IMM_FormFieldHints(containerId)
{
	this.containerId = containerId;
	this.container = null;
	
	this.init = function()
	{
		var self = this;
		this.container = document.getElementById(this.containerId);
		$(this.container).children("input").each(function() {
			self.setHint(this);			
		}); 
	};
	
    this.setHint = function (t) {

        // get it once since it won't change
        var title = $(t).attr('title');
		
		
        // only apply logic if the element has the attribute
        if (title) { 
          // on blur, set value to title attr if text is blank
          $(t).blur(function (){
            if ($(t).val() === '') {
              $(t).val(title);
              $(t).addClass('blurredhint');
            } 
          });
          // on focus, set value to blank if current value 
          // matches title attr
          $(t).focus(function (){
            if ($(t).val() == title) {		
              $(t).val('');
              $(t).removeClass('blurredhint');
            }
          });
    
          // clear the pre-defined text when form is submitted
          $(t).parents('form:first()').submit(function(){
              if ($(t).val() == title) {
                  $(t).val('');
                  $(t).removeClass('blurredhint');
              }
          });
    
          // now change input to title
          $(t).blur();
        }
    };
	this.init();
}
