when you hit a button, you call menu_detail, but this only changes var detail,

and in action detail_event(){ it's only searching on create for which detail it is

so... i'm guessing there's more to you code that creates the level after you've chosen detail, but if not, that's your problem

hope this helps