function mouseOver(id) {
  var img = document.getElementById(id);
  img.src = img.src.replace('icon.', 'hover.');
}

function mouseOut(id) {
  var img = document.getElementById(id);
  img.src = img.src.replace('hover.', 'icon.');
}

function do_font_resize(size) {
  var entry = document.getElementById('entry');
  if (entry) {
    if (entry.style.fontSize) {
      var s = entry.style.fontSize;
      s = s.replace("em","");
      s = parseFloat(s);
    } else {
      s = default_font_size;
    }
    if (size == 'smaller') {
      s = s - font_size_step;
    } else {
      s = s + font_size_step;
    }
    if (s < (default_font_size - font_size_range) ) { s = (default_font_size - font_size_range); }
    if (s > (default_font_size + font_size_range) ) { s = (default_font_size + font_size_range); }
    entry.style.fontSize = s + 'em';
  }
}

function do_load_runway() {

  var widget = Runway.createOrShowInstaller(
      document.getElementById("runway"),
      {
        slideSize             : 240,
        reflectivity          : 0.7,
        reflectionExtent      : 0.5,
        spread                : 0.6,
        centerSpread          : 0.7,
        recede                : 2,
        tilt                  : 60,
        backgroundGradient    : 'single',
        backgroundColor       : '#FFFFFF',
        showTitle             : false,
        // titleFontFamily       : 'Tahoma',
        // titleFontSize         : 12,
        // titleFontBold         : true,
        // titleColor            : '#FFFFFF',
        showSubtitle          : false,

        // event handlers
        onReady: function() {
          widget.setRecords(records);
          // widget.select(5);
        },
        onSelect: function(index, id) {
          var record = records[index];
          var reference_link = document.getElementById('reference_link');
          reference_link.innerHTML = '<a href="' + record.url + '" target="_blank">' + record.title + '</a>';
        }
      }
    );

}
