
		function FleetZoomControl() {
		}
		
		FleetZoomControl.prototype = new GControl();

		// Creates a one DIV for each of the buttons and places them in a container
		// DIV which is returned as our control element. We add the control to
		// to the map container and return the element for the map class to
		// position properly.
		FleetZoomControl.prototype.initialize = function(map) {
		  var container = document.createElement("div");

		  var zoomFleet = document.createElement("div");
		  this.setButtonStyle_(zoomFleet);
		  container.appendChild(zoomFleet);
		  zoomFleet.appendChild(document.createTextNode("??a ta s??f?"));
		  GEvent.addDomListener(zoomFleet, "click", function() {
			fleetZoom();
		  });	
		 
		 /* var zoomLeg1 = document.createElement("div");
		  this.setButtonStyle_(zoomLeg1);
		  container.appendChild(zoomLeg1);
		  zoomLeg1.appendChild(document.createTextNode("Διαδρομή 1"));
		  GEvent.addDomListener(zoomLeg1, "click", function() {
			legZoom(1);
		  });

		  var zoomLeg2 = document.createElement("div");
		  this.setButtonStyle_(zoomLeg2);
		  container.appendChild(zoomLeg2);
		  zoomLeg2.appendChild(document.createTextNode("Διαδρομή 2"));
		  GEvent.addDomListener(zoomLeg2, "click", function() {
			legZoom(2);
		  });

		  var zoomLeg3 = document.createElement("div");
		  this.setButtonStyle_(zoomLeg3);
		  container.appendChild(zoomLeg3);
		  zoomLeg3.appendChild(document.createTextNode("Διαδρομή 3"));
		  GEvent.addDomListener(zoomLeg3, "click", function() {
			legZoom(3);
		  });

		  var zoomLeg4 = document.createElement("div");
		  this.setButtonStyle_(zoomLeg4);
		  container.appendChild(zoomLeg4);
		  zoomLeg4.appendChild(document.createTextNode("Διαδρομή 4"));
		  GEvent.addDomListener(zoomLeg4, "click", function() {
			legZoom(4);
		  });
*/
		  map.getContainer().appendChild(container);
		  return container;
		}

		// By default, the control will appear in the top left corner of the
		// map with 7 pixels of padding.
		FleetZoomControl.prototype.getDefaultPosition = function() {
		  return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(5, 50));
		}

		// Sets the proper CSS for the given button element.
		FleetZoomControl.prototype.setButtonStyle_ = function(button) {
		  button.style.textDecoration = "none";
		  button.style.color = "#003399";
		  button.style.backgroundColor = "#FFFFFF";
		  button.style.font = "7pt Tahoma";
		  button.style.border = "1px solid black";
		  button.style.padding = "2px";
		  button.style.marginBottom = "3px";
		  button.style.textAlign = "center";
		  button.style.width = "7em";
		  button.style.cursor = "pointer";
		}

		function FleetZoomControlEN() {
		}
		
		FleetZoomControlEN.prototype = new GControl();

		// Creates a one DIV for each of the buttons and places them in a container
		// DIV which is returned as our control element. We add the control to
		// to the map container and return the element for the map class to
		// position properly.
		FleetZoomControlEN.prototype.initialize = function(map) {
		  var container = document.createElement("div");

		  var zoomFleet = document.createElement("div");
		  this.setButtonStyle_(zoomFleet);
		  container.appendChild(zoomFleet);
		  zoomFleet.appendChild(document.createTextNode("All boats"));
		  GEvent.addDomListener(zoomFleet, "click", function() {
			fleetZoom();
		  });	
		 
		  var zoomLeg1 = document.createElement("div");
		  this.setButtonStyle_(zoomLeg1);
		  container.appendChild(zoomLeg1);
		  zoomLeg1.appendChild(document.createTextNode("Leg 1"));
		  GEvent.addDomListener(zoomLeg1, "click", function() {
			legZoom(1);
		  });

		  var zoomLeg2 = document.createElement("div");
		  this.setButtonStyle_(zoomLeg2);
		  container.appendChild(zoomLeg2);
		  zoomLeg2.appendChild(document.createTextNode("Leg 2"));
		  GEvent.addDomListener(zoomLeg2, "click", function() {
			legZoom(2);
		  });

		  var zoomLeg3 = document.createElement("div");
		  this.setButtonStyle_(zoomLeg3);
		  container.appendChild(zoomLeg3);
		  zoomLeg3.appendChild(document.createTextNode("Leg 3"));
		  GEvent.addDomListener(zoomLeg3, "click", function() {
			legZoom(3);
		  });

		  var zoomLeg4 = document.createElement("div");
		  this.setButtonStyle_(zoomLeg4);
		  container.appendChild(zoomLeg4);
		  zoomLeg4.appendChild(document.createTextNode("Leg 4"));
		  GEvent.addDomListener(zoomLeg4, "click", function() {
			legZoom(4);
		  });

		  map.getContainer().appendChild(container);
		  return container;
		}

		// By default, the control will appear in the top left corner of the
		// map with 7 pixels of padding.
		FleetZoomControlEN.prototype.getDefaultPosition = function() {
		  return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(5, 50));
		}

		// Sets the proper CSS for the given button element.
		FleetZoomControlEN.prototype.setButtonStyle_ = function(button) {
		  button.style.textDecoration = "none";
		  button.style.color = "#003399";
		  button.style.backgroundColor = "#FFFFFF";
		  button.style.font = "7pt Tahoma";
		  button.style.border = "1px solid black";
		  button.style.padding = "2px";
		  button.style.marginBottom = "3px";
		  button.style.textAlign = "center";
		  button.style.width = "7em";
		  button.style.cursor = "pointer";
		}
	function fleetZoom() {
		var gBounds = new GLatLngBounds();
		if (carGroupLat && carGroupLng) {			
			for (var i=0;i<carGroupLat.length;i++) {		
				if (carGroupLat[i]>0 && carGroupLng[i]>0)
				{	
					gBounds.extend(new GLatLng(carGroupLat[i], carGroupLng[i]));				
				}
			}           			       
			var zoomLevel = map.getBoundsZoomLevel(gBounds);
			var center = gBounds.getCenter();
			map.setCenter(center, zoomLevel,G_SATELLITE_MAP);  		
		} 
		removePath();
	}
	
	function legZoom(index) { 
		var gBounds = new GLatLngBounds();
		
		switch (index)
		{
			case 1:
				gBounds.extend(new GLatLng(37.88410833, 23.71731389));
				gBounds.extend(new GLatLng(36.826706, 25.865252));
				break;
			case 2:
				gBounds.extend(new GLatLng(36.826706, 25.865252));
				gBounds.extend(new GLatLng(37.690156, 26.941916));
				break;
			case 3:
				gBounds.extend(new GLatLng(37.690156, 26.941916));
				gBounds.extend(new GLatLng(38.514763, 26.223142));
				break;
			case 4:
				gBounds.extend(new GLatLng(38.514763, 26.223142));
				gBounds.extend(new GLatLng(37.88410833, 23.71731389));
				break;
		}
		map.setZoom(map.getBoundsZoomLevel(gBounds));
		map.setCenter(gBounds.getCenter());
		removePath();
	}
