var isGoogleMap = true; // for now - this should be determined from the database somehow


var isSearchMove = true; // set this to true when the map is being moved as a result of a 'goto result' action on a search - this will keep the info windo open

var currdeschead = "";
//var theURL ="http://"+window.location.host+"/version4/includes";

// these two variables keep the lat and lng location of the point that the uesr has clicked on as the result of a search
var infolat;
var infolng;


var selectedGeometryType = "";

var offsetx = -270;
var offsety =  20;


var ie5 = (document.getElementById && document.all);
var ns6 = (document.getElementById && !document.all);
var ua = navigator.userAgent.toLowerCase();
var isapple = (ua.indexOf('applewebkit') != -1 ? 1 : 0);

var xhReqContent3;
var xhReqShowForm;


var theAdminPoint;
var theAdminPolygon;
var theAdminLine;

var minisitegroup;
var xhReqJava;


/* ===========================================
// THE GLOBAL VARIABLES FOR THE GOOGLE MAP INSTANCE ONLY 
=============================================*/
var map;
var overlay;
var projection;
var directionDisplay;
var directionsService = new google.maps.DirectionsService();
// ====== Create a Client Geocoder ======
//var geo = new GClientGeocoder(); 
var geo = new google.maps.Geocoder();
// ====== Array for decoding the failure codes ======
//var reasons=[];
//reasons[G_GEO_SUCCESS]            = "Success";
//reasons[G_GEO_MISSING_ADDRESS]    = "Missing Address: The address was either missing or had no value.";
//reasons[G_GEO_UNKNOWN_ADDRESS]    = "Unknown Address:  No corresponding geographic location could be found for the specified address.";
//reasons[G_GEO_UNAVAILABLE_ADDRESS]= "Unavailable Address:  The geocode for the given address cannot be returned due to legal or contractual reasons.";
//reasons[G_GEO_BAD_KEY]            = "Bad Key: The API key is either invalid or does not match the domain for which it was given";
//reasons[G_GEO_TOO_MANY_QUERIES]   = "Too Many Queries: The daily geocoding quota for this site has been exceeded.";
//reasons[G_GEO_SERVER_ERROR]       = "Server error: The geocoding request could not be successfully processed.";
var geocoder;
var centerLatitude = 20;
var centerLongitude = -156; 
var startZoom = 10;
var n_buttonText="Map"; //Text that shows up on the button for the custom layer (n=normal, s=sat)
var s_buttonText="Satellite";
var minisites;
var xmlUpdateMap;
var xmlGetInfo;
var infodisplayed;
var infopolyline; // this is the line between the info box and the item in question ..
var theAdminPolygon;
var theAdminLine;
var theAdminPoint;
/* ===========================================
// END OF THE GLOBAL VARIABLES FOR THE GOOGLE MAP INSTANCE ONLY 
=============================================*/

// code to populate the variables that should give the content for each of the tabs

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 addContentText1 = "";  // the first stage in the data capture process
var addContentText2 = ""; // the second stage in the data capture process
var addContentText3 = ""; 
var editText = "";
var xhReqContent2;
var xhReqContent3;

// ========================================
// CODE TO GET INITIAL TEXT FOR THE SEARCH TAB
var xmlSearchMap;


var xhAdminReq; // the http xml request to see if the user is logged in as an administrator or not!
var xhAddMinisiteReq;



var xmlGetDivContent;



// store the div text when the user changes tab on the info box
var mainInfoDivText = "";
var photoInfoDivText = "";
var noiseInfoDivText = "";
var currentInfoTab = "main";

