function CustomBrowserXMLObject()
{
   var ieVersions = ["Microsoft.XmlDom","MSXML.DOMDocument","MSXML2.DOMDocument","MSXML3.DOMDocument","MSXML4.DOMDocument"];
   var xmlHttp = null;
   var xmlDoc = null;
   var client = "";
	
   function initialize()
   {
      try
      {
         // Firefox, Opera 8.0+, Safari
         xmlHttp = new XMLHttpRequest();
         xmlDoc = document.implementation.createDocument("", "", null);
         client = navigator.userAgent.toLowerCase().indexOf('chrome')>-1?"chrome":"mozilla";
      }
      catch (e)
      {
         // Internet Explorer [Except - IE.8]
         var i,len = ieVersions.length;
         for(i = 0;i<len ; i++)
         {
            try
            {
               xmlDoc = xmlHttp = new ActiveXObject(ieVersions[i]);
               client = "ie";
            }
            catch(e1)
            {

            }
         }
      }
   }
	
   this.getXMLHttpObject = function()
   {
      if(xmlHttp == null)
      {
         initialize();
      }
      return xmlHttp;
   }
	
   this.getXMLDocObject = function(url)
   {
      if(xmlDoc == null)
      {
         initialize();
      }
      return xmlDoc;
   }
	
   this.getClient = function()
   {
      if(xmlDoc == null)
      {
         initialize();
      }
      return client;
   }
   this.changeOpacity = function(obj,val)
   {
      if(this.getClient() == "id")
      {
         obj.filters.alpha.opacity = val;
      }
      else
      {
         obj.style.opacity = parseFloat(val/100);
      }
   }
}

function initializeLayerCombo(zoomComboObj,yearComboObj,opNm,zmLvl)
{
   var url = "LayerRegisterAjax?opName="+opNm+"&zoomLevel="+zmLvl;
   //alert(url);
   var xmlDoc = null;
	
   /* Initializer Helper Variables */
   var primaryDataNode;
   var zoomLevelNode;
   var yearNode;
	
   var lenPD;
   var lenZM,itrZM;
   var lenYN,itrYN;
	
   /* Data Storing Variables */
   var selectedZoomlevel;
   var selectedYear;
   var zoomlevelList = new Array();
   var yearList = new Array();
	
	
   var browserObj = new CustomBrowserXMLObject();
   xmlDoc = browserObj.getXMLDocObject();
	
   if(browserObj.getClient() == "ie")
   {
      //alert("@ IE End");
      xmlDoc.async = false;
      xmlDoc.onreadystatechange = function()
      {
         if (xmlDoc.readyState == 4)
         {
            operationOnLoadedXML();
         }
      };
      xmlDoc.load(url);
   }
   else if(browserObj.getClient() == "mozilla")
   {
      //alert("@ Mozilla End");
      xmlDoc = document.implementation.createDocument("", "", null);
		
      xmlDoc.load(url);
      xmlDoc.onload = function()
      {
         //alert("Mozilla Load Time : "+(new Date().getTime()-tmpTime));
         operationOnLoadedXML();
      }
   }
   else if(browserObj.getClient() == "chrome")
   {
      xmlhttp = browserObj.getXMLHttpObject();
      xmlhttp.open("GET",url,false);
      xmlhttp.send(null);
      xmlDoc = xmlhttp.responseXML;
      operationOnLoadedXML();
   }
		
   function operationOnLoadedXML()
   {
      //alert("Called callback");
      try{
         rootNode = xmlDoc.documentElement;
         statusCode = parseInt(rootNode.childNodes[1].attributes[0].nodeValue);
			
         if(statusCode == 1)
         {
            primaryDataNode = rootNode.childNodes[2];
            zoomLevelNode = rootNode.childNodes[3];
            yearNode = rootNode.childNodes[4];
				
            lenPD = primaryDataNode.childNodes.length;
            lenZM = zoomLevelNode.childNodes.length;
            lenYN = yearNode.childNodes.length;
				
            if(lenPD==2)
            {
               selectedZoomlevel = primaryDataNode.childNodes[0].attributes[0].nodeValue;
               selectedYear = primaryDataNode.childNodes[1].attributes[0].nodeValue;
            }
								
            for(itrZM=0 ; itrZM<lenZM ; itrZM++)
            {
               zoomlevelList.push(new Array(zoomLevelNode.childNodes[itrZM].attributes[0].nodeValue,
                  zoomLevelNode.childNodes[itrZM].attributes[0].nodeValue));
            }
				
            for(itrYN=0 ; itrYN<lenYN ; itrYN++)
            {
               yearList.push(new Array(yearNode.childNodes[itrYN].attributes[0].nodeValue,
                  yearNode.childNodes[itrYN].attributes[0].nodeValue));
            }
				
            var zoomCombo = new ComboBoxOperation(zoomComboObj);
            zoomCombo.initCombo(zoomlevelList);
            zoomCombo.selectElement(selectedZoomlevel);
            var yearCombo = new ComboBoxOperation(yearComboObj);
            yearCombo.initCombo(yearList);
            yearCombo.selectElement(selectedYear);
				
            administrativeLayerController(opNm,zoomComboObj.value,yearComboObj.value);
         }
         else
         {
            alert("[Initializer Comobobox] : No Data Found");
         }
      }
      catch(e)
      {
         alert("[Initializer Comobobox] : "+e);
      }
   }
}

function initializeLayerInfowindowContent(mapObj,targetObj,layerName,zoom,year,point)
{
   var url = "LayerInfowindowContentAjax?layerName="+layerName+"&zoomLevel="+zoom+"&year="+year+"&lat="+point.lat()+"&lng="+point.lng();
	
   var insiseHTMLCode = "<img src='"+absPath+"/images/loadingGreen.gif' /> Please wait";
   var insiseHTMLCodeError = "Internal Error occoured";
	
   var response = null;
	
   //alert("Ajax Called\n"+url);
   var xmlDoc = null;
   var browserObj = new CustomBrowserXMLObject();
   var xmlhttpObj = browserObj.getXMLHttpObject();
	
   xmlhttpObj.onreadystatechange = function()
   {
      if (xmlhttpObj.readyState == 4 && xmlhttpObj.status == 200)
      {
         response = xmlhttpObj.responseText;
        	
         if(response.indexOf("**##**null**##**") == -1)
         {
            mapObj.openInfoWindowHtml(point,xmlhttpObj.responseText);
         }
         else
         {
      //alert("'"+response+"'");
      }
      }
   }
	
   xmlhttpObj.open("GET",url,true);
   xmlhttpObj.send(null);
}

