this not really a google maps question and my solution is definitely
not the best. Maybe somebody can tell you a better way, but here's
what I'd do:
assign a global variable at top of your script
var myVar = null;
when you create your marker (home), add your variable to the marker
array as a key:value pair
var: 1
inside your marker click function, assign the global myVar value with
your home.var value
myVar = home.var;
inside your jQuery dialog confirm function, put
test(myVar);