// 
// PEEL.js - Managing icon animations next to menu items
//

      delay = 100;                // delay between frames, image size and name of the main section      imgk = 5;      imgname = new Array();      imgs = new Array();      counter = new Array();      peelingup = new Array();      peelingdown = new Array();      currentsection = 'q';      lastover = '';
      function preload(section)       {          if (document.images)          {   	      imgs[section] = new Array();   	      for (i=0; i < imgk; i++)    	      {   		      imgs[section][i] = new Image();   		      imgs[section][i].src = 'images/' + imgname[section] + i + ".gif";   	      }   	      counter[section] = 1;         }      }      // Load prefix of image name      imgname['a'] = 'h';      imgname['b'] = 'i';      imgname['c'] = 'a';
      imgname['d'] = 'p';      imgname['e'] = 'c';             // Preload gifs      preload('a');      preload('b');      preload('c');
      preload('d');      preload('e');            // Initialize state of animations      peelingup['a'] = 1;      peelingup['b'] = 1;      peelingup['c'] = 1;
      peelingup['d'] = 1;      peelingup['e'] = 1;             if (currentsection)       {   	   peelingup[currentsection] = 0;   	   peelingdown[currentsection] = 1;      }      function startpeelup(section)       {          if (document.images)          {   	      if (section != currentsection)    	      {   		      startpeeldown(lastover);   		      lastover = section;   		      peelingup[section] = 1;   		      peelingdown[section] = 0;   		      peelup(section);            }         }      }      function startpeeldown(section)       {          if (document.images)          {   	      if (section != currentsection)    	      {   		      peelingdown[section] = 1;   		      peelingup[section] = 0;   		      peeldown(section);            }         }      }      function peelup(section)       {          if (section != currentsection)          {   	      if (! peelingdown[section])    	      {   		      if (counter[section] < imgk)    		      {   			      document.images[section].src = imgs[section][counter[section]].src;   			      if (counter[section] < (imgk-1))    			      {   				      counter[section] = counter[section] + 1;   				      setTimeout("peelup('" + section + "')",delay);                  }               }            }         }      }      function peeldown(section)       {          if (section != currentsection)          {   		   if (! peelingup[section])    		   {   		      if (counter[section] > -1)    		      {      			   document.images[section].src = imgs[section][counter[section]].src;   			      if (counter[section] > 0)    			      {   				      counter[section] = counter[section] - 1;   				      setTimeout("peeldown('" + section + "')",delay);                  }               }            }         }      }
