var cssmenuids=["mainmenu"] //Enter id(s) of CSS Horizontal UL menus, separated by commas
var csssubmenuoffset=0 //Offset of submenus from main menu. Default is 0 pixels.

function createcssmenu2(){
for (var i=0; i<cssmenuids.length; i++){
	  var ultags=document.getElementById(cssmenuids[i]).getElementsByTagName("ul") //DEBUG
	  //document.write('cssmenuids[i]: ' + cssmenuids[i] + '</br>');
	  for (var t=0; t<ultags.length; t++){
			ultags[t].style.top=ultags[t].parentNode.offsetHeight+csssubmenuoffset+"px"
			//document.write('UL TAG: ' + ultags[t] + ' - style top: ' + ultags[t].style.top + '</br>');//DEBUG
	
			var spanref=document.createElement("span")
			
			spanref.className="arrowdiv"
			spanref.innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;"
			ultags[t].parentNode.getElementsByTagName("a")[0].appendChild(spanref)
			
			ultags[t].parentNode.onmouseover=function(){
				this.style.zIndex=600
				this.getElementsByTagName("ul")[0].style.visibility="visible"
				this.getElementsByTagName("ul")[0].style.zIndex=500
			}
			ultags[t].parentNode.onmouseout=function(){
				this.style.zIndex=500
				this.getElementsByTagName("ul")[0].style.visibility="hidden"
				this.getElementsByTagName("ul")[0].style.zIndex=600
			}
    }
	//document.write('</br>');//DEBUG
  }
}


if (window.addEventListener)
window.addEventListener("load", createcssmenu2, false)
else if (window.attachEvent)
window.attachEvent("onload", createcssmenu2)
