If you are going down this route, although I'm sure there are more graceful solutions to what you are doing... you are better off sending an object with all the keys and values you wish to set:
setValue({amount1:'amount1', amount2:'amount2'});
This structure is far more extensible than defining sperate variables. All you need do is make sure your keys tie up to their destination inputs with some kind of standardized naming convension and you can use a function like this:
function(obj){
var i, elm;
for( i in obj ) {
if ( (elm = document.getElementById(i)) ) {
elm.value = obj[i];
}
}
}
By standardised naming convension, all I mean is that your key names match that of their destination inputs. so you have inputs on your destination page with id="amount1" and another with id="amount2". Also bear in mind if you are sending "amounts" I'm guessing they are numerical.. if so you don't need to send them as strings, which means you can avoid the \" escapes.
web.loadUrl(
"javascript:window.onload = function(){setValue({amount1:123, amount2:5});};"
);