function preloadImages() { 
  var d=document; 
  if(d.images){ 
    if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=preloadImages.arguments; 
    for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ 
      d.MM_p[j]=new Image; 
      d.MM_p[j++].src=a[i];
    }
  }
}

function highlight(which) {

  /* swap figure image for highlighted "on" image */

    var jj = 0; // set to 1 for jumping jacks, 0 for normal operations
    if (jj == 1) {
      if (which == "learn") 
        var imgFile = "images2/engage_figure.jpg";
      else if (which == "personalize")
        var imgFile = "images2/engage_figure.jpg";
      if (which == "engage")
        var imgFile = "images2/personalize_figure.jpg";
    }
    else { //if not jumping jacks mode
      var imgFile = "images2/" + which + "_figure_on.jpg";
    }
      
    var imgID = which + 'Figure';
    document.getElementById(imgID).src=imgFile; 

    /* change style of corresponding GoalTerm by changing its class */

    var goalID = 'Goal_' + which;
    var newClass = 'ActiveGoal_' + which;
    document.getElementById(goalID).className = newClass;
}

function unhighlight(which) {

  /* Return to original image  */

    var imgFile = "images2/" + which + "_figure.jpg";
    var imgID = which + 'Figure';
    document.getElementById(imgID).src=imgFile; 

  /* restore original class of corresponding GoalTerm */
    var goalID = "Goal_" + which;
    document.getElementById(goalID).className = "GoalTermLink";
}
