plugins/gallery/gallery-bits.js
author Dan
Sat, 03 Nov 2007 14:15:52 -0400
changeset 12 3893b99cd443
parent 10 b38afb86dcad
child 42 7c6e2e97aa08
permissions -rw-r--r--
Changed image scaling to use the GD/ImageMagick abstraction function in the latest Coblynau commit. This BREAKS compatibility with 1.0.2b1 and earlier

/*
 * Misc functions for Snapr.
 */

function gal_toggle(elem, img, img_open, img_close)
{
  if ( !img_close || !img_open )
  {
    img_close = scriptPath + '/plugins/gallery/toggle-closed.png';
    img_open  = scriptPath + '/plugins/gallery/toggle-open.png';
  }
  if ( elem.style.display == 'none' || !elem.style.display )
  {
    elem.style.display = 'block';
    try {
      img.src = img_open;
    } catch(e) {};
  }
  else
  {
    elem.style.display = 'none';
    try {
      img.src = img_close;
    } catch(e) {};
  }
}