var startCapture = false; // required for compatibility with the minisite functionality

function setupMapBounds() {
	if (isGoogleMap) {
		setupMapBoundsGM();
	}
	else  {
		setupMapBoundsOL();
	}
}
function setMapListeners() {
	if (isGoogleMap) {
		setMapListenersGM();
	
	}
	else  {
		setMapListenersOL();
	}

}
function updateOverviewMapSetupSearch() {
        // generate the icon and layer colours for minisites
        // this is separate from the usual site
	setupOverviewSearch();
}


//******************************************
// FUNCTIONALITY FOR VERSION 3- FOR THE SEARCH PROCESS - WE NEED TO KEEP THE POINTS that we move to from the search result on the map
// and also make sure that the info pop-up works 


var overviewLat;
var overviewLng;

function getOverviewInfo(point,layername,tablename,id) {
	if (isGoogleMap) {
		getOverviewInfoGM(point,layername,tablename,id);
	}
	else {
		getOverviewInfoOL(point,layername,tablename,id);
	}
	getOverviewInfoHTML(layername, id);
}

var currentTab = "legend"; // the variable that stores the tab we are actually on 
// so that we can keep the html text in a variable and just repaste it into the DIV as required ..
// at the start of the page load process it will be 'legend'

// these variables store the HTML text for each tab
var searchText = "";
var legendText = "";

var xhReqContent2;
var xhReqContent3;
var xmlSearchMap;
// ========================================
// CODE TO GET INITIAL TEXT FOR THE SEARCH TAB
var xmlSearchMap;

// the search tab is made up of different parts:
// 1.  the heading
// 2.  the search box for the user to type
// 3.  the pull-down of the themes to search in
// 4.  the search button
// 5.  the results DIV

// need to retrieve all these bits separately and add them together


/*function setupOverviewMapData() {
	if (isGoogleMap) {
		setupOverviewMapGM();
	}
	else {
		setupOverviewMapOL();
	}
}*/

// ========================================

function searchAllMaps() {
 	loadOverviewHTMLIntoDIV('../html/communityMapsSearchTab.html','maptabs');
 	legendText = document.getElementById('controlcontent').innerHTML;
 	storeCurrentOverviewDIVText();
 	currentTab = "Search";
 	document.getElementById('controlcontent').innerHTML = searchText;
}

function showAllMapsList() {
	loadOverviewHTMLIntoDIV('../html/communityMapsMapListTab.html','maptabs');
	// load the search tab as current
	searchText = document.getElementById('controlcontent').innerHTML;
	storeCurrentOverviewDIVText();
	currentTab = "AllMaps";
	document.getElementById('controlcontent').innerHTML = legendText;
}

function storeCurrentOverviewDIVText() {
	var controlText = document.getElementById('controlcontent').innerHTML;
	
	if (currentTab == "AllMaps")  {
		legendText = controlText;
	}
	if (currentTab == "Search")  {
		searchText = controlText;
	}


}
var currentTab = "legend"; // the variable that stores the tab we are actually on 
// so that we can keep the html text in a variable and just repaste it into the DIV as required ..
// at the start of the page load process it will be 'legend'

// these variables store the HTML text for each tab
var searchText = "";
var legendText = "";

var xhReqContent2;
var xhReqContent3;

// ========================================
// CODE TO GET INITIAL TEXT FOR THE SEARCH TAB
var xmlSearchMap;
// the search tab is made up of different parts:
// 1.  the heading
// 2.  the search box for the user to type
// 3.  the pull-down of the themes to search in
// 4.  the search button
// 5.  the results DIV

// need to retrieve all these bits separately and add them together

function setUpSearchTab() {
	 callSearchHTTPOverview();
}

// ========================================





/*
function updateOverviewMap() {

	// get the actual map data
	if (isGoogleMap) {
		updateOverviewMapGM();
	}
	else {
		updateOverviewMapOL();
	}
}
*/
