/**
*
* egContextMenu Class
*/
function egContextMenu(id, posX, posY, width, height, container) {
	 this.objName = 'contextMenu_'+id;
	 this.id = id;
	 this.x = 0;
	 this.y = 0;
	 this.width = 0;
	 this.height = 0;

	 this.getHeight = egWindow_getHeight;
	 this.getWidth  = egWindow_getWidth;

	 this.show = egWindow_show;
	 this.hide = egWindow_hide;
	 this.moveTo = egWindow_moveTo;
	 this.displayAt = egWindow_displayAt;

	 this.addMenuItem = egContextMenu_addMenuItem;
	 this.addSeparator = egContextMenu_addSeparator;

/*
	 if(!container) {
	   container = 'easy-GUI_mainLayer';
	 }
*/
	 container = 'easy-GUI_topLayer';
	 
	 divRoot = document.getElementById(container);

	 divRoot.innerHTML += '<div id="'+this.id+'" class="egContextMenu"></div>';

	 this.shadow = new egShadow(this.id);

	 div = document.getElementById(this.id);
	 div.style.width  = width + 'px';
	 /*div.style.height = height + 'px';*/
}

function egContextMenu_addSeparator() {
	  var strTemp = '<div class="egContextMenuOptionSeparator"></div>';
	  div = document.getElementById(this.id);
	  div.innerHTML += strTemp;
}

function egContextMenu_addMenuItem(text, icon, action) {
	  var strTemp = '<div class="egContextMenuOuterFrame">'
	+ '    <a class="egContextMenuInnerFrame" href="javascript:'+action+'">'
	+ '        <div class="egContextMenuInnerFrameImage"><img border="0" src="'+icon+'" /></div>'
	+ '        <div class="egContextMenuInnerFrameText">'+text+'</div>'
	+ '    </a>'
	+ '</div>';
	  div = document.getElementById(this.id);
	  div.innerHTML += strTemp;
}
