var cssmenuids=["cssmenu1"] //Enter id(s) of CSS Horizontal UL menus, separated by commas
var csssubmenuoffset=-1 //Offset of submenus from main menu. Default is 0 pixels.

function createcssmenu2(){  //Counts the number of horisontal menupoints, and creates dropdown menues if needed.
for (var i=0; i<cssmenuids.length; i++){ //counts the number of horisontal menupoints 
  var ultags=document.getElementById(cssmenuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
			ultags[t].style.top=ultags[t].parentNode.offsetHeight+csssubmenuoffset+"px" //sets offset for submenu
    	var spanref=document.createElement("span") //creates dropdown area
			spanref.className="arrowdiv" //Retrieves picture of arrow in CSS
			spanref.innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;" //Arrow alignment
			ultags[t].parentNode.getElementsByTagName("a")[0].appendChild(spanref) //Gets the CSS specifications for the horisontal menupoints
    	ultags[t].parentNode.onmouseover=function(){ //Creates dropdown on mouseover
    	this.getElementsByTagName("ul")[0].style.visibility="visible" //Checks css file for area named "visibility" and sets this to visible
    	}
    	ultags[t].parentNode.onmouseout=function(){ //Removes dropdown on mouseout
			this.getElementsByTagName("ul")[0].style.visibility="hidden" //Checks css file for area named "visibility" and sets this to hidden
    }
    }
  }
}

if (window.addEventListener)
window.addEventListener("load", createcssmenu2, false) //For IE, this part activates creation of menu
else if (window.attachEvent)
window.attachEvent("onload", createcssmenu2) //For FF & Mozilla, this part activates creation of menu