// maltaphoto V1.0 JavaScript SourceCode
// (c) 2006 by tricos media. All rights reserved.
// [TCB] 18.06.2006 08:43:36

var mainProjectDomain="www.maltaphoto.net";

function doPopup(url, width, height)
{
	height+=24+15;
	tspopmywin=window.open(url, 'tsPopup', 'width='+width+',height='+height+',directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no');
	tspopmywin.focus();
}

function swapImage(img, src)
{
	document.images[img].src="images/"+src;
}




function createMarker(point, icon, text) {
  var marker = new GMarker(point, icon);
 /*
  var infoTabs = [
 new GInfoWindowTab("Tab #1", "This is tab #1 content"),
 new GInfoWindowTab("Tab #2", 'This is tab #2 content<img src="images/duck_head_smile_lg_wht.gif" width="130" height="130" alt="" border="0" />')
];
*/
  GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml(text);
//	marker.openInfoWindowTabsHtml(infoTabs);
  });

  return marker;
}


function createMarkerEx(lat, lng, icon, text)
{
	var point = new GLatLng(lat, lng);
	return createMarker(point, icon, text);
}

var icon;
var heritageIcon;
var museumIcon;
var churchIcon;
var sightIcon;
var beachIcon;
var photoIcon;
var restaurantIcon;
var map;

function mpload()
{
	if($('map') != null) {
		if (GBrowserIsCompatible()) {
	        map = new GMap2(document.getElementById("map"));
			map.addControl(new GLargeMapControl());
			//map.addControl(new GMapTypeControl());
	        map.setCenter(new GLatLng(35.94299166369471, 14.385223388671875), 11);
			map.setMapType(G_SATELLITE_MAP);
		/*	GEvent.addListener(map, "moveend", function() {
			  var center = map.getCenter();
			  document.getElementById("message").innerHTML = center.toString();
			});
		*/
			// Create our "tiny" marker icon
			icon = new GIcon();
			icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
			icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
			icon.iconSize = new GSize(12, 20);
			icon.shadowSize = new GSize(22, 20);
			icon.iconAnchor = new GPoint(6, 20);
			icon.infoWindowAnchor = new GPoint(5, 1);
			
			// HERITAGE ICON
			heritageIcon = new GIcon();
			heritageIcon.image = "/images/arrow_heritage.png";
			heritageIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
			heritageIcon.iconSize = new GSize(12, 21);
			heritageIcon.shadowSize = new GSize(22, 20);
			heritageIcon.iconAnchor = new GPoint(6, 20);
			heritageIcon.infoWindowAnchor = new GPoint(5, 1);
			
			// MUSEUM ICON
			museumIcon = new GIcon();
			museumIcon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
			museumIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
			museumIcon.iconSize = new GSize(12, 20);
			museumIcon.shadowSize = new GSize(22, 20);
			museumIcon.iconAnchor = new GPoint(6, 20);
			museumIcon.infoWindowAnchor = new GPoint(5, 1);
			
			// CHURCH ICON
			churchIcon = new GIcon();
			churchIcon.image = "/images/arrow_church.png";
			churchIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
			churchIcon.iconSize = new GSize(12, 21);
			churchIcon.shadowSize = new GSize(22, 20);
			churchIcon.iconAnchor = new GPoint(6, 20);
			churchIcon.infoWindowAnchor = new GPoint(5, 1);
			
			// SIGHT ICON
			sightIcon = new GIcon();
			sightIcon.image = "/images/arrow_sight.png";
			sightIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
			sightIcon.iconSize = new GSize(12, 20);
			sightIcon.shadowSize = new GSize(22, 20);
			sightIcon.iconAnchor = new GPoint(6, 20);
			sightIcon.infoWindowAnchor = new GPoint(5, 1);
			
			// BEACH ICON
			beachIcon = new GIcon();
			beachIcon.image = "/images/arrow_beach.png";
			beachIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
			beachIcon.iconSize = new GSize(12, 21);
			beachIcon.shadowSize = new GSize(22, 20);
			beachIcon.iconAnchor = new GPoint(6, 20);
			beachIcon.infoWindowAnchor = new GPoint(5, 1);
			
			// PHOTO ICON
			photoIcon = new GIcon();
			photoIcon.image = "/images/arrow_photo.png";
			photoIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
			photoIcon.iconSize = new GSize(12, 20);
			photoIcon.shadowSize = new GSize(22, 20);
			photoIcon.iconAnchor = new GPoint(6, 20);
			photoIcon.infoWindowAnchor = new GPoint(5, 1);
			
			// RESTAURANT ICON
			restaurantIcon = new GIcon();
			restaurantIcon.image = "/images/arrow_restaurant.png";
			restaurantIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
			restaurantIcon.iconSize = new GSize(12, 20);
			restaurantIcon.shadowSize = new GSize(22, 20);
			restaurantIcon.iconAnchor = new GPoint(6, 20);
			restaurantIcon.infoWindowAnchor = new GPoint(5, 1);
			
			initPage();
			
      	}
	}
}

function quickZoom(lat, lng, level)
{
	if(map != null)
	{
		map.setCenter(new GLatLng(lat, lng), level);
	}
}


function mpunload()
{
	GUnload();
	
}



// open an info window
				function showMarkerInfo(i) {
					markers[i].openInfoWindowHtml(infoHtmls[i]);
				}
		
		
		