Thanks Greg thats great, I'm quite rusty on my JS. If I wasn't passing box as the parameter, say I was passing the variable 'i', how could I make JS pass the "correct" value of 'i' instead of the last one? Regards, Pete