var DDSPEED = 1;
var DDTIMER = 1;

// 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){
 
      c.style.display = 'block';
      c.style.height = 408;
      
      c.maxh =0;
     
    
  }else{
     c.style.display = 'none';
      c.style.height =0;
      c.maxh =0;
  }
}

// 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) ;
 
}

// incrementally expand/contract the dropdown and change the opacity //
function ddSlide(c,d){
  var currh = c.offsetHeight;
  var dist;
  if(d == 1){
      c.style.display = 'block';
      c.style.height =408;
      c.maxh =0;
  }
  else{
    currh = 0;
    c.style.height = currh + 'px';
 
    c.maxh =408
   // dist = (Math.round(currh / DDSPEED));
  }
 //  c.style.height = currh + (dist * d) + 'px';
  
 
}

 