var groupFiles = new Array();

function groupFile(fileName,groupId){
    this.fileName = fileName;
    this.groupId = groupId;
}

function selectChanges(el){
    if(el.value == "") return false;
    re = new RegExp(el.value);
    for(i=0; i < groupFiles.length ;i++){
        if (re.test(groupFiles[i].fileName)){
            $('group'+groupFiles[i].groupId).checked = true;
        }
    }
    el.value = "";
    return false;
}

function invertSelect(){
    for(i=0; i < groupFiles.length ;i++){
        var el = $('group'+groupFiles[i].groupId);
        if (el.checked){
            el.checked = false;
        } else {
            el.checked = true;
        }
    }
    return false;
}

function clearSelect(){
    for(i=0; i < groupFiles.length ;i++){
        var el = $('group'+groupFiles[i].groupId);
        el.checked = false;
    }
    return false;
}
