/*
Your key is:
ABQIAAAA03Dia8EcT9LgMBjgRdkXnBSeilAygNG2DbawzLTdNIkNKtJxwBR0VXC-tSuWqRPw6DTAfw2pyhXFOQ
This key is good for all URLs in this directory:
http://www.tricityrentals.com/splashpages/buffalo/
*/

var map;

var infowinhandle = new Array();

function fireInfowin(index){

  	GEvent.trigger(infowinhandle[index], "mouseover");
  	return false;

}

function createMarker(point, index, markertext) {

	// shadow, icon dimensions, etc.
	var baseIcon = new GIcon();
	
	baseIcon.iconSize = new GSize(20, 34);
	baseIcon.infoShadowAnchor = new GPoint(18, 25);

	if(index == 5){
	
	baseIcon.shadow = "http://www.tricityrentals.com/splashpages/buffalo/images/shadow650.png";
	baseIcon.shadowSize = new GSize(37, 34);
	baseIcon.iconAnchor = new GPoint(9, -4);
	baseIcon.iconSize = new GSize(20, 26);
	baseIcon.infoWindowAnchor = new GPoint(9, 10);

	}else{
	
	baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
	baseIcon.shadowSize = new GSize(37, 34);
	baseIcon.iconAnchor = new GPoint(9, 4);
	baseIcon.iconSize = new GSize(20, 34);	
	baseIcon.infoWindowAnchor = new GPoint(9, 2);

	}
	// Create a number icon for this point using our icon class
	var icon = new GIcon(baseIcon);
	icon.image = "http://www.tricityrentals.com/splashpages/buffalo/images/marker" + (index+1) + ".png";

  	var marker = new GMarker(point, icon);

  	infowinhandle[index] = marker;

  	GEvent.addListener(marker, "mouseover", function() {
  	marker.openInfoWindowHtml('<span class="smallType">' + markertext + '</span>');
  });

  return marker;

}

