// JavaScript Document
/***********************************************
* AnyLink Vertical Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="main.php?section=about&subsection=mission"> MISSION</a>'
menu1[1]='<a href="main.php?section=about&subsection=history"> HISTORY</a>'
menu1[2]='<a href="main.php?section=about&subsection=principals"> PRINCIPALS</a>'
menu1[3]='<a href="main.php?section=about&subsection=firm-profile"> FIRM PROFILE</a>'
menu1[4]='<a href="main.php?section=about&subsection=locations"> LOCATIONS</a>'
menu1[5]='<a href="main.php?section=about&subsection=awards">NEWS AND AWARDS</a>'
menu1[6]='<a href="main.php?section=about&subsection=contact"> CONTACT US</a>'
menu1[7]='<img src="images/aBlank.gif" width="100%" height="5" />'

//Contents for menu 2
var menu2=new Array()
menu2[0]='<a href="main.php?section=services&subsection=mechanical"> MECHANICAL SYSTEM DESIGN</a>'
menu2[1]='<a href="main.php?section=services&subsection=electrical"> ELECTRICAL SYSTEM DESIGN</a>'
menu2[2]='<a href="main.php?section=services&subsection=structural"> STRUCTURAL SYSTEM DESIGN</a>'
menu2[3]='<a href="main.php?section=services&subsection=energy"> ENERGY SYSTEMS ANALYSIS &amp;<br />&nbsp;&nbsp;&nbsp;&nbsp;DESIGN/SUSTAINABLE<br />&nbsp;&nbsp;&nbsp;&nbsp;GREEN BUILDING DESIGN</a>'
menu2[4]='<a href="main.php?section=services&subsection=signal"> SIGNAL &amp;<br />&nbsp;&nbsp;&nbsp;&nbsp;TELECOMMUNICATIONS DESIGN</a>'
menu2[5]='<img src="images/aBlank.gif" width="100%" height="5" />'

//Contents for menu 3
var menu3=new Array()
menu3[0]='<a href="main.php?section=experience&subsection=healthcare"> HEALTHCARE</a>'
menu3[1]='<a href="main.php?section=experience&subsection=medical"> MEDICAL OFFICE BUILDINGS</a>'
menu3[2]='<a href="main.php?section=experience&subsection=k12-schools"> K12 SCHOOLS</a>'
menu3[3]='<a href="main.php?section=experience&subsection=universitiesy"> UNIVERSITIES/COLLEGES</a>'
menu3[4]='<a href="main.php?section=experience&subsection=commercial"> COMMERCIAL</a>'
menu3[5]='<a href="main.php?section=experience&subsection=governmental"> GOVERNMENTAL</a>'
menu3[6]='<a href="main.php?section=experience&subsection=laboratories"> LABORATORIES</a>'
menu3[7]='<a href="main.php?section=experience&subsection=entertainment"> ENTERTAINMENT</a>'
menu3[8]='<a href="main.php?section=experience&subsection=military"> MILITARY</a>'
menu3[9]='<a href="main.php?section=experience&subsection=retail-malls"> RETAIL/MALLS</a>'
menu3[10]='<a href="main.php?section=experience&subsection=public-fac"> PUBLIC FACILITIES</a>'
menu3[11]='<a href="main.php?section=experience&subsection=master-plan"> MASTER INFRASTRUCTURE<br />&nbsp;&nbsp;&nbsp;&nbsp;PLANNING</a>'
menu3[12]='<a href="main.php?section=experience&subsection=gov-guam"> FEDERAL GOVERNMENT</a>'
menu3[13]='<a href="main.php?section=experience&subsection=water-treat"> WATER TREATMENT</a>'
menu3[14]='<a href="main.php?section=experience&subsection=wastewater-treat"> WASTE WATER TREATMENT</a>'
menu3[15]='<a href="main.php?section=experience&subsection=transit-facilities"> TRANSIT FACILITIES</a>'
menu3[16]='<a href="main.php?section=experience&subsection=bridges"> BRIDGES</a>'
menu3[17]='<a href="main.php?section=experience&subsection=civil-engineering"> CIVIL ENGINEERING<br />&nbsp;&nbsp;&nbsp;&nbsp;INFRASTRUCTURE</a>'
menu3[18]='<img src="images/aBlank.gif" width="100%" height="5" />'

//Contents for menu 4
var menu4=new Array()
menu4[0]='<a href="ftp://www.tmadtg.com" target="_blank"> FTP ACCESS</a>'
menu4[1]='<a href="https://sft.tmadtg.com" target="_blank"> SFT ACCESS</a>'
menu4[2]='<img src="images/aBlank.gif" width="100%" height="5" />'

//Contents for menu 5
var menu5=new Array()
menu5[0]='<a href="ftp://www.tmadtg.com" target="_blank"> FTP ACCESS</a>'
menu5[1]='<a href="https://sft.tmadtg.com" target="_blank"> SFT ACCESS</a>'
menu5[2]='<a href="main.php?section=resources&subsection=corporate-email"> CORPORATE EMAIL</a>'
menu5[3]='<a href="main.php?section=resources&subsection=employees-portal"> EMPLOYEES PORTAL</a>'
menu5[4]='<a href="http://archive.mail.tmadtg.com" target="_blank"> ARCHIVE EMAIL</a>'
menu5[5]='<a href="main.php?section=resources&subsection=newsletter"> NEWSLETTER</a>'
menu5[6]='<img src="images/aBlank.gif" width="100%" height="5" />'

//Contents for menu 6
var menu6=new Array()
menu6[0]='<a href="http://www.beyazpatel.com/" target="_blank"> BEYAZ & PATEL CONSULTING<br />&nbsp;&nbsp;&nbsp;&nbsp;ENGINEERS</a>'
menu6[1]='<a href="http://www.goetting.com/" target="_blank"> GOETTING & ASSOCIATES<br />&nbsp;&nbsp;&nbsp;&nbsp;CONSULTING ENGINEERS</a>'
menu6[2]='<img src="images/aBlank.gif" width="100%" height="5" />'

var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var horizontaloffset=0 //horizontal offset of menu from default location. (0-5 is a good value)

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" name="dropmenudiv" style="visibility:hidden;width: 220px;" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth, offset){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if(offset==1){
dropmenuobj.style.left=dropmenuobj.style.top=-500
}
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click") {
obj.visibility=hidden
MM_swapImgRestore()
}
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x-obj.offsetWidth < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move menu up?
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either? (position at top of viewable window then)
edgeoffset=dropmenuobj.y
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth, offset){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById ? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top");
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+horizontaloffset+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
}
if (ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth, offset)
dropmenuobj.x=getposOffset(obj, "left")
if(offset == true)
dropmenuobj.y=getposOffset(obj, "top")-39;
else
dropmenuobj.y=getposOffset(obj, "top")-20;
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+horizontaloffset+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
}
return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(id){
	if (typeof dropmenuobj!="undefined"){
		if (ie4||ns6) {
			dropmenuobj.style.visibility="hidden"
			if (id) {
				MM_swapImgRestoreSingle(id)
			} else {
				MM_swapImgRestore()
			}
		}
	}
}

function delayhidemenu(imageID){
	if (ie4||ns6) {
		if (imageID) {
			delayhide=setTimeout("hidemenu('" + imageID + "')",disappeardelay)
		} else {
			delayhide=setTimeout("hidemenu()",disappeardelay)
		}	
		//delayhide=setTimeout("hidemenu('" + imageID + "')",disappeardelay)
	}
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}