/* - - - - - - - - - - - - - - - - - - - - -
Cím : assmako javascript                                    
Készítő : Busa Csaba / maps.google.com
URL : http://www.bcsnet.hu
- - - - - - - - - - - - - - - - - - - - - */
    
/* - - - - - JAVASCRIPT - - - - - */

window.onload = function() {
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("map"));
		map.setCenter(new GLatLng(46.233980, 20.498060), 12);
		map.addControl(new GLargeMapControl());      
		map.addControl(new GMapTypeControl());
		
		var polyline = new GPolyline([
  			new GLatLng(46.233980, 20.498060),
  			new GLatLng(46.231130, 20.491920),
			new GLatLng(46.229390, 20.480870),
			new GLatLng(46.227619, 20.481056),
			new GLatLng(46.226990, 20.480808),
			new GLatLng(46.221622, 20.477729),
			new GLatLng(46.221050, 20.477666),
			new GLatLng(46.216360, 20.475160),
			new GLatLng(46.216086, 20.475071),
			new GLatLng(46.215140, 20.474560),
			new GLatLng(46.214937, 20.474571),
			new GLatLng(46.214780, 20.474690),
		], "#0000ff", 5);
		map.addOverlay(polyline);
		
		var assIcon = new GIcon();
		assIcon.iconSize = new GSize(32, 32);
		assIcon.iconAnchor = new GPoint(32, 32);
		assIcon.infoWindowAnchor = new GPoint(9, 2);
		assIcon.infoShadowAnchor = new GPoint(18, 25);
	
		function createMarker(point, picture) {

			assIcon.image = picture;
			
			markerOptions = { icon:assIcon };
			var marker = new GMarker(point, markerOptions);
	
			GEvent.addListener(marker, "click", function() {
				marker.openInfoWindowHtml("<b>ASS Berendezési Rendszerek Ipari Bt. </b><br />H-6900 Makó<br />Rákosi út 4.<br />");
			});
			return marker;
			}
			
			var latlng = new GLatLng(46.235431, 20.497264);
			map.addOverlay(createMarker(latlng, "../images/ass.png"));
			
			var latlng = new GLatLng(46.214780, 20.474790);
			map.addOverlay(createMarker(latlng, "../images/lamp.png"));
			
			var latlng = new GLatLng(46.229780, 20.481305);
			map.addOverlay(createMarker(latlng, "../images/temp.png"));
			
			var latlng = new GLatLng(46.228889, 20.481391);
			map.addOverlay(createMarker(latlng, "../images/temp.png"));
		}
	}

window.onunload = function() {
	GUnload();
}
