

/* Function for shuffling a set of stepped images, 
 * where the set can be of any size.
 *
 * Parameters:
 * image - a string prefix identifying the element class
 * total - the total number of images of this class
 * n     - a number identifying the image to be shown upper-most
 */
function promote (image, total, n) {

  // iterate over each image 
  for(i=1; i<=(total); i++) {
    if(i<n) {
      //left => step up to the upper-most image
      document.getElementById(image + i).style.zIndex = (total - (n-i));
    }
    else if(i==n) {
      //alert("i==n");
      //upper-most
      document.getElementById(image + i).style.zIndex = total;
    }
    else if(i>n) {
      //alert("i>n");
      //right => step down from upper-most
      document.getElementById(image + i).style.zIndex = n - i;
    }
    // now simulate mouse out for the image
    document.getElementById(image + i).onmouseout();
  }
}


