var menu=function(text,link,left,top,level,parent,child,target)
{
	this.text=text
	this.link=link
	this.left=left
	this.top=top
	this.level=level
	this.parent=parent
	this.child=child
	this.target=target
}

//ffa800
var jsHome=0,armenulen=0
var arjsMenu=new Array()
arjsMenu[armenulen++]=new menu("Home","home.htm",0,0,0,null,false,"_parent")
arjsMenu[armenulen++]=new menu("About us","#",82,96,0,null,true,"_parent")
arjsMenu[armenulen++]=new menu("Services","#",162,96,0,null,true,"_parent")
arjsMenu[armenulen++]=new menu("Applications","applications.htm",241,96,0,null,true,"_parent")
arjsMenu[armenulen++]=new menu("Career","career.htm",407,96,0,null,true,"_parent")
arjsMenu[armenulen++]=new menu("Alliances","#",409,96,0,null,true,"_parent")
arjsMenu[armenulen++]=new menu("Contacts","contactus.htm",0,0,0,null,false,"_parent")
arjsMenu[armenulen++]=new menu("Site map","sitemap.htm",0,0,0,null,false,"_parent")
arjsMenu[armenulen++]=new menu("Pressroom","#",650,96,0,null,true,"_parent")
arjsMenu[armenulen++]=new menu("E-Docs","edocs.htm",741,96,0,null,true,"_parent")


arjsMenu[armenulen++]=new menu("Company Profile","aboutus.htm",0,0,1,"About us",false,"_parent")
arjsMenu[armenulen++]=new menu("The NST Philosophy","thenstphilosophy.htm",0,0,1,"About us",false,"_parent")
arjsMenu[armenulen++]=new menu("Vision","missionvision.htm",0,0,1,"About us",false,"_parent")
arjsMenu[armenulen++]=new menu("Core Competence","corecompetence.htm",0,0,1,"About us",false,"_parent")
arjsMenu[armenulen++]=new menu("The Board","boardofdirectors.htm",0,0,1,"About us",false,"_parent")
arjsMenu[armenulen++]=new menu("The NST Team","thenstteam.htm",0,0,1,"About us",false,"_parent")
arjsMenu[armenulen++]=new menu("Navayuga Group","navayugagroup.htm",220,234,1,"About us",true,"_parent")

arjsMenu[armenulen++]=new menu("NEC (Navayuga Engineering)","nec.htm",0,0,2,"Navayuga Group",false,"_parent")
arjsMenu[armenulen++]=new menu("NEL (Navayuga Exports)","navayugaexports.htm",0,0,2,"Navayuga Group",false,"_parent")
arjsMenu[armenulen++]=new menu("NIT (Navayuga Infotech)","nit.htm",0,0,2,"Navayuga Group",false,"_parent")

arjsMenu[armenulen++]=new menu("GIS Solutions & Services ","services.htm",0,0,1,"Services",false,"_parent")
arjsMenu[armenulen++]=new menu("Remote Sensing Solutions","rss.htm",0,0,1,"Services",false,"_parent")
arjsMenu[armenulen++]=new menu("Photogrammetry Solutions ","ps.htm",0,0,1,"Services",false,"_parent")
arjsMenu[armenulen++]=new menu("Surveying & Mapping Services","sms.htm",0,0,1,"Services",false,"_parent")
arjsMenu[armenulen++]=new menu("Database Services","ds.htm",0,0,1,"Services",false,"_parent")
arjsMenu[armenulen++]=new menu("Positioning & Navigation Applications","pna.htm",0,0,1,"Services",false,"_parent")
arjsMenu[armenulen++]=new menu("Web GIS & Wireless Systems","gisw.htm",0,0,1,"Services",false,"_parent")
arjsMenu[armenulen++]=new menu("Strategic Consulting","sc.htm",0,0,1,"Services",false,"_parent")
arjsMenu[armenulen++]=new menu("System Integration in GIS","si.htm",0,0,1,"Services",false,"_parent")
arjsMenu[armenulen++]=new menu("GIS software solutions development & Integrated IT Solutions","gisssd.htm",0,0,1,"Services",false,"_parent")
arjsMenu[armenulen++]=new menu("GIS Education & Training","giset.htm",0,0,1,"Services",false,"_parent")
arjsMenu[armenulen++]=new menu("Detailed Project Report","dpr.htm",0,0,1,"Services",false,"_parent")

