﻿(function ($) {
    $.fn.watermark = function (params) {
        params = $.extend({ text: '(Optional)' }, params);

        this.each(function () {
            if (this.value == '') {
                $(this).val(params.text).css('text-align', 'center');
            }

            $(this).focus(function () {
                if (this.value == params.text) {
                    $(this).val('').css('text-align', 'left');
                }
            }).blur(function () {
                if (this.value == '') {
                    $(this).val(params.text).css('text-align', 'center');
                }
            });
        });

        return this;
    };
})(jQuery);
