function setClassName(objId, className) {
    document.getElementById(objId).className = className;
}

function CheckCountry(countrySelectBox, stateUSDropDownID, stateCanadaDropDownID, stateTextBoxID, countryValidatorId) {
    var stateUSDropDown = document.getElementById(stateUSDropDownID);
    var stateCanadaDropDown = document.getElementById(stateCanadaDropDownID);
    var stateTextBox = document.getElementById(stateTextBoxID);
    var countryValidator = document.getElementById(countryValidatorId);

    if (countrySelectBox.options[countrySelectBox.selectedIndex].value == "")
        ValidatorEnable(countryValidator, true);
    else
        ValidatorEnable(countryValidator, false);

    if (countrySelectBox.options[countrySelectBox.selectedIndex].value == "224") {
        stateUSDropDown.className = 'show';
        stateCanadaDropDown.className = 'hide';
        stateTextBox.className = 'hide';
    }
    else if (countrySelectBox.options[countrySelectBox.selectedIndex].value == "40") {
        stateUSDropDown.className = 'hide';
        stateCanadaDropDown.className = 'show';
        stateTextBox.className = 'hide';
    }
    else {
        stateUSDropDown.className = 'hide';
        stateCanadaDropDown.className = 'hide';
        stateTextBox.className = 'show';
        stateTextBox.value = "";
    }
}

function UpdateStateBoxValue(stateDropDown, stateTextBoxID, stateValidatorId) {
    var stateTextBox = document.getElementById(stateTextBoxID);
    var stateValidator = document.getElementById(stateValidatorId);

    stateTextBox.value = stateDropDown.options[stateDropDown.selectedIndex].value;

    if (stateTextBox.value == "")
        ValidatorEnable(stateValidator, true);
    else
        ValidatorEnable(stateValidator, false);
}

function UpdateStateBoxValidator(stateTextBox, stateValidatorId) {
    var stateValidator = document.getElementById(stateValidatorId);

    if (stateTextBox.value == "")
        ValidatorEnable(stateValidator, true);
    else
        ValidatorEnable(stateValidator, false);
}

function ToggleDescRequired(checkboxId, textboxId, validatorId) {
    var checkbox = document.getElementById(checkboxId);
    var textbox = document.getElementById(textboxId);
    var validator = document.getElementById(validatorId);

    if (checkbox.checked == true) {
        textbox.disabled = false;
        ValidatorEnable(validator, true);
    }
    else {
        textbox.value = "";
        textbox.disabled = true;
        ValidatorEnable(validator, false);
    }
}

function avoidSubmitInFirefox(e) {
    var evt = e ? e : window.event;
    if (evt.keyCode == 13) evt.cancelBubble = true;
}

function ShowHideOtherPracticeSettingsDesc(practiceSettingsDropDown, pnlPracticeSettingsOtherTextBoxId) {
    var pnlPracticeSettingsOtherTextBox = document.getElementById(pnlPracticeSettingsOtherTextBoxId);

    if (practiceSettingsDropDown.options[practiceSettingsDropDown.selectedIndex].value == "8") {
        pnlPracticeSettingsOtherTextBox.className = 'show_table_row';
    }
    else {
        pnlPracticeSettingsOtherTextBox.className = 'hide';
    }
}