	var map;
	var ppp;
	ppp = 0;
	function myload() {

	if (ppp == 0) {
		//initSlideDownMenu();
		ppp = 1;
	};

      if (GBrowserIsCompatible()) {
/*
_mSvgEnabled = true;
_mSvgForced = true;
*/
        map = new GMap2(document.getElementById("map"));
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());

		/*
		var copyright = new GCopyright(1, new GLatLngBounds(new GLatLng(-90, -180),
					    new GLatLng(90, 180)), 0, "©2007 www.tomap.nl");
		var copyrightCollection = new GCopyrightCollection('Chart');
		copyrightCollection.addCopyright(copyright);
		var tilelayers = [new GTileLayer(copyrightCollection , 3, 11)];
		tilelayers[0].getTileUrl = CustomGetTileUrl;

		function CustomGetTileUrl(a,b) {
			var z = 17 - b;
			var f = "/maps/?x="+a.x+"&amp;y="+a.y+"&amp;zoom="+z;
			return f;
		}
		var custommap = new GMapType(tilelayers, new GMercatorProjection(12), "Chart", {errorMessage:"No data available"});
		map.addMapType(custommap);
		*/
		
/*		
var lineThickness = 1;

var points = [];
var points2 = [];
var points3 = [];
var points4 = [];

var polygonDisplayed = [];
var polygons = [];


    map.setCenter(new GLatLng(37.4419, -122.1419), 12);//11);

    getPoints();
alert("tot hier polyline...");
var polyline = new GPolyline([new GLatLng(37.4419, -122.1419), new GLatLng(37.4519, -122.1519)], "#ff0000", 10);
map.addOverlay(new GPolyline([new GLatLng(37.4419, -122.1419), new GLatLng(37.4419, -121.1419)], "#008800", 4));
alert("tot hier polyline...");
    

	//dit werkt...    
    var point = new GLatLng(37.4419, -122.1419);
    map.addOverlay(new GMarker(point))
    var point = new GLatLng(47.656, -122.34);
    map.addOverlay(new GMarker(point))    
    alert("tot hier ok...");      
    map.addOverlay(polyline);

    alert("tot hier polyline...");  
    polygons[0] = new GPolygon(points, true, "#008800",1,true);

    map.addOverlay(polygons[0]);
    alert("tot hier ..polygonnnnnn...");    

    
    polygonDisplayed[0] = true;
    
    
    polygons[1] = new GPolygon(points2, true,"#0000ff",0.40,true);
    map.addOverlay(polygons[1]);
    polygonDisplayed[1] = true;

    polygons[2] = new GPolygon(points3, true,"#0000ff",0.40,true);
    map.addOverlay(polygons[2]);
    polygonDisplayed[2] = true;

    polygons[3] = new GPolygon(points4, true,"#0000ff",0.40,true);
    map.addOverlay(polygons[3]);
    polygonDisplayed[3] = true;
    alert("tot hier ok...");

*/
   
    // Add a listener for Zooms
//    GEvent.addListener(map, "zoom", function() {
/*
    GEvent.addListener(map, "zoomend", function (oldLevel, newLevel) {
//        GLog.write("ZOOM level = "+map.getZoom());
        map.clearOverlays(); 

        polygons[0] = new JPolygon(points,"#ff6b54",true,map);
        polygons[1] = new JPolygon(points2, "#0000ff",true, map);
        polygons[2] = new JPolygon(points3, "#0000ff",true, map);
        polygons[3] = new JPolygon(points4, "#0000ff",true, map);

        for (var i = 0; i < polygonDisplayed.length; i++) {
            // Only add the polygon as an overlay if it is in the visible part of the map
            if (map.getBounds().intersects(polygons[i].getBounds())) {
                map.addOverlay(polygons[i]);
                polygonDisplayed[i] = true;
            }
            else {
                polygonDisplayed[i] = false;
            }
        }
    });
*/

/*
    // Add a listener for clicks to display Infowindows
    GEvent.addListener(map, "click", function(overlay, point) {
        if (point) {
           if (polygons[0].inZone(point)) {
               map.openInfoWindowHtml(point, "<html>Hello world</html>");
            }
        }
    });


    // Add a listener for Moveends
    GEvent.addListener(map, "moveend", function() {
        for (var i = 0; i < polygonDisplayed.length; i++) {
            if (polygonDisplayed[i] == false) {
                // Only add the polygon as an overlay if it is in the visible part of the map
                if (map.getBounds().intersects(polygons[i].getBounds())) {
                    map.addOverlay(polygons[i]);
                    polygonDisplayed[i] = true;
               }
                else {
                    polygonDisplayed[i] = false;
                }
            }
        }
    });
*/

/*
function getPoints() {
    points = [];
    points2 = [];
    points3 = [];
    points4 = [];


    points.push(new GLatLng(51.4429695, 5.4881045));
    points.push(new GLatLng(51.4429695, 5.4751095));
    points.push(new GLatLng(51.4299745, 5.4751095));
    points.push(new GLatLng(51.4299745, 5.4881045));
    points.push(new GLatLng(51.4429695, 5.4881045));

    points2.push(new GLatLng(47.613204319056045, -122.3871176135507));
    points2.push(new GLatLng(47.61684683369688, -122.39467145259941));
    points2.push(new GLatLng(47.619546488233524, -122.40304688745843));
    points2.push(new GLatLng(47.6212211041749, -122.41198907747764));
    points2.push(new GLatLng(47.621819698061735, -122.42122582970698));
    points2.push(new GLatLng(47.65780847769449, -122.42078698801428));
    points2.push(new GLatLng(47.65661042317468, -122.40230103040005));
    points2.push(new GLatLng(47.65325895036952, -122.38440580764272));
    points2.push(new GLatLng(47.647856297874895, -122.3676470171554));
    points2.push(new GLatLng(47.64056722782395, -122.35253529684004));

    points3.push(new GLatLng(47.67196640153331, -122.40194487615674));
    points3.push(new GLatLng(47.670441122952554, -122.40242212714896));
    points3.push(new GLatLng(47.669003789264345, -122.40323095795063));
    points3.push(new GLatLng(47.6676980670374, -122.40434677666259));
    points3.push(new GLatLng(47.66656362207177, -122.40573567025076));
    points3.push(new GLatLng(47.66563491512721, -122.40735543611405));
    points3.push(new GLatLng(47.66494015590858, -122.40915686460134));
    points3.push(new GLatLng(47.66450044696301, -122.41108523348356));
    points3.push(new GLatLng(47.66432914337661, -122.41308196906145));
    points3.push(new GLatLng(47.664431447619266, -122.41508642362988));
    points3.push(new GLatLng(47.66480425177183, -122.41703771556456));
    points3.push(new GLatLng(47.66543623189323, -122.41887657644166));
    points3.push(new GLatLng(47.66630819166827, -122.42054714939652));
    points3.push(new GLatLng(47.667393644945094, -122.4219986843779));
    points3.push(new GLatLng(47.66865961955101, -122.42318707902091));
    points3.push(new GLatLng(47.670067658077365, -122.4240762184578));
    points3.push(new GLatLng(47.67157498535267, -122.42463907338354));
    points3.push(new GLatLng(47.67313580725602, -122.4248585229242));
    points3.push(new GLatLng(47.67470270151376, -122.42472787711355));
    points3.push(new GLatLng(47.67622805829765, -122.4242510828295));
    points3.push(new GLatLng(47.677665526889755, -122.42344260661204));
    points3.push(new GLatLng(47.67897142444998, -122.42232699759226));
    points3.push(new GLatLng(47.68010606403055, -122.42093814351227));
    points3.push(new GLatLng(47.6810349613982, -122.41931824220789));
    points3.push(new GLatLng(47.681729883880274, -122.4175165196664));
    points3.push(new GLatLng(47.68216970923763, -122.41558773358417));
    points3.push(new GLatLng(47.68234106834319, -122.41359050798094));
    points3.push(new GLatLng(47.68223875203066, -122.41158554966611));
    points3.push(new GLatLng(47.68186586967498, -122.40963380102326));
    points3.push(new GLatLng(47.68123375464964, -122.40779458556197));
    points3.push(new GLatLng(47.680361619541274, -122.40612380291493));
    points3.push(new GLatLng(47.67927597164953, -122.40467222842542));
    points3.push(new GLatLng(47.67800980662052, -122.40348396922352));
    points3.push(new GLatLng(47.67660160483078, -122.40259512384083));
    points3.push(new GLatLng(47.67509416114368, -122.4020326861151));
    points3.push(new GLatLng(47.67353328372113, -122.40181372659974));

    points4.push(new GLatLng(47.706, -122.34));
    points4.push(new GLatLng(47.663, -122.34));
    points4.push(new GLatLng(47.663, -122.30));
    points4.push(new GLatLng(47.706, -122.30));

}
*/
		
		//map.addControl(new GOverviewMapControl());	
		//map.addControl(new GOverviewMapControl(), new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10, 10)));
		//GOverviewMapControl
		//GLargeMapControl
		//map.addControl(new GMapTypeControl(), new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10, 10)));
        
        
        map.setCenter(new GLatLng(52.0879, 5.11610), 7);
        
	    //var point = new GLatLng(52.0885, 5.11612);
/*
        var baseicon = new GIcon();
        baseicon.iconSize = new GSize(12, 20);
        baseicon.iconAnchor = new GPoint(6, 19);
        baseicon.infoWindowAnchor = new GPoint(6, 1);
        icon = new GIcon(baseicon);
        icon.image = "test.png";

        icon.iconSize = new GSize(131, 30);
        icon.iconAnchor = new GPoint(1, 30)
        icon.infoWindowAnchor = new GPoint(10, 0);


		// Creates a marker at the given point with the given number label
		function createUserMarker(point, number, icon) {
		  //var marker = new GMarker(point);
		  var marker = new GMarker(point, icon);
			  GEvent.addListener(marker, "click", function() {
			    marker.openInfoWindowHtml("Marker #<b>" + number + "</b>");
		  });
		  return marker;
		}
*/
//		map.addOverlay(createUserMarker(point, 1, icon));
		/*
		GDownloadUrl("data.xml", function(data, responseCode) {
			var xml = GXml.parse(data);
			var markers = xml.documentElement.getElementsByTagName("marker");
			for (var i = 0; i < markers.length; i++) {
				var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")),
                            parseFloat(markers[i].getAttribute("lng")));
				map.addOverlay(new GMarker(point));
			}
		});
		*/
      }
    }
    
