var cells = new Array();

function onMouseCell(id, bgcolor, textcolor)
{
	var cell = document.getElementById(id);
	cells[id] = [cell.style.backgroundColor, cell.style.color];
	
	if (!cell) 
		return;
	
	cell.style.backgroundColor = bgcolor;
	cell.style.color = textcolor;
}

function offMouseCell(id)
{
	var cell = document.getElementById(id);
	
	if (!cell) 
		return;
	
	cell.style.backgroundColor = cells[id][0];
	cell.style.color = cells[id][1];
}

function switchClass(id, className)
{
	var cell = document.getElementById(id);
	
	if (!cell) 
		return;
		
	cell.className = className;
}

var padding_w = 4;
var border_w = 1;
var pt_offset = document.all?1:0;

function HighlightProperty(id, row, on)
{
	var map_rgn = YAHOO.util.Dom.getRegion('comm_map_id');
	var popup = YAHOO.util.Dom.get('comm_map_popup_id');
	var point = YAHOO.util.Dom.get('comm_map_point_id');

	if (on)
	{
		switchClass('proprow_'+id, 'chart_on');
	
		popup.innerHTML = prop_list[id].name;
		
		popup_rgn = YAHOO.util.Dom.getRegion('comm_map_popup_id');
		YAHOO.util.Dom.setX('comm_map_popup_id', map_rgn.left+prop_list[id].map_x-popup_rgn.width+2*padding_w+2*border_w+11);
		YAHOO.util.Dom.setY('comm_map_popup_id', map_rgn.top+prop_list[id].map_y-popup_rgn.height-9+pt_offset);
		
		popup_rgn = YAHOO.util.Dom.getRegion('comm_map_popup_id');
		YAHOO.util.Dom.setX(point, popup_rgn.right-22+pt_offset);
		YAHOO.util.Dom.setY(point, popup_rgn.bottom-2+pt_offset);
		
		YAHOO.util.Dom.setStyle('comm_map_popup_id', 'visibility', 'visible');
		YAHOO.util.Dom.setStyle('comm_map_point_id', 'visibility', 'visible');
	}
	else
	{
		switchClass('proprow_'+id, 'chart_'+row+'_off');
	
		YAHOO.util.Dom.setStyle('comm_map_popup_id', 'visibility', 'hidden');
		YAHOO.util.Dom.setStyle('comm_map_point_id', 'visibility', 'hidden');	
	}
}