  /* for vogue legacy slideshows only!!! */
  
function runOnLoad(f) {
    if (runOnLoad.loaded) f();    // If already loaded, just invoke f() now.
    else runOnLoad.funcs.push(f); // Otherwise, store it for later
}

runOnLoad.funcs = []; // The array of functions to call when the document loads
runOnLoad.loaded = false; // The functions have not been run yet.

// Run all registered functions in the order in which they were registered.
// It is safe to call runOnLoad.run() more than once: invocations after the
// first do nothing. It is safe for an initialization function to call
// runOnLoad() to register another function.
runOnLoad.run = function() {
    if (runOnLoad.loaded) return;  // If we've already run, do nothing
    for(var i = 0; i < runOnLoad.funcs.length; i++) {
        try { runOnLoad.funcs[i](); }
        catch(e) { /* An exception in one function shouldn't stop the rest */ }
    }
    
    runOnLoad.loaded = true; // Remember that we've already run once.
    delete runOnLoad.funcs;  // But don't remember the functions themselves.
    delete runOnLoad.run;    // And forget about this function too!
};

// Register runOnLoad.run() as the onload event handler for the window
if (window.addEventListener)
    window.addEventListener("load", runOnLoad.run, false);
else if (window.attachEvent) window.attachEvent("onload", runOnLoad.run);
else window.onload = runOnLoad.run;
  
  /* master roll over code                 
   Author : Daniel Nolan
   http://www.bleedingego.co.uk/webdev.php
   add the attribute class="imgover" to images that requires a mouseover 
     this image must be named exactly the same as the original image,      
   but it needs _o on the end of the name in the same directory as the   
   original.                               
  */
  
function initRollovers() {
  if (!document.getElementById) return
  
  var aPreLoad = new Array();
  var sTempSrc;
  var aImages = document.getElementsByTagName('img');
  
  for (var i = 0; i < aImages.length; i++) {    
    if (aImages[i].className == 'imgover') {
      var src = aImages[i].getAttribute('src');
      var ftype = src.substring(src.lastIndexOf('.'), src.length);
      var hsrc = src.replace(ftype, '_on'+ftype);

      aImages[i].setAttribute('hsrc', hsrc);
      
      aPreLoad[i] = new Image();
      aPreLoad[i].src = hsrc;
      
      aImages[i].onmouseover = function() {
        sTempSrc = this.getAttribute('src');
        this.setAttribute('src', this.getAttribute('hsrc'));
      } 
      
      aImages[i].onmouseout = function() {
        if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_on'+ftype, ftype);
        this.setAttribute('src', sTempSrc);
      }
    }
  }
}

runOnLoad(initRollovers);