you can't create new variables on the fly with jscript afaik but you could do this with an associative array.
code:
var my_vars= new Array()
function setValue(name,data){
my_vars[name]=data;
}
note that you can assign a value to an item in the array without declaring that item.