    var dbase = eval(Database);
    var toggle_organisations=true;
		var toggle_academics=true;
		var toggle_students=true;
		var toggle_israeli=true;
		var toggle_palestines=true;
		var toggle_news=true;

    dbase = dbase['Database'];
    //console.log(dbase);

    //console.log(dbase);
    // marker icon (42 x 42 px)
    // Create our "tiny" marker icon
    var icon_blank = new GIcon();
    var icon_st = new GIcon();
    var icon_stP = new GIcon();
    var icon_stB = new GIcon();
    var icon_stBC = new GIcon();
    var icon_stC = new GIcon();
    var icon_stO = new GIcon();
    var icon_org = new GIcon();
    var icon_orgP = new GIcon();
    var icon_orgB = new GIcon();
    var icon_orgBC = new GIcon();
    var icon_orgC = new GIcon();
    var icon_orgO = new GIcon();
    var icon_ac = new GIcon();
    var icon_acP = new GIcon();
    var icon_acB = new GIcon();
    var icon_acBC = new GIcon();
    var icon_acC = new GIcon();
    var icon_acO = new GIcon();
    var icon_is = new GIcon();
    var icon_isP = new GIcon();
    var icon_isB = new GIcon();
    var icon_isBC = new GIcon();
    var icon_isC = new GIcon();
    var icon_isO = new GIcon();
    var icon_pl = new GIcon();
    var icon_plP = new GIcon();
    var icon_plB = new GIcon();
    var icon_plBC = new GIcon();
    var icon_plC = new GIcon();
    var icon_plO = new GIcon();
    var icon_nw = new GIcon();
    var icon_nwP = new GIcon();
    var icon_nwB = new GIcon();
    var icon_nwBC = new GIcon();
    var icon_nwC = new GIcon();
    var icon_nwO = new GIcon();
    
    icon_blank.image = "blank.gif";
    icon_blank.iconSize = new GSize(1,1);
    icon_blank.iconAnchor = new GPoint(0, 0);
    icon_blank.infoWindowAnchor = new GPoint(0, 0);
    icon_st.image = "flags/flag_students.gif";
    icon_st.iconSize = new GSize(18, 31);
    icon_st.iconAnchor = new GPoint(0, 31);
    icon_st.infoWindowAnchor = new GPoint(5, 1);
    icon_stP.image = "flags/flag_studentsP.gif";
    icon_stP.iconSize = new GSize(18, 31);
    icon_stP.iconAnchor = new GPoint(0, 31);
    icon_stP.infoWindowAnchor = new GPoint(5, 1);
    icon_stB.image = "flags/flag_studentsB.gif";
    icon_stB.iconSize = new GSize(18, 31);
    icon_stB.iconAnchor = new GPoint(0, 31);
    icon_stB.infoWindowAnchor = new GPoint(5, 1);
    icon_stBC.image = "flags/flag_studentsBC.gif";
    icon_stBC.iconSize = new GSize(18, 31);
    icon_stBC.iconAnchor = new GPoint(0, 31);
    icon_stBC.infoWindowAnchor = new GPoint(5, 1);
    icon_stC.image = "flags/flag_studentsC.gif";
    icon_stC.iconSize = new GSize(18, 31);
    icon_stC.iconAnchor = new GPoint(0, 31);
    icon_stC.infoWindowAnchor = new GPoint(5, 1);
    icon_stO.image = "flags/flag_studentoccani.gif";
    icon_stO.iconSize = new GSize(18, 31);
    icon_stO.iconAnchor = new GPoint(0, 31);
    icon_stO.infoWindowAnchor = new GPoint(5, 1);
    icon_org.image = "flags/flag_organisations.gif";
    icon_org.iconSize = new GSize(18, 31);
    icon_org.iconAnchor = new GPoint(0, 31);
    icon_org.infoWindowAnchor = new GPoint(5, 1);
    icon_orgP.image = "flags/flag_organisationsP.gif";
    icon_orgP.iconSize = new GSize(18, 31);
    icon_orgP.iconAnchor = new GPoint(0, 31);
    icon_orgP.infoWindowAnchor = new GPoint(5, 1);
    icon_orgB.image = "flags/flag_organisationsB.gif";
    icon_orgB.iconSize = new GSize(18, 31);
    icon_orgB.iconAnchor = new GPoint(0, 31);
    icon_orgB.infoWindowAnchor = new GPoint(5, 1);
    icon_orgBC.image = "flags/flag_organisationsBC.gif";
    icon_orgBC.iconSize = new GSize(18, 31);
    icon_orgBC.iconAnchor = new GPoint(0, 31);
    icon_orgBC.infoWindowAnchor = new GPoint(5, 1);
    icon_orgC.image = "flags/flag_organisationsC.gif";
    icon_orgC.iconSize = new GSize(18, 31);
    icon_orgC.iconAnchor = new GPoint(0, 31);
    icon_orgC.infoWindowAnchor = new GPoint(5, 1);
    icon_orgO.image = "flags/flag_organisationoccani.gif";
    icon_orgO.iconSize = new GSize(18, 31);
    icon_orgO.iconAnchor = new GPoint(0, 31);
    icon_orgO.infoWindowAnchor = new GPoint(5, 1);
    icon_ac.image = "flags/flag_academics.gif";
    icon_ac.iconSize = new GSize(18, 31);
    icon_ac.iconAnchor = new GPoint(0, 31);
    icon_ac.infoWindowAnchor = new GPoint(5, 1);
    icon_acP.image = "flags/flag_academicsP.gif";
    icon_acP.iconSize = new GSize(18, 31);
    icon_acP.iconAnchor = new GPoint(0, 31);
    icon_acP.infoWindowAnchor = new GPoint(5, 1);
    icon_acB.image = "flags/flag_academicsB.gif";
    icon_acB.iconSize = new GSize(18, 31);
    icon_acB.iconAnchor = new GPoint(0, 31);
    icon_acB.infoWindowAnchor = new GPoint(5, 1);
    icon_acBC.image = "flags/flag_academicsBC.gif";
    icon_acBC.iconSize = new GSize(18, 31);
    icon_acBC.iconAnchor = new GPoint(0, 31);
    icon_acBC.infoWindowAnchor = new GPoint(5, 1);
    icon_acC.image = "flags/flag_academicsC.gif";
    icon_acC.iconSize = new GSize(18, 31);
    icon_acC.iconAnchor = new GPoint(0, 31);
    icon_acC.infoWindowAnchor = new GPoint(5, 1);
    icon_acO.image = "flags/flag_academicoccani.gif";
    icon_acO.iconSize = new GSize(18, 31);
    icon_acO.iconAnchor = new GPoint(0, 31);
    icon_acO.infoWindowAnchor = new GPoint(5, 1);
    icon_is.image = "flags/flag_israeli.gif";
    icon_is.iconSize = new GSize(18, 31);
    icon_is.iconAnchor = new GPoint(0, 31);
    icon_is.infoWindowAnchor = new GPoint(5, 1);
    icon_isP.image = "flags/flag_israeliP.gif";
    icon_isP.iconSize = new GSize(18, 31);
    icon_isP.iconAnchor = new GPoint(0, 31);
    icon_isP.infoWindowAnchor = new GPoint(5, 1);
    icon_isB.image = "flags/flag_israeliB.gif";
    icon_isB.iconSize = new GSize(18, 31);
    icon_isB.iconAnchor = new GPoint(0, 31);
    icon_isB.infoWindowAnchor = new GPoint(5, 1);
    icon_isBC.image = "flags/flag_israeliBC.gif";
    icon_isBC.iconSize = new GSize(18, 31);
    icon_isBC.iconAnchor = new GPoint(0, 31);
    icon_isBC.infoWindowAnchor = new GPoint(5, 1);
    icon_isC.image = "flags/flag_israeliC.gif";
    icon_isC.iconSize = new GSize(18, 31);
    icon_isC.iconAnchor = new GPoint(0, 31);
    icon_isC.infoWindowAnchor = new GPoint(5, 1);
    icon_isO.image = "flags/flag_israeloccani.gif";
    icon_isO.iconSize = new GSize(18, 31);
    icon_isO.iconAnchor = new GPoint(0, 31);
    icon_isO.infoWindowAnchor = new GPoint(5, 1);
    icon_pl.image = "flags/flag_palestines.gif";
    icon_pl.iconSize = new GSize(18, 31);
    icon_pl.iconAnchor = new GPoint(0, 31);
    icon_pl.infoWindowAnchor = new GPoint(5, 1);
    icon_plP.image = "flags/flag_palestinesP.gif";
    icon_plP.iconSize = new GSize(18, 31);
    icon_plP.iconAnchor = new GPoint(0, 31);
    icon_plP.infoWindowAnchor = new GPoint(5, 1);
    icon_plB.image = "flags/flag_palestinesB.gif";
    icon_plB.iconSize = new GSize(18, 31);
    icon_plB.iconAnchor = new GPoint(0, 31);
    icon_plB.infoWindowAnchor = new GPoint(5, 1);
    icon_plBC.image = "flags/flag_palestinesBC.gif";
    icon_plBC.iconSize = new GSize(18, 31);
    icon_plBC.iconAnchor = new GPoint(0, 31);
    icon_plBC.infoWindowAnchor = new GPoint(5, 1);
    icon_plC.image = "flags/flag_palestinesC.gif";
    icon_plC.iconSize = new GSize(18, 31);
    icon_plC.iconAnchor = new GPoint(0, 31);
    icon_plC.infoWindowAnchor = new GPoint(5, 1);
    icon_plO.image = "flags/flag_palestineoccani.gif";
    icon_plO.iconSize = new GSize(18, 31);
    icon_plO.iconAnchor = new GPoint(0, 31);
    icon_plO.infoWindowAnchor = new GPoint(5, 1);
    icon_nw.image = "flags/flag_news.gif";
    icon_nw.iconSize = new GSize(18, 31);
    icon_nw.iconAnchor = new GPoint(0, 31);
    icon_nw.infoWindowAnchor = new GPoint(5, 1);
    icon_nwP.image = "flags/flag_newsP.gif";
    icon_nwP.iconSize = new GSize(18, 31);
    icon_nwP.iconAnchor = new GPoint(0, 31);
    icon_nwP.infoWindowAnchor = new GPoint(5, 1);
    icon_nwB.image = "flags/flag_newsB.gif";
    icon_nwB.iconSize = new GSize(18, 31);
    icon_nwB.iconAnchor = new GPoint(0, 31);
    icon_nwB.infoWindowAnchor = new GPoint(5, 1);
    icon_nwBC.image = "flags/flag_newsBC.gif";
    icon_nwBC.iconSize = new GSize(18, 31);
    icon_nwBC.iconAnchor = new GPoint(0, 31);
    icon_nwBC.infoWindowAnchor = new GPoint(5, 1);
    icon_nwC.image = "flags/flag_newsC.gif";
    icon_nwC.iconSize = new GSize(18, 31);
    icon_nwC.iconAnchor = new GPoint(0, 31);
    icon_nwC.infoWindowAnchor = new GPoint(5, 1);
    icon_nwO.image = "flags/flag_newsoccani.gif";
    icon_nwO.iconSize = new GSize(18, 31);
    icon_nwO.iconAnchor = new GPoint(0, 31);
    icon_nwO.infoWindowAnchor = new GPoint(5, 1);

