I have a couple of problems with my map that I haven't been able to solve through Googling and looking at other people's questions. I'm not too familiar with Javascript and AJAX, so some solutions I have found I can't seem to implement into my particular system. Sorry if similar questions are out there, I just haven't had any luck implementing those solutions.

The first problem I'm having is that I want to get a simple MarkerClusterer system in so the markers will cluster. I've added the scripts to my system, but they just don't cluster. When I used the data.json of the examples, the clustering worked; but getting the data into a variable using AJAX and using that doesn't seem to do a thing.

The second problem is that the markers are being added on top of each other periodically, rather than being updated. I'm guessing that in the simplest case I'll want to clear the old markers before adding the new ones, but whenever I try to add a solution proposed by others, all my markers disappear. So if someone could help out in being specific with my system, that'd be awesome.

Here's my javascript:
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
  var script = '<script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer';
  if (document.location.search.indexOf('compiled') !== -1) {
    script += '_compiled';
  script += '.js"><' + '/script>';

<script type="text/javascript">     

  function initialize() {
    var myLatlng = new google.maps.LatLng(35.0839, -106.6186);
    var mapDiv = document.getElementById('map-canvas');
    map = new google.maps.Map(mapDiv, {
      center: new google.maps.LatLng(35.0839, -106.6186),
      zoom: 16,
      mapTypeId: google.maps.MapTypeId.HYBRID

setTimeout(initializeMaps, 5000);

function initializeMaps() {
var ajax;
ajax=new XMLHttpRequest();
if (ajax.readyState==4 && ajax.status==200)
var markers = ajax.responseText;
var markers = JSON.parse(markers);

function addMap(markers) {
var iconBase = 'http://mydomain.com/images/';
var infowindow = new google.maps.InfoWindow(), marker, i;
for (i = 0; i < markers.length; i++) {  
    var marker = new google.maps.Marker({
        position: new google.maps.LatLng(markers[i][1], markers[i][2]),
        map: map,
        icon: iconBase + markers[i][3]
    google.maps.event.addListener(marker, 'click', (function(marker, i) {
        return function() {
            infowindow.open(map, marker);
    })(marker, i));
setTimeout(initializeMaps, 5000);

var markerCluster = new MarkerClusterer(map, markers);    

  google.maps.event.addDomListener(window, 'load', initialize);