Local variable function_result is now declared as var where needed.
Embedded asp code is accepted in vbs to javascript conversion.