
function OnGridSelectionChanged(Type) {
    if (Type == 1) {
        gvUnAssignedVehicles.GetSelectedFieldValues('VehicleId', OnGridSelectionCompleteUnAssVeh);
    }
    if (Type == 2) {
        gvAssignedVehicles.GetSelectedFieldValues('TAutoTokenID', OnGridSelectionCompleteAssVeh);
    }
}

function OnGridSelectionCompleteUnAssVeh(values) {
    var counter = document.getElementById("hdnVehicleIdsToBeAssinged");
    counter.value = '';
    for (var i = 0; i < values.length; i++) {
        counter.value = counter.value + values[i] + ',';
    }
}

function OnGridSelectionCompleteAssVeh(values) {
    var counter = document.getElementById("hdnVehicleIdsToBeUnassinged");
    counter.value = '';
    for (var i = 0; i < values.length; i++) {
        counter.value = counter.value + values[i] + ',';
    }
}

function LoadTUserVehAssignmentSettingsPopup() {
    var PnlRestrict = document.getElementById('pnlLeaseSettings');
    PnlRestrict.style.display = 'block';
}
function CloseTUserVehAssignmentSettingsPopup() {
    var PnlRestrict = document.getElementById('pnlLeaseSettings');
    PnlRestrict.style.display = 'none';
}
function LoadTUserVehUnAssignmentSettingsPopup() {
    var PnlRestrict = document.getElementById('pnlUnassignTUserVehicle');
    PnlRestrict.style.display = 'block';
}
function CloseTUserVehUnAssignmentSettingsPopup() {
    var PnlRestrict = document.getElementById('pnlUnassignTUserVehicle');
    PnlRestrict.style.display = 'none';
}