    //<![CDATA[
    if (GBrowserIsCompatible()) 
    { 
      // Set up three markers with info windows 
      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.";
      reasons[403]                      = "Error 403: Probably an incorrect error caused by a bug in the handling of invalid JSON.";
     
     
     
      function createMarker(point,html) {
        var marker = new GMarker(point);//alert(html);
        GEvent.addListener(marker, "mouseover", function() {
          marker.openInfoWindowHtml(html);
        });
        return marker;
      }
     str=document.getElementById("txtaddress").value;
	 strarr=str.split("^");
	 store_id=document.getElementById("txtstoreid").value;
      // Display the map, with some controls and set the initial location 
      var map = new GMap2(document.getElementById("showmap"));
      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
	 var geo = new GClientGeocoder(); //alert(str);
	  geo.getLocations(strarr[0], function (result)
      { 
            // If that was successful
           if (result.Status.code == G_GEO_SUCCESS) 
           {
              // Lets assume that the first marker is the one we want
              var p = result.Placemark[0].Point.coordinates;
              lat=p[1];
              lng=p[0];//alert(lat);
			        

			   point = new GLatLng(lat,lng);//alert("first");
               map.setCenter(point,10);
               
               stroreidarr=store_id.split("^");     
               storeid=stroreidarr[0];

               showcontent(storeid);

            }
         }
        );
	 
//	  address="";
//	  j=0;
//	   //alert(strarr.length);
//       for(i=0;i<strarr.length;i++)
//	   {
//    	  address=strarr[i];//alert("100");
//    	  setTimeout('showmark("'+address+'","'+i+'")',100);
//	   }
	}
//    // display a warning if the browser was not compatible
    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }

    //]]>
function showcontent(id)
{
      url="getaddress.aspx?storeid="+id+"&mode=map";
       AjaxCall(url, show_address);
       

}
function show_address()
{
 if(req.readyState==4)
 {
    // alert(req.responseText);
    if(req.responseText!="")
    {
       		   var marker = createMarker(point,req.responseText)
      			map.addOverlay(marker);
      			}

   // return req.responseText;
 }   

}
function showmark(address,i)
{
    	  if(address!="")
    	  {
		      var geo = new GClientGeocoder(); alert(result.Status.code);
	      geo.getLocations(address, function (result)
          { 
                // If that was successful
              // if (result.Status.code == G_GEO_SUCCESS) 
              // {
                  // Lets assume that the first marker is the one we want
                  var p = result.Placemark[0].Point.coordinates;//alert(p);
                  lat=p[1];
                  lng=p[0];
			      j++;
			      strarrn=str.split("^");
			      add=strarrn[j-1];
			      stroreidarr=store_id.split("^");     
                  storeid=stroreidarr[j-1];
			       point = new GLatLng(lat,lng);
          		   
      		       showcontent(i);

               // }
            }
              );
             
            }

}

