﻿// JScript File

//Focus was set to the textbox
function focusSet(textbox, text)
{
    if (textbox.value == text)
    {
        textbox.value = "";
    }
    
    SetNormalClass(textbox);
}

//Focus was left form the textbox
function focusLeft(textbox, text)
{
    if (textbox.value == "")
    {
        textbox.value = text;
        SetWatermarkClass(textbox);
    }
    else if (textbox.value == text)
    {
        SetWatermarkClass(textbox);
    }
    else
    {
        SetNormalClass(textbox);
    }
    
}

//Set the textbox to Watermark class
function SetWatermarkClass(textbox)
{
    textbox.className = "Watermarked";
}

//Set the textbox as normal class
function SetNormalClass(textbox)
{
    textbox.className = "ControlsText";
}