var preloaded = new Array();
function preloadImages()
{
    for (var i = 0; i < arguments.length; i++)
    {
        preloaded[i] = document.createElement('img');
        preloaded[i].setAttribute('src',arguments[i]);
    };
};

function swapImage(id,image)
{
   img = document.getElementById(id);
   if(img != null)
   {
      img.setAttribute('src',image);
   }
}

function sh(bid)
{
	var act=(document.getElementById(bid).style.display == 'none') ? 'block' : 'none';
	document.getElementById(bid).style.display = act;
}

function banana(id,cnt)
{
   this.id = id;
   this.cnt = parseInt(cnt);
   this.idx = 0;

   this.run = function()
   {
      this.iTimerID = window.setInterval('ban.ff()', 7000);
      //this.ff();
   }

   this.ff = function()
   {
      var id = this.id+this.idx; 
      document.getElementById(id).style.display = 'none';
      this.idx = (this.idx<(this.cnt-1))?this.idx+1:0; 
      id = this.id+this.idx;
      document.getElementById(id).style.display = 'block';
   }
   
   this.rw = function()
   {
      var id = this.id+this.idx;
      document.getElementById(id).style.display = 'none';
      this.idx = (this.idx>0)?this.idx-1:this.cnt-1;
      id = this.id+this.idx;
      document.getElementById(id).style.display = 'block';
   }
}