An question about detecting an submenu

fixed!

anybody get any idea? or is my code to long to read? I might be able to shorten it up a bit so you can see more clearly what the problem is?

Greetz