var DDSPEED = 10;
var DDTIMER = 15;

// main function to handle the mouse events //
function ddMenu(id,d){
  var h = document.getElementById(id + '-ddheader');
  var c = document.getElementById(id + '-ddcontent');
  $(c).stop(true,true);
  if(d == 1){
  $(h).stop(true,true);
  //$(h).css({opacity: 1,height: c.maxh});
    if(c.maxh && c.maxh <= c.offsetHeight){return}
    else if(!c.maxh){
      c.style.display = 'block';
      c.style.height = 'auto';
      c.maxh = c.offsetHeight;
      c.style.height = '0px';
    }
	$(c).animate({opacity: 1,height: c.maxh});
  }else{
	$(c).animate({opacity: 0,height: '0px'});
  }
}

// collapse the menu //
function ddCollapse(c){
  //c.timer = setInterval(function(){ddSlide(c,-1)},DDTIMER);
}

// 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');
  $(h).stop(true,false);
  $(c).stop(true,true);
  $(c).css({opacity: 1,height: c.maxh});
}

