var blankText = "                    ";

function selMove( sFrom, sTo, doAll )
{
    var ix;
    toLoc = sTo.options.length - 1;

    for ( ix = 0; ix < sFrom.options.length; ++ix )
    {
        sopt = sFrom.options[ix];
        if ( ( sopt.value != 0 ) && ( doAll || sopt.selected ) )
        {
            sTo.options[toLoc] = 
                new Option( sopt.text, sopt.value );
            ++toLoc; 
        }
        sTo.options[toLoc] = new Option( blankText, 0 ); 
    }
    for ( ix = sFrom.options.length - 1; ix >= 0; --ix )
    {
        sopt = sFrom.options[ix];
        if ( ( sopt.value != 0 ) && ( doAll || sopt.selected ) )
        {
            sFrom.options[ix] = null;
        }
    }
}

function showList( which )
{
    var msg = "Contents: ";
    var ix;
    for ( ix = 0; ix < which.options.length; ++ix )
    {
        sopt = which.options[ix];
        if ( sopt.value != 0 )
        {
            msg = msg + "[" + sopt.value + ":" + sopt.text + "] ";
        } else {
            msg = msg + "[0:dummy] ";
        }
    }
    alert( msg );
}

function forceSelect( which )
{
    var ix;
    for ( ix = 0; ix < which.options.length; ++ix )
    {
        sopt = which.options[ix];
        if ( sopt.value != 0 ) 
        {
            sopt.selected = true;
        } else {
            sopt.selected = false; 
        }
    }
}