function initializeWaterCoastalSensor(csMap)
{
   var tmpTime = new Date().getTime();
   var url = "CoastalWatarQualitySensorAjax";
   var xmlDoc = null;
	
   var browserObj = new CustomBrowserXMLObject();
   xmlDoc = browserObj.getXMLDocObject();
	
   if(browserObj.getClient() == "ie")
   {
      //alert("@ IE End");
      xmlDoc.async = false;
      xmlDoc.onreadystatechange = function()
      {
         if (xmlDoc.readyState == 4)
         {
            operationOnLoadedXML();
         }
      };
      xmlDoc.load(url);
   }else if(browserObj.getClient() == "mozilla")
   {
      //alert("@ Mozilla End");
      xmlDoc = document.implementation.createDocument("", "", null);
		
      xmlDoc.load(url);
      xmlDoc.onload = function()
      {
         //alert("Mozilla Load Time : "+(new Date().getTime()-tmpTime));
         operationOnLoadedXML();
      }
   }
   else if(browserObj.getClient() == "chrome")
   {
      xmlhttp = browserObj.getXMLHttpObject();
      xmlhttp.open("GET",url,false);
      xmlhttp.send(null);
      xmlDoc = xmlhttp.responseXML;
      operationOnLoadedXML();
   }
	
   function operationOnLoadedXML()
   {
      //alert("Called callback");
      var legendIcons = ["images/map/mrkr_blue.gif"];
		
      var legendStr = null;
      var htmlMessage = null;
      var markerArray = [];
		
      var rootNode = null;
      var locNodeList = null;
      var locDetails = null;
      var locLen,locItr ;
		
      var statusCode = null;
      var details = null;
		
      try
      {
         rootNode = xmlDoc.documentElement;
         statusCode = parseInt(rootNode.childNodes[1].attributes[0].nodeValue);
			
         if(statusCode == 1)
         {
            locNodeList = rootNode.childNodes[2];
            locLen = locNodeList.childNodes.length;
				
            legendStr = "<div id='wtrQualSenCoastal'><ul class='legends'>";
            legendStr += "<li class='header'>Coastal Water Quality Monitor</li></ul></div>";
				
            for(locItr = 0; locItr<locLen; locItr++)
            {
               locDetails = locNodeList.childNodes[locItr];
					
               markerArray.push([new GLatLng(locDetails.attributes[1].nodeValue,
                  locDetails.attributes[2].nodeValue),
               locDetails.attributes[3].nodeValue,
               legendIcons[0],
               getHtmlInfobox([locDetails.attributes[3].nodeValue,
                  converDMSFromDecimal(locDetails.attributes[1].nodeValue),
                  converDMSFromDecimal(locDetails.attributes[2].nodeValue),
                  locDetails.attributes[4].nodeValue,
                  locDetails.attributes[5].nodeValue])
               ]);
            }
            showHideWaterQualityMonitorCoastal(markerArray,true,legendStr);
         }
         else
         {
      //alert("No Data Found");
      }
			
      }
      catch(e)
      {
         alert("Exc[Coastal Water Marker] : "+e);
      }
   }
   function getHtmlInfobox(details)
   {
      return '<table width="200px" border="0" cellspacing="2" cellpadding="0" class="infoWindow">'+
      '<tr><td width="40%" class="label" valign="top">Location:</td>'+
      '<td width="60%" valign="top">'+details[0]+'</td></tr>'+
      '<tr><td width="40%" class="label" valign="top">Latitude:</td>'+
      '<td width="60%" valign="top">'+details[1]+'</td></tr>'+
      '<tr><td width="40%" class="label" valign="top">Longitude:</td>'+
      '<td width="60%" valign="top">'+details[2]+'</td></tr>'+
      '<tr><td width="40%" class="label" valign="top">COMAPS:</td>'+
      '<td width="60%" valign="top">'+details[3]+'</td></tr>'+
      '<tr><td width="40%" class="label" valign="top">Last Reading:</td>'+
      '<td width="60%" valign="top">'+details[4]+'</td></tr>'+
      '</table>';
   }
}

function initializeWasteWater(csMap)
{
   var tmpTime = new Date().getTime();
   var url = "WasteWaterAjax";
   var xmlDoc = null;
	
   var browserObj = new CustomBrowserXMLObject();
   xmlDoc = browserObj.getXMLDocObject();
	
   if(browserObj.getClient() == "ie")
   {
      //alert("@ IE End");
      xmlDoc.async = false;
      xmlDoc.onreadystatechange = function()
      {
         if (xmlDoc.readyState == 4)
         {
            operationOnLoadedXML();
         }
      };
      xmlDoc.load(url);
   }
   else if(browserObj.getClient() == "mozilla")
   {
      //alert("@ Mozilla End");
      xmlDoc = document.implementation.createDocument("", "", null);
		
      xmlDoc.load(url);
      xmlDoc.onload = function()
      {
         //alert("Mozilla Load Time : "+(new Date().getTime()-tmpTime));
         operationOnLoadedXML();
      }
   }
   else if(browserObj.getClient() == "chrome")
   {
      xmlhttp = browserObj.getXMLHttpObject();
      xmlhttp.open("GET",url,false);
      xmlhttp.send(null);
      xmlDoc = xmlhttp.responseXML;
      operationOnLoadedXML();
   }
	
   function operationOnLoadedXML()
   {
      //alert("Called callback");
      /*
		var legendIcons = ["images/map/mrkr_green.gif",
		                   "images/map/mrkr_blue.gif",
		                   "images/map/mrkr_violet.gif",
		                   "images/map/mrkr_orange.gif",
		                   "images/map/mrkr_red.gif"];
		*/		
      var legendObj = null;
      var legendString = null;
      var htmlMessage = null;
      var markerArray = [];
		
      var rootNode = null;
      var locNodeList = null;
      var locDetails = null;
      var locLen,locItr ;
		
      var statusCode = null;
      var details = null;
		
      try
      {
         rootNode = xmlDoc.documentElement;
         statusCode = parseInt(rootNode.childNodes[1].attributes[0].nodeValue);
			
         if(statusCode == 1)
         {
            locNodeList = rootNode.childNodes[2];
            locLen = locNodeList.childNodes.length;
				
            legendObj = new CS_Legends('5.02','361.72','wasteWater','legends','Waste Water [LPCD]');
				
            legendObj.setV1(5.02);
            legendObj.setV2(76);
            legendObj.setV3(147);
            legendObj.setV4(218);
            legendObj.setV5(289);
            legendObj.setV6(994.35);
				
            //legendObj.defaultInitialize(5);
            legendString = legendObj.getLegendStringMarkerSqueare();
					
            for(locItr = 0; locItr<locLen; locItr++)
            {
               locDetails = locNodeList.childNodes[locItr];
					
               markerArray.push([new GLatLng(locDetails.attributes[1].nodeValue,
                  locDetails.attributes[2].nodeValue),
               locDetails.attributes[4].nodeValue,
               legendObj.getSquareMarkerIcon(parseFloat(locDetails.attributes[4].nodeValue)),
                  getHtmlInfobox([locDetails.attributes[3].nodeValue,
                     converDMSFromDecimal(locDetails.attributes[1].nodeValue),
                     converDMSFromDecimal(locDetails.attributes[2].nodeValue),
                     locDetails.attributes[4].nodeValue])
                  ]);
            }
            showHideWasteWater(markerArray,true,legendString);
         }
         else
         {
      //alert("No Data Found");
      }
			
      }
      catch(e)
      {
         alert("Exc[Coastal Water Marker] : "+e);
      }
   }
   function getHtmlInfobox(details)
   {
      return '<table width="200px" border="0" cellspacing="2" cellpadding="0" class="infoWindow">'+
      '<tr><td width="40%" class="label" valign="top">City:</td>'+
      '<td width="60%" valign="top">'+details[0]+'</td></tr>'+
      '<tr><td width="40%" class="label" valign="top">Latitude:</td>'+
      '<td width="60%" valign="top">'+details[1]+'</td></tr>'+
      '<tr><td width="40%" class="label" valign="top">Longitude:</td>'+
      '<td width="60%" valign="top">'+details[2]+'</td></tr>'+
      '<tr><td width="40%" class="label" valign="top">LPCD:</td>'+
      '<td width="60%" valign="top">'+details[3]+'</td></tr>'+
      '</table>';
   }
}


