function ChangeTitle(NewTitle) {
  document.title = NewTitle;
}
function createMarker(point, html, icon) {
  var marker = new GMarker(point,icon);
                                                                                
  // Show this marker's index in the info window when it is clicked
  GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml(html);
  });
                                                                                
  return marker;
}
function _getInitialUrl() {
    var x = Math.random();
    if (document.location.search.indexOf("test=") > 0) {
	var _tester = document.location.search.indexOf("test=") + "test=".length;
	if ( document.location.search.substring(_tester) ) {
 	   return 'http://www.losangelesearthquakes.com/test.js';
        }
    }
    var new_url = 'http://www.losangelesearthquakes.com/eq/';
    var national = document.location.search.indexOf("national");
    if (national > 0) {
       new_url = new_url + 'national/';
    }
    var min_mag = '';
    if (document.location.search.indexOf("min=") > 0) {
      var min = document.location.search.indexOf("min=") + "min=".length;
      min_mag = document.location.search.substring(min);
    }
    var rpp = '';
    if (document.location.search.indexOf("rpp=") > 0) {
      var rpp_n = document.location.search.indexOf("rpp=") + "rpp=".length;
      rpp = document.location.search.substring(rpp_n);
    }
    new_url = new_url + x + '/index.js?c=' + c_start + '&min=' + min_mag + '&rpp=' + rpp;
//alert(new_url);
    return new_url;
}
var redicon = new GIcon();
var yellowicon = new GIcon();
var blueicon = new GIcon();
blueicon.image = 'http://www.losangelesearthquakes.com/small.png';
blueicon.iconSize = new GSize(15,15);
blueicon.shadow = 'http://www.losangelesearthquakes.com/smallshadow.png';
blueicon.shadowSize = new GSize(30,16);
yellowicon.image = 'http://www.losangelesearthquakes.com/medium.png';
yellowicon.iconSize = new GSize(25,25);
yellowicon.shadow = 'http://www.losangelesearthquakes.com/mediumshadow.png';
yellowicon.shadowSize = new GSize(46,23);
redicon.image = 'http://www.losangelesearthquakes.com/big.png';
redicon.iconSize = new GSize(40,40);
redicon.shadow = 'http://www.losangelesearthquakes.com/bigshadow.png';
redicon.shadowSize = new GSize(70, 34);
redicon.iconAnchor = new GPoint(20,20);
yellowicon.iconAnchor = new GPoint(12,12);
blueicon.iconAnchor = new GPoint(7,7);
redicon.infoWindowAnchor = new GPoint(20,20);
yellowicon.infoWindowAnchor = new GPoint(12,12);
blueicon.infoWindowAnchor = new GPoint(7,7);

function NextSet() {
  var s = document.createElement( "script" );
  s.src = _getInitialUrl();
  s.type = "text/javascript";
  document.getElementsByTagName( "head" )[0].appendChild( s );
}

NextSet();
