
function style() {
 this.mouseOffFontColor = "ffffff";
 this.mouseOffBackgroundColor = "336699";
 this.mouseOnFontColor = "000000";
 this.mouseOnBackgroundColor = "orange";
 this.menuBorderColor;
 this.fontSize = 11;
 this.fontStyle = "normal"; // normal or italic 
 this.fontWeight = "normal"; // bold or normal
 this.fontName = "Arial, Verdana";
 this.menuItemPadding = 3;
 this.subMenuImage = ""  // Sub Menu Image (Leave this blank if not needed)
 this.borderAndSeparatorBar;  // 3D Border & Separator bar
 this.highColor = "66ffff";  // 3D High Color
 this.lowColor = "000099"; // 3D Low Color
 this.currentPageItemFontColor = "ffffff"; // Current Page Item Font Color (leave this blank to disable)
 this.currentPageItemBackgroundColor = "336699"; // Current Page Item Background Color (leave this blank to disable)
 this.topBarImage; // Top Bar image (Leave this blank to disable)
 this.menuHeaderFontColor = "ffffff";  // Menu Header Font Color (Leave blank if headers are not needed)
 this.menuHeaderBackgroundColor = "000099"; // Menu Header Background Color (Leave blank if headers are not needed)
}

function Menu() {
 this.menuName = ""; // Menu Name - This is needed in order for the menu to be called
 this.menuTop; // Menu Top - The Top position of the menu in pixels
 this.menuLeft; // Menu Left - The Left position of the menu in pixels
 this.menuWidth; // Menu Width - Menus width in pixels
 this.menuBorderWidth = 0;  // Menu Border Width 
 this.screenPosition; // Screen Position - here you can use "center;left;right;middle;top;bottom" or a combination of "center:middle"
 this.styleProperties = toStyleArray(new style()); // Style properties is set here
 this.alwaysVisible = 1; // Always Visible - allows the menu item to be visible at all time (1=on/0=off)
 this.alignment = "left"  // Alignment - sets the menu elements text alignment, values valid here are: left, right or center			
 this.filter; // Filter - Text variable for setting transitional effects on menu activation - see above for more info
 this.followScrolling; // Follow Scrolling - Tells the menu item to follow the user down the screen (visible at all times) (1=on/0=off)
 this.horizontalMenu = 1; // Horizontal Menu - Tells the menu to become horizontal instead of top to bottom style (1=on/0=off)
 this.keepAlive;  // Keep Alive - Keeps the menu visible until the user moves over another menu or clicks elsewhere on the page (1=on/0=off)
 this.positionOfTopSubImage; // Position of TOP sub image left:center:right
 this.setOverallWidth; // Set the Overall Width of Horizontal Menu to 100% and height to the specified amount (Leave blank to disable)
 this.rightToLeft; // Right To Left - Used in Hebrew for example. (1=on/0=off)
 this.openMenuOnClick; // Open the Menus OnClick - leave blank for OnMouseover (1=on/0=off) 
 this.idOfDiv; // ID of the div you want to hide on MouseOver (useful for hiding form elements)
 this.futureUse1; // Reserved for future use
 this.futureUse2; // Reserved for future use
 this.futureUse3; // Reserved for future use
 this.futureUse4; // Reserved for future use
}

function menuItem() {
 // "Description Text", "URL", "Alternate URL", "Status", "Separator Bar"
 this.descriptionText = "";
 this.url = "";
 this.alternateUrl;
 this.status;
 this.separatorBar = 1;
}

function toMenuArray(menuObj,arrItem) {
 var menuArray = [
	 menuObj.menuName,
	 menuObj.menuTop,
	 menuObj.menuLeft,
	 menuObj.menuWidth,
	 menuObj.menuBorderWidth,
	 menuObj.screenPosition,
	 menuObj.styleProperties,
	 menuObj.alwaysVisible,
	 menuObj.alignment,
	 menuObj.filter,
	 menuObj.followScrolling,
	 menuObj.horizontalMenu,
	 menuObj.keepAlive,
	 menuObj.positionOfTopSubImage,
	 menuObj.setOverallWidth,
	 menuObj.rightToLeft,
	 menuObj.openMenuOnClick,
	 menuObj.idOfDiv,
	 menuObj.futureUse1,
	 menuObj.futureUse2,
	 menuObj.futureUse3,
	 menuObj.futureUse4
 ];
 
 var itemLength = menuArray.length;
 
 for(i=0,j=0;i<arrItem.length;i++) {
 	var menuItemObj = arrItem[i];
	menuArray[itemLength++] = menuItemObj.descriptionText; 
 	menuArray[itemLength++] = menuItemObj.url;
	menuArray[itemLength++] = menuItemObj.alternateUrl;
 	menuArray[itemLength++] = menuItemObj.status;
 	menuArray[itemLength++] = menuItemObj.separatorBar; 
 }
 return menuArray; 
}

function toStyleArray(styleObj) {
 var styleArray = [
	 styleObj.mouseOffFontColor,
	 styleObj.mouseOffBackgroundColor,
	 styleObj.mouseOnFontColor,
	 styleObj.mouseOnBackgroundColor,
	 styleObj.menuBorderColor,
	 styleObj.fontSize,
	 styleObj.fontStyle,
	 styleObj.fontWeight,
	 styleObj.fontName,
	 styleObj.menuItemPadding,
	 styleObj.subMenuImage,
	 styleObj.borderAndSeparatorBar,
	 styleObj.highColor,
	 styleObj.lowColor,
	 styleObj.currentPageItemFontColor,
	 styleObj.currentPageItemBackgroundColor,
	 styleObj.topBarImage,
	 styleObj.menuHeaderFontColor,
	 styleObj.menuHeaderBackgroundColor
 ]
 return styleArray;
}