function unload() {
	
}

function userLoad(pGuid, pZoom, pX, pY, pCat, pSub, pSubCat, pDataset) {
//function userLoad(pGuid, pZoom) {
//function userLoad(pGuid) {

//function userLoad(pGuid) {
	//mId = pId;
	mGuid = pGuid;
	mCat = pCat;
	mSub = pSub;
	mSubCat = pSubCat;
	mDataset = pDataset;
	//alert(mGuid);
	//var integer mZoom = 0;
	//alert("pX: " + pX + "  pY: " + pY); 
	var s;
	var mX;
	var mY;
	s = eval(pZoom);
	//alert("zoomfactor: " + s);
	//mX = pX;
	//mY = pY;
	
	mX = eval(pX);
	mY = eval(pY);
	//alert(typeof s);
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map"));
        map.clearOverlays()
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		//alert("zoom in if: " + mZoom);
        map.setCenter(new GLatLng(mY, mX), s);
        map.panTo(new GLatLng(mY, mX));
        //map.setCenter(new GLatLng(52.0879, 5.11610), 7);
        //locate('15','Dance events','contentReader.aspx','dance events',true, false);
        
        findUserLocations(mGuid, mCat, mSub, mSubCat, mDataset);
      }
}




// This function picks up the click and opens the corresponding info window
/*
function myclick(i) {
	gmarkers[i].openInfoWindowHtml(htmls[i]);

	mLon = markerElements[i].getAttribute( 'lon'	);
	mLat = markerElements[i].getAttribute( 'lat'	);
	locateAds(markerElements[i].getAttribute('City'));
	//locatePois(markerElements[i].getAttribute('City'), mLon, mLat);
}
*/

// This function picks up the click and opens the corresponding page in the side_bar
/*
function navclick(i) {
      document.getElementById("side_bar").innerHTML = side_bar_html[i];
}

// functions that open the dynamic info window forms
function tohere(i) {
	gmarkers[i].openInfoWindowHtml(htmls[i]);
}
*/

// This function triggers a "from" event on the marker
/*
function fromhere(i) {
   GEvent.trigger(gmarkers[i],"from");
}
*/
