jQuery.fn.sameHeight = function() {
  var newHeight = -999999999999;

  this.each(function(i, el) {
    var h = jQuery(el).height();
    if (h > newHeight) {
      newHeight = h;
    }
  });

  return this.each(function(i, el){
    jQuery(el).height(newHeight);
  });
};

jQuery.fn.attachFatField = function() {
  return this.each(function(i, el) {
  	var _el = jQuery(el);
  	if (_el.attr('for') != '') {
  		var _input = jQuery('#' + _el.attr('for'));
  		if (_input.val() == '') {
  			_el.show();
  		}
  		_input.focus(function(){
  			_el.hide();
  		});
  		_input.blur(function(){
  			if (_input.val() == '') {
  				_el.show();
  			}
  		});
  		_el.click(function(){
  			_input.focus();
  		});
  	}
  });
}



jQuery.fn.labelOver = function(overClass) {
	return this.each(function(){
		var label = jQuery(this);
		var f = label.attr('for');
		if (f) {
			var input = jQuery('#' + f);

			this.hide = function() {
			  label.css({ textIndent: -10000 })
			}

			this.show = function() {
			  if (input.val() == '') label.css({ textIndent: 0 })
			}

			// handlers
			input.focus(this.hide);
			input.blur(this.show);
		  label.addClass(overClass).click(function(){ input.focus() });

			if (input.val() != '') this.hide();
		}
	})
}