function initializePollutionAirRest(csMap,type)
{
   var tmpTime = new Date().getTime();
   var url = "PollutionAirRest?type="+type;
   var xmlDoc = null;
	
   var browserObj = new CustomBrowserXMLObject();
   xmlDoc = browserObj.getXMLDocObject();
	
   if(browserObj.getClient() == "ie")
   {
      //alert("@ IE End");
      xmlDoc.async = false;
      xmlDoc.onreadystatechange = function()
      {
         if (xmlDoc.readyState == 4)
         {
            operationOnLoadedXML();
         }
      };
      xmlDoc.load(url);
   }
   else if(browserObj.getClient() == "mozilla")
   {
      //alert("@ Mozilla End");
      xmlDoc = document.implementation.createDocument("", "", null);
		
      xmlDoc.load(url);
      xmlDoc.onload = function()
      {
         //alert("Mozilla Load Time : "+(new Date().getTime()-tmpTime));
         operationOnLoadedXML();
      }
   }
   else if(browserObj.getClient() == "chrome")
   {
      xmlhttp = browserObj.getXMLHttpObject();
      xmlhttp.open("GET",url,false);
      xmlhttp.send(null);
      xmlDoc = xmlhttp.responseXML;
      operationOnLoadedXML();
   }
	
   function operationOnLoadedXML()
   {
      //alert("Called callback");
      var legendIcons = ["images/map/mrkr_blue.gif"];
		
      var legendObj = null;
      var legendString = null;
      var htmlMessage = null;
      var markerArray = [];
		
      var rootNode = null;
		
      var locLegendNode = null;
      var locNodeList = null;
      var locDetails = null;
      var locLen,locItr ;
		
      var statusCode = null;
      var details = null;
		
      try
      {
         rootNode = xmlDoc.documentElement;
         statusCode = parseInt(rootNode.childNodes[1].attributes[0].nodeValue);
			
         if(statusCode == 1)
         {
            if(type < 8)
            {
               locLegendNode = rootNode.childNodes[2];

               locNodeList = rootNode.childNodes[3];
               locLen = locNodeList.childNodes.length;

               //alert(locLegendNode.attributes[0].nodeValue+":"+locLegendNode.attributes[1].nodeValue);

               /* Initializing legends */
               var legendDisplayMessage = null;
               if(type >= 1 && type <= 4)
               {
                  legendDisplayMessage = "Pollution Air "+locLegendNode.attributes[2].nodeValue+" [&mu;g/m3]<br />";
               }
               else if (type >= 5 && type <= 7 )
               {
                  legendDisplayMessage = "Stack "+locLegendNode.attributes[2].nodeValue+" [&mu;g/m3]<br />";
               }

               if(type == 1)
               {
                  //rspm
                  legendDisplayMessage += "Standard = 120 &mu;g/m3";
               }
               else if(type == 2 || type == 5)
               {
                  //spm
                  legendDisplayMessage += "Standard = 360 &mu;g/m3";
               }
               else if(type == 3 || type == 6)
               {
                  //so2
                  legendDisplayMessage += "Standard = 80 &mu;g/m3";
               }
               else if(type == 4 || type == 7)
               {
                  //nox
                  legendDisplayMessage += "Standard = 80 &mu;g/m3";
               }
               
               
               legendObj = new CS_Legends(locLegendNode.attributes[0].nodeValue,locLegendNode.attributes[1].nodeValue,
                  'wasteWater','legends',legendDisplayMessage);
               legendObj.defaultInitialize(5);
               legendString = legendObj.getLegendStringMarker();

               for(locItr = 0; locItr<locLen; locItr++)
               {
                  locDetails = locNodeList.childNodes[locItr];

                  markerArray.push([new GLatLng(locDetails.attributes[1].nodeValue,
                     locDetails.attributes[2].nodeValue),
                  locDetails.attributes[5].nodeValue,
                  legendObj.getMarkerIcon(parseFloat(locDetails.attributes[5].nodeValue)),
                     getHtmlInfobox([converDMSFromDecimal(locDetails.attributes[1].nodeValue),
                        converDMSFromDecimal(locDetails.attributes[2].nodeValue),
                        locDetails.attributes[5].nodeValue])
                     ]);
               }
               showHidePollutionAirRest(markerArray,true,legendString,type);

            }
            else
            {
               locNodeList = rootNode.childNodes[2];
               locLen = locNodeList.childNodes.length;
               
               for(locItr = 0; locItr<locLen; locItr++)
               {
                  locDetails = locNodeList.childNodes[locItr];

                  markerArray.push([new GLatLng(locDetails.attributes[1].nodeValue,
                     locDetails.attributes[2].nodeValue),
                  locDetails.attributes[3].nodeValue,
                  legendIcons[0],
                  getHtmlInfobox([locDetails.attributes[5].nodeValue])
                     ]);
               }
               showHidePollutionAirRest(markerArray,true,'',type);

            }
				
         }
         else
         {
      //alert("No Data Found");
      }
			
      }
      catch(e)
      {
         alert("Ex [Pollution Air REST Marker] : "+e);
      }
   }
   
   function getHtmlInfobox(details)
   {
      if(type < 8)
      {
         return '<table width="200px" border="0" cellspacing="2" cellpadding="0" class="infoWindow">'+
         '<tr><td width="40%" class="label" valign="top">Latitude:</td>'+
         '<td width="60%" valign="top">'+details[0]+'</td></tr>'+
         '<tr><td width="40%" class="label" valign="top">Longitude:</td>'+
         '<td width="60%" valign="top">'+details[1]+'</td></tr>'+
         '<tr><td width="40%" class="label" valign="top">Microgram/l:</td>'+
         '<td width="60%" valign="top">'+details[2]+'</td></tr>'+
         '</table>';
      }
      else
      {
         //         var tmp = '<br/><div id="chart1div"></div>';
         //         tmp = tmp + ' <embed type="application/x-shockwave-flash" ' +
         //      'src="http://localhost:8080/pollutionmap/js/fusion/FCF_Line.swf" width="350" height="250"' +
         //      'id="chart1Id" name="chart1Id" quality="high" allowScriptAccess="always" swliveconnect="true"' +
         //      'flashvars="chartWidth=350&chartHeight=250&dataURL=Http%3A//localhost%3A8080/pollutionmap/NampChartData%3Fid%3D272%26type%3D8"/>';
         //         tmp += '<SCRIPT type="text/javascript">var chart1 = new FusionCharts("'+absPath+'js/fusion/FCF_Line.swf", "chart1Id", "350", "250");'
         //         + "chart1.setDataURL(escape(\""+details[0].replace("$", "&", "gi")+"\"));"
         //         + 'chart1.render("chart1div");</SCRIPT>'
         var infoText = '<br><div id="chart1div"></div>';
         if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length)
         {
            infoText = infoText + ' <embed type="application/x-shockwave-flash" ' +
            'src="'+absPath+'js/fusion/FCF_Line.swf" width="350" height="250"' +
            'id="chart1Id" name="chart1Id" quality="high" allowScriptAccess="always" swliveconnect="true"' +
            'flashvars="chartWidth=350&chartHeight=250&dataURL=' + escape(details[0].replace("$", "&", "gi"))+'"/>';
         }
         else
         {
            infoText = infoText + '<object id="chart1Id" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '+
            ' width="350" height="250"><param name="movie" value="'+absPath+'js/fusion/FCF_Line.swf" />'+
            '<param name="quality" value="high" /><param name="allowScriptAccess" value="always" /><param name="swliveconnect" '+
            'value="true" /><param name="flashvars" value="chartWidth=350&chartHeight=250&'+
            'dataURL=' + escape(details[0].replace("$", "&", "gi"))+'" /></object>';

         }
         return infoText;
      }
		
   }
}

