function start(){
	if (document.title == 'Login'){
    document.getElementById('content').style.height = '300';	
  }
	if (document.title){
	  document.title = 'Triángulo vzw - ' + document.title;
	}
	else {
	  document.title = 'Triángulo vzw - Home';
	}	
  if(top.location != self.location){
    top.location.replace(self.location);
  }	
}
function toon(inhoud){
  document.getElementById(inhoud).style.display = 'block';
}
function verberg(inhoud){
  document.getElementById(inhoud).style.display = 'none';
}
function verwijder(bestand){
  if (confirm('Weet je zeker dat dit bestand verwijderd mag worden?')){
    document.location.href = bestand;
	 }
}
var vorigBlok = '';
function kleur(inhoud){
  if (document.getElementById(inhoud)){
	  if (document.getElementById(vorigBlok)){
	    document.getElementById(vorigBlok).style.color = '#003399';
		  document.getElementById(vorigBlok).style.textDecoration = 'none';
	  }
	  document.getElementById(inhoud).style.color = '#ff0033';
	  document.getElementById(inhoud).style.textDecoration = 'underline';
	  vorigBlok = inhoud;
	}	
}
var map = null;
var geocoder = null;
var adres;
var adrestekst;
function toonKaart(adres) {
  if (document.getElementById('routebeschrijving')){
		document.traject.bestemming.value = adres;
	}
  if (GBrowserIsCompatible()&&(document.getElementById('map'))) {
    map = new GMap2(document.getElementById('map'));
    map.addControl(new GMapTypeControl());
		map.addControl(new GLargeMapControl());
		var icon = new GIcon();
    icon.image = "afbeeldingen/logoklein.png";
    icon.shadow = "afbeeldingen/shadow-logoklein.png";
		icon.iconSize = new GSize(30.0, 24.0);
    icon.shadowSize = new GSize(43.0, 24.0);
    icon.iconAnchor = new GPoint(15.0, 12.0);
    icon.infoWindowAnchor = new GPoint(15.0, 12.0);
		var geocoder = new GClientGeocoder();		
      if (geocoder) {
			  adrestekst = adres;
			  adres = adres + ' Belgium';
        geocoder.getLatLng(
          adres,
          function(point) {					
            map.setCenter(point, 13);
            var marker = new GMarker(point, {icon:icon, title:adrestekst}); 
			      map.addOverlay(marker);
						var markerTekst = 'Atheneum Kapellen<br />' + adrestekst;
            GEvent.addListener(marker, 'click', function() {
              marker.openInfoWindowHtml(markerTekst);
							});						
					}	
       );
     }	   
  }
}
function toonKaart2(adres) {
  if (GBrowserIsCompatible()&&(document.getElementById('map'))) {
    map = new GMap2(document.getElementById('map'));
		map.addControl(new GLargeMapControl());
		var icon = new GIcon();
    icon.image = "afbeeldingen/logoklein.png";
    icon.shadow = "afbeeldingen/shadow-logoklein.png";
		icon.iconSize = new GSize(30.0, 24.0);
    icon.shadowSize = new GSize(43.0, 24.0);
    icon.iconAnchor = new GPoint(15.0, 12.0);
    icon.infoWindowAnchor = new GPoint(15.0, 12.0);
		var geocoder = new GClientGeocoder();		
      if (geocoder) {
			  adrestekst = adres;
			  adres = adres + ' Belgium';
        geocoder.getLatLng(
          adres,
          function(point) {					
            map.setCenter(point, 18);
						map.setMapType(G_SATELLITE_MAP);
            var marker = new GMarker(point, {icon:icon, title:adrestekst}); 
			      map.addOverlay(marker);
						var markerTekst = '<div style="padding: 5px; text-align: center">Atheneum Kapellen';
						markerTekst+= '<br /><img src="afbeeldingen/domein.jpg" />';
						markerTekst+= '<br />Klik op het +-teken<br /> voor meer info.</div>';
            var maxContentDiv = document.createElement('div');
						
					  marker.openInfoWindowHtml(markerTekst,
            {maxContent: maxContentDiv, 
             maxTitle: "Meer info over ons domein"});
            var iw = map.getInfoWindow();
            GEvent.addListener(iw, "maximizeclick", function() {
              GDownloadUrl("domein.php", function(data) {
              maxContentDiv.innerHTML = data;
              });
            });
						
						GEvent.addListener(marker, 'click', function() {
            var maxContentDiv = document.createElement('div');
					  marker.openInfoWindowHtml(markerTekst,
            {maxContent: maxContentDiv, 
             maxTitle: "Meer info over ons domein"});
            var iw = map.getInfoWindow();
            GEvent.addListener(iw, "maximizeclick", function() {
              GDownloadUrl("domein.php", function(data) {
              maxContentDiv.innerHTML = data;
              });
            });
            });				
					}	
       );
     }	   
  }
}
var gdir;
var geocoder = null;
var addressMarker;
function route(fromAddress, toAddress) {
  document.getElementById('routebeschrijving').innerHTML = '';
	document.getElementById('routebeschrijving').style.display = 'block'; 
  map = new GMap2(document.getElementById("map"));
	map.addControl(new GMapTypeControl());
	map.addControl(new GLargeMapControl());
	gdir = new GDirections(map, document.getElementById('routebeschrijving'));
	gdir.load("from: " + fromAddress + " to: " + toAddress,		
                {"locale": 'nl'} );																																																
}
function wijzigRichting(){
  var adres1 = document.traject.vertrek.value;
	var adres2 = document.traject.bestemming.value;
	document.traject.bestemming.value = adres1;
	document.traject.vertrek.value = adres2;
	route(document.traject.vertrek.value, document.traject.bestemming.value);
}