function createMarker(point, orgName, recordNo, latitude, longitude, description, type, country_code, events, events_description, boycott, boycott_description, occupation, occupation_description, petition,  petition_description, email1, email1_description, email2, email2_description, website1, website1_description, website2, website2_description, website3, website3_description,  blog, blog_description) {

			if (type == 'O') {
					if (showoccupation) {
						if (occupation) {
							var marker = new GMarker(point, icon_orgO);
						} else {
							var marker = false;
						}
				 	} else if (showboycott) {
						if (boycott) {					
							var marker = new GMarker(point, icon_orgBC);
				 		} else {
							var marker = false;
						}
				 	} else if (showpetition) {
						if (petition) {					
							var marker = new GMarker(point, icon_orgP);
				 		} else {
							var marker = false;
						}
				 	} else if (showevents) {
						if (events) {					
							var marker = new GMarker(point, icon_orgC);
				 		} else {
							var marker = false;
						}
				 	} else if (showblog) {
						if (blog) {					
							var marker = new GMarker(point, icon_orgB);
				 		} else {
							var marker = false;
						}
				  } else {
						if (occupation) {
							var marker = new GMarker(point, icon_orgO);
						} else {
							var marker = new GMarker(point, icon_org);
						}
					}
      }
			if (type == 'S') {
					if (showoccupation) {
						if (occupation) {
							var marker = new GMarker(point, icon_stO);
						} else {
							var marker = false;
						}
				 	} else if (showboycott) {
						if (boycott) {					
							var marker = new GMarker(point, icon_stBC);
				 		} else {
							var marker = false;
						}
				 	} else if (showpetition) {
						if (petition) {					
							var marker = new GMarker(point, icon_stP);
				 		} else {
							var marker = false;
						}
				 	} else if (showevents) {
						if (events) {					
							var marker = new GMarker(point, icon_stC);
				 		} else {
							var marker = false;
						}
				 	} else if (showblog) {
						if (blog) {					
							var marker = new GMarker(point, icon_stB);
				 		} else {
							var marker = false;
						}
				  } else {
						if (occupation) {
							var marker = new GMarker(point, icon_stO);
						} else {
							var marker = new GMarker(point, icon_st);
						}
					}
						
//					if (occupation && showoccupation) {
//							var marker = new GMarker(point, icon_stO);
//					} else if (petition && showpetition) {
//							var marker = new GMarker(point, icon_stP);
//				 	} else {
//							var marker = new GMarker(point, icon_st);
//				  }
      }
			if (type == 'A') {
					if (showoccupation) {
						if (occupation) {
							var marker = new GMarker(point, icon_acO);
						} else {
							var marker = false;
						}
				 	} else if (showboycott) {
						if (boycott) {					
							var marker = new GMarker(point, icon_acBC);
				 		} else {
							var marker = false;
						}
				 	} else if (showpetition) {
						if (petition) {					
							var marker = new GMarker(point, icon_acP);
				 		} else {
							var marker = false;
						}
				 	} else if (showevents) {
						if (events) {					
							var marker = new GMarker(point, icon_acC);
				 		} else {
							var marker = false;
						}
				 	} else if (showblog) {
						if (blog) {					
							var marker = new GMarker(point, icon_acB);
				 		} else {
							var marker = false;
						}
				  } else {
						if (occupation) {
							var marker = new GMarker(point, icon_acO);
						} else {
							var marker = new GMarker(point, icon_ac);
						}
					}
      }
			if (type == 'I') {
					if (showoccupation) {
						if (occupation) {
							var marker = new GMarker(point, icon_isO);
						} else {
							var marker = false;
						}
				 	} else if (showboycott) {
						if (boycott) {					
							var marker = new GMarker(point, icon_isBC);
				 		} else {
							var marker = false;
						}
				 	} else if (showpetition) {
						if (petition) {					
							var marker = new GMarker(point, icon_isP);
				 		} else {
							var marker = false;
						}
				 	} else if (showevents) {
						if (events) {					
							var marker = new GMarker(point, icon_isC);
				 		} else {
							var marker = false;
						}
				 	} else if (showblog) {
						if (blog) {					
							var marker = new GMarker(point, icon_isB);
				 		} else {
							var marker = false;
						}
				  } else {
						if (occupation) {
							var marker = new GMarker(point, icon_isO);
						} else {
							var marker = new GMarker(point, icon_is);
						}
					}
      }

			if (type == 'PL') {
					if (showoccupation) {
						if (occupation) {
							var marker = new GMarker(point, icon_plO);
						} else {
							var marker = false;
						}
				 	} else if (showboycott) {
						if (boycott) {					
							var marker = new GMarker(point, icon_plBC);
				 		} else {
							var marker = false;
						}
				 	} else if (showpetition) {
						if (petition) {					
							var marker = new GMarker(point, icon_plP);
				 		} else {
							var marker = false;
						}
				 	} else if (showevents) {
						if (events) {					
							var marker = new GMarker(point, icon_plC);
				 		} else {
							var marker = false;
						}
				 	} else if (showblog) {
						if (blog) {					
							var marker = new GMarker(point, icon_plB);
				 		} else {
							var marker = false;
						}
				  } else {
						if (occupation) {
							var marker = new GMarker(point, icon_plO);
						} else {
							var marker = new GMarker(point, icon_pl);
						}
					}
      }

			if (type == 'N') {
					if (showoccupation) {
						if (occupation) {
							var marker = new GMarker(point, icon_nwO);
						} else {
							var marker = false;
						}
				 	} else if (showboycott) {
						if (boycott) {					
							var marker = new GMarker(point, icon_nwBC);
				 		} else {
							var marker = false;
						}
				 	} else if (showpetition) {
						if (petition) {					
							var marker = new GMarker(point, icon_nwP);
				 		} else {
							var marker = false;
						}
				 	} else if (showevents) {
						if (events) {					
							var marker = new GMarker(point, icon_nwC);
				 		} else {
							var marker = false;
						}
				 	} else if (showblog) {
						if (blog) {					
							var marker = new GMarker(point, icon_nwB);
				 		} else {
							var marker = false;
						}
				  } else {
						if (occupation) {
							var marker = new GMarker(point, icon_nwO);
						} else {
							var marker = new GMarker(point, icon_nw);
						}
					}
      }

			if (marker) {
      	GEvent.addListener(marker, "mouseover", function() {
        	marker.openInfoWindowHtml(getInfoWindowContents(orgName, recordNo, latitude, longitude, description, type, country_code, events, events_description, boycott, boycott_description, occupation, occupation_description, petition,  petition_description, email1, email1_description, email2, email2_description, website1, website1_description, website2, website2_description, website3, website3_description,  blog, blog_description ));
      		});
      }

      return marker;
};
    
