function ajaxPost(map,strURL,callbackoption) {
    var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('GET', strURL, true);
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
			switch(callbackoption) {
				case("fetchplotdata"):
					if(self.xmlHttpReq.responseText != "") {
						PlotPointsOnMap(map,self.xmlHttpReq.responseText);
					}else{
						//alert("fetchplotdata: No points found!");
					}
					break;
				case("fetchplotdataforhomepage"):
					if(self.xmlHttpReq.responseText != "") {
						PlotPointsOnMapForHomepage(map,self.xmlHttpReq.responseText);
					}else{
						//alert("fetchplotdata: No points found!");
					}
					break;
				default:
					displayMessage("DEFAULT SWITCH CASE!");
					break;
			}
        }
    }
    self.xmlHttpReq.send(null);
}

function displayMessage(msg){
	alert(msg);
	//document.write(msg)
}

function PlotPointsOnMap(map,strItems) {
	//alert("Reached PlotPointsOnMap()\n\n" + strItems);
	//document.write("Reached PlotPointsOnMap()\n\n" + strItems);

	//	Now we need to parse through the returned values of "279|LAT|LON|DESC@231|LAT|LON|DESC@" and get

	var myResult = strItems.split("@");
	var thisID = 0;
	var allPoints = new Array();

	for(i = 0; i < myResult.length - 1; i++){
		thisResult = myResult[i].split("|");
		thisID = thisResult[0];
		thisLat = thisResult[1];
		thisLon = thisResult[2];
		thisDesc = thisResult[3];

		allPoints[i] = new GLatLng(thisLat,thisLon);

		//	Plot this point :-)
		PlotPoint(map,thisLat,thisLon,thisDesc);
	}
	//	Autoresize
	//alert("AutoResize");
	var latlngbounds = new GLatLngBounds( );
	  for ( var i = 0; i < allPoints.length; i++ )
	  {
		latlngbounds.extend( allPoints[ i ] );
	  }
	  map.setCenter( latlngbounds.getCenter( ), map.getBoundsZoomLevel( latlngbounds ) );

}

function PlotPointsOnMapForHomepage(map,strItems) {
	//alert("Reached PlotPointsOnMapForHomepage()\n\n" + strItems);
	//document.write("Reached PlotPointsOnMap()\n\n" + strItems);

	//	Now we need to parse through the returned values of "279|LAT|LON|DESC@231|LAT|LON|DESC@" and get

	var myResult = strItems.split("@");
	var thisID = 0;
	var allPoints = new Array();

	for(i = 0; i < myResult.length - 1; i++){
		thisResult = myResult[i].split("|");
		thisID = thisResult[0];
		thisLat = thisResult[1];
		thisLon = thisResult[2];
		thisDesc = thisResult[3];

		allPoints[i] = new GLatLng(thisLat,thisLon);

		//	Plot this point :-)
		PlotPoint(map,thisLat,thisLon,thisDesc);
	}
}

function PlotPoint(map,thisLat,thisLon,thisDesc) {
	//	Plots a point on the specified map, at the specified location, with the specified description.
	//alert("Plotting " + thisLat + "/" + thisLon + "\n\n" + thisDesc);
	if(thisLat != "") {
		if(thisLon != "") {
			var thisPoint = new GLatLng(thisLat,thisLon);
			var thisMarker = new GMarker(thisPoint);
			map.addOverlay(thisMarker);
			GEvent.addListener(thisMarker,"click",function(){
				thisMarker.openInfoWindowHtml(thisDesc)})
		}
	}
}