var drag_to_zoom_status = false;

function drag_to_zoom(){
	gzoomctrl.buttonClick_();
	/*if(!drag_to_zoom_status){
		drag_to_zoom_status = true;
		document.getElementById('bt_drag_to_zoom').src='/images/bt_drag_to_zoom_over.gif';
	}else{
		drag_to_zoom_status = false;
		document.getElementById('bt_drag_to_zoom').src='/images/bt_drag_to_zoom.gif';
	}*/
}

function zoom_map(act){
	switch(act){
		case 'in':
			extMap.zoomIn();
			break;
		case 'out':
			extMap.zoomOut();
			break;
		default:
			extMap.returnToSavedPosition();
			break;
	}
}
function move_map(direction){
	switch(direction){
		case 'north':
			extMap.panDirection(0,1);
			break;
		case 'south':
			extMap.panDirection(0,-1);
			break;
		case 'west':
			extMap.panDirection(1,0);
			break;
		case 'east':
			extMap.panDirection(-1,0);
			break;
	}
}
function resize_map(){
	//gzoomctrl.resetDragZoom_();
	drag_to_zoom_status = false;
	document.getElementById('bt_drag_to_zoom').src='/images/bt_drag_to_zoom.gif';
	var bmap = document.getElementById("map");
	var bt = document.getElementById("bt_expand");
	if (bmap.style.height == "92px") {
		bmap.style.height = "372px";
		extMap.checkResize();
		bt.innerHTML = '<a href="javascript:resize_map();"><img src="/images/07_reduce_map.jpg" alt="Minimize Map" width="170" height="26" border="0"></a>';
		return;
	}

	if (bmap.style.height == "372px") {
		bmap.style.height = "92px";
		extMap.checkResize();
		bt.innerHTML = '<a href="javascript:resize_map();"><img src="/images/07_expand_map.jpg" alt="Maximize Map" width="170" height="26" border="0"></a>';
		return;
	}
}

function full_map(){
	drag_to_zoom_status = false;
	document.getElementById('bt_drag_to_zoom').src='/images/bt_drag_to_zoom.gif';
	var bmap = document.getElementById("map");
	var bt = document.getElementById("bt_expand");
	if (bmap.style.height == "92px") {
		bmap.style.height = "372px";
		extMap.checkResize();
		bt.innerHTML = '<a href="javascript:resize_map();"><img src="/images/07_reduce_map.jpg" alt="Minimize Map" width="170" height="26" border="0"></a>';
		return;
	}
}

