
function showSubmenu(objMenu,txtSubmenu,status){
  //close all menus
  shutSubmenu(status);
  //show current menu
  newLeft=getAbsX(objMenu)-2;
  newTop=getAbsY(objMenu)+25;
  mySubmenu=document.getElementById(txtSubmenu);
  mySubmenu.style.left=newLeft;
  mySubmenu.style.top=newTop;
  mySubmenu.style.display='inline';

  //shutmaster popup
  myShutmaster=document.getElementById('shutmaster');
  myShutmaster.style.width=document.body.clientWidth-100;
  myShutmaster.style.height=document.body.clientHeight-320;

  //highlight current menu point
	over(objMenu,status);
}

function getAbsX(aObject) {
 // Return the absolute x coordinate of an element
  return aObject.offsetLeft + (aObject.offsetParent ? getAbsX(aObject.offsetParent) : 0);
}

function getAbsY(aObject) {
 // Return the absolute y coordinate of an element
  return aObject.offsetTop + (aObject.offsetParent ? getAbsY(aObject.offsetParent) : 0);
}

function shutSubmenu(status){
  //shut all submenus
  for(i=1;i<20;i++){
    //alert('menu_'+i);
    myElement=document.getElementById('sub_'+i);
    if(!myElement) continue;
    myElement.style.display="none";
  }
  //close shutmaster
  myShutmaster=document.getElementById('shutmaster');
  myShutmaster.style.width=0;
  myShutmaster.style.height=0;
  //de-highlight menu
  if (status!="status") out();
}

//highlight function for menu
function over(aObject,status){
  //de-highlight all menu points
  if (status!="status") out();
  //highlight current menu
  aObject.style.backgroundColor='#AA2321';
}

//anti-highlight function for menu
function out(){
  //alert("out");
  for(i=1;i<=40;i++){
		if (i!=status) {
    	myElement=document.getElementById('menu_'+i);
    	if(!myElement) continue;
    	myElement.style.backgroundColor='#0F173F';
		}
  }
}


//highlight function for submenus
function subover(aObject){
  aObject.style.backgroundColor='#AA2321';
  aObject.style.color='#ffffff';
}

//anti-highlight function for submenus
function subout(aObject){
  aObject.style.backgroundColor='#959cb6';
  aObject.style.color='#000000';
}

