﻿function populateElement(selector, defvalue) {
    $(selector).each(function () {
        if ($.trim(this.value) == "") {
            this.value = defvalue;
        }
    });

    $(selector).focus(function () {
        if (this.value == defvalue) {
            this.value = "";
        }
    });

    $(selector).blur(function () {
        if ($.trim(this.value) == "") {
            this.value = defvalue;
        }
    });
}