function getInfoWindowContents(orgName, recordNo, latitude, longitude, description, type, country_code, events, events_description, boycott, boycott_description, occupation, occupation_description, petition,  petition_description, email1, email1_description, email2, email2_description, website1, website1_description, website2, website2_description, website3, website3_description,  blog, blog_description) {
			var i=0;
      var infoWindowText='<div class="mapInfoWindow">';
      infoWindowText = infoWindowText + '<b>'+ orgName + '</b><br /><br />';
      if(description) {
        description = description.replace(/[\n\r]/g, '');
        description = description.replace(/ Woe /g, '<br />Woe');
        infoWindowText = infoWindowText + description;
        infoWindowText = infoWindowText + '<br /><br />';
      
      };
      infoWindowText = infoWindowText + "<font face='Arial' color='#666666'>";
      if(email1) {
      	i++;
      	infoWindowText = infoWindowText + "Contact: <a href='mailto:"+ email1 + "' class='GMaps'>" + email1_description + "</a>. ";
      }	
      if (i>0) {
      	i=0;
     		infoWindowText = infoWindowText + "<br>";
      }
      if(email2) {
      	i++;
      	infoWindowText = infoWindowText + "Contact: <a href='mailto:"+ email2 + "' class='GMaps'>" + email2_description + "</a>. ";
      }	
      if (i>0) {
      	i=0;
     		infoWindowText = infoWindowText + "<br>";
      }
      if(occupation) {
      	i++;
      	infoWindowText = infoWindowText + "Occupation: <a href='" + occupation + "' class='GMaps' target='_blank'>";
      	infoWindowText = infoWindowText + occupation_description + "</a>";
			}
      if (i>0) {
      	i=0;
     		infoWindowText = infoWindowText + "<br>";
      }
      if(boycott) {
      	i++;
      	infoWindowText = infoWindowText + "Boycott: <a href='" + boycott + "' class='GMaps' target='_blank'>";
      	infoWindowText = infoWindowText + boycott_description + "</a>";
			}
      if (i>0) {
      	i=0;
     		infoWindowText = infoWindowText + "<br>";
      }
      if(petition) {
      	i++;
      	infoWindowText = infoWindowText + "Petition <a href='" + petition + "' class='GMaps' target='_blank'>";
      	infoWindowText = infoWindowText + petition_description + "</a>";
			}
      if (i>0) {
      	i=0;
     		infoWindowText = infoWindowText + "<br>";
      }
      if(blog) {
      	i++;
      	infoWindowText = infoWindowText + "Website: <a href='" + blog + "' class='GMaps' target='_blank'>";
      	infoWindowText = infoWindowText + blog_description + "</a>";
			}
      if (i>0) {
      	i=0;
     		infoWindowText = infoWindowText + "<br>";
      }
      if(website1) {
      	i++;
      	infoWindowText = infoWindowText + "Website: <a href='" + website1 + "' class='GMaps' target='_blank'>";
     		infoWindowText = infoWindowText + website1_description + "</a>. ";
			}
      if (i>0) {
      	i=0;
     		infoWindowText = infoWindowText + "<br>";
      }
      if(website2) {
      	i++;
      	infoWindowText = infoWindowText + "Website: <a href='" + website2 + "' class='GMaps' target='_blank'>";
      	infoWindowText = infoWindowText + website2_description + "</a>";
			}
      if (i>0) {
      	i=0;
     		infoWindowText = infoWindowText + "<br>";
      }
      if(website3) {
      	i++;
      	infoWindowText = infoWindowText + "Website: <a href='" + website3 + "' class='GMaps' target='_blank'>";
      	infoWindowText = infoWindowText + website3_description + "</a>";
			}
      if (i>0) {
      	i=0;
     		infoWindowText = infoWindowText + "<br>";
      }
      if(events) {
      	i++;
      	infoWindowText = infoWindowText + "Calendar: <a href='" + events + "' class='GMaps' target='_blank'>";
      	infoWindowText = infoWindowText + events_description + "</a>";
			}
      infoWindowText = infoWindowText + ".</font>";
      if (i>0) {
      	i=0;
     		infoWindowText = infoWindowText + "<br>";
      }
      infoWindowText = infoWindowText + '<br><span id="zoomInOn_' + recordNo +'" ';
      infoWindowText = infoWindowText + 'onclick="zoomInFunctions.zoomInOn' + recordNo + "('" + latitude + "', '" + longitude + "')" +';"';
      infoWindowText = infoWindowText + '>';
      infoWindowText = infoWindowText + 'Klik hier om in te zoomen';
      infoWindowText = infoWindowText + '</span>';
      infoWindowText = infoWindowText + '<br /><br />';

      infoWindowText = infoWindowText + '</div>';
      return infoWindowText;      
};
    
