var curBranch = null;

function changeBranch(hint){
        if(curBranch)curBranch.style.display = "none";

        curBranch                            = document.all['subbranch'+event.srcElement.value];
        curBranch.style.display              = "block";

        resetHint(hint);
}

function showBranch(hint){
        if(event.srcElement.selectedIndex != -1){ 
                hint.value                   = event.srcElement[event.srcElement.selectedIndex].text;
                document.all['okonx'].value  = event.srcElement[event.srcElement.selectedIndex].value != "00000" ? event.srcElement[event.srcElement.selectedIndex].value : "";
        }
}

function resetHint(hint){
        if(curBranch != null){ 
                hint.value                   = curBranch[curBranch.selectedIndex].text;
                document.all['okonx'].value  = curBranch[curBranch.selectedIndex].value != "00000" ? curBranch[curBranch.selectedIndex].value : "";
        }
}

function FormCreate(hint){
        if(curBranch)curBranch.style.display = "none";

        curBranch                            = document.all['subbranch0'];
        if(curBranch)curBranch.style.display = "block";

        resetHint(hint);
}


