var map = null;

function HandleOver (id) 
{
	var button = document.getElementById(id);

	if (id == 'next')
		button.src= next_sel_image.src;
	if (id == 'prev')
		button.src= prev_sel_image.src;
	if (id == 'first')
		button.src= first_sel_image.src;
	if (id == 'last')
		button.src= last_sel_image.src;
}

function HandleLeave (id) 
{
	var button = document.getElementById(id);

	if (id == 'next')
		button.src= next_image.src;
	if (id == 'prev')
		button.src= prev_image.src;
	if (id == 'first')
		button.src= first_image.src;
	if (id == 'last')
		button.src= last_image.src;
}



function placeMarkerAtPoint(point)
{
    //var marker = new GMarker(point,{icon: icon});
    var marker = new GMarker(point);

    GEvent.addListener(marker,"click",function() {
        //marker.openInfoWindowHtml('here is some text');

		marker.openInfoWindowHtml ("<span class=\"iwstyle\"><div class=\"bookName\">The Fortune Of War</div><a href=\"http://www.cannonade.net/map.php?The_Surgeons_Mate&amp;18&amp;2\">Grand Banks</a><p><img src=\"pics/g-flag.png\" height=\"16\" width=\"16\"><img src=\"pics/r-flag.png\" height=\"16\" width=\"16\"><img src=\"pics/a-flag.png\" height=\"16\" width=\"16\"><img src=\"pics/n-flag.png\" height=\"16\" width=\"16\"><img src=\"pics/d-flag.png\" height=\"16\" width=\"16\"><img src=\"pics/space.png\" height=\"16\" width=\"16\"><img src=\"pics/b-flag.png\" height=\"16\" width=\"16\"><img src=\"pics/a-flag.png\" height=\"16\" width=\"16\"><img src=\"pics/n-flag.png\" height=\"16\" width=\"16\"><img src=\"pics/k-flag.png\" height=\"16\" width=\"16\"><img src=\"pics/s-flag.png\" height=\"16\" width=\"16\"></p><p>44° 1' 27\" North - 50° 29' 35\" West</p><p><a href=\"credits.php\">Thanks to Fisheries and Oceans Canada, 2005 for this image.</a></p><p style=\"font-style: italic;\">In the simplest words he could find he explained that the Portuguese went where the cod were, and this year there were even more cod on the Middle Bank than on the Saint Pierre or even the Grand Bank itself</p><img src=\"pics/thumb_banks.jpg\" height=\"112\"><div class=\"iwnavigate\"><img id=\"first\" onmouseover=\"HandleOver('first');\" onmouseout=\"HandleLeave('first');\" style=\"cursor: pointer;\" src=\"pics/first.png\" onclick=\"HandleClick(0,'1')\" height=\"25\"><img id=\"prev\" onmouseover=\"HandleOver('prev');\" onmouseout=\"HandleLeave('prev');\" style=\"cursor: pointer;\" src=\"pics/prev.gif\" onclick=\"HandleClick(17,'2')\" height=\"25\"><img onclick=\"centerAndZoom(44.024421519659334,-50.4931640625)\" style=\"text-align: center; padding-left: 20px; padding-right: 20px; cursor: pointer;\" src=\"pics/magnify_glass_small.png\" height=\"24\"><img id=\"next\" onmouseover=\"HandleOver('next');\" onmouseout=\"HandleLeave('next');\" style=\"cursor: pointer;\" src=\"http://www.cannonade.net/pics/next.gif\" onclick=\"HandleClick(19,'2')\" height=\"25\"></span>");

    });

    map.addOverlay(marker);
}

function initialize() {
	if (GBrowserIsCompatible()) 
	{
		map = new GMap2(document.getElementById("map"));
		map.enableContinuousZoom ();
		map.setCenter(new GLatLng(31.2, 121.5), 6);
		map.setUIToDefault();

		placeMarkerAtPoint (new GLatLng (31.2, 121.5));
	}
}

