var ATM = [];
ATM[0]={id: "as", desc: "Alterna Savings ATM", lat: 45.422488, lng: -75.684750, show: true, multiple: false, campus: "main"};
ATM[1]={id: "bns", desc: "Bank of Nova Scotia ATM", lat: 45.424421, lng: -75.686145, show: true, multiple: true, campus: "main", location: "TBT"};
ATM[2]={id: "bns", desc: "Bank of Nova Scotia ATM", lat: 45.419393, lng: -75.678855, show: false, multiple: true, campus: "main", location: "CBY"};
ATM[3]={id: "bns", desc: "Bank of Nova Scotia ATM", lat: 45.422499, lng: -75.683860, show: false, multiple: true, campus: "main", location: "UCU"};
ATM[4]={id: "cp", desc: "Caisse Populaire ATM", lat: 45.423395, lng: -75.684037, show: true, multiple: true, campus: "main", location: "MRT"};
ATM[5]={id: "cp", desc: "Caisse Populaire ATM", lat: 45.423749, lng: -75.686901, show: false, multiple: true, campus: "main", location: "DMS"};
ATM[6]={id: "cibc", desc: "CIBC ATM", lat: 45.422537, lng: -75.683967, show: true, multiple: false, campus: "main"};
ATM[7]={id: "cibc", desc: "CIBC ATM", lat: 45.402563, lng: -75.649828, show: true, multiple: false, campus: "altaVista"};
ATM[8]={id: "nb", desc: "National Bank ATM", lat: 45.422537, lng: -75.683763, show: true, multiple: false, campus: "main"};
ATM[9]={id: "rbc", desc: "Royal Bank ATM", lat: 45.421833, lng: -75.680271, show: true, multiple: false, campus: "main"};

var ATM_ICON = "images/icons/icon_atm.png";

UOATM = function (){
}

UOATM.prototype.plotATM = function(map,i,id,forTool){
	var icon = new GIcon();
	icon.iconSize = new GSize(20,20);
	icon.iconAnchor = new GPoint(20,20);
	icon.image = ATM_ICON;
	var point = new GLatLng(ATM[i].lat, ATM[i].lng);
	var markerOpts = {icon: icon, clickable: forTool?false:true, draggable: forTool?true:false, hide: id==ATM[i].id&&getCampus()==ATM[i].campus?false:true};
	var marker = new GMarker(point, markerOpts);
	return marker;
}

UOATM.prototype.plotATMTool = function(map,i,index){
	var icon = new GIcon();
	icon.iconSize = new GSize(20,20);
	icon.iconAnchor = new GPoint(20,20);
	icon.infoWindowAnchor = new GPoint(20,20);
	icon.image = ATM_ICON;
	var point = new GLatLng(ATM[i].lat, ATM[i].lng);
	var markerOpts = {icon: icon, hide: i==index&&getCampus()==ATM[i].campus?false:true};
	var marker = new GMarker(point, markerOpts);
	marker.index = i;
	GEvent.addListener(marker, "click", function() {
		var bounds = new GLatLngBounds();
		var lat = marker.getLatLng().lat() + 0.001;
		var lng = marker.getLatLng().lng();
		var point = new GLatLng(lat, lng);
		bounds.extend(point);
		marker.checked = "";
		if (UOM._poiCategory == "atm" && UOM._poiId == i) {
			marker.checked = "checked";
		}
		marker.openInfoWindowHtml("<input type='checkbox' value="+this.index+" "+this.checked+" onclick='UOM._map.selectPoi(this);' />Select Point of Interest");
		//map.setZoom(18);
		map.setCenter(bounds.getCenter());
	});
	return marker;
}

