jQuery.fn.labelOver = function(overClass) {
	
	var jquery_object = this;
	var current_focus = null;
	var inputs = [];
	var classShow = overClass + '-show'
	var classHide = overClass + '-hide'
	
	this.each(function(){
		var label = jQuery(this);
		var f = label.attr('for');
		if (f) {
			var input = jQuery('#' + f);
			if (input) {
				inputs.push(input);
				var typeClass = (input.length>0) ? overClass+ '-type-'+ input[0].type.toLowerCase() : '';
				this.hide = function() {
				  label.removeClass(classShow).addClass(classHide);
				  current_focus = this;
				}
				this.show = function() {
				  if (input.val() == '') { 
				  	label.removeClass(classHide).addClass(classShow);
				  }
				  current_focus = null;				  
				}
	
				// handlers
				input.focus(this.hide);
				input.blur(this.show);
				input.change(this.hide);
				label.addClass(overClass).addClass(typeClass).click(function(){ input.focus() });
				
				if (input.val() != '') this.hide();
			}			
		}
	});
	/* Catch the autofill */
	var interval = setInterval(function() {  
            $(inputs).each(function(index) {
				// set data cache on element to input value if not yet set  
                if ($(this).data('change_listener') == undefined) {  
                    $(this).data('change_listener', $(this).val());  
                    return;  
                }  
                // return if the value matches the cache  
                if ($(this).data('change_listener') == $(this).val()) {  
                    return;  
                }  
                // ignore if element is in focus (since change event will fire on blur)  
                if (this == current_focus) {  
                    return;  
                }  
                // if we make it here, manually fire the change event and set the new value  
                $(this).trigger('change');  
                $(this).data('change_listener', $(this).val());
				window.setTimeout(function(){ clearInterval(interval); }, 5000);
            });  
    }, 200);	


	return this;
}