plugins/gallery/gallery-bits.js
author Dan Fuhry <dan@enanocms.org>
Sun, 01 Aug 2010 12:42:21 -0400
changeset 39 e9a7e37bdadd
parent 10 b38afb86dcad
child 42 7c6e2e97aa08
permissions -rw-r--r--
Fixed some PHP warnings and display issues. Brought up to date with 1.1.x plugin management/install/upgrade system.

/*
 * 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) {};
  }
}