<!--
// File:   utils.js
// Author: Graeme S. McAfee
// Email:  gmcafee@sympatico.ca
// Copyright 2006 Graeme S. McAfee. All rights reserved.
//
// Modification of this code is not permitted without the express permission
// from the author.

//=============================================================================
// Utility functions
//=============================================================================

// ----------------------------------------------------------------------------
// Create a DOM menuitem "<div>" element object
// ----------------------------------------------------------------------------
function createMenuDivElement(name) {
	var nav = document.getElementById("navbar");
	var div = document.createElement("DIV");
	var styleStr;
	
	div.id = name;
	nav.appendChild(div);

	return div;
}

// ----------------------------------------------------------------------------
// Create a DOM menuitem "<div>" element object
// ----------------------------------------------------------------------------
function createMenuItemDivElement(name, index, type, text, hasSubmenu) {
	var div;
	
	div = document.createElement("DIV");
	div.id = name +"_"+ type +"_"+ index;
		
	if (text) {
		html  = "<table border='0' cellpadding='0' cellspacing='0'>";
		html += "<tr>";

		html += "<td style='white-space:nowrap'>" + text + "</td>";
		
		if (type != "mainmenu"){
			html += "<td>";
			
			if (type == "submenuItem" && hasSubmenu) {
				html += "&nbsp;<img src='images/arrow.gif' />";
			}
			
			html += "</td>";
		}
	
		html += "</tr></table>";




		div.innerHTML = html;

	}
	
	styleStr = getStyleString(type);
	div.style.cssText = styleStr;
	div.setAttribute("style", styleStr);
		
	return div;
}

function point(x,y) {
	this.x = x;
	this.y = y;
}

//-->
