function mouseOverContextButton(buttonID)
{
	var btn = document.getElementById("btn_"+buttonID);
	var btn_img = document.getElementById("btn_img_"+buttonID);	
	btn.style.backgroundColor='#CCCCCC';
	btn_img.style.backgroundColor='#CCCCCC';
}

function mouseContextMenuButtonPressed(buttonID,senderObject)
{
	contextVisible=false;
	deActivate();
	clickMode=false;
	contextMenuPressed(buttonID,senderObject);	
}

function mouseOutContextButton(buttonID)
{
	var btn = document.getElementById("btn_"+buttonID);
	var btn_img = document.getElementById("btn_img_"+buttonID);	
	btn.style.backgroundColor='#E6ECFF';
	btn_img.style.backgroundColor='#E6ECFF';
}

function EnterContextMenu(layerName, TTitle, TContent, senderObject){
clickMode=true;
ContentInfo = '<table border="0" class="ContextMenuTable" cellspacing="0" cellpadding="0">'+
'<tr><td width="100%" class="ContextMenuRow">'+
'<table border="0" width="100%" cellpadding="0" cellspacing="1" align="center">'+
'<tr><td width="100%"><table width="100%" cellpadding=0 cellspacing=0>';
for (var x=0;x<TContent.length;x++)
{
var arr = TContent[x];
if (arr[0] != 0)
	ContentInfo += '<tr><td id="btn_img_'+arr[0]+'" onclick="mouseContextMenuButtonPressed(\''+arr[0]+'\',\''+senderObject+'\');" onMouseOver="mouseOverContextButton(\''+arr[0]+'\');" onMouseOut="mouseOutContextButton(\''+arr[0]+'\');" class="contextMenuImageBtn" width=10><a href="#" ><img src="./content/images/'+arr[2]+'" border=0></a></td><td id="btn_'+arr[0]+'" onclick="mouseContextMenuButtonPressed(\''+arr[0]+'\',\''+senderObject+'\');" onMouseOver="mouseOverContextButton(\''+arr[0]+'\');" onMouseOut="mouseOutContextButton(\''+arr[0]+'\');" class="contextMenuButton" align=center><a class="ContextMenuLinkButton" href="#" >'+arr[1]+'</a></td></tr>';
else
{
	ContentInfo += '<tr><td class="ContextMenuInfoBorder" colspan=2 valign=top align=center><table width="100%" cellpadding=0 cellspacing=0><tr><td class="ContextMenuInfoHeader">'+arr[1]+'</td></tr><tr><td class="ContextMenuInfoContent">'+arr[2]+'</td></tr></table></td></tr>';
}
}
ContentInfo += 
'</table></td></tr>'+
'</table>'+
'</td></tr>'+
'</table>'+
'</td></tr>'+
'</table>';
contextVisible=false;
ReplaceContent(layerName);
Activate();
overhere("");
}
