$.fn.showError = function(msg) {
    if ($(this).data('errorDiv')) {
        $(this).data('errorDiv').remove();
        $(this).data('errorDiv', false);
    }
    div = $("<div>").appendTo(this.parent()).html(msg).addClass('inputError');
    div.one('click',function() {
        try {
            $(this).remove();
        } catch(e) { }
    });
    div.css('top', this.position().top+this.outerHeight()+'px');
    div.css('left', this.position().left+'px');
    div.outerWidth(this.outerWidth());
    $(this).data('errorDiv', div);
    $(this).one('focus', function() {
        try {
            $(this).data('errorDiv').remove();
            $(this).data('errorDiv',false);
        } catch(e) { }
    });
    
};
