/* 
 Functions to provide support to EW mapping pages
	see http://www.ew.govt.nz/maps

	Returns appropriate link 
		SVG (IE) implementation of the mapping application or
		PNG (all other browsers) implementations
*/
 
function provideMapOptions(mapID, mapTitle){
	var browser=navigator.appName;
	var b_version=navigator.appVersion;
	var version=parseFloat(b_version);

	var baseURL = "http://gis.ew.govt.nz";
	var res = "";
	if (location.hostname == "wwwtest" || location.hostname == "wwwdevel") {
		baseURL = "http://gistest.ew.govt.nz";
	}

	if ((browser=="Microsoft Internet Explorer") && (version>=4)){
		res = '<p><input type="checkbox" name="districtSelector" onclick="javascript:var newWindow; newWindow=window.open(\'' + baseURL + '/ew_gis/default.asp?map=' + mapID + '\',\'popwindow\',\'scrollbars=1, width=860, height=600,resizable=1\');newWindow.focus();"> Tick to view the <strong>' + mapTitle + '</strong> and confirm you have read the <a href="/maps/Terms-of-use/">terms of use</a>.';
		document.write(res);
	} else {
		// PNG version
		res = '<p><input type="checkbox" name="districtSelector" onclick="this.selected=false; self.location=\'' + baseURL + '/ew_gis/map_query.asp?mapTopic=' + mapID + '\';"> Tick to view the <strong>' + mapTitle + '</strong> selection helper and confirm you have read the <a href="/maps/Terms-of-use/">terms of use</a>.';
		document.write(res);
	}
}