////
//// support code for MIT Music Program site map page
////

//
// required:
//   jquery.js (version 1.2.6+) (see jquery.com)
//

$(document).ready(function(){

  //
  // iterate through maplist to find venue names;
  // attach hover events to links that show/hide the corresponding map overlays
  //
  //
  $('#maplisttable td').each( function() {
    var venue = $(this).attr('class');

    // attach hover functions to links in list
    //
    $(this).find('a.maplink').mouseover( function() {
      $('#divcampusmap p.'+venue).show();
    });
    $(this).find('a.maplink').mouseout( function() {
      $('#divcampusmap p.'+venue).hide();
    });
    // attach hover functions to image map
    //
    $('#campusmapmap area.'+venue).mouseover( function() {
      $('#divcampusmap p.'+venue).show();
    });
    $('#campusmapmap area.'+venue).mouseout( function() {
      $('#divcampusmap p.'+venue).hide();
    });
    // attach hover functions to overlays
    //
    $('#divcampusmap p.'+venue).mouseover( function() {
      $('#divcampusmap p.'+venue).show();
    });
    $('#divcampusmap p.'+venue).mouseout( function() {
      $('#divcampusmap p.'+venue).hide();
    });

  });


});
