﻿
$(document).ready(function () {

    // Add the value of "Search..." to the input field and a class of .empty
    $("#email").val("Your email address..").addClass("empty");

    // When you click on #search
    $("#email").focus(function () {

        // If the value is equal to "Search..."
        if ($(this).val() == "Your email address..") {
            // remove all the text and the class of .empty
            $(this).val("").removeClass("empty"); ;
        }

    });

    // When the focus on #search is lost
    $("#email").blur(function () {

        // If the input field is empty
        if ($(this).val() == "") {
            // Add the text "Search..." and a class of .empty
            $(this).val("Your email address..").addClass("empty");
        }

    });

    // Add the value of "Search..." to the input field and a class of .empty
    $("#message").val("Your message..").addClass("empty");

    // When you click on #search
    $("#message").focus(function () {

        // If the value is equal to "Search..."
        if ($(this).val() == "Your message..") {
            // remove all the text and the class of .empty
            $(this).val("").removeClass("empty"); ;
        }

    });

    // When the focus on #search is lost
    $("#message").blur(function () {

        // If the input field is empty
        if ($(this).val() == "") {
            // Add the text "Search..." and a class of .empty
            $(this).val("Your message..").addClass("empty");
        }

    });

    // Add the value of "Search..." to the input field and a class of .empty
    $("#code").val("Please enter the numbers to the left..").addClass("empty");

    // When you click on #search
    $("#code").focus(function () {

        // If the value is equal to "Search..."
        if ($(this).val() == "Please enter the numbers to the left..") {
            // remove all the text and the class of .empty
            $(this).val("").removeClass("empty"); ;
        }

    });

    // When the focus on #search is lost
    $("#code").blur(function () {

        // If the input field is empty
        if ($(this).val() == "") {
            // Add the text "Search..." and a class of .empty
            $(this).val("Please enter the numbers to the left..").addClass("empty");
        }

    });

});