function load() {
	 
  if(GBrowserIsCompatible()){
		
		var imga = '<IMG SRC="http://www.';
		var imgb = '/images/complexsmall.jpg" BORDER="0" WIDTH="105" height="71">';
		
		var weburl = new Array('http://www.tricityrentals.com/BuffaloRegion/ArmorHeights/ArmorHeightsHome.aspx','http://www.tricityrentals.com/BuffaloRegion/BellTower/BellTowerHome.aspx','http://www.tricityrentals.com/BuffaloRegion/BigTreeManor/BigTreeManorHome.aspx','http://www.tricityrentals.com/BuffaloRegion/CountryClub/CountryClubManorHome.aspx',
'http://www.tricityrentals.com/BuffaloRegion/EmersonSquare/EmersonSquareHome.aspx',
'http://www.tricityrentals.com/BuffaloRegion/Hallmark/HallmarkVillageHome.aspx',
'http://www.tricityrentals.com/BuffaloRegion/ParadiseLane/ParadiseLaneHome.aspx',
'http://www.tricityrentals.com/BuffaloRegion/Quakertowne/QuakertowneHome.aspx',
'http://www.tricityrentals.com/BuffaloRegion/RaintreeIsland/RaintreeIslandHome.aspx',
'http://www.tricityrentals.com/BuffaloRegion/RegencyCourt/RegencyCourtHome.aspx',
'http://www.tricityrentals.com/BuffaloRegion/VillageGreen/VillageGreenHome.aspx'
)

		var aptimage = new Array('http://www.tricityrentals.com/Images/Buffalo/ContentImages/ArmorHeights/ArmorHeights.jpg',
		'http://www.tricityrentals.com/Images/Buffalo/ContentImages/BellTower/belltowermid.jpg',
'http://www.tricityrentals.com/Images/Buffalo/ContentImages/BigTreeManor/BigTreeManor.jpg',
'http://www.tricityrentals.com/Images/Buffalo/ContentImages/CountryClubManor/CountryClubManor.jpg', 'http://www.tricityrentals.com/Images/Buffalo/ContentImages/EmersonSquare/EmersonSquare.jpg',
'http://www.tricityrentals.com/Images/Buffalo/ContentImages/HallmarkVillage/HallmarkVillage.jpg',
'http://www.tricityrentals.com/Images/Buffalo/ContentImages/Paradiselane/ParadiseLane.jpg','http://www.tricityrentals.com/Images/Buffalo/ContentImages/QuakerTowne/QuakerTowne.jpg',
'http://www.tricityrentals.com/Images/Buffalo/ContentImages/RaintreeIsland/RainTreeIsland.jpg',
'http://www.tricityrentals.com/Images/Buffalo/ContentImages/RegencyCourt/RegencyCourt.jpg',
'http://www.tricityrentals.com/Images/Buffalo/ContentImages/VillageGreen/VillageGreen.jpg')



		
		var propertylonlat = new Array(
			42.741248, -78.794214, // Armor Heights
			42.86784, -78.717878, // Bell Tower
			42.766286, -78.783442, // Big Tree Manor
			42.977847, -78.717930, // County Club Manor
		    42.984886, -78.814745, // Emerson Square
			42.749845, -78.824783, // Hallmark Village
			43.014069, -78.844001, // Paradise Lane
			42.799818, -78.738513, // Quakertowne Apartments
			43.016192, -78.84517, // Raintree Island
			42.782745, -78.798442, // Regency Court
			42.811250, -78.710725 // Village Green
    		);
	
		var propertytext = Array(
        '<div class="balloon"><b>Armor Heights Apartments</b><br><IMG SRC="' + aptimage[0] +'" BORDER="0" WIDTH="105" height="71"><br>1 & 2 Bedroom Apartments<br><A HREF="' + weburl[0] + '" TARGET="1">Visit Our Web Site</A><br><a href="mailto:armor@tricityrentals.com?subject=Armor%20Heights%20Apartments%20Contact">Email Contact</a></div>',
		'<div class="balloon"><b>Bell Tower Apartments</b><br><IMG SRC="' + aptimage[1] +'" BORDER="0" WIDTH="105" height="71"><br>1 & 2 Bedroom Apartments<br><A HREF="' + weburl[1] + '" TARGET="1">Visit Our Web Site</A><br><a href="mailto:belltower@tricityrentals.com?subject=Bell%20Tower%20Apartments%20Contact">Email Contact</a></div>',
        '<div class="balloon"><b>Big Tree Manor Apartments</b><br><IMG SRC="' + aptimage[2] +'" BORDER="0" WIDTH="105" height="71"><br>1 & 2 Bedroom Apartments<br><A HREF="' + weburl[2] + '" TARGET="1">Visit Our Web Site</A><br><a href="mailto:armor@tricityrentals.com?subject=Big%20Tree%20Manor%20Apartments%20Contact">Email Contact</a></div>',
      '<div class="balloon"><b>County Club Manor Apartments</b><br><IMG SRC="' + aptimage[3] +'" BORDER="0" WIDTH="105" height="71"><br>1 & 2 Bedroom Apartments<br><A HREF="' + weburl[3] + '" TARGET="1">Visit Our Web Site</A><br><a href="mailto:countryclub@tricityrentals.com?subject=County%20Club%20Manor%20Apartments%20Contact">Email Contact</a></div>',
       '<div class="balloon"><b>Emerson Square Apartments</b><br><IMG SRC="' + aptimage[4] +'" BORDER="0" WIDTH="105" height="71"><br>1 Bedroom Apartments<br><A HREF="' + weburl[4] + '" TARGET="1">Visit Our Web Site</A><br><a href="mailto:emerson@tricityrentals.com?subject=Emerson%20Square%20Apartments%20Contact">Email Contact</a></div>',
       '<div class="balloon"><b>Hallmark Village Apartments</b><br><IMG SRC="' + aptimage[5] +'" BORDER="0" WIDTH="105" height="71"><br>1 & 2 Bedroom Apartments<br><A HREF="' + weburl[5] + '" TARGET="1">Visit Our Web Site</A><br><a href="mailto:hallmark@tricityrentals.com?subject=Hallmark%20Village%20Apartments%20Contact">Email Contact</a></div>',
       '<div class="balloon"><b>Paradise Lane Apartments</b><br><IMG SRC="' + aptimage[6] +'" BORDER="0" WIDTH="105" height="71"><br>1 & 2 Bedroom Apartments<br><A HREF="' + weburl[6] + '" TARGET="1">Visit Our Web Site</A><br><a href="mailto:paradise@tricityrentals.com?subject=Paradise%20Lane%20Apartments%20Contact">Email Contact</a></div>',
       '<div class="balloon"><b>Quakertowne Apartments</b><br><IMG SRC="' + aptimage[7] +'" BORDER="0" WIDTH="105" height="71"><br>2 Bedroom Apartments<br>and 2 Bedroom Townhomes<br><A HREF="' + weburl[7] + '" TARGET="1">Visit Our Web Site</A><br><a href="mailto:quakertowne@tricityrentals.com@tricityrentals.com?subject=Quakertowne%20Apartments%20Contact">Email Contact</a></div>',
       '<div class="balloon"><b>Raintree Island Apartments</b><br><IMG SRC="' + aptimage[8] +'" BORDER="0" WIDTH="105" height="71"><br>1 & 2 Bedroom Apartments<br><A HREF="' + weburl[8] + '" TARGET="1">Visit Our Web Site</A><br><a href="mailto:raintree@tricityrentals.com?subject=Raintree%20Island%20Apartments%20Contact">Email Contact</a></div>',
       '<div class="balloon"><b>Regency Court Apartments</b><br><IMG SRC="' + aptimage[9] +'" BORDER="0" WIDTH="105" height="71"><br>1 & 2 Bedroom Apartments<br><A HREF="' + weburl[9] + '" TARGET="1">Visit Our Web Site</A><br><a href="mailto:regencycourt@tricityrentals.com?subject=Regency%20Court%20Apartments%20Contact">Email Contact</a></div>',
'<div class="balloon"><b>Village Green Apartments</b><br><IMG SRC="' + aptimage[10] +'" BORDER="0" WIDTH="105" height="71"><br>1 & 2 Bedroom Apartments<br><A HREF="' + weburl[10] + '" TARGET="1">Visit Our Web Site</A><br><a href="mailto:villagegreen@tricityrentals.com?subject=Village%20Green%20Apartments%20Contact">Email Contact</a></div>'
    );

		map = new GMap2(document.getElementById("map"));
		map.setCenter(new GLatLng(42.850000, -78.814745), 10);
		map.addControl(new GScaleControl()); 
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl()); 
		map.addControl(new GOverviewMapControl());

		var j = 0;
		for (var i = 0; i < propertylonlat.length; i++){

			var point = new GLatLng(propertylonlat[i], propertylonlat[++i]);
			map.addOverlay(createMarker(point, j, propertytext[j++]));

		}

	}
		
}
