I don't see how this works:
ddmenuitemparent = document.getElementsByClassName(this).parentNode;
getElementsByClassName returns an *array* (okay, technically a collection). So how can you get the parentNode of an entire collection?
On top of that, getElementsByClassName is expecting, as the name says, a *NAME* as its argument. You are, instead, passing in an object (this is always an object of some kind, it would not likely be a class name).
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.