<!---->arjsMenu[armenulen++]=new menu("Partners","partners.htm",527,96,1,"Alliances",false,"_parent")
<!---->arjsMenu[armenulen++]=new menu("Orbimage","orbimat.htm",0,0,2,"Partners",false,"_parent")
<!---->arjsMenu[armenulen++]=new menu("ESRI","esri.htm",0,0,2,"Partners",false,"_parent")


arjsMenu[armenulen++]=new menu("Partner With Us","clients.htm",0,0,1,"Alliances",false,"_parent")


arjsMenu[armenulen++]=new menu("Natural Resources Management","naturalresources.htm",0,0,1,"Applications",false,"_parent")
arjsMenu[armenulen++]=new menu("Disaster Management & Mitigation","dm&m.htm",0,0,1,"Applications",false,"_parent")
arjsMenu[armenulen++]=new menu("Cadastre","cadastre.htm",0,0,1,"Applications",false,"_parent")
arjsMenu[armenulen++]=new menu("Urban Planning, Management & Governance","upm&g.htm",0,0,1,"Applications",false,"_parent")
arjsMenu[armenulen++]=new menu("Business GIS","businessgis.htm",0,0,1,"Applications",false,"_parent")
arjsMenu[armenulen++]=new menu("Transportation","transportation.htm",0,0,1,"Applications",false,"_parent")
arjsMenu[armenulen++]=new menu("Infrastucture","infrastructure.htm",0,0,1,"Applications",false,"_parent")

arjsMenu[armenulen++]=new menu("Press Releases","PressReleases.htm",0,0,1,"Pressroom",false,"_parent")

/*'arjsMenu[armenulen++]=new menu("EDoc1","../dnlds/E_brochure_29th%20sept_ver2.pdf",0,0,1,"E-Docs",false,"_blank")
'arjsMenu[armenulen++]=new menu("EDoc1","../dnlds/navayugainfotech.pdf",0,0,1,"E-Docs",false,"_blank")
'arjsMenu[armenulen++]=new menu("EDoc1","../dnlds/nelebrochure.pdf",0,0,1,"E-Docs",false,"_blank")
*/

var maxlevel=0
function loadmenu()
{
	var level=-1
	var objp=document.getElementById('jsMenuLinks')
	strd="",strp=""
	for(var i=0;i<arjsMenu.length;i++)
	{
		if(arjsMenu[i].level==0)
		{
			strp+="<div class='mainlinkscont'"
			if(arjsMenu[i].child)strp+=" alt='"+arjsMenu[i].text+"' onmouseover='showmenu(this)' onmouseout=MM_showHideLayers(this.alt,'','hide')"
			if(arjsMenu[i].target=="_parent")strp+=" onclick=\"document.location='"+arjsMenu[i].link+"' \">";
			else strp+=" onclick=\"window.open('"+arjsMenu[i].link+"') \">";
			strp+="<img src='../images/linkicon.gif' alt='' align='absmiddle' />"+arjsMenu[i].text+"</div>";
		}
		if(arjsMenu[i].level>level)
		{
			level=arjsMenu[i].level
			strd+="<div id='jsMenu"+level+"'></div>"	
		}
	}
	maxlevel=level
	objp.innerHTML=strp+"<div id='jsMenu' style='z-index: 100;position:absolute;left:0px;top:0px'></div>"
	var obj=document.getElementById('jsMenu')
	obj.innerHTML=strd
}


window.onload=function()
{
	loadmenu();
	clock();
}

