﻿/**
 * Global jQuery functions
 */

// Ensures that DOM has been loaded before adding events
$(document).ready(function() {
    // Toggles visibility of the login box
    $("#login .btn").toggle(
        function() {
            $("#login").addClass("active");
        },
        function() {
            $("#login").removeClass("active");
        }
    );

    // onBlur and onFocus for all input text fields
        $("input:text").not('.search-textbox')
        .focus(function() {
            if ($.trim(this.value) == this.defaultValue) {
                this.value = "";
            }
        })
        .blur(function() {
            if ($.trim(this.value) == "") {
                this.value = (this.defaultValue) ? this.defaultValue : "";
            }
        });
});
