var menuOpacity=0.9;
// main function to handle the mouse events //
function ddMenu(id,d){
  var h = document.getElementById(id + '-ddheader');
  var c = document.getElementById(id + '-ddcontent');
  if(d == 1)
  {
	if(!c.maxh)
	{
      c.style.display = 'block';
      c.style.height = 'auto';
      c.maxh = c.offsetHeight;
      c.style.height = '0px';
      c.style.position='absolute';

    }
    ddSlide(c,1);
  }
  else
  {
	ddCollapse(c)
  }
}

// collapse the menu //
function ddCollapse(c)
{
  ddSlide(c,-1)
}

// cancel the collapse if a user rolls over the dropdown //
function cancelHide(id)
{
  var h = document.getElementById(id + '-ddheader');
  var c = document.getElementById(id + '-ddcontent');
ddSlide(c,1);
}

//  expand/close the dropdown and change the opacity //
function ddSlide(c,d){
  if (d==1)
  {
	c.style.height = c.maxh + 'px';
	c.style.opacity=menuOpacity;
	c.style.filter = 'alpha(opacity='+menuOpacity*100+')';
        c.style.position='absolute';
   }
	else 
   {
	c.style.height=0+'px';
	c.style.opacity=0;
	c.style.filter = 'alpha(opacity='+0+')';
        c.style.position='absolute';
    }
  }