function initializePollutionAir(csMap, source)
{
   var tmpTime = new Date().getTime();
   var url = "PollutionAirAjax?source="+source;
   //location.href = url;
   var xmlDoc = null;
	
   var browserObj = new CustomBrowserXMLObject();
   xmlDoc = browserObj.getXMLDocObject();
	
   if(browserObj.getClient() == "ie")
   {
      //alert("@ IE End");
      xmlDoc.async = false;
      xmlDoc.onreadystatechange = function()
      {
         if (xmlDoc.readyState == 4)
         {
            operationOnLoadedXML();
         }
      };
      xmlDoc.load(url);
   }
   else if(browserObj.getClient() == "mozilla")
   {
      //alert("@ Mozilla End");
      xmlDoc = document.implementation.createDocument("", "", null);
		
      xmlDoc.load(url);
      xmlDoc.onload = function()
      {
         //alert("Mozilla Load Time : "+(new Date().getTime()-tmpTime));
         operationOnLoadedXML();
      }
   }
   else if(browserObj.getClient() == "chrome")
   {
      xmlhttp = browserObj.getXMLHttpObject();
      xmlhttp.open("GET",url,false);
      xmlhttp.send(null);
      xmlDoc = xmlhttp.responseXML;
      operationOnLoadedXML();
   }
	
   function operationOnLoadedXML()
   {
      //alert("Called callback");
      var legendIcons = ["images/map/mrkr_blue.gif"];
		
      var legendStr = null;
      var htmlMessage = null;
      var markerArray = [];
		
      var rootNode = null;
      var locNodeList = null;
      var locDetails = null;
      var locLen,locItr ;
		
      var statusCode = null;
      var details = null;
		
      try
      {
         rootNode = xmlDoc.documentElement;
         //alert(rootNode.childNodes.length);
         statusCode = parseInt(rootNode.childNodes[1].attributes[0].nodeValue);
			
         if(statusCode == 1)
         {
            locNodeList = rootNode.childNodes[2];
            locLen = locNodeList.childNodes.length;
				
            legendStr = "<div id='polAir'><ul class='legends'>";
            legendStr += "<li class='header'>Air Quality Monitor</li></ul></div>";
				
            for(locItr = 0; locItr<locLen; locItr++)
            {
               locDetails = locNodeList.childNodes[locItr];
					
               markerArray.push([new GLatLng(locDetails.attributes[1].nodeValue,
                  locDetails.attributes[2].nodeValue),
               locDetails.attributes[3].nodeValue,
               legendIcons[0],
               getHtmlInfobox([locDetails.attributes[3].nodeValue,
                  converDMSFromDecimal(locDetails.attributes[1].nodeValue),
                  converDMSFromDecimal(locDetails.attributes[2].nodeValue),
                  locDetails.attributes[4].nodeValue,
                  locDetails.attributes[5].nodeValue])
               ]);
            }
            showHidePollutionAirMarker(markerArray,true,legendStr);
         }
         else
         {
            //alert("No Data Found");
         }
			
      }
      catch(e)
      {
         alert("Exc[Headquarters Marker] : "+e);
      }
   }
   function getHtmlInfobox(details)
   {
      return '<table width="200px" border="0" cellspacing="2" cellpadding="0" class="infoWindow">'+
      '<tr><td width="40%" class="label" valign="top">Location:</td>'+
      '<td width="60%" valign="top">'+details[0]+'</td></tr>'+
      '<tr><td width="40%" class="label" valign="top">Latitude:</td>'+
      '<td width="60%" valign="top">'+details[1]+'</td></tr>'+
      '<tr><td width="40%" class="label" valign="top">Longitude:</td>'+
      '<td width="60%" valign="top">'+details[2]+'</td></tr>'+
      '<tr><td width="40%" class="label" valign="top">Type:</td>'+
      '<td width="60%" valign="top">'+details[3]+'</td></tr>'+
      '<tr><td width="40%" class="label" valign="top">Parameter:</td>'+
      '<td width="60%" valign="top">'+details[4].replace(/Andlt;/gi, "<").replace(/Andgt;/gi, ">").replace(/Andnbsp;/gi, "&nbsp;")+'</td></tr>'+
      '</table>';
   }
}

