

// extend GMap2 to include position before last move
GMap2.prototype.oldCoords = new GLatLng(0,0);

// extebd GMap2 to add crosshair at centre of map
GMap2.prototype.addCrosshairs=function() {

  var container=this.getContainer();
  if(this.crosshairs) this.removeCrosshairs();

  var crosshairs=document.createElement("img");
  crosshairs.src='crosshair.gif';
  crosshairs.style.width=crosshairsSize+'px';
  crosshairs.style.height=crosshairsSize+'px';
  crosshairs.style.border='0';
  crosshairs.style.position='relative';
  crosshairs.style.top=((container.clientHeight-crosshairsSize)/2)+'px';
  crosshairs.style.left=((container.clientWidth-crosshairsSize)/2)+'px';
  crosshairs.style.zIndex='500';
  container.appendChild(crosshairs);
  this.crosshairs=crosshairs;
  return crosshairs;
};

GMap2.prototype.removeCrosshairs=function() {
  this.crosshairs.parentNode.removeChild(this.crosshairs);
  this.crosshairs=null;
};

GMap2.prototype.recenterCrosshairs=function() {
  if(this.crosshairs) {
    var container=this.getContainer();
    this.crosshairs.style.top=((container.clientHeight-crosshairsSize)/2)+'px';
    this.crosshairs.style.left=((container.clientWidth-crosshairsSize)/2)+'px';
  }
};

