plugins/gallery/gallery-bits.js
changeset 10 b38afb86dcad
parent 0 7caf561c50ee
child 42 7c6e2e97aa08
--- a/plugins/gallery/gallery-bits.js	Thu Aug 09 12:31:24 2007 -0400
+++ b/plugins/gallery/gallery-bits.js	Thu Aug 09 12:34:39 2007 -0400
@@ -1,5 +1,5 @@
 /*
- * Misc functions for Enano.Img Gallery.
+ * Misc functions for Snapr.
  */
 
 function gal_toggle(elem, img, img_open, img_close)
@@ -9,15 +9,19 @@
     img_close = scriptPath + '/plugins/gallery/toggle-closed.png';
     img_open  = scriptPath + '/plugins/gallery/toggle-open.png';
   }
-  if ( elem.style.display == 'block' )
+  if ( elem.style.display == 'none' || !elem.style.display )
   {
-    elem.style.display = 'none';
-    img.src = img_close;
+    elem.style.display = 'block';
+    try {
+      img.src = img_open;
+    } catch(e) {};
   }
   else
   {
-    elem.style.display = 'block';
-    img.src = img_open;
+    elem.style.display = 'none';
+    try {
+      img.src = img_close;
+    } catch(e) {};
   }
 }