var zoomInFunctions = new Object;
var planRouteFunctions = new Object;
var prev_lattitude;
var prev_longitude;
var prev_level;
var prev_maptype;
var prev_center;
    
function sortByFirstName(a, b) {
    var x = a.FirstName.toLowerCase();
    var y = b.FirstName.toLowerCase();
    return ((x < y) ? -1 : ((x > y) ? 1 : 0));
}

function load(lattitude, longitude, level, maptype, newload) {
      if (! GBrowserIsCompatible()) {
        return false;
      };

			//alert(lattitude);
			var map = new GMap2(document.getElementById("map"));
      // startlocatie NL
      //map.setCenter(new GLatLng(37.4419, -122.1419), 13);
      //G_MAP_TYPE, G_SATELLITE_TYPE, or G_HYBRID_TYPE
      map.addMapType(G_PHYSICAL_MAP);
      //map.setMapType(G_TERRAIN_TYPE);
			map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());

			if (newload == 'Y') {
				prev_center = new GLatLng(lattitude, longitude);
				prev_lattitude = lattitude;
				prev_longitude = longitude;
				prev_level = level;
				prev_maptype = maptype;
			}
			//prev_center = p1;
			//alert("maptype=" + maptype);
			//alert(prev_center);
      map.setCenter(prev_center, level, maptype);

			GEvent.addListener(map,"maptypechanged", function(){ 
				prev_lattitude = prev_center.lat();
				prev_longitude = prev_center.lng();
				prev_level = map.getZoom();
				prev_maptype = map.getCurrentMapType();
				prev_center = map.getCenter();
			}); 

			GEvent.addListener(map,"zoomend", function(){ 
				prev_lattitude = prev_center.lat();
				prev_longitude = prev_center.lng();
				prev_level = map.getZoom();
				prev_maptype = map.getCurrentMapType();
				prev_center = map.getCenter();
			}); 

			GEvent.addListener(map,"moveend", function(){ 
				prev_lattitude = prev_center.lat();
				prev_longitude = prev_center.lng();
				prev_level = map.getZoom();
				prev_maptype = map.getCurrentMapType();
				prev_center = map.getCenter();
			}); 

			GEvent.addListener(map,"dragend", function(){ 
				prev_lattitude = prev_center.lat();
				prev_longitude = prev_center.lng();
				prev_level = map.getZoom();
				prev_maptype = map.getCurrentMapType();
				prev_center = map.getCenter();
			}); 

			//var kml = new GGeoXml("http://pipes.yahoo.com/pipes/pipe.run?_id=d696db6de1dda5c86fc8fa59bbef6aec&_render=kml&gCalXml=http%3A%2F%2Fwww.google.com%2Fcalendar%2Ffeeds%2Fstudentenprotest%2540gmail.com%2Fpublic%2Fbasic");
   		//map.addOverlay(kml);
			//var kml2 = new GGeoXml("http://pipes.yahoo.com/pipes/pipe.run?_id=d696db6de1dda5c86fc8fa59bbef6aec&_render=kml&gCalXml=http%3A%2F%2Fwww.google.com%2Fcalendar%2Ffeeds%2Fverhefjestemagenda%2540gmail.com%2Fpublic%2Fbasic");
   		//map.addOverlay(kml2);

      //G_MAP_TYPE, G_SATELLITE_TYPE, or G_HYBRID_TYPE
      //map.setMapType(G_HYBRID_TYPE);
      counter = 1;
      for(recordNo in dbase) {
        var latitude = dbase[recordNo]['LookAt']['latitude'];
        var longitude = dbase[recordNo]['LookAt']['longitude'];
        var description = dbase[recordNo]['description'];
        var type = dbase[recordNo]['type'];
        var country_code = dbase[recordNo]['country_code'];
        var occupation = dbase[recordNo]['occupation'];
        var occupation_description = dbase[recordNo]['occupation_description'];
        var boycott = dbase[recordNo]['boycott'];
        var boycott_description = dbase[recordNo]['boycott_description'];
        var petition = dbase[recordNo]['petition'];
        var petition_description = dbase[recordNo]['petition_description'];
        var events = dbase[recordNo]['event'];
        var events_description = dbase[recordNo]['event_description'];
        var website1 = dbase[recordNo]['website1'];
        var website1_description = dbase[recordNo]['website1_description'];
        var website2 = dbase[recordNo]['website2'];
        var website2_description = dbase[recordNo]['website2_description'];
        var website3 = dbase[recordNo]['website3'];
        var website3_description = dbase[recordNo]['website3_description'];
        var blog = dbase[recordNo]['blog'];
        var blog_description = dbase[recordNo]['blog_description'];
        var email1 = dbase[recordNo]['email1'];
        var email1_description = dbase[recordNo]['email1_description'];
        var email2 = dbase[recordNo]['email2'];
        var email2_description = dbase[recordNo]['email2_description'];
        var orgName = dbase[recordNo]['name'];
        
        var point = new GLatLng(latitude,longitude);
        var addOverlay = false;
        
				if (type == 'O' && toggle_organisations) {
					addOverlay = true;
        } 
				if (type == 'A' && toggle_academics) {
					addOverlay = true;
        } 
				if (type == 'S' && toggle_students) {
					addOverlay = true;
        } 
				if (type == 'I' && toggle_israeli) {
					addOverlay = true;
        } 
				if (type == 'PL' && toggle_palestines) {
					addOverlay = true;
        } 
				if (type == 'N' && toggle_news) {
					addOverlay = true;
        } 
        
        if (addOverlay) {
					var  marker = createMarker(point, orgName, counter, latitude, longitude, description, type, country_code, events, events_description, boycott, boycott_description, occupation, occupation_description, petition,  petition_description, email1, email1_description, email2, email2_description, website1, website1_description, website2, website2_description, website3, website3_description,  blog, blog_description);
					if (marker) {
        		map.addOverlay(marker);
        		var functionName = 'zoomInOn' + counter;
        		zoomInFunctions[functionName] = function(zoomLatitude, zoomLongitude) {
          	map.setCenter(new GLatLng(zoomLatitude,zoomLongitude), 15);
          	map.addControl(new GOverviewMapControl());
        		}; 
        	}
        }

        counter++;
      }
}

