
// Base context menu builder
function ContextMenuBuilder(contextMenuId){
	this.contextMenuId = contextMenuId
}

ContextMenuBuilder.prototype.build = function(domNode, dataNode){
	var contextMenu = top.document.getElementById(this.contextMenuId);
	var table = getItemsContainer(contextMenu);
	//  do not hide top and bottom indents
	for (var i=1; i < table.rows.length-1; i++){
		table.rows[i].className = "hidden_item";
	}
	this.populate(domNode, dataNode);

	function getItemsContainer(container){
		for (var j = 0; j < container.childNodes.length; j++){
			if (container.childNodes[j].tagName){
				return container.childNodes[j];
			}
		}
	}
}

ContextMenuBuilder.prototype.populate = function(domNode, dataNode){}

ContextMenuBuilder.prototype.checkForWordTipVisible = function(){
	if (!top.wordTipManager)
		return false
	
	return top.wordTipManager.displayed;
}