



//
// FUNCTION TO EXPAND MENUS
//

function expandMenu(menuid) {
// loop for each possible menu id
for (i = 1; i < 4; i++) {
// construct match id to compare to calling menu id
var matchid = "d_menu[" + i + "]";
// construct trigger id for style modification
var triggerid = "d_menutrigger[" + i + "]";
// if no match to calling menu id
if (matchid != menuid) {
// if element exists
if (document.getElementById(matchid)) {
// set display to none
document.getElementById(matchid).style.display = "none";
}
}
// if calling element exists
if (document.getElementById(menuid)) {
// set display to block
document.getElementById(menuid).style.display = "block";
}
}
// reset menuid
menuid = '';
return;
}

//
// FUNCTION TO CHANGE ELEMENT'S BACKGROUND COLOR
//

function changeBGColor(elem,color1,color2) {
// check current value of background color
if (elem.style.backgroundColor == color1) {
// assign new value to background color
elem.style.backgroundColor = color2;
} else {
elem.style.backgroundColor = color1;
}
return;
}





