function ShowMenu(id) 
{
   	 DoShow(id);
   	 menuInFocus = id;
}


function ShowPreview(id) 
{
    DoShow(id);
}


function HidePreview(id) 
{
    DoShow(menuInFocus);
}

function DoShow(id,evenement) 
{
    // Unset all menu groups by setting the class to "off"
    // Assumes maximum of 15 groups (which is far more than will ever be used)
    for (i = 0; i < 15; i++) {
        var element = document.getElementById("group" + i);
        if (element != null) 
	{
            element.className = "off";
        } 
	else 
	{
            break;
        }
    }
    // Set new group to "on."
    document.getElementById(id).className = "on"; 
}