/* "Surface Water" Pollution Marker */
function initializePollutionWater(csMap)
{
   //alert("Pollution Water Ajax Called");
   var tmpTime = new Date().getTime();
   var url = "PollutionWaterAjax";
   //location.href = url;
   var xmlDoc = null;
	
   var browserObj = new CustomBrowserXMLObject();
   xmlDoc = browserObj.getXMLDocObject();
	
   if(browserObj.getClient() == "ie")
   {
      //alert("@ IE End");
      xmlDoc.async = false;
      xmlDoc.onreadystatechange = function()
      {
         if (xmlDoc.readyState == 4)
         {
            operationOnLoadedXML();
         }
      };
      xmlDoc.load(url);
   }
   else if(browserObj.getClient() == "mozilla")
   {
      //alert("@ Mozilla End");
      xmlDoc = document.implementation.createDocument("", "", null);
		
      xmlDoc.load(url);
      xmlDoc.onload = function()
      {
         operationOnLoadedXML();
      }
   }
   else if(browserObj.getClient() == "chrome")
   {
      xmlhttp = browserObj.getXMLHttpObject();
      xmlhttp.open("GET",url,false);
      xmlhttp.send(null);
      xmlDoc = xmlhttp.responseXML;
      operationOnLoadedXML();
   }
	
   function operationOnLoadedXML()
   {
      //alert("Called callback");
      var legendIcons = ["images/map/mrkr_blue.gif"];
		
      var legendStr = null;
      var htmlMessage = null;
      var markerArray = [];
		
      var rootNode = null;
      var locNodeList = null;
      var locDetails = null;
      var locLen,locItr ;
		
      var statusCode = null;
      var details = null;
		
      try
      {
         rootNode = xmlDoc.documentElement;
         statusCode = parseInt(rootNode.childNodes[1].attributes[0].nodeValue);
			
         if(statusCode == 1)
         {
            locNodeList = rootNode.childNodes[2];
            locLen = locNodeList.childNodes.length;
				
            legendStr = "<div id='polWater'><ul class='legends'>";
            legendStr += "<li class='header'>Water Pollution</li></ul></div>";
				
            for(locItr = 0; locItr<locLen; locItr++)
            {
               locDetails = locNodeList.childNodes[locItr];
					
               markerArray.push([new GLatLng(locDetails.attributes[1].nodeValue,
                  locDetails.attributes[2].nodeValue),
               locDetails.attributes[3].nodeValue,
               legendIcons[0],
               getHtmlInfobox([locDetails.attributes[3].nodeValue,
                  locDetails.attributes[4].nodeValue,
                  locDetails.attributes[5].nodeValue,
                  locDetails.attributes[6].nodeValue,
                  locDetails.attributes[7].nodeValue,
                  converDMSFromDecimal(locDetails.attributes[1].nodeValue),
                  converDMSFromDecimal(locDetails.attributes[2].nodeValue)])
               ]);
            }
            showHidePollutionWaterMarker(markerArray,true,legendStr);
         }
         else
         {
            //alert("No Data Found");
         }
      }
      catch(e)
      {
         alert("Exc[Water Pollution Marker] : "+e);
      }
   }
   function getHtmlInfobox(details)
   {
      return '<table width="300px" border="0" cellspacing="2" cellpadding="0" class="infoWindow">'+
      '<tr><td width="30%" class="label" valign="top">Location:</td>'+
      '<td width="70%" valign="top">'+details[0]+'</td></tr>'+
      '<tr><td class="label">Type:</td>'+
      '<td>'+details[1]+'</td></tr>'+
      '<tr><td class="label">Village:</td>'+
      '<td>'+details[2]+'</td></tr>'+
      '<tr><td class="label">Taluka:</td>'+
      '<td>'+details[3]+'</td></tr>'+
      '<tr><td class="label">District:</td>'+
      '<td>'+details[4]+'</td></tr>'+
      '<tr><td class="label">Latitude:</td>'+
      '<td>'+details[5]+'</td></tr>'+
      '<tr><td class="label">Longitude:</td>'+
      '<td>'+details[6]+'</td></tr>'+
      '</table>';
   }
}

function initializeWaterQualiatyMonitor(csMap)
{
   //alert("Pollution Water Ajax Called");
   var tmpTime = new Date().getTime();
   var url = "WaterQualityMonitorAjax";
   var xmlDoc = null;
	
   var browserObj = new CustomBrowserXMLObject();
   xmlDoc = browserObj.getXMLDocObject();
	
   if(browserObj.getClient() == "ie")
   {
      //alert("@ IE End");
      xmlDoc.async = false;
      xmlDoc.onreadystatechange = function()
      {
         if (xmlDoc.readyState == 4)
         {
            operationOnLoadedXML();
         }
      };
      xmlDoc.load(url);
   }
   else if(browserObj.getClient() == "mozilla")
   {
      //alert("@ Mozilla End");
      xmlDoc = document.implementation.createDocument("", "", null);
		
      xmlDoc.load(url);
      xmlDoc.onload = function()
      {
         //alert("Mozilla Load Time : "+(new Date().getTime()-tmpTime));
         operationOnLoadedXML();
      }
   }
   else if(browserObj.getClient() == "chrome")
   {
      xmlhttp = browserObj.getXMLHttpObject();
      xmlhttp.open("GET",url,false);
      xmlhttp.send(null);
      xmlDoc = xmlhttp.responseXML;
      operationOnLoadedXML();
   }
	
   function operationOnLoadedXML()
   {
      //alert("Called callback");
      var legendIcons = ["images/map/mrkr_blue.gif"];
		
      var legendStr = null;
      var htmlMessage = null;
      var markerArray = [];
		
      var rootNode = null;
      var locNodeList = null;
      var locDetails = null;
      var locLen,locItr ;
		
      var statusCode = null;
      var details = null;
		
      try
      {
         rootNode = xmlDoc.documentElement;
         statusCode = parseInt(rootNode.childNodes[1].attributes[0].nodeValue);
			
         if(statusCode == 1)
         {
            locNodeList = rootNode.childNodes[2];
            locLen = locNodeList.childNodes.length;
				
            legendStr = "<div id='wtrQualSen'><ul class='legends'>";
            legendStr += "<li class='header'>Water Quality Monitor</li></ul></div>";
				
            for(locItr = 0; locItr<locLen; locItr++)
            {
               locDetails = locNodeList.childNodes[locItr];
					
               markerArray.push([new GLatLng(locDetails.attributes[1].nodeValue,
                  locDetails.attributes[2].nodeValue),
               locDetails.attributes[0].nodeValue,
               legendIcons[0],
               getHtmlInfobox([locDetails.attributes[0].nodeValue,
                  locDetails.attributes[3].nodeValue,
                  locDetails.attributes[4].nodeValue,
                  converDMSFromDecimal(locDetails.attributes[1].nodeValue),
                  converDMSFromDecimal(locDetails.attributes[2].nodeValue)])
               ]);
            }
            showHideWaterQualityMonitor(markerArray,true,legendStr);
         }
         else
         {
      //alert("No Data Found");
      }
      }
      catch(e)
      {
         alert("Exc[Water Pollution Marker] : "+e);
      }
   }
   function getHtmlInfobox(details)
   {
      return '<table width="300px" border="0" cellspacing="2" cellpadding="0" class="infoWindow">'+
      '<tr><td width="30%" class="label" valign="top">Location:</td>'+
      '<td width="70%" valign="top">'+details[0]+'</td></tr>'+
      '<tr><td class="label">State:</td>'+
      '<td>'+details[1]+'</td></tr>'+
      '<tr><td class="label">District:</td>'+
      '<td>'+details[2]+'</td></tr>'+
      '<tr><td class="label">Latitude:</td>'+
      '<td>'+details[3]+'</td></tr>'+
      '<tr><td class="label">Longitude:</td>'+
      '<td>'+details[4]+'</td></tr>'+
      '</table>';
   }
}

