// handle events (mouse-over, mouse-out, mouse-down) event in menu area.
var normalText1;
function jsMouseDownEvent(mEvent)
{
	// Internet Explorer
	if (mEvent.srcElement)
		HandleMouseEvent(mEvent.srcElement, 'mousedown');
	// Netscape and Firefox
	else if (mEvent.target)
		HandleMouseEvent(mEvent.target, 'mousedown');
}

function jsMouseOverEvent(mEvent)
{
	// Internet Explorer
	if (mEvent.srcElement)
		HandleMouseEvent(mEvent.srcElement, 'mouseover');
	// Netscape and Firefox
	else if (mEvent.target)
		HandleMouseEvent(mEvent.target, 'mouseover');
}

function jsMouseOutEvent(mEvent)
{
	// Internet Explorer
	if (mEvent.srcElement)
		HandleMouseEvent(mEvent.srcElement, 'mouseout');
	// Netscape and Firefox
	else if (mEvent.target)
		HandleMouseEvent(mEvent.target, 'mouseout');
}

function HandleMouseEvent(node, action)
{
    if (action == 'mouseover') {
	    if (node.nodeName.toUpperCase() == 'A') {
            normalText1 = node.runtimeStyle.cssText;
            node.runtimeStyle.cssText = 'color:blue;background-color:#FFFFFF;border:1px groove pink;text-decoration:none;padding-right:2px;'
        }
    }
    if (action == 'mouseout') {
	    if (node.nodeName.toUpperCase() == 'A') 
            node.runtimeStyle.cssText  = normalText1;
    }
    if (action == 'mousedown') {   // toggle +/- gif image
	    if (node.nodeName.toUpperCase() == 'IMG') {  // clicked on <IMG ..> area
	        if (node.src.indexOf('plus.')>0) {
	            node.src = '../image/minus.gif';
                node.nextSibling.nextSibling.style.display = 'block';
            }
	        else if (node.src.indexOf('minus.')>0) {
	            node.src = '../image/plus.gif';
                node.nextSibling.nextSibling.style.display = 'none';
	        }
	    }
	    if (node.nodeName.toUpperCase() == 'A') {   // clicked on <A ...> area, plus/minus image is at left of <A...>
	        if (node.previousSibling.src.indexOf('plus.')>0) {
	            node.previousSibling.src = '../image/minus.gif';
                node.nextSibling.style.display = 'block';
            }
	        else if (node.previousSibling.src.indexOf('minus.')>0) {
	            node.previousSibling.src = '../image/plus.gif';
                node.nextSibling.style.display = 'none';
	        }
	    }
    }  
}