function loadmenu () {

			var country_counter = 0;
			var university_counter = 0;
			var information_counter = 0;
			counter = 0;
			var country;
			var country_name;
			var prev_country="";

      for(recordNo in dbase) {
        var latitude = dbase[recordNo]['LookAt']['latitude'];
        var longitude = dbase[recordNo]['LookAt']['longitude'];
        var description = dbase[recordNo]['description'];
        var type = dbase[recordNo]['type'];
        var country_code = dbase[recordNo]['country_code'];
        var occupation = dbase[recordNo]['occupation'];
        var occupation_description = dbase[recordNo]['occupation_description'];
        var boycott = dbase[recordNo]['boycott'];
        var boycott_description = dbase[recordNo]['boycott_description'];
        var petition = dbase[recordNo]['petition'];
        var petition_description = dbase[recordNo]['petition_description'];
        var events = dbase[recordNo]['event'];
        var events_description = dbase[recordNo]['event_description'];
        var website1 = dbase[recordNo]['website1'];
        var website1_description = dbase[recordNo]['website1_description'];
        var website2 = dbase[recordNo]['website2'];
        var website2_description = dbase[recordNo]['website2_description'];
        var website3 = dbase[recordNo]['website3'];
        var website3_description = dbase[recordNo]['website3_description'];
        var blog = dbase[recordNo]['blog'];
        var blog_description = dbase[recordNo]['blog_description'];
        var email1 = dbase[recordNo]['email1'];
        var email1_description = dbase[recordNo]['email1_description'];
        var email2 = dbase[recordNo]['email2'];
        var email2_description = dbase[recordNo]['email2_description'];
        var orgName = dbase[recordNo]['name'];
				country = dbase[recordNo]['country'];
				
				if (type == 'S' && toggle_students) {
					if (country != prev_country && counter > 0) {
							getCountry(prev_country);
							//alert( Countries[country_counter]['country_code'] );
							country_name = getCountry(prev_country);
							//alert('uc:' + (university_counter + 1) + 'country:' + (country_counter + 1));
							window['Menu4_' + (country_counter + 1)]=new Array(country_name,"","",university_counter,20,150);
							//alert("window['Menu4_" + (country_counter + 1) + "]=new Array(" + country_name + ",'',''," + (university_counter) + ",20,150);");
							country_counter++;
							university_counter=0;
					}
					information_counter=0;
    			if(email1) {
    				information_counter++;
    				var linkurl = "mailto:" + email1;
    				window['Menu4_' + (country_counter + 1) + '_' + (university_counter + 1) + '_' + information_counter]=new Array("Contact",linkurl,"",0,20,250);
    				//alert( "window['Menu4_' + (country_counter + 1) + '_' + (university_counter + 1) + '_' + information_counter]=new Array('BloG'," + linkurl + ",'',0,20,250);" );
					}
    			if(blog) {
    				information_counter++;
    				var linkurl = "javascript:NewWin=window.open('" + blog + "','_new');window['NewWin'].focus()";
    				window['Menu4_' + (country_counter + 1) + '_' + (university_counter + 1) + '_' + information_counter]=new Array("BloG",linkurl,"",0,20,250);
    				//alert( "window['Menu4_' + (country_counter + 1) + '_' + (university_counter + 1) + '_' + information_counter]=new Array('BloG'," + linkurl + ",'',0,20,250);" );
					}
    			if(events) {
    				information_counter++;
    				var linkurl = "javascript:NewWin=window.open('" + events + "','_new');window['NewWin'].focus()";
    				window['Menu4_' + (country_counter + 1) + '_' + (university_counter + 1) + '_' + information_counter]=new Array(events_description,linkurl,"",0,20,250);
    				//alert( "window['Menu4_' + (country_counter + 1) + '_' + (university_counter + 1) + '_' + information_counter]=new Array('BloG'," + linkurl + ",'',0,20,250);" );
					}
    			if(website1) {
    				information_counter++;
    				var linkurl = "javascript:NewWin=window.open('" + website1 + "','_new');window['NewWin'].focus()";
    				window['Menu4_' + (country_counter + 1) + '_' + (university_counter + 1) + '_' + information_counter]=new Array(website1_description,linkurl,"",0,20,250);
    				//alert( "window['Menu4_' + (country_counter + 1) + '_' + (university_counter + 1) + '_' + information_counter]=new Array('BloG'," + linkurl + ",'',0,20,250);" );
					}
    			if(website2) {
    				information_counter++;
    				var linkurl = "javascript:NewWin=window.open('" + website2 + "','_new');window['NewWin'].focus()";
    				window['Menu4_' + (country_counter + 1) + '_' + (university_counter + 1) + '_' + information_counter]=new Array(website2_description,linkurl,"",0,20,250);
    				//alert( "window['Menu4_' + (country_counter + 1) + '_' + (university_counter + 1) + '_' + information_counter]=new Array('BloG'," + linkurl + ",'',0,20,250);" );
					}
    			if(website3) {
    				information_counter++;
    				var linkurl = "javascript:NewWin=window.open('" + website3 + "','_new');window['NewWin'].focus()";
    				window['Menu4_' + (country_counter + 1) + '_' + (university_counter + 1) + '_' + information_counter]=new Array(website3_description,linkurl,"",0,20,250);
    				//alert( "window['Menu4_' + (country_counter + 1) + '_' + (university_counter + 1) + '_' + information_counter]=new Array('BloG'," + linkurl + ",'',0,20,250);" );
					}
    			if(occupation) {
    				information_counter++;
    				var linkurl = "javascript:NewWin=window.open('" + occupation + "','_new');window['NewWin'].focus()";
    				window['Menu4_' + (country_counter + 1) + '_' + (university_counter + 1) + '_' + information_counter]=new Array(occupation_description,linkurl,"",0,20,250);
    				//alert( "window['Menu4_' + (country_counter + 1) + '_' + (university_counter + 1) + '_' + information_counter]=new Array('BloG'," + linkurl + ",'',0,20,250);" );
					}
    			if(boycott) {
    				information_counter++;
    				var linkurl = "javascript:NewWin=window.open('" + boycott + "','_new');window['NewWin'].focus()";
    				window['Menu4_' + (country_counter + 1) + '_' + (university_counter + 1) + '_' + information_counter]=new Array(boycott_description,linkurl,"",0,20,250);
    				//alert( "window['Menu4_' + (country_counter + 1) + '_' + (university_counter + 1) + '_' + information_counter]=new Array('BloG'," + linkurl + ",'',0,20,250);" );
					}
    			if(petition) {
    				information_counter++;
    				var linkurl = "javascript:NewWin=window.open('" + petition + "','_new');window['NewWin'].focus()";
    				window['Menu4_' + (country_counter + 1) + '_' + (university_counter + 1) + '_' + information_counter]=new Array(petition_description,linkurl,"",0,20,250);
    				//alert( "window['Menu4_' + (country_counter + 1) + '_' + (university_counter + 1) + '_' + information_counter]=new Array('BloG'," + linkurl + ",'',0,20,250);" );
					}

					window['Menu4_' + (country_counter + 1) + '_' + (university_counter + 1)]=new Array(orgName,"","",information_counter,20,300);	
					//alert("window['Menu4_" + (country_counter + 1) + "_" + (university_counter + 1) + "]=new Array(" + orgName + ",'',''," + information_counter + ",20,250); ");	
					university_counter++;

					prev_country = country;
          counter++;
        } 
      }
			window['Menu4_' + (country_counter + 1)]=new Array(country_name,"","",university_counter,20,150);
  		//alert("window['Menu4_" + (country_counter + 1) + "]=new Array(" + country_name + ",'',''," + (university_counter) + ",20,150);");
			window['Menu4']=new Array("Universiteiten","","",country_counter,20,120);

}

