That's because they're defined in the function "StartDownload", and thus they're private for the function. They aren't accessible outside that function.
To fix this, you have to define Width and Height globally. At the very beginning of your script, outside any function, add this:
code:
var Width;
var Height
//Here the rest of the script, in your case: function OnEvent_Initialize(MessengerStart) etc.
and remove the "var" before Width and Height in your function. This way, the variables are accessible by all parts of your script, and can also be changed by any function.