﻿/// <reference path="Modernizr.js"/>

var active_color = '#000'; // Colour of user provided text
var inactive_color = '#cdcdcd'; // Colour of default text

$(document).ready(function () {
    $("input.login-text-input").css("color", inactive_color);
    var default_values = new Array();
    $("input.login-text-input").focus(function () {
        if (!default_values[this.id]) {
            default_values[this.id] = this.value;
        }
        if (this.value == default_values[this.id]) {
            this.value = '';
            this.style.color = active_color;
            if (this.id == 'login-password-field')
                this.setAttribute("type", "password");
        }
        $(this).blur(function () {
            if (this.value == '') {
                this.style.color = inactive_color;
                this.value = default_values[this.id];
                this.removeAttribute('type');
            }
        });
    });
});
