function MoveInputValue() {
    this.oFrom = null;
    this.oTo = null;
}

MoveInputValue.prototype.$ = function (oid) {
    if (typeof oid == "object") {
        return oid;
    }
    oid = document.getElementById(oid);
    if (oid) {
        return oid;
    } else {
        return null;
    }
};

MoveInputValue.prototype.move = function (oIdInputFrom, oIdInputTo) {
    var value = '';
    this.oFrom = this.$(oIdInputFrom);
    if (typeof this.oFrom.oTo == 'undefined') {
        this.oFrom.oTo = this.$(oIdInputTo);
    }
    this.oTo = this.oFrom.oTo;
    if (!this.oFrom || !this.oTo) {
        return false;
    }
    value = (this.oFrom.value||'') + '';
    
    if (this.oTo.value == '' || (this.oTo.defaultValue == this.oFrom.defaultValue && this.oTo.defaultValue == this.oTo.value)) {
        this.oTo.defaultValue = value;
        this.oTo.value = value;
    }
    this.oFrom.defaultValue = value;
    return true;
}

var moveInputValue = new MoveInputValue();
