var icon=new Array(); // lijst van gebruikte icons

function addIcon(image, iconnr) { // stel een specifiek icon in inclusief kleur
    icon[iconnr]=new GIcon();
    icon[iconnr].image = "marker/"+image+".png";
    icon[iconnr].shadow = "marker/schaduw.png";
    icon[iconnr].iconSize = new GSize(12, 20);
    icon[iconnr].shadowSize = new GSize(22, 20);
    icon[iconnr].iconAnchor = new GPoint(6, 20);
    icon[iconnr].infoWindowAnchor = new GPoint(5, 1);
}

function init(x,y,s) { // initieer de map
    gmap.addControl(new GSmallMapControl());
    gmap.setCenter(new GLatLng(x, y), s);
}

function mark(iconnr,image,naam,adres,plaats,korting,x,y) { // zet een marker op de map inclusief tankstation informatie
    if (icon[iconnr]) {
        var marker = new GMarker(new GLatLng(x,y), icon[iconnr]);
	GEvent.addListener(marker, "click", function() {
    	    marker.openInfoWindowHtml('<div style="width:250px" class="popup"><img width=119 src="logo/'+image+'">'+'<br>'+naam+'<br>'+adres+'<br>'+plaats+'<br><br><b>korting '+korting+'</div>');
        });
	gmap.addOverlay(marker);
    }
}

