creating a menu in javascript issues
<p>I have created a menu using js and css. Each li in the top level ul has a specific background image also a specific onmouseover image.</p>

<p>Everything is working fine, EXCEPT the onmouseover background whenever I have a submenu under it. Please check the vertical menu under the following link:
<a href="http://www.balouta.com/Autostar3/testmenu/test.html" rel="nofollow">http://www.balouta.com/Autostar3/testmenu/test.html</a></p>

<p>The Javascript used is the following:</p>

<pre><code>var menuids=new Array("verticalmenu")
var submenuoffset=0 

function createcssmenu(){

for (var i=0; i&lt;menuids.length; i++){
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t&lt;ultags.length; t++){

    ultags[t].parentNode.onmouseover=function(){ 

    this.getElementsByTagName("ul")[0].style.right=this.parentNode.offsetWidth+submenuoffset+"px"
    this.getElementsByTagName("ul")[0].style.display="block"

    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.display="none"
    }
    }
  }
}


if (window.addEventListener)
window.addEventListener("load", createcssmenu, false)
else if (window.attachEvent)
window.attachEvent("onload", createcssmenu)
</code></pre>
