$(document).ready(function ()
{
    $("form.Form div.Field :text[value=''], form.Form div.Field :password[value=''], form.Form div.Field textarea").each(function (index)
    {
        if ($(this).val() == '')
        {
            $(this).prev("label").show();
        }
    });

    $("form.Form div.Field select").each(function (index)
    {
        if ($(this).val() == '')
        {
            $(this).css("color", "#B3B3B3");
        }
    });

    $('form.Form div.Field input[type="text"], form.Form div.Field input[type="password"], form.Form div.Field textarea').keyup(function ()
    {
        if ($(this).val() != '')
        {
            $(this).prev("label").hide();
        }
        else
        {
            $(this).prev("label").show();
        }
    });

    $('div.Field select').change(function ()
    {
        if ($(this).val() != '')
        {
            $(this).css("color", "#003399");
        }
        else
        {
            $(this).css("color", "#B3B3B3");
        }
    });

    $('form.Form div.Field input[type="text"], form.Form div.Field input[type="password"], form.Form div.Field textarea, form.Form div.Field select').focus(function ()
    {
        $(this).parent().addClass("Active");
    });

    $('form.Form div.Field input[type="text"], form.Form div.Field input[type="password"], form.Form div.Field textarea, form.Form div.Field select').blur(function ()
    {
        $(this).parent().removeClass("Active");
    });
});