function initializeWaterQualiatyMonitorPCB(csMap)
{
   //alert("Pollution Water Ajax Called");
   var tmpTime = new Date().getTime();
   var url = "WaterQualityMonitorPCBAjax";
   var xmlDoc = null;
	
   var browserObj = new CustomBrowserXMLObject();
   xmlDoc = browserObj.getXMLDocObject();
	
   if(browserObj.getClient() == "ie")
   {
      //alert("@ IE End");
      xmlDoc.async = false;
      xmlDoc.onreadystatechange = function()
      {
         if (xmlDoc.readyState == 4)
         {
            operationOnLoadedXML();
         }
      };
      xmlDoc.load(url);
   }
   else if(browserObj.getClient() == "mozilla")
   {
      //alert("@ Mozilla End");
      xmlDoc = document.implementation.createDocument("", "", null);
		
      xmlDoc.load(url);
      xmlDoc.onload = function()
      {
         //alert("Mozilla Load Time : "+(new Date().getTime()-tmpTime));
         operationOnLoadedXML();
      }
   }
   else if(browserObj.getClient() == "chrome")
   {
      xmlhttp = browserObj.getXMLHttpObject();
      xmlhttp.open("GET",url,false);
      xmlhttp.send(null);
      xmlDoc = xmlhttp.responseXML;
      operationOnLoadedXML();
   }
	
   function operationOnLoadedXML()
   {
      //alert("Called callback");
      var legendIcons = ["images/map/mrkr_blue.gif"];
		
      var legendStr = null;
      var htmlMessage = null;
      var markerArray = [];
		
      var rootNode = null;
      var locNodeList = null;
      var locDetails = null;
      var locLen,locItr ;
		
      var statusCode = null;
      var details = null;
		
      try
      {
         rootNode = xmlDoc.documentElement;
         //alert(rootNode.childNodes[1].attributes[0].nodeValue);
         //alert(rootNode.childNodes[1].childNodes[0].nodeValue);
			
         statusCode = parseInt(rootNode.childNodes[1].attributes[0].nodeValue);
         //statusCode = 1;
			
         if(statusCode == 1)
         {
            locNodeList = rootNode.childNodes[2];
            locLen = locNodeList.childNodes.length;
				
            legendStr = "<div id='wtrQualSenPCB'><ul class='legends'>";
            legendStr += "<li class='header'>Water Quality Monitor</li></ul></div>";
				
            for(locItr = 0; locItr<locLen; locItr++)
            {
               locDetails = locNodeList.childNodes[locItr];
					
               markerArray.push([new GLatLng(locDetails.attributes[1].nodeValue,
                  locDetails.attributes[2].nodeValue),
               locDetails.attributes[0].nodeValue,
               legendIcons[0],
               getHtmlInfobox([locDetails.attributes[0].nodeValue,
                  locDetails.attributes[3].nodeValue,
                  locDetails.attributes[4].nodeValue,
                  locDetails.attributes[5].nodeValue,
                  locDetails.attributes[6].nodeValue,
                  converDMSFromDecimal(locDetails.attributes[1].nodeValue),
                  converDMSFromDecimal(locDetails.attributes[2].nodeValue)])
               ]);
            }
            showHideWaterQualityMonitorPCB(markerArray,true,legendStr);
         }
         else
         {
      //alert("No Data Found");
      }
      }
      catch(e)
      {
         alert("Exc[Water Pollution Sensor PCB] : "+e);
      }
   }
   function getHtmlInfobox(details)
   {
      return '<table width="300px" border="0" cellspacing="2" cellpadding="0" class="infoWindow">'+
      '<tr><td width="30%" class="label" valign="top">Location:</td>'+
      '<td width="70%" valign="top">'+details[0]+'</td></tr>'+
      '<tr><td class="label">Taluka:</td>'+
      '<td>'+details[1]+'</td></tr>'+
      '<tr><td class="label">Village:</td>'+
      '<td>'+details[2]+'</td></tr>'+
      '<tr><td class="label">District:</td>'+
      '<td>'+details[3]+'</td></tr>'+
      '<tr><td class="label">State:</td>'+
      '<td>'+details[4]+'</td></tr>'+
      '<tr><td class="label">Latitude:</td>'+
      '<td>'+details[5]+'</td></tr>'+
      '<tr><td class="label">Longitude:</td>'+
      '<td>'+details[6]+'</td></tr>'+
      '</table>';
   }
}

