﻿//populate inputfield and repopulate on focus, blue etc - 
//this function is expecting you to set the default value already by
//a required input (initial value) field or some other .NET functionality

function hint(selector) {
    $(selector).each(function() {
        if($.trim(this.value) == "") {
            this.value = this.defaultValue;
        }
    });
  
    $(selector).focus(function() {
        if(this.value == this.defaultValue) {
            this.value = "";
        }
    });
    
    $(selector).blur(function() {
        if($.trim(this.value) == "") {
            this.value = this.defaultValue;
        }
    });
 }

