﻿// ------------------------------------------------------------------------
// Hides the watermark text in the given textbox
// ------------------------------------------------------------------------
function HideTextBoxEmailMessage(elem)
{
    if(elem != null)
    {
        if(elem.value == elem.defaultValue)
        {
            elem.value = "";
            elem.className = elem.className.replace(" waterMarkField", "");
        }
    }
}

// ------------------------------------------------------------------------
// Shows the watermark text in the given textbox
// ------------------------------------------------------------------------
function ShowTextBoxEmailMessage(elem)
{
    if(elem != null)
    {
        if(elem.value == "")
        {
            elem.value = elem.defaultValue;
            elem.className = elem.className + " waterMarkField";
        }
    }
}

function confirmSubmit(msg) {
    if (confirm(msg) == true)
        return true;
    else
        return cancelEvent();
}

function cancelEvent() {
    // ie hack
    if (window.event) window.event.cancelBubble = true;
    return false;
}