
    var lclicon = new GIcon();
    lclicon.image = "http://labs.google.com/ridefinder/images/mm_20_green.png";
    lclicon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
    lclicon.iconSize = new GSize(12, 20);
    lclicon.shadowSize = new GSize(20, 18);
    lclicon.iconAnchor = new GPoint(6, 20);
    lclicon.infoWindowAnchor = new GPoint(5, 1);
	
    var stateicon = new GIcon();
    stateicon.image = "http://www.google.com/mapfiles/marker.png";
    stateicon.shadow = "http://www.google.com/mapfiles/shadow50.png";
    stateicon.iconSize = new GSize(20, 34);
    stateicon.shadowSize = new GSize(37, 34);
    stateicon.iconAnchor = new GPoint(6, 34);
    stateicon.infoWindowAnchor = new GPoint(5, 1);
	
if (GBrowserIsCompatible()) {

	function GPoint2(x,y) { return new GLatLng(y,x); }
		// this variable will collect the html which will eventually be placed in the sidebar
		var sidebar_html = "";
	
		// arrays to hold copies of the markers and html used by the sidebar
		// because the function closure trick doesnt work there
		var gmarkers = [];
		var htmls = [];
		var i = 0;
	
	
	// A function to create the marker and set up the event window
	function createMarker(point,name,html,icon,rn) {
		if (icon == "stateicon") {
			var marker = new GMarker(point,stateicon);
		} else {
			var marker = new GMarker(point,lclicon);
		}
		GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml(html);
		SetListing(rn);
	});
	gmarkers[i] = marker;
	htmls[i] = html;
	// add a line to the sidebar html
	//sidebar_html += '<a href="javascript:myclick(' + i + ')">' + name + '</a><br>';
	i++;
	return marker;
	}

	// This function picks up the click and opens the corresponding info window
	function myclick(i) {
		gmarkers[i].openInfoWindowHtml(htmls[i]);
	}
	// create the map
	CreateTSNMap();	
	// put the assembled sidebar_html contents into the sidebar div (not used on TNS site)
	//document.getElementById("sidebar").innerHTML = sidebar_html;
	
} else {
	alert("Oops! The Google Maps API is not compatible with this browser");
}
function SetListing(id) {
	var link = public_url + '/scripts/articlegenie/agmapartlist.php?mapkey=' + id; //public_url supplied by config.php
	document.getElementById('DisplayFrame').src=link;
}

