    var map = null;
    var geocoder = null;
	
	function initialize() {
		if (GBrowserIsCompatible()) {
			map = new GMap2(document.getElementById("map_canvas"));
			map.setCenter(new GLatLng(47.18,19.52), 6);
			geocoder = new GClientGeocoder();
			
			map.addControl(new GLargeMapControl());
			
			map.addControl(new GMapTypeControl());
			//map.addControl(new google.maps.LocalSearch(), new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,20)));
      }
    }

	
	function createMarker(latlng, address) {
	
		// Create our "tiny" marker icon
		var blueIcon = new GIcon(G_DEFAULT_ICON);
		//blueIcon.image = "http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png";
				
		var marker = new GMarker(latlng);
		GEvent.addListener(marker,"click", function() {
			var myHtml = "<b>" + address + "</b><br/>";
			map.openInfoWindowHtml(latlng, myHtml);
		});
				
	/*
		markerOptions = { icon:blueIcon };

		var marker = new GMarker(latlng, markerOptions);
		marker.value = address;
		GEvent.addListener(marker,"click", function() {
			var myHtml = "<b>" + address + "</b><br/>";
			map.openInfoWindowHtml(latlng, myHtml);
		});
	*/
		return marker;
	}

	
    function showAddress(address) {
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              //alert(address + " not found");
            } else {
              map.setCenter(point, 12);
              //var marker = new GMarker(point);
              //map.addOverlay(marker);
			  map.addOverlay(createMarker(point, address));
              //marker.openInfoWindowHtml(address);
            }
          }
        );
      }
    }
	
	//Index Web Solutions Copyright
	
	function createAtmMarker(latlng, address, bank, place) {
		var blueIcon = new GIcon(G_DEFAULT_ICON);
		blueIcon.image = "images/atm.png";
		blueIcon.iconSize = GSize(40, 38);
		blueIcon.iconAnchor = new GPoint(20, 42);
		blueIcon.infoWindowAnchor = new GPoint(20, 15);
						

		markerOptions = { icon:blueIcon };

		var marker = new GMarker(latlng, markerOptions);
		marker.value = address;
		GEvent.addListener(marker,"click", function() {
			var myHtml = "<b>" +bank+ "</b><br/><b>"+address+"</b><br/><b>"+place+"</b><br/>";
			map.openInfoWindowHtml(latlng, myHtml);
		});
		return marker;
	}
	
	//targets finders start
	
	var globali = 0;
	function showAllAtm() {
		var over = globali+10;
		for(i=globali; i<over; i++) {
			if(!allATMaddressArr[i]) {break;}
			showATM(allATMaddressArr[i],allATMbankArr[i],allATMplaceArr[i]);
		}
		
		if(allATMaddressArr[globali]) {
			globali = over;
			setTimeout("showAllAtm();",1800);
		}
	}
	
	function showAllGeneral() {
		var over = globali+10;
		for(i=globali; i<over; i++) {
			if(!allATMaddressArr[i]) {break;}
			showAddress(allATMaddressArr[i]);
		}
		
		if(allATMaddressArr[globali]) {
			globali = over;
			setTimeout("showAllGeneral();",1800);
		}
	}
	
	//targets finder over
	
    function showATM(address,bank,place) {
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              //alert(address + " not found");
            } else {
              map.setCenter(point, 12);
              //var marker = new GMarker(point);
              //map.addOverlay(marker);
			  map.addOverlay(createAtmMarker(point, address, bank, place));

              //marker.openInfoWindowHtml(address);
            }
          }
        );
      }
    }
	
	
	function showBankOnMap(bank,address,place) {
		if (geocoder) {
			geocoder.getLatLng(
				address,
				function(point) {
					if (!point) {} else {
						map.setCenter(point, 12);
						var myHtml = "<b>" +bank+ "</b><br/><b>"+address+"</b><br/><b>"+place+"</b><br/>";
						map.openInfoWindowHtml(point, myHtml);
				}
			  }
			);
		  }
	}
	
	function createAtmMessage(latlng, address, bank, place) {
		var blueIcon = new GIcon(G_DEFAULT_ICON);
		blueIcon.image = "images/atm.png";
		blueIcon.iconSize = GSize(40, 38);
		blueIcon.iconAnchor = new GPoint(20, 42);
		blueIcon.infoWindowAnchor = new GPoint(20, 15);
						

		markerOptions = { icon:blueIcon };

		var marker = new GMarker(latlng, markerOptions);
		marker.value = address;
		GEvent.addListener(marker,"click", function() {
			var myHtml = "<b>" +bank+ "</b><br/><b>"+address+"</b><br/><b>"+place+"</b><br/>";
			map.openInfoWindowHtml(latlng, myHtml);
		});
		return marker;
	}
	
	//--------petrol------------------
	
    function showPetrol(address,bank,place) {
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              //alert(address + " not found");
            } else {
              map.setCenter(point, 12);
              //var marker = new GMarker(point);
              //map.addOverlay(marker);
			  map.addOverlay(createPetrolMarker(point, address, bank, place));

              //marker.openInfoWindowHtml(address);
            }
          }
        );
      }
    }
	
	function showAllPetrol() {
		var over = globali+10;
		for(i=globali; i<over; i++) {
			if(!allATMaddressArr[i]) {break;}
			showPetrol(allATMaddressArr[i],allATMbankArr[i],allATMplaceArr[i]);
		}
		
		if(allATMaddressArr[globali]) {
			globali = over;
			setTimeout("showAllPetrol();",1800);
		}
	}
	
	function createPetrolMarker(latlng, address, bank, place) {
		var blueIcon = new GIcon(G_DEFAULT_ICON);
		blueIcon.image = "images/petrol.png";
		blueIcon.iconSize = GSize(30, 30);
		blueIcon.iconAnchor = new GPoint(15, 30);
		blueIcon.infoWindowAnchor = new GPoint(15, 30);
		blueIcon.shadow = "";
						

		markerOptions = { icon:blueIcon };

		var marker = new GMarker(latlng, markerOptions);
		marker.value = address;
		GEvent.addListener(marker,"click", function() {
			var myHtml = "<b>" +bank+ "</b><br/><b>"+address+"</b><br/><b>"+place+"</b><br/>";
			map.openInfoWindowHtml(latlng, myHtml);
		});
		return marker;
	}
