// JavaScript Document

function FloatingPanel() {}

FloatingPanel.panels = new Array();

FloatingPanel.add = function(obj)
{
	var idx;

	for (idx = 0; idx < FloatingPanel.panels.length; ++idx) {
		if (FloatingPanel.panels[idx] == obj) { break; }
	}
	
	FloatingPanel.panels[idx] = obj;
}

FloatingPanel.remove = function(obj)
{
	eval('clearTimeout(t'+obj.id+');');
	obj.style.display = "none";
	FloatingPanel.panels.remove(obj);
}

FloatingPanel.clearAll = function()
{
	for (var idx = 0; idx < FloatingPanel.panels.length; ++idx) {
		var obj = FloatingPanel.panels[idx];
		
		FloatingPanel.remove(obj);
	}
}

function cancelB(event)
{
	// Cancel Bubble
	if (!event) var event = window.event;
	
	if (event) {
		event.cancelBubble = true;
		if (event.stopPropagation) event.stopPropagation();
	}
}

function floatingPanelAction(element, event)
{
	cancelB(event);
	
	FloatingPanel.clearAll();
	FloatingPanel.add(element);
	code = "document.getElementById('"+element.id+"').style.display = 'block';";
	
	eval('t'+element.id+' = setTimeout(code, 500);');
}

function finger(f, event)
{
	floatingPanelAction($('finger_'+f), event);
	
}

document.body.onmouseover = function() { FloatingPanel.clearAll(); }