// JScript File

function WatermarkTextBox(watermarkText) {
    var _watermarkText = watermarkText;

    this.TextboxClick = TextboxClick;
    this.TextboxLeave = TextboxLeave;

    function TextboxClick(event) {
        var tb = null;
        if (window.event)
            tb = window.event.srcElement;
        else if (event.target)
            tb = event.target;
        if (tb != null) {
            tb.value = "";
            tb.setAttribute("class", "widetextfield");
            tb.setAttribute("className", "widetextfield");
        }
    }

    function TextboxLeave(event) {
        var tb = null;
        if (window.event)
            tb = window.event.srcElement;
        else if (event.target)
            tb = event.target;
        if (tb != null) {
            if (tb.value == "") {
                tb.value = _watermarkText;
                tb.setAttribute("class", "watermarkWidetextfield");
                tb.setAttribute("className", "watermarkWidetextfield");
            }
        }
    }
}