elName = '';

function objMove(elName, direction, selection) {
    leftBox = eln(elName + '__left');
    rightBox = eln(elName + '__right');
    
    originBox = (direction == 'toRight') ? leftBox : rightBox;
    targetBox = (direction == 'toLeft') ? leftBox : rightBox;

    originLength = originBox.childNodes.length;

    moveOptions    = new Array();

    for (i = 0; i < originLength; i++)    {
        opt = originBox.childNodes[i];
        if(!selection || opt.selected) {
            moveOptions.push(opt);
        }
    }
    for (h = 0; h < moveOptions.length; h++) {
        targetBox.appendChild(moveOptions[h]);
    }

    allOptions = document.getElementsByTagName('option');

    leftLength = leftBox.length;
    rightLength = rightBox.length;

    realval = '';
    for (i = 0 ; i < leftLength; i++) {
        opt = leftBox.childNodes[i];
        if (document.all) opt.setAttribute('selected',false)
        else opt.selected = false;
        if (i) realval+="\n";
        realval+=opt.value;
    }
    eln(elName).value = realval;
    for (i = 0 ; i < rightLength; i++) {
        opt = rightBox.childNodes[i];
        if (document.all) opt.setAttribute('selected',false)
        else opt.selected = false;
    }
}