function getCountry(code){
  var recordNo;
  for(recordNo in Countries) {
			//alert(Countries[recordNo]['country_code']);
			if (Countries[recordNo]['country_code'] == code) {
  				return Countries[recordNo]['country'];
		  }
	}
  return "Unknown";
}

function currentMapTypeNumber(map){
  var type=-1;
  for(var ix=0;ix<map.getMapTypes().length;ix++){
    if(map.getMapTypes()[ix]==map.getCurrentMapType())
      type=ix;
  }
  return type;
}

var showpetition=false;
var showblog=false;
var showevents=false;
var showoccupation=false;
var showboycott=false;

function showitems() {

	showpetition=false;
	showblog=false;
	showevents=false;
	showoccupation=false;
	showboycott=false;
	
	var item = document.getElementById('type7').options[document.getElementById('type7').selectedIndex].value;
	//alert(window['toggle_'+ img.id]); 
	// Toggle image based on current SRC.
	if (window['show'+ item]) {
		window['show'+ item] = false;
	} else {
		window['show'+ item] = true;
	}
	GUnload();
	load(prev_lattitude, prev_longitude, prev_level, prev_maptype, 'N');
}

function toggleImage(img) {

	//alert(window['toggle_'+ img.id]); 
	// Toggle image based on current SRC.
	if (window['toggle_'+ img.id]) {
		document.getElementById(img.id).src = document.getElementById('flag_' + img.id + '_off').src;
		window['toggle_'+ img.id] = false;
	} else {
		document.getElementById(img.id).src = document.getElementById('flag_' + img.id).src;
		window['toggle_'+ img.id] = true;
	}
	GUnload();
	load(prev_lattitude, prev_longitude, prev_level, prev_maptype, 'N');
}
