function __doOpen(sURL) {
    window.open("http://" + sURL, "_blank", "height=500,width=500,top=50,left=50,location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,titlebar=yes,toolbar=yes", false);
}

function __doOpenFull(sURL) {
    window.open("http://" + sURL, "_blank", "top=50,left=50,location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,titlebar=yes,toolbar=yes", false);
}

function __doOpenHelp(sURL) {
    window.open(sURL, "_blank", "height=500,width=350,top=50,left=50,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=yes,toolbar=no", false);
}

function disableSubmit(btnToDisable) {
    btnToDisable.className = "DisabledButton";
    btnToDisable.onclick = function() { return false };
}

function enableSubmit(btnToEnable) {
    btnToEnable.className = "Button";
    btnToEnable.onclick = null;
}

function checkAllBoxes(frmAll, chkAll, strAll) {
    // If the checkbox calling the function is itself checked, the rest of the specified checkboxes
    // are then made checked, else, all are made unchecked

    blnCheckAll = false;

    if (chkAll.checked) {
        blnCheckAll = true;
    }

    // Loops through all the elements in the given form, looking for checkboxes whose names contain
    // the specified text
    for (i = 0; i < frmAll.elements.length; i++) {
        if (frmAll.elements[i].type == "checkbox" && frmAll.elements[i].name.indexOf(strAll) >= 0) {
            // Sets the box's "checked" attribute to the appropriate value
            frmAll.elements[i].checked = blnCheckAll;
        }
    }
}

//This function will return a characters remaining value in the inputfield. It counts the length of the textfield and
//subtracts the length from the maxvalue. It also prevents the user from going over the maximum.
function onUpdateStrLength(textfield, inputfield, maxvalue) {
    txt = document.getElementById(textfield);
    ifld = document.getElementById(inputfield);
    if (txt.value.length > maxvalue)
        txt.value = txt.value.substr(0, maxvalue);
    ifld.value = maxvalue - txt.value.length;
}

//Formats a phone number
function formatPhone(txt) {
    strValue = removeNonNumeric(txt.value);

    if (strValue.length == 0)
        return true;

    if (strValue.length == 7) {
        txt.value = strValue.substring(0, 3) + "-" + strValue.substring(3, 7);

        return true;
    }

    if (strValue.length == 10) {
        txt.value = strValue.substring(0, 3) + "-" + strValue.substring(3, 6) + "-" + strValue.substring(6, 10);

        return true;
    }

    txt.value = strValue;

    return false;
}