var textControl;
var radioControl = new Array();
var numchars;

function loadControls(tc,rc,nc){
    textControl = document.getElementById(tc);
    for(var i = 0; i <= 4; i++){
       radioControl[i] = document.getElementById(rc + "_" + i); 
    }        
    numchars = nc;
    
    window.setInterval('checkTextbox()', 250);
}

function checkTextbox(){
    if(textControl.value.length < numchars){
        changeRadios(true);
    }
    else{
        changeRadios(false);
    }    
}

function changeRadios(d){
    for(var i = 0; i <= 4; i++){
        radioControl[i].disabled = d;
        if(d == true){
            radioControl[i].checked = false;
        }
    }
}
