function OGmaps(icon, address, zoom, text, simple){

	this.icon	=	icon;
	this.address	=	address;
	this.zoom	=	zoom;
	this.text	=	text;
	this.simple	=	simple;

}

OGmaps.prototype.load		=	function(){

	var map			=	new GMap2(document.getElementById("map"));

	var geocoder		=	new GClientGeocoder();
	
	var zoom		=	this.zoom;
	
	var text		=	this.text;
	
	scroll_zoom();

	map.setCenter(new GLatLng(52.268157,5.185547), 8);
	
	map.setMapType(G_NORMAL_MAP);
	
	if(this.simple){
	
		map.addControl(new GSmallMapControl());
		
	}else{
	
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		map.addControl(new GOverviewMapControl);
	
	}
	
	var OGicon		=	new GIcon();
	
	OGicon			=	new GIcon();
	OGicon.image		=	this.icon;
	OGicon.iconSize		=	new GSize(28, 28);
	OGicon.iconAnchor	=	new GPoint(14, 28);
	OGicon.infoWindowAnchor	=	new GPoint(14, 2);
	
	markerOptions		=	{ icon:OGicon };

	if(geocoder){

		geocoder.getLatLng(
		
			this.address,
			
			function(point){
			
				if(!point){
					
				} else {
					
					map.setCenter(point, zoom);
					
					var marker	=	new GMarker(point, markerOptions);
					
					map.addOverlay(marker);
					
				}
		
				GEvent.addListener(marker, "click", function() {
		
					marker.openInfoWindowHtml(text);
		
				});
		
				GEvent.addListener(marker, "dblclick", function() {
					
					map.setCenter(point, zoom);
				
				});
				
			}
			
		);
		
	}
	
	function scroll_zoom(){

		var d	=	document.getElementById('map');

		if(d){
		
	        	if(document.body.addEventListener){
	        	
				d.addEventListener('DOMMouseScroll', function(oEvent){

					if(oEvent.detail > 0){
					
						map.zoomOut();
					
					}else{
					
						map.zoomIn();
					
					}
					
				}, false);
				

			}else{

				d.onmousewheel = function(){

					if(event.wheelDelta < 0){
					
						map.zoomOut();
					
					}else{
					
						map.zoomIn();
					
					}
				
					return false;
				}
				
			}
			
		}

	}

}

