Hi Lars,
I'm in the dark when it comes to this stuff but noticed one line of the code has " " around the menuitem text and the other line just has single quotes ' ' around the same text. Is that the way it's supposed to be?
var shutdiv =eval( "menuitem"+i+".thediv");
var shutdiv =eval('menuitem'+i+'.thediv');