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(){
for (var i=0; i<cssmenuids.length; i++){
  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"
    	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=100
    	this.getElementsByTagName("ul")[0].style.visibility="visible"
					this.getElementsByTagName("ul")[0].style.zIndex=0
    	}
    	ultags[t].parentNode.onmouseout=function(){
					this.style.zIndex=0
					this.getElementsByTagName("ul")[0].style.visibility="hidden"
					this.getElementsByTagName("ul")[0].style.zIndex=100
    	}
    }
  }
}

if (window.addEventListener)
window.addEventListener("load", createcssmenu2, false)
else if (window.attachEvent)
window.attachEvent("onload", createcssmenu2)

function moveOver(){
	var boxLength = document.forma.choiceBox.length;
	var selectedItem = document.forma.available.selectedIndex;
	var selectedText = document.forma.available.options[selectedItem].text;
	var selectedValue = document.forma.available.options[selectedItem].value;
	var i;
	var isNew = true;
	if (boxLength != 0) {
	for (i = 0; i < boxLength; i++) {
	thisitem = document.forma.choiceBox.options[i].text;
	if (thisitem == selectedText) {
	isNew = false;
	break;
		  }
	   }
	} 
	if (isNew) {
	newoption = new Option(selectedText, selectedValue, false, false);
	document.forma.choiceBox.options[boxLength] = newoption;
	}
	document.forma.available.selectedIndex=-1;
	document.forma.hid.value = saveMe();
}

function removeMe() {
	var boxLength = document.forma.choiceBox.length;
	arrSelected = new Array();
	var count = 0;
	for (i = 0; i < boxLength; i++) {
	if (document.forma.choiceBox.options[i].selected) {
	arrSelected[count] = document.forma.choiceBox.options[i].value;
	}
	count++;
	}
	var x;
	for (i = 0; i < boxLength; i++) {
	for (x = 0; x < arrSelected.length; x++) {
	if (document.forma.choiceBox.options[i].value == arrSelected[x]) {
	document.forma.choiceBox.options[i] = null;
	   }
	}
	boxLength = document.forma.choiceBox.length;
	}
	document.forma.hid.value = saveMe();
}

function removeselected(){
	var boxLength = document.forma.choiceBox.length;
	arrSelected = new Array();
	var count = 0;
	for (i = 0; i < boxLength; i++) {
		arrSelected[count] = document.forma.choiceBox.options[i].value;
		count++;
	}
	var x;
	for (i = 0; i < boxLength; i++) {
	for (x = 0; x < arrSelected.length; x++) {
		document.forma.choiceBox.options[i] = null;
	}
		boxLength = document.forma.choiceBox.length;
		document.forma.hid.value = " ";
	}
}

function saveMe() {
	var strValues = "";
	var boxLength = document.forma.choiceBox.length;
	var count = 0;
	if (boxLength != 0) {
	for (i = 0; i < boxLength; i++) {
	if (count == 0) {
	strValues = document.forma.choiceBox.options[i].value;
	}
	else {
	strValues = strValues + " " + document.forma.choiceBox.options[i].value;
	}
	count++;
	   }
	}
	return strValues;
}