function initializeHedquarters(csMap)
{
   var tmpTime = new Date().getTime();
   var url = "HeadquarterAjax";
   var xmlDoc = null;
	
   var browserObj = new CustomBrowserXMLObject();
   xmlDoc = browserObj.getXMLDocObject();
	
   if(browserObj.getClient() == "ie")
   {
      //alert("@ IE End");
      xmlDoc.async = false;
      xmlDoc.onreadystatechange = function()
      {
         if (xmlDoc.readyState == 4)
         {
            operationOnLoadedXML();
         }
      };
      xmlDoc.load(url);
   }
   else if(browserObj.getClient() == "mozilla")
   {
      //alert("@ Mozilla End");
      xmlDoc = document.implementation.createDocument("", "", null);
		
      xmlDoc.load(url);
      xmlDoc.onload = function()
      {
         //alert("Mozilla Load Time : "+(new Date().getTime()-tmpTime));
         operationOnLoadedXML();
      }
   }
   else if(browserObj.getClient() == "chrome")
   {
      xmlhttp = browserObj.getXMLHttpObject();
      xmlhttp.open("GET",url,false);
      xmlhttp.send(null);
      xmlDoc = xmlhttp.responseXML;
      operationOnLoadedXML();
   }
	
   function operationOnLoadedXML()
   {
      //alert("Called callback");
      var legendIcons = ["images/map/mrkr_green.gif","images/map/mrkr_red.gif",
      "images/map/mrkr_blue.gif","images/map/mrkr_orange.gif"];
		
      var htmlMessage = null;
      var markerArray = [];
		
      var rootNode = null;
      var locNodeList = null;
      var locDetails = null;
      var locLen,locItr ;
		
      var statusCode = null;
      var details = null;
		
      try
      {
         rootNode = xmlDoc.documentElement;
         statusCode = parseInt(rootNode.childNodes[1].attributes[0].nodeValue);
			
         if(statusCode == 1)
         {
            locNodeList = rootNode.childNodes[2];
            locLen = locNodeList.childNodes.length;
				
            for(locItr = 0; locItr<locLen; locItr++)
            {
               locDetails = locNodeList.childNodes[locItr];
										
               markerArray.push([new GLatLng(locDetails.attributes[1].nodeValue,
                  locDetails.attributes[2].nodeValue),
               locDetails.attributes[3].nodeValue,
               legendIcons[parseInt(locDetails.attributes[7].nodeValue)],
                  getHtmlInfobox([locDetails.attributes[3].nodeValue,
                     locDetails.attributes[4].nodeValue,
                     locDetails.attributes[5].nodeValue,
                     locDetails.attributes[6].nodeValue])
                  ]);
            }
            new CS_MarkersHeadQuarters(csMap,markerArray).showClusterMarkers(csMap);
         }
         else
         {
      //alert("No Data Found");
      }
			
      }
      catch(e)
      {
         alert("Exc[Headquarters Marker] : "+e);
      }
		
		
   }
	
   function getHtmlInfobox(details)
   {
      return '<table width="200px" border="0" cellspacing="2" cellpadding="0" class="infoWindow">'+
      '<tr><td width="40%" class="label">Name:</td>'+
      '<td width="60%">'+details[0]+'</td>'+
      '</tr><tr><td class="label">Town:</td>'+
      '<td>'+details[1]+'</td>'+
      '</tr><tr><td class="label">District:</td>'+
      '<td>'+details[2]+'</td>'+
      '</tr><tr><td class="label">State:</td>'+
      '<td>'+details[3]+'</td>'+
      '</tr></table>';
   }
}

function initializeGGWNitrateMarker(state,district,nitrateRante)
{
   //alert("Called...");
   var tmpTime = null;
   tmpTime = new Date().getTime();
	
   var url = "GGWNitrateAjax?state="+state+"&district="+district+"&nitrateRange="+nitrateRante;
   var xmlDoc = null;
	
   var browserObj = new CustomBrowserXMLObject();
   xmlDoc = browserObj.getXMLDocObject();
	
   //alert(navigator.userAgent+" : "+browserObj.getClient());
	
   if(browserObj.getClient() == "ie")
   {
      //alert("@ IE End");
      xmlDoc.async = false;
      xmlDoc.onreadystatechange = function()
      {
         if (xmlDoc.readyState == 4)
         {
            operationOnLoadedXML();
         }
      };
      xmlDoc.load(url);
   }
   else if(browserObj.getClient() == "mozilla")
   {
      //alert("@ Mozilla End");
      xmlDoc = document.implementation.createDocument("", "", null);
		
      xmlDoc.load(url);
      xmlDoc.onload = function()
      {
         //alert("Mozilla Load Time : "+(new Date().getTime()-tmpTime));
         operationOnLoadedXML();
      }
   }
   else if(browserObj.getClient() == "chrome")
   {
      xmlhttp = browserObj.getXMLHttpObject();
      xmlhttp.open("GET",url,false);
      xmlhttp.send(null);
      xmlDoc = xmlhttp.responseXML;
      operationOnLoadedXML();
   }
	
   function operationOnLoadedXML()
   {
      tmpTime = new Date().getTime();
      var tmpXmlDoc = xmlDoc;
		
      var locationNodes = null;
      var dataNode = null;
      var legendsNodes = null;
      var legendNode = null;
      var legendIcons = ["images/map/mrkr_green.gif","images/map/mrkr_blue.gif",
      "images/map/mrkr_violet.gif","images/map/mrkr_orange.gif","images/map/mrkr_red.gif"];
      var legendStr = "";
		
      var tmpString = "";
		
      var fTr, sTr = -1, fLen;
      var lItr,lLen;
		
      var legendArray = new Array();
      var markerArray = new Array();
      var element;
      var markerDetails = null;
		
      try
      {
         fLen = xmlDoc.getElementsByTagName("data").length;
			
         var rootNode = xmlDoc.documentElement;
			
         legendsNodes = rootNode.childNodes[0];
         locationNodes = rootNode.childNodes[1];
			
         lLen = legendsNodes.childNodes.length;
			
         legendStr = "<div id='ggw_nitrate'><ul class='legends'>";
         legendStr += "<li class='header'>Nitrate Level [mg/L]</li>";
         for(lItr = 0 ; lItr<lLen ; lItr++)
         {
            legendNode = legendsNodes.childNodes[lItr];
            legendArray[lItr] = [legendNode.attributes[0].nodeValue,legendNode.attributes[1].nodeValue];
            legendStr += "<li style='padding-left:10px'><img src='"+legendIcons[lItr]+"' />&nbsp;&nbsp;"
            +legendArray[lItr][0]+" - "+legendArray[lItr][1]+"</li>";
         }
         legendStr += "</ul></div>";
			
         fLen = locationNodes.childNodes.length;
         for (fTr = 0; fTr < fLen/* && fTr <=100 */; fTr++)
         {
            dataNode = locationNodes.childNodes[fTr];
				
            element = new Array();
            markerDetails = new Array();
				
            markerDetails[0] = dataNode.attributes[0].nodeValue;
            markerDetails[1] = dataNode.attributes[1].nodeValue;
            markerDetails[2] = dataNode.attributes[2].nodeValue;
            markerDetails[3] = dataNode.attributes[3].nodeValue;
            markerDetails[4] = legendIcons[parseInt(dataNode.attributes[6].nodeValue)-1];
				
            element[0] = new GLatLng(dataNode.attributes[4].nodeValue,
               dataNode.attributes[5].nodeValue,false);
            element[1] = markerDetails;
				
            markerArray[fTr] = element;
         }
         //alert("XML Processing Time : ["+fLen+"] "+(new Date().getTime()-tmpTime));
			
         showHideGGWNitrateMarker(markerArray,true,null,null,null,legendStr);
      }
      catch (e)
      {
         alert("Exc [Parsing Error] : " + e);
         return null;
      }
   }
}

