﻿$(document).ready(function() {

    //Initialize 'Default Values' handler for textboxes
    initDefaultValues();

    //Add other 'onready' scripts here.
    
});

function initDefaultValues() {
    $("(*.DefaultValue").each(function() {
        if ($(this).val() != $(this).attr('YMDefaultValue')) {
            $(this).removeClass('DefaultValue');
        }
    });

    $("*.DefaultValue").focus(function() {
        if ($(this).val() == $(this).attr('YMDefaultValue')) {
            $(this).val('');
            $(this).removeClass('DefaultValue');
        }
    });

    $("*.DefaultValue, textarea.DefaultValue").blur(function() {
        if ($(this).val().length == 0) {
            $(this).val($(this).attr('YMDefaultValue'));
            $(this).addClass('DefaultValue');
        }
    });
}