function showmenu(obj)
{
	alt=obj.alt
	var str="",txt="",left=0,top=0,width=0,lvl=0,parent=""
	for(var i=0;i<arjsMenu.length;i++)
	{
		if(arjsMenu[i].text==alt)
		{
			left=arjsMenu[i].left
			if(screen.availWidth>1280)left+=185
			else if(screen.availWidth>1152)left+=125
			else if(screen.availWidth>1024)left+=65
			/*if(screen.availWidth>1024)
			{
				var i=0
				while(screen.availWidth<(1024+(i+1)*128))i++;
				left+=60*i
			}*/
			top=arjsMenu[i].top+jsHome
			lvl=arjsMenu[i].level
			parent=arjsMenu[i].parent
			
		}
		if(arjsMenu[i].parent==alt)
		{  
			txt=arjsMenu[i].text
	
					if (width < txt.length*7) width=txt.length*7+20

			str+="<tr><td height='20' alt='"+txt+"' onmouseover=\"this.style.background='#ffa800';"
			
			str+="showmenu(this);MM_showHideLayers('"+parent+"','','show');"
			
			str+="\" onmouseout=\"this.style.background='#bdcfe7';MM_showHideLayers(this.alt,'','hide')\""
			
			str+=" onclick="

			if(arjsMenu[i].target=="_parent")str+="document.location=\""+arjsMenu[i].link+"\" "
			else str+="window.open('"+arjsMenu[i].link+"') "

			str+="style='cursor:hand;cursor:pointer;padding:2px 5px 0px 5px;color:#000000'>"
			
			str+="<img height=8 hspace=3 src='../images/arrow.gif' width=8 align=middle vspace=1 border=0 /><b>"

			str+=txt+"&nbsp;&nbsp;</b></td></tr><tr><td height='1' style='background:#000000;'></td></tr>" 
		}		
	}
	str+="</table></div>"
	
	var strF="<div id='"+alt+"' onmouseover=\"MM_showHideLayers(this.id,'','show');"
	strF+="MM_showHideLayers('"+parent+"','','show');"
	strF+="\""
	
	strF+=" onmouseout=\"MM_showHideLayers(this.id,'','hide');"
	strF+="MM_showHideLayers('"+parent+"','','hide');"
	strF+="\""

	strF+=" style=' FILTER: alpha(opacity=85); background:#bdcfe7; position: absolute; left:"+left+"px; TOP:"+top+"px;'>"

	strF+="<table cellSpacing=0 cellPadding=0 border=0 width='"+width+"'>"
	strF+=str
	for (var i=lvl;i<maxlevel;i++)
		if(document.getElementById("jsMenu"+i))document.getElementById("jsMenu"+i).innerHTML=''
	document.getElementById("jsMenu"+lvl).innerHTML=strF
}




// shortcuts opening/closing

	cc=0
	function showshort()
	{
	if (cc==0) 
	{
	cc=1
	short.style.display="block"
	
	//nms.src="../../images/en/nms_down.gif"
	}
	else
	{
	cc=0
	short.style.display="none"
	
	//nms.src="../../images/en/nms_up.gif"
	}
}


	function hideshort()
	{
	if (cc==1) 
	{
	short.style.display="none"
	
	//nms.src="../../images/en/nms_up.gif"
	}	
}

function clock()             		<!-- Set the function called clock !-->
{
now = new Date()            		<!-- Grab the current Date !-->
sec = now.getSeconds()      		<!-- Get the seconds !-->
min = now.getMinutes()      		<!-- Get the minutes !-->
hrs = now.getHours()        		<!-- Get the hours   !-->
if (sec <= 9) { sec = "0"+sec; }       	<!-- Add a 0 if less than 10 !-->
if (min <= 9) { min = "0"+min; }       	<!-- Same as above !-->
if (hrs <= 9 && hrs != 0)              	<!-- If the time is less than nine !-->
{
msg = "am";                         	<!-- Set the message to AM !-->
} 
else if (hrs > 9 && hrs < 12) {    	<!-- Set it to AM if above 10 but less than 12 !-->
msg = "am";                         	<!-- Set the message to AM !-->
} 
else if (hrs > 12) {               		<!-- If the time's greater than 12 !-->
hrs = (hrs - 12)                     	<!-- Subtract 12 from current time variable !-->
msg = "pm";                         	<!-- Set the message to PM !-->
} 
else if (hrs == 0) {               		<!-- If time equals 0 (midnight) !-->
msg = "am";                         	<!-- Set the message to AM !-->
hrs = "12";                          		<!-- Set the hour to 12 for readability !-->
}
else if (hrs ==12) {               		<!-- If time equals 0 (midnight) !-->
msg = "pm";                         	<!-- Set the message to AM !-->
hrs = "12";                          		<!-- Set the hour to 12 for readability !-->
}
else {                             		<!-- Else the hour equals the hour !-->
hrs = hrs;
}
timestring = hrs+":"+min+":"+sec+" "+msg;  <!-- Set the time string !-->
setTimeout("clock()",1000)             	<!-- Set the timeout for the function 'clock' !-->
dayName = new Array ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat")
monName = new Array ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
now = new Date()							    
fulldate=monName[now.getMonth()] + " " +now.getDate()+", " +now.getFullYear();
var obj=document.getElementById("clockID")
if(obj)obj.innerHTML = fulldate +" "+timestring;

}