function initializeGGWArseniceMarker(state,district,nitrateRante)
{
   //alert("Called...");
   var tmpTime = null;
   tmpTime = new Date().getTime();
	
   var url = "GGWArsenicAjax";
   var xmlDoc = null;
	
   var browserObj = new CustomBrowserXMLObject();
   xmlDoc = browserObj.getXMLDocObject();
	
   if(browserObj.getClient() == "ie")
   {
      //alert("@ IE End");
      xmlDoc.async = false;
      xmlDoc.onreadystatechange = function()
      {
         if (xmlDoc.readyState == 4)
         {
            operationOnLoadedXML();
         }
      };
      xmlDoc.load(url);
   }
   else if(browserObj.getClient() == "mozilla")
   {
      //alert("@ Mozilla End");
      xmlDoc = document.implementation.createDocument("", "", null);
		
      xmlDoc.load(url);
      xmlDoc.onload = function()
      {
         //alert("Mozilla Load Time : "+(new Date().getTime()-tmpTime));
         operationOnLoadedXML();
      }
   }
   else if(browserObj.getClient() == "chrome")
   {
      xmlhttp = browserObj.getXMLHttpObject();
      xmlhttp.open("GET",url,false);
      xmlhttp.send(null);
      xmlDoc = xmlhttp.responseXML;
      operationOnLoadedXML();
   }
	
   function operationOnLoadedXML()
   {
      tmpTime = new Date().getTime();
      var tmpXmlDoc = xmlDoc;
		
      var locationNodes = null;
      var dataNode = null;
      var legendsNodes = null;
      var legendNode = null;
      var legendIcons = ["images/map/mrkr_green.gif","images/map/mrkr_blue.gif",
      "images/map/mrkr_violet.gif","images/map/mrkr_orange.gif","images/map/mrkr_red.gif"];
      var legendStr = "";
		
      var tmpString = "";
		
      var fTr, sTr = -1, fLen;
      var lItr,lLen;
		
      var legendArray = new Array();
      var markerArray = new Array();
      var element;
      var markerDetails = null;
		
      try
      {
         fLen = xmlDoc.getElementsByTagName("data").length;
			
         var rootNode = xmlDoc.documentElement;
			
         legendsNodes = rootNode.childNodes[0];
         locationNodes = rootNode.childNodes[1];
			
         lLen = legendsNodes.childNodes.length;
			
         legendStr = "<div id='ggw_arsenic'><ul class='legends'>";
         legendStr += "<li class='header'>Arsenic Level [mg/L]</li>";
         for(lItr = 0 ; lItr<lLen ; lItr++)
         {
            legendNode = legendsNodes.childNodes[lItr];
            legendArray[lItr] = [legendNode.attributes[0].nodeValue,legendNode.attributes[1].nodeValue];
            legendStr += "<li style='padding-left:10px'><img src='"+legendIcons[lItr]+"' />&nbsp;&nbsp;"+legendArray[lItr][0]+" - "
            +legendArray[lItr][1]+"</li>";
         }
         legendStr += "</ul></div>";
			
         fLen = locationNodes.childNodes.length;
         for (fTr = 0; fTr < fLen/* && fTr <=100 */; fTr++)
         {
            dataNode = locationNodes.childNodes[fTr];
				
            element = new Array();
            markerDetails = new Array();
				
            markerDetails[0] = dataNode.attributes[0].nodeValue;
            markerDetails[1] = dataNode.attributes[1].nodeValue;
            markerDetails[2] = dataNode.attributes[2].nodeValue;
            markerDetails[3] = dataNode.attributes[3].nodeValue;
            markerDetails[4] = legendIcons[parseInt(dataNode.attributes[6].nodeValue)-1];
				
            element[0] = new GLatLng(dataNode.attributes[4].nodeValue,
               dataNode.attributes[5].nodeValue,false);
            element[1] = markerDetails;
				
            markerArray[fTr] = element;
         }
         //alert("XML Processing Time : ["+fLen+"] "+(new Date().getTime()-tmpTime));
			
         showHideGGWArsenicMarker(markerArray,true,null,null,null,legendStr);
      }
      catch (e)
      {
         alert("Exc [Parsing Error] : " + e);
         return null;
      }
   }
}

function createRequestObject()
{
   var ajaxRequestObj;
   try
   {
      // Opera 8.0+, Firefox, Safari
      ajaxRequestObj = new XMLHttpRequest();
   }
   catch (ex)
   {
      // Internet Explorer Browsers
      try
      {
         ajaxRequestObj = new ActiveXObject("Msxml2.XMLHTTP");
      }
      catch (ex)
      {
         try
         {
            ajaxRequestObj = new ActiveXObject("Microsoft.XMLHTTP");
         }
         catch (ex)
         {
            // Something went wrong
            alert("Your browser broke!");
            return false;
         }
      }
   }
   return ajaxRequestObj;
}

function getLandMarks(dataSourceIndex)
{
   var ajaxRequest = createRequestObject();
   // Create a function that will receive data sent from the server
   ajaxRequest.onreadystatechange = function()
   {
      if (ajaxRequest.readyState == 4 && ajaxRequest.status == 200)
      {
         var response = ajaxRequest.responseText;
         if(response.length > 0)
         {
            landMarkMarkers[dataSourceIndex][targetMap_txt]= new Array();
            eval(response);
            if(landMarkMarkerMgr[targetMap_txt] == null)
            {
               landMarkMarkerMgr[targetMap_txt] = new MarkerManager(targetMap.getMap());
            }
            landMarkMarkerMgr[targetMap_txt].addMarkers(landMarkMarkers[dataSourceIndex][targetMap_txt], 13);
            landMarkMarkerMgr[targetMap_txt].refresh();
         }
      }
      else
      {

      }
   };

   var queryString = "?source="+(dataSourceIndex+1);
   ajaxRequest.open("GET", "LandMarkAjax" + queryString, true);
   ajaxRequest.send(null);
}
