var Home = [["Home","index.php"]];
var About_Us = [["About Us","about_us.php"],["Awards","awards.php"],["Personnel Skills","personnel_skills.php"],["Contact Us","contactus.php"],["Map","map.php"]];
var Services = [["Services","services.php"],["Other Services","other.php"]];
var Staff_Profile = [["Staff Profile","staff_profile.php"],["Staff Composition","staff_composition.php"]];
var FAQ = [["FAQ's","faq.php"]];
var Projects = [["Projects","projects.php"]];
function show(e,path)
{
	colID = path;		 
	var myArray = Home;
	switch(path)
	{
		case "Home":
				 myArray = Home;
				 break;
		case "About_Us":
				 myArray = About_Us;
				 break;
		case "Services":
				 myArray = Services;
				 break;
		case "Staff_Profile":
				 myArray = Staff_Profile;
				 break;
		case "FAQ":
				 myArray = FAQ;
				 break;
		case "Projects":
				 myArray = Projects;
				 break;
	}
	$str = "<ul id='menu_item' class = 'm2' style = 'padding: 0;'><li>";	 
	for(var i = 0; i<myArray.length; i++)
	{				
			//$str = $str + "<li>" + "<a href = '" + myArray[i][1] + "'>" + myArray[i][0] + "<\/a>" + "<\/li>";
			$str = $str + "<li>" + "<a href = '" + myArray[i][1] + "'>" + myArray[i][0] + "</a>" + "</li>";
	}
	$str = $str + "</li></ul>";
	document.getElementById("sub_global").innerHTML = $str;
	document.getElementById("sub_global").style.visibility = "visible";
}
function closesubnav(e){
  //if ((e.clientY <2)||(e.clientY > 20))
	if (e.clientY > 220)
	{
		//document.getElementById("sub_global").innerHTML = "&nbsp;";
		document.getElementById("sub_global").style.visibility = "hidden";
	}
}
function reset(e,str_input)
{
	if (e.clientY > 220)
	{
		switch(str_input)
		{
			case "Home":
					 show(e,'Home');
					 break;
			case "Map":
					 show(e,'About_Us');
					 break;
			case "Staff Profiles":
					 show(e,'Staff_Profile');
					 break;
			case "Staff Composition":
					 show(e,'Staff_Profile');
					 break;
			case "Services":
					 show(e,'Services');
					 break;
			case "About Us":
					 show(e,'About_Us');
					 break;
			case "Awards":
					 show(e,'About_Us');
					 break;
			case "Contact Us":
					 show(e,'About_Us');
					 break;
			case "Frequently Asked Questions":
					 show(e,'FAQ');
					 break;
			case "Other Services":
					 show(e,'Services');
					 break;
			case "Personnel Skills":
					 show(e,'About_Us');
					 break;
			case "Projects":
					 show(e,'Projects');
					 break;			
		}	
	}
}
var d1 = new Date("06/11/2010");
var d2 = new Date();
var d3,d4;// = new Date();
function startTime()
{
	d3 = d1-d2;
	return Math.round(d3/(1000*60*60*24));
}
function newWindow(path){
    window.open(path);  
}
function $(e){
	return document.getElementById(e);
}
var pop= "pop";
function load(id, p){
	if ( p == "pop") hide2();
	else hide1();
	pop = p;
	$(pop).style.visibility = "visible";
	$(pop).style.display = "block";
	getInfo(id);
	
}
function hide()
{
		hide1();
		hide2();
}
function hide1()
{
		$("pop").style.visibility = "hidden";
		$("pop").style.display = "none";
}
function hide2()
{
	try
	{	
		$("pop2").style.visibility = "hidden";
		$("pop2").style.display = "none";
	}
	catch(e)
	{
	}
}
function GetXmlHttpObject(){
	var xmlHttp=null;
	try{ // Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e){// Internet Explorer
		try{
			// I.E. 5.5
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e){
			// I.E. 6.0	
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}

function getInfo(user){
	// delete here	
	try{
		var xmlHttp = GetXmlHttpObject();
		var url=user+".php";
		//var url = "process_online_bookmarks/testing.php";
		$(pop).innerHTML =  "<br><br><center><img src='images/load0.gif' /> </center>";
		xmlHttp.onreadystatechange=function(){
			if(xmlHttp.readyState==4){
				response = xmlHttp.responseText;
				if (response != "FALSE"){
					$(pop).innerHTML = response;
				}else $(pop).innerHTML = "<br><br>ERROR: adding failed";
			}
		}
		xmlHttp.open("GET", url, true);
		xmlHttp.send(null);

	}catch(e){
		alert("ERROR: name = "+ e.name + "; message = " + e.massage);
	}
}
function hide_content()
{
		$("main_content").innerHTML = "";
		/*$("main_content").style.visibility = "hidden";
		$("main_content").style.display = "none";*/
}
/*function show(s,d)
{
	$(d).innerHTML = s;
}*/
/////////////////////////////////////GOOGLE MAPS CODE////////////////////////////////////////////////////////////////////////////
function initialize() 
{
	var message = "Home of metroplan";
	
	if (GBrowserIsCompatible()) 
	{
		var map = new GMap2(document.getElementById("map_canvas"));
		map.setCenter(new GLatLng(-33.9636125288, 25.6025045181), 17);
		var latlng0 = new GLatLng(-33.9636125288, 25.6025045181);
		map.addOverlay(createMarker(latlng0, 0));	 
		map.setMapType(G_HYBRID_MAP);
	}
  
	function createMarker(latlng, number) {
	  var marker = new GMarker(latlng);
	  marker.value = number;
	  GEvent.addListener(marker,"click", function() {
		var myHtml = "<b>METROPLAN</b><br/><img src = images/map_image.jpg alt = 'Metroplan Home'/><br/>"+message;
		map.openInfoWindowHtml(latlng, myHtml);
	  });
	  return marker;
	}		
	   
}