// JavaScript Document

//here you place the ids of every element you want.
var ids=new Array('emp_0','emp_1','emp_2','emp_3','emp_4','emp_5','emp_6');

function switchid(id){	
	hideallids();
	showdiv(id);
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
		if ( id == 'route_map' ) { loadMap(); }
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
			if ( id == 'route_map' ) { loadMap(); }
		}
		else { // IE 4
			document.all.id.style.display = 'block';
			if ( id == 'route_map' ) { loadMap(); }
		}
	}
}
	
function openvenster() {
var win = window.open ('http://test.rsvdv.nl/echtehelden/route.php','newwindow','height=470,width=500,toolbar=no,menubar=no, scrollbars=no,resizable=yes,location=no,directories=no,status=no');
win.focus();
return false;
}

function loadMap() {
  if (GBrowserIsCompatible()) {
	var map = new GMap2(document.getElementById("map"));
	map.setCenter(new GLatLng(51.8984161649958, 4.572951793670654), 15);
	
	map.addControl(new GLargeMapControl());
	map.addControl(new GMapTypeControl());
	map.addControl(new GOverviewMapControl());

	 var marker = new GMarker(new GLatLng(51.8984161649958, 4.572951793670654));
	 GEvent.addListener(marker, "click", function() {
		 var html = '<div style="width: 210px; padding-right: 10px"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><a href="http://www.echtehelden.nl" target="_blank">Echte Helden</a><br />Beverwaardseweg 73<br />3077 GK Rotterdam<br/><small><a href="http://maps.google.nl/?q=Beverwaardseweg+73,+3077+Rotterdam,+Rotterdam+(Zuid-Holland)+(Echte+Helden)&ie=UTF8&ll=51.898700837429644,4.572951793670654&spn=0.006501,0.014591&z=16&iwloc=addr&om=1" target="_blank">Bereken route</a></small></td><td><img src="images/eh.gif" align="Echte Helden" /></td></tr></table><\/div>';
		 marker.openInfoWindowHtml(html);
	 });
	 map.addOverlay(marker);
	 GEvent.trigger(marker, "click");

  }
}
