﻿// button mouseover
function btnMouseOver(btnObj, event){
    if (window.event)
        window.event.cancelBubble = true; // IE stop bubbling
    else
        if (event) // Firefox stop bubbling
	    {
		    event.preventDefault();
		    event.stopPropagation();
	    }
	var btnId = btnObj.getAttribute("id");
	if (null != btnId) { // update each picture of the button
        btnChangeBackground(btnId+"_left", "-over");
        btnChangeBackground(btnId+"_bg", "-over");
        btnChangeBackground(btnId+"_right", "-over");
    }
}
// button mouseout
function btnMouseOut(btnObj, event){
    if (window.event)
        window.event.cancelBubble = true; // IE stop bubbling
    else
        if (event) // Firefox stop bubbling
	    {
		    event.preventDefault();
		    event.stopPropagation();
	    }
	var btnId = btnObj.getAttribute("id");
	if (null != btnId) { // update each picture of the button
        btnChangeBackground(btnId+"_left", "");
        btnChangeBackground(btnId+"_bg", "");
        btnChangeBackground(btnId+"_right", "");
    }
}
// change node picture
function btnChangeBackground(nodeId, filenameSuffix){
    var pictObj = document.getElementById(nodeId);
    if (null != pictObj) {
        var pictExt = pictObj.getAttribute("pictExt");
        var pictName = pictObj.getAttribute("pictName");
        pictObj.style.backgroundImage = "url(/images/roundBtns/"+pictName+filenameSuffix+"."+pictExt+")";
    }
}
