ckp
[plewww.git] / plekit / niftycorner / nifty_init.js
1 /* 
2   $Id$
3
4  instead of explicitly calling 
5  Nifty ('div#$id','medium');
6  on every single element as the original niftycube.js recommends, 
7  we just do that on every element that has one of the
8  the nifty-{small,medium,big} class set
9 */
10
11 var nifty_inited = false;
12
13 function nifty_init () {
14   if ( nifty_inited ) return;
15   var elements=document.getElementsByClassName('nifty-medium');
16   for (var i=0; i<elements.length; i++) {
17     // somehow we catch something with an empty id
18     id = elements[i].id;
19     if (id) 
20       Nifty('div#'+id,'medium');
21   }
22   nifty_inited = true;
23 }
24