﻿function LanguageChange(dropDown, divPanelId) {
    // show other language div if required, otherwise hide it
    var isOther = dropDown.options[dropDown.selectedIndex].value == "Other";
    document.getElementById(divPanelId).style.display = isOther ? "block" : "none";
}

function CourtOrdersChange(dropDown, rowId) {
    // show court orders if required, otherwise hide it
    var hasCourtOrders = dropDown.options[dropDown.selectedIndex].value == "1";
    document.getElementById(rowId).style.display = hasCourtOrders ? "" : "none";
}

function AddressNotApplicable(checkbox, rowIds) {
    // show address if required, otherwise hide it
    var visiblity = checkbox.checked ? "none" : "";
    for (var i = 0; i < rowIds.length; i++) {
        document.getElementById(rowIds[i]).style.display = visiblity;
    }
}

function DateRangeChange(dropDown, rowIds) {
    // show custom date rows if required, otherwise hide it
    var isDateRange = dropDown.options[dropDown.selectedIndex].value == "dateRange";
    for (var i = 0; i < rowIds.length; i++) {
        document.getElementById(rowIds[i]).style.display = isDateRange ? "" : "none";
    } 
}
