var leftMenuLayerIds = new Array();

var curLeftMenuLayer = "";



function swapLeftmenu(menuId)

{

  if (menuId == curLeftMenuLayer)

  {

    var display = document.getElementById(menuId).style.display;



	if (display == "none")

      showLeftSubMenu(menuId);

    else {

      hideLeftSubMenu(menuId);

      curLeftMenuLayer = '';

    }

  }

  else

  {

    curLeftMenuLayer = menuId;

    var key;

    for (key in leftMenuLayerIds)

    {

      var lid = leftMenuLayerIds[key];

      if (menuId == lid){

        showLeftSubMenu(lid);

      }

	  else{

        hideLeftSubMenu(lid);

	  }

    }

  }

}



function showLeftSubMenu(menuId)

{

  var imgObj = document.getElementById("Image_"+menuId);

  var imgSrc = imgObj.src;

  if (imgObj.oSrc)

    imgObj.oSrc = imgObj.oSrc.replace(/\.gif/,'.gif');

  imgObj.src = imgSrc.replace(/\.gif/,'.gif');

  document.getElementById(menuId).style.display = "block";

}



function hideLeftSubMenu(menuId)

{

  var imgObj = document.getElementById("Image_"+menuId);

  var imgSrc = imgObj.src;

  if (imgObj.oSrc)

    imgObj.oSrc = imgObj.oSrc.replace(/-\.gif/,'.gif');

  imgObj.src = imgSrc.replace(/-\.gif/,'.gif');

  document.getElementById(menuId).style.display = "none";

}



function swapImage(imgId,param1,imgName,param2)

{

  if (curLeftMenuLayer && imgId.indexOf(curLeftMenuLayer) > -1)

    imgName = imgName.replace(/\.gif/,'.gif');

  MM_swapImage(imgId,param1,imgName,param2);

}





