if( radiosw_loaded === undefined ) {

function radioChangeHandler( comrades )
{
    for( i=0; i < comrades.length; i++ )
        changeHandler( comrades[i].id );
}

// --- CommonRadioSwitcher ---

var CommonRadioSwitcher = function( id ) {
    this.pool = new Array;
    var $this = this;
    updates[id] = function() { $this.Refresh(); }
}
CommonRadioSwitcher.prototype.add = function( obj, two_st ) { 
    if( obj ) { this.pool[obj.GetDataElem().id] = obj; obj.two_st=two_st; }
}
CommonRadioSwitcher.prototype.over = function( uid ) { if( !this.pool[uid].two_st && !this.pool[uid].isOn() ) this.pool[uid].over(); }
CommonRadioSwitcher.prototype.out  = function( uid ) { if( !this.pool[uid].two_st && !this.pool[uid].isOn() ) this.pool[uid].out();  }
CommonRadioSwitcher.prototype.down = function( uid ) {
    for( var other in this.pool ) {
        if( other == uid ) continue;
        this.pool[other].out();
        this.pool[other].clear(true);
    }
    this.pool[uid].set(true);
    this.pool[uid].down();
    return true;
}
CommonRadioSwitcher.prototype.Refresh = function() {
    for( var other in this.pool )
        if( this.pool[other].isOn() ) this.pool[other].down(); else this.pool[other].enable();
}

var radiosw_loaded = true;

}