var map_loaded = false;
function show_google_map() {
if(map_loaded) return false;
map_element = document.getElementById("map");
var map = new GMap(document.getElementById("map"));
map.addControl(new GMapTypeControl());
gzoomctrl = new GZoomControl({nOpacity:.0},{nOverlayRemoveMS:0,bStickyZoom:false});
map.addControl(gzoomctrl);

map.centerAndZoom(new GPoint("-62.2520469", "46.3585152"), 7);
marker0 = new GMarker(new GPoint("-62.2520469", "46.3585152"));
map.addOverlay(marker0);
var html0 = '<table width="227" border=0 cellpadding=1 cellspacing=0 bgcolor="ffffff"><tbody><tr><td valign=top align=left width="0"></td><td width="223" align=left valign=top><table width="100%" border="0"><tr><td width="38%" valign="top"><span class="body"><img src="/listing_images/5/2722_1.jpg" width="80" height="80" border="0"></span></td><td width="62%" valign="top"><strong class="MarkerTxtCap">A Place to Stay Inn</strong><br /><span class="MarkerTxtAdd">Box 607, 9 Longworth St.</span><br /><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a onclick="add_listing(\'2722\',\'A Place to Stay Inn\',\'/listing_images/5/2722_1.jpg\',\'Prince Edward Island\',\'Souris\',\'compare\',\'A_Place_to_Stay_Inn\')" href="#" class="Markerlinks">Add To Compare</a><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a onclick="add_listing(\'2722\',\'A Place to Stay Inn\',\'/listing_images/5/2722_1.jpg\',\'Prince Edward Island\',\'Souris\',\'enquiry\',\'A_Place_to_Stay_Inn\')" href="#" class="Markerlinks">Add To Reservation Cart </a><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a href="/A_Place_to_Stay_Inn/" class="Markerlinks">See Detailed Listing</a></td></tr></table></td></tr></tbody></table><p><a href="javascript:zoom_map(\'in\');"><img src="/images/zoom_in.gif" width="61" height="16" border="0"></a>&nbsp;&nbsp;<a href="javascript:zoom_map(\'out\');"><img src="/images/zoom_out.gif" width="61" height="16" border="0"></a></p>';
//map.openInfoWindowHtml(map.getCenterLatLng(), html0);	
GEvent.addListener(marker0, "click", function() {
extMap.panTo(new GLatLng("46.3585152", "-62.2520469"));
marker0.openInfoWindowHtml(html0);
});
marker1 = new GMarker(new GPoint("-62.253696", "46.354729"));
map.addOverlay(marker1);
var html1 = '<table width="227" border=0 cellpadding=1 cellspacing=0 bgcolor="ffffff"><tbody><tr><td valign=top align=left width="0"></td><td width="223" align=left valign=top><table width="100%" border="0"><tr><td width="38%" valign="top"><span class="body"><img src="/listing_images/4/2059_1.jpg" width="80" height="80" border="0"></span></td><td width="62%" valign="top"><strong class="MarkerTxtCap">The McLean House Inn</strong><br /><span class="MarkerTxtAdd"></span><br /><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a onclick="add_listing(\'2059\',\'The McLean House Inn\',\'/listing_images/4/2059_1.jpg\',\'Prince Edward Island\',\'Souris\',\'compare\',\'mcleanhouseinn\')" href="#" class="Markerlinks">Add To Compare</a><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a onclick="add_listing(\'2059\',\'The McLean House Inn\',\'/listing_images/4/2059_1.jpg\',\'Prince Edward Island\',\'Souris\',\'enquiry\',\'mcleanhouseinn\')" href="#" class="Markerlinks">Add To Reservation Cart </a><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a href="/mcleanhouseinn/" class="Markerlinks">See Detailed Listing</a></td></tr></table></td></tr></tbody></table><p><a href="javascript:zoom_map(\'in\');"><img src="/images/zoom_in.gif" width="61" height="16" border="0"></a>&nbsp;&nbsp;<a href="javascript:zoom_map(\'out\');"><img src="/images/zoom_out.gif" width="61" height="16" border="0"></a></p>';
//map.openInfoWindowHtml(map.getCenterLatLng(), html1);	
GEvent.addListener(marker1, "click", function() {
extMap.panTo(new GLatLng("46.354729", "-62.253696"));
marker1.openInfoWindowHtml(html1);
});
marker2 = new GMarker(new GPoint("-62.251346", "46.352632"));
map.addOverlay(marker2);
var html2 = '<table width="227" border=0 cellpadding=1 cellspacing=0 bgcolor="ffffff"><tbody><tr><td valign=top align=left width="0"></td><td width="223" align=left valign=top><table width="100%" border="0"><tr><td width="38%" valign="top"><span class="body"><img src="/listing_images/26/13123_1.jpg" width="80" height="80" border="0"></span></td><td width="62%" valign="top"><strong class="MarkerTxtCap">The Matthew House Inn</strong><br /><span class="MarkerTxtAdd">15 Breakwater Street</span><br /><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a onclick="add_listing(\'13123\',\'The Matthew House Inn\',\'/listing_images/26/13123_1.jpg\',\'Prince Edward Island\',\'Souris\',\'compare\',\'matthewhouseinn\')" href="#" class="Markerlinks">Add To Compare</a><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a onclick="add_listing(\'13123\',\'The Matthew House Inn\',\'/listing_images/26/13123_1.jpg\',\'Prince Edward Island\',\'Souris\',\'enquiry\',\'matthewhouseinn\')" href="#" class="Markerlinks">Add To Reservation Cart </a><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a href="/matthewhouseinn/" class="Markerlinks">See Detailed Listing</a></td></tr></table></td></tr></tbody></table><p><a href="javascript:zoom_map(\'in\');"><img src="/images/zoom_in.gif" width="61" height="16" border="0"></a>&nbsp;&nbsp;<a href="javascript:zoom_map(\'out\');"><img src="/images/zoom_out.gif" width="61" height="16" border="0"></a></p>';
//map.openInfoWindowHtml(map.getCenterLatLng(), html2);	
GEvent.addListener(marker2, "click", function() {
extMap.panTo(new GLatLng("46.352632", "-62.251346"));
marker2.openInfoWindowHtml(html2);
});
marker3 = new GMarker(new GPoint("-62.2536960", "46.3547290"));
map.addOverlay(marker3);
var html3 = '<table width="227" border=0 cellpadding=1 cellspacing=0 bgcolor="ffffff"><tbody><tr><td valign=top align=left width="0"></td><td width="223" align=left valign=top><table width="100%" border="0"><tr><td width="38%" valign="top"><span class="body"><img src="/listing_images/5/2582_1.jpg" width="80" height="80" border="0"></span></td><td width="62%" valign="top"><strong class="MarkerTxtCap">Bothwell Beach Cottages</strong><br /><span class="MarkerTxtAdd">Bothwell, Souris RR#2</span><br /><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a onclick="add_listing(\'2582\',\'Bothwell Beach Cottages\',\'/listing_images/5/2582_1.jpg\',\'Prince Edward Island\',\'Souris\',\'compare\',\'bothwell\')" href="#" class="Markerlinks">Add To Compare</a><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a onclick="add_listing(\'2582\',\'Bothwell Beach Cottages\',\'/listing_images/5/2582_1.jpg\',\'Prince Edward Island\',\'Souris\',\'enquiry\',\'bothwell\')" href="#" class="Markerlinks">Add To Reservation Cart </a><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a href="/bothwell/" class="Markerlinks">See Detailed Listing</a></td></tr></table></td></tr></tbody></table><p><a href="javascript:zoom_map(\'in\');"><img src="/images/zoom_in.gif" width="61" height="16" border="0"></a>&nbsp;&nbsp;<a href="javascript:zoom_map(\'out\');"><img src="/images/zoom_out.gif" width="61" height="16" border="0"></a></p>';
//map.openInfoWindowHtml(map.getCenterLatLng(), html3);	
GEvent.addListener(marker3, "click", function() {
extMap.panTo(new GLatLng("46.3547290", "-62.2536960"));
marker3.openInfoWindowHtml(html3);
});
marker4 = new GMarker(new GPoint("-63.010974", "46.330117"));
map.addOverlay(marker4);
var html4 = '<table width="227" border=0 cellpadding=1 cellspacing=0 bgcolor="ffffff"><tbody><tr><td valign=top align=left width="0"></td><td width="223" align=left valign=top><table width="100%" border="0"><tr><td width="38%" valign="top"><span class="body"><img src="/listing_images/0/334_1.jpg" width="80" height="80" border="0"></span></td><td width="62%" valign="top"><strong class="MarkerTxtCap">The Inn At Bay Fortune</strong><br /><span class="MarkerTxtAdd">Route 310, Bay Fortune</span><br /><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a onclick="add_listing(\'334\',\'The Inn At Bay Fortune\',\'/listing_images/0/334_1.jpg\',\'Prince Edward Island\',\'Souris\',\'compare\',\'innatbayfortune334\')" href="#" class="Markerlinks">Add To Compare</a><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a onclick="add_listing(\'334\',\'The Inn At Bay Fortune\',\'/listing_images/0/334_1.jpg\',\'Prince Edward Island\',\'Souris\',\'enquiry\',\'innatbayfortune334\')" href="#" class="Markerlinks">Add To Reservation Cart </a><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a href="/innatbayfortune334/" class="Markerlinks">See Detailed Listing</a></td></tr></table></td></tr></tbody></table><p><a href="javascript:zoom_map(\'in\');"><img src="/images/zoom_in.gif" width="61" height="16" border="0"></a>&nbsp;&nbsp;<a href="javascript:zoom_map(\'out\');"><img src="/images/zoom_out.gif" width="61" height="16" border="0"></a></p>';
//map.openInfoWindowHtml(map.getCenterLatLng(), html4);	
GEvent.addListener(marker4, "click", function() {
extMap.panTo(new GLatLng("46.330117", "-63.010974"));
marker4.openInfoWindowHtml(html4);
});
marker5 = new GMarker(new GPoint("-62.267535", "46.441137"));
map.addOverlay(marker5);
var html5 = '<table width="227" border=0 cellpadding=1 cellspacing=0 bgcolor="ffffff"><tbody><tr><td valign=top align=left width="0"></td><td width="223" align=left valign=top><table width="100%" border="0"><tr><td width="38%" valign="top"><span class="body"><img src="/listing_images/4/2060_1.jpg" width="80" height="80" border="0"></span></td><td width="62%" valign="top"><strong class="MarkerTxtCap">Johnson Shore Inn</strong><br /><span class="MarkerTxtAdd">RR#3 Route 16 - Hermanville</span><br /><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a onclick="add_listing(\'2060\',\'Johnson Shore Inn\',\'/listing_images/4/2060_1.jpg\',\'Prince Edward Island\',\'Souris\',\'compare\',\'johnsonshoreinn\')" href="#" class="Markerlinks">Add To Compare</a><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a onclick="add_listing(\'2060\',\'Johnson Shore Inn\',\'/listing_images/4/2060_1.jpg\',\'Prince Edward Island\',\'Souris\',\'enquiry\',\'johnsonshoreinn\')" href="#" class="Markerlinks">Add To Reservation Cart </a><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a href="/johnsonshoreinn/" class="Markerlinks">See Detailed Listing</a></td></tr></table></td></tr></tbody></table><p><a href="javascript:zoom_map(\'in\');"><img src="/images/zoom_in.gif" width="61" height="16" border="0"></a>&nbsp;&nbsp;<a href="javascript:zoom_map(\'out\');"><img src="/images/zoom_out.gif" width="61" height="16" border="0"></a></p>';
//map.openInfoWindowHtml(map.getCenterLatLng(), html5);	
GEvent.addListener(marker5, "click", function() {
extMap.panTo(new GLatLng("46.441137", "-62.267535"));
marker5.openInfoWindowHtml(html5);
});
marker6 = new GMarker(new GPoint("-62.301409", "46.344000"));
map.addOverlay(marker6);
var html6 = '<table width="227" border=0 cellpadding=1 cellspacing=0 bgcolor="ffffff"><tbody><tr><td valign=top align=left width="0"></td><td width="223" align=left valign=top><table width="100%" border="0"><tr><td width="38%" valign="top"><span class="body"><img src="/listing_images/5/2737_1.jpg" width="80" height="80" border="0"></span></td><td width="62%" valign="top"><strong class="MarkerTxtCap">Inn at Bay Fortune</strong><br /><span class="MarkerTxtAdd">Bay Fortune</span><br /><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a onclick="add_listing(\'2737\',\'Inn at Bay Fortune\',\'/listing_images/5/2737_1.jpg\',\'Prince Edward Island\',\'Souris\',\'compare\',\'innatbayfortune\')" href="#" class="Markerlinks">Add To Compare</a><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a onclick="add_listing(\'2737\',\'Inn at Bay Fortune\',\'/listing_images/5/2737_1.jpg\',\'Prince Edward Island\',\'Souris\',\'enquiry\',\'innatbayfortune\')" href="#" class="Markerlinks">Add To Reservation Cart </a><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a href="/innatbayfortune/" class="Markerlinks">See Detailed Listing</a></td></tr></table></td></tr></tbody></table><p><a href="javascript:zoom_map(\'in\');"><img src="/images/zoom_in.gif" width="61" height="16" border="0"></a>&nbsp;&nbsp;<a href="javascript:zoom_map(\'out\');"><img src="/images/zoom_out.gif" width="61" height="16" border="0"></a></p>';
//map.openInfoWindowHtml(map.getCenterLatLng(), html6);	
GEvent.addListener(marker6, "click", function() {
extMap.panTo(new GLatLng("46.344000", "-62.301409"));
marker6.openInfoWindowHtml(html6);
});
marker7 = new GMarker(new GPoint("-62.273717", "46.369131"));
map.addOverlay(marker7);
var html7 = '<table width="227" border=0 cellpadding=1 cellspacing=0 bgcolor="ffffff"><tbody><tr><td valign=top align=left width="0"></td><td width="223" align=left valign=top><table width="100%" border="0"><tr><td width="38%" valign="top"><span class="body"><img src="/listing_images/5/2590_1.jpg" width="80" height="80" border="0"></span></td><td width="62%" valign="top"><strong class="MarkerTxtCap">Howe Bay Cottage</strong><br /><span class="MarkerTxtAdd">R.R. #4 Souris</span><br /><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a onclick="add_listing(\'2590\',\'Howe Bay Cottage\',\'/listing_images/5/2590_1.jpg\',\'Prince Edward Island\',\'Souris\',\'compare\',\'howebaybeachhouses\')" href="#" class="Markerlinks">Add To Compare</a><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a onclick="add_listing(\'2590\',\'Howe Bay Cottage\',\'/listing_images/5/2590_1.jpg\',\'Prince Edward Island\',\'Souris\',\'enquiry\',\'howebaybeachhouses\')" href="#" class="Markerlinks">Add To Reservation Cart </a><br /><img src="/images/bulletArrow.gif" width="11" height="7" /> <a href="/howebaybeachhouses/" class="Markerlinks">See Detailed Listing</a></td></tr></table></td></tr></tbody></table><p><a href="javascript:zoom_map(\'in\');"><img src="/images/zoom_in.gif" width="61" height="16" border="0"></a>&nbsp;&nbsp;<a href="javascript:zoom_map(\'out\');"><img src="/images/zoom_out.gif" width="61" height="16" border="0"></a></p>';
//map.openInfoWindowHtml(map.getCenterLatLng(), html7);	
GEvent.addListener(marker7, "click", function() {
extMap.panTo(new GLatLng("46.369131", "-62.273717"));
marker7.openInfoWindowHtml(html7);
});
extMap = map;
extMap.savePosition();
map_loaded = true;
}

window.onunload=GUnload;