﻿$(function () {
    //use a unique name to register the user control
    jQuery(document).ready(function () {
        $(".Gray").each(function () {
            $(this)[0].DefaultValue = $(this).val();
        });

        $(".UserName").keypress(function () {
            if ($(this).val() == $(this)[0].DefaultValue) {
                $(this).removeClass("Gray");
                $(this).val('');
            }
        });


        $(".UserName").focus(function () {
            if ($(this).val() == $(this)[0].DefaultValue) {
                $(this).removeClass("Gray");
                $(this).val('');
            }
        });
        
        $(".Gray").blur(function () {
            if ($(this).val() == '') {
                $(this).addClass("Gray");
                $(this).val($(this)[0].DefaultValue);
            }
        });
        $("#Password1").focus(function () {
            $(this).hide();
            $("#Password").show();
            $("#Password").focus();
        });
        $("#Password").blur(function () {

            if ($(this).val() == '') {
                
                $(this).hide();
                $("#Password1").show();
            }
        });

    });
});
