function SwitchMenu(obj, menuobj)
{
 if(document.getElementById)
 {
  var el = document.getElementById(obj);
  var eli = document.getElementById("cont").getElementsByTagName("LI");
  for (var i=0; i<eli.length; i++)
  {
   if(eli[i].className.indexOf('Menu') > 0)
   {
    eli[i].className = 'liMenuOut';
   }
  }
  var ar = document.getElementById("cont").getElementsByTagName("DIV");
  if (el)
  {
  if(el.style.display == "none")
  {
   for (var i=0; i<ar.length; i++)
   {
    ar[i].style.display = "none";
   }
   el.style.display = "block";
   document.getElementById(menuobj).className = "liMenuActive";
  }else{
   el.style.display = "none";
  }
  }
 }
}

function CollapseMenu()
{
 var eli = document.getElementById("cont").getElementsByTagName("LI");
 for (var i=0; i<eli.length; i++)
 {
  if(eli[i].className.indexOf('Menu') > 0)
  {
   eli[i].className = 'liMenuOut';
  }
 }
 var ar = document.getElementById("cont").getElementsByTagName("DIV");
 for (var i=0; i<ar.length; i++) ar[i].style.display = "none";
}

function SelectMenu()
{
 var tmpLoc = "";
 if(location.href.lastIndexOf('MENU=') > 0)
 {
  tmpLoc = location.href.substring(location.href.lastIndexOf('MENU=') + 5);
  if(tmpLoc.indexOf('&') > 0) tmpLoc = tmpLoc.substring(0, tmpLoc.indexOf('&'));
 } else {
  tmpLoc = location.href.substring(location.href.lastIndexOf('/') + 1);
  if(tmpLoc.indexOf('&') > 0) tmpLoc = tmpLoc.substring(0, tmpLoc.indexOf('&'));
 }
 if(tmpLoc.indexOf('#') > 0) tmpLoc = tmpLoc.substring(0, tmpLoc.indexOf('#'));
 if(tmpLoc.indexOf('-') > 0)
 {
  tmpMenu = tmpLoc.substring(0, tmpLoc.indexOf('-'));
  tmpSubMenu =  tmpLoc.substring(tmpLoc.indexOf('-') + 1);
  if(tmpSubMenu.indexOf('&') > 0) tmpSubMenu = tmpSubMenu.substring(0, tmpSubMenu.indexOf('&'));
 } else {
  tmpMenu = tmpLoc;
  tmpSubMenu = 'none';
 }
 if(tmpSubMenu != 'none')
 {
  SwitchMenu('sub' + tmpMenu, 'menu' + tmpMenu);
  var els = document.getElementById('lisublink' + tmpLoc);
  if(els) els.className = 'liSubActive';
 } else {
  var els = document.getElementById('menu' + tmpLoc);
  if(els) els.className = 'liMenuActive';  
 }
}

function VerticalMenu()
{
 var tmpLoc = "";
 if(location.href.lastIndexOf('VMENU=') > 0)
 {
  tmpLoc = location.href.substring(location.href.lastIndexOf('VMENU=') + 6);
  if(tmpLoc.indexOf('&') > 0) tmpLoc = tmpLoc.substring(0, tmpLoc.indexOf('&'));
 } else {
  tmpLoc = location.href.substring(location.href.lastIndexOf('/') + 1);
  if(tmpLoc.indexOf('&') > 0) tmpLoc = tmpLoc.substring(0, tmpLoc.indexOf('&'));
 }
 if(tmpLoc.indexOf('#') > 0) tmpLoc = tmpLoc.substring(0, tmpLoc.indexOf('#'));

 var ar = document.getElementById("contsmall").getElementsByTagName("LI");
 for (var i=0; i<ar.length; i++)
 {
	if(ar[i].id == tmpLoc) ar[i].className = 'liMenuActivesmall';
 }
}

