
function infoWndMsNSomervale() {
  return "<p class='MapHdr'><a href='MsN.asp'>Midsomer Norton</a></p>" + 
         "<p class='MapAddr'>Somervale School</p>" + 
         "<p class='MapDays'>Tuesday</p>";
}

function infoWndMsN() {
  return "<p class='MapHdr'><a href='MsN.asp'>Midsomer Norton</a></p>" + 
         "<p class='MapAddr'>St John Ambulance Hall</p>" + 
         "<p class='MapDays'>Tuesday</p>";
}

function infoWndPar() {
  return "<p class='MapHdr'><a href='Yeovil-Parcroft.asp'>Yeovil - Parcroft</a></p>" +
          "<p class='MapAddr'>Parcroft Community Junior School<br/>Summerleaze Park</p>" +
          "<p class='MapDays'>Monday</p>";
}


function infoWndBuck() {
  return "<p class='MapHdr'><a href='Yeovil-Bucklers.asp'>Yeovil - Buckler's Mead</a></p>" +
          "<p class='MapAddr'>Buckler's Mead Community School<br/>St Johns Road</p>" +
          "<p class='MapDays'>Wednesday, Friday</p>";
}

 function infoWndHiHam() {
  return "<p class='MapHdr'><a href='HighHam.asp'>High Ham</a></p>" +
          "<p class='MapAddr'>High Ham Primary School<br/>High Ham</p>" +
          "<p class='MapDays'>Tuesday</p>";
}

function infoWndYeovil() {
  return "<p class='MapHdr'>Yeovil</p>" + 
          "<p class='MapAddr'>" +
            "<a href='Yeovil-Bucklers.asp'>Buckler's Mead School</a><br/>" +
            "<a href='Yeovil-Parcroft.asp'>Parcroft Junior School</a>" +
          "</p>";
}

// 580×420: roughly full-screen 640×480 with browser chrome
// Location Map

  var theLoc;
  
  function load(dspDivId, mapDivId, smlMapId, bigMapId, latlng) {
    if (GBrowserIsCompatible()) {
      theLoc = new LocInfo( dspDivId, mapDivId, smlMapId, bigMapId, latlng );
    }
  }
  
  function Show( locInfo ) {
    locInfo.ShowBigMap();
  }
  
  function LocInfo( dspDivId, mapDivId, smlMapId, bigMapId, latlng ) {
    // Google Maps misbehaves if this.bigMap is created (and initialized) in
    // this ctr. (Seems to be something to do with positioning of 'mapDivId' div)
    // Delaying bigMap creation/init until first call to ShowBigMap seems to fix
    // the problem (and saves time on load)
    
	  this.dspDiv = document.getElementById(dspDivId);
	  this.mapDiv = document.getElementById(mapDivId);
    
    this.latlng = latlng;
    this.smlMap = new GMap2(document.getElementById( smlMapId ));
    this.mkSml  = new GMarker(latlng);
    this.mkBig  = new GMarker(latlng);

    this.smlMap.setCenter(latlng, 14, G_NORMAL_MAP);
    this.smlMap.addOverlay(this.mkSml);        
    this.smlMap.disableDoubleClickZoom();
    this.smlMap.disableDragging();

    this.ShowBigMap = function() {
      this.dspDiv.style.display = "";
      this.mapDiv.style.display = "";

      if ( !this.bigMap ) {
        this.bigMap = new GMap2(document.getElementById( bigMapId )); 

        this.bigMap.setCenter(latlng, 14, G_NORMAL_MAP);
        this.bigMap.addControl(new GSmallMapControl());
        this.bigMap.addOverlay(this.mkBig);        
        this.bigMap.addControl(new GMapTypeControl());
        this.bigMap.enableDoubleClickZoom();
        this.bigMap.enableScrollWheelZoom();
      }
      return false;
    }
    
    this.HideBigMap = function() {
      this.dspDiv.style.display = "none";
      this.mapDiv.style.display = "none";
      
      return false;
    }
    
    this.ResetMap = function() {
      this.bigMap.setCenter( this.latlng, 14, G_NORMAL_MAP);
    }
    
    GEvent.addListener( this.smlMap, "click", function() {Show(theLoc);} );
  }
  