﻿	var widthLarge = "950px";
	var widthSmall = "300px";
	var heightLarge = "550px";
	var heightSmall = "0px";
	var currentMapSize = "small";
	var MarkersReady = false;
	
	var map;
	var latlng = new google.maps.LatLng(30.697944962,-65.479101037);		
	var latlngLarge = new google.maps.LatLng(31.697944962,-0.479101037);
	 
	function InitializeGoogleMap(canvasControlID) 
	{		
		var myOptions = {
					mapTypeControl: true,
					zoom: 1,
					center: latlng,
					mapTypeId: google.maps.MapTypeId.ROADMAP, 
					mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
					navigationControl: true,
					navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL}
					};		
		 
		map = new google.maps.Map(document.getElementById(canvasControlID), myOptions);	

		if (MarkersReady)
		{
			AddMarkers();
		}
	}

	function AddMarker(position, map, title, infoContent,mapIcon)
	{
		 var marker = new google.maps.Marker({
								position: position,								 
								map: map,
								clickable: true,
								title: title,
								icon:mapIcon													
								});	
		var infowindow = new google.maps.InfoWindow(
		{
				content: infoContent,
				marker: marker
		});
		google.maps.event.addListener(marker, 'click', function() { infowindow.open(map,marker);	});								

	}

	function ToggleMapSize(sender)
	{
		var mapParent = document.getElementById("mapParent");
		if(currentMapSize == "small") {
			mapParent.style.position = map.getDiv().style.position = "absolute";
			mapParent.style.right = map.getDiv().style.right = 0;
			map.getDiv().style.top = 70;
			map.getDiv().style.width = widthLarge;
			mapParent.style.width = "970px";
			map.getDiv().style.height = heightLarge;
			mapParent.style.height = "640px";
			map.getDiv().style.border = "10px solid #ccc";

			map.width = widthLarge;
			map.height = heightLarge;

			map.setZoom(2);
			google.maps.event.trigger(map, 'resize'); 
			map.setCenter(latlngLarge);
			currentMapSize = "large";

			if (document.getElementById(sender).innerText != null)
				document.getElementById(sender).innerText = "CLICK TO MINIMIZE MAP";
			else
				document.getElementById(sender).innerHTML = "CLICK TO MINIMIZE MAP";
		}
		else {
			mapParent.style.position = map.getDiv().style.position = "relative";
			mapParent.style.right = map.getDiv().style.right = 0;
			map.getDiv().style.top = 1;
			mapParent.style. width = map.getDiv().style.width = widthSmall;
			map.getDiv().style.height = heightSmall;
			mapParent.style.height = "70px";
			map.getDiv().style.border = "0px solid #ccc";
		
			map.width = widthSmall;
			map.height = heightSmall;
	 
			map.setZoom(1);
			google.maps.event.trigger(map, 'resize'); 
			map.setCenter(latlng);

			currentMapSize = "small";
			if (document.getElementById(sender).innerText != null)
				document.getElementById(sender).innerText = "CLICK TO ENLARGE MAP";
			else
				document.getElementById(sender).innerHTML = "CLICK TO ENLARGE MAP";
		}
	}	

