  /* This script and many more are available free online at
The JavaScript Source!! http://www.javascriptsource.com
Created by: Konstantin Jagello | http://javascript-array.com/ */

var TimeOut         = 300;

var currentLayer    = null;

var currentitem     = null;
var currentLayerNum = 0;

var noClose         = 0;

var closeTimer      = null;




function mopen(n) {

  var l  = document.getElementById("menu"+n);

  var mm = document.getElementById("mmenu"+n);


	
  if(l) {

    mcancelclosetime();
 
   l.style.visibility='visible';
 
   if(currentLayer && (currentLayerNum != n))
 
     currentLayer.style.visibility='hidden';
 
   currentLayer = l;

    currentitem = mm;
 
   currentLayerNum = n;	
		
  } else if(currentLayer) {

    currentLayer.style.visibility='hidden';
    currentLayerNum = 0;

    currentitem = null;

    currentLayer = null;

 	}


}

function mclosetime() {

  closeTimer = window.setTimeout(mclose, TimeOut);


}

function mcancelclosetime() {
 
 if(closeTimer) {

    window.clearTimeout(closeTimer);

    closeTimer = null;

  }


}

function mclose() {

  if(currentLayer && noClose!=1)   {

    currentLayer.style.visibility='hidden';

    currentLayerNum = 0;

   currentLayer = null;

    currentitem = null;
 
 } else {
 
   noClose = 0;
 
 }
 
 currentLayer = null;

  currentitem = null;

}


document.onclick = mclose; 





















div#header { 
     border-radius:15px;
     margin-top:-110px;
     background-color:#e0edc5;
     border:5px solid #390;
     margin-left:300px;
     height:50px;
     padding:12px;
     text-align:center;
     width:1100px;
    -moz-box-shadow:2px 2px 4px #515151;
   -webkit-box-shadow:2px 2px 4px #515151;}











#dd {

  margin-left: 43%;
  padding: 0 0 20px 0;
  margin-top:-400px;

}



#dd li {
  margin: 0;
  padding: 0;
  list-style: none;
  float:left;
  font: bold 18px arial;

}



#dd li a.menu {
  display: block;
  text-align: center;
  background: green;
  padding: 4px 10px;
  margin: 0 1px 0 0;
  color: #FFF;
  width: 190px;
  text-decoration: none;
  border-radius:10px;


}



#dd li a.menu:hover {
  background:#8dcb41;
}



.submenu {
  background:#eaf3da;
  border: 1px solid green;
  visibility: hidden; 
  position: absolute; 
  z-index: 3;

}



.submenu a {
  display: block; 
  font: 23px arial; 
  text-align: left;
  text-decoration: none;
  padding: 5px;
  color:green;

}



.submenu a:hover {
  background: #8dcb41;
  color: #FFF;
}






 












   






