var _ImageFX1 = new Array();

function ImageFX1(time, image, list, link)
{

this.index =                                    _ImageFX1.length;
_ImageFX1[this.index] =                         this;
this.obj =                                      '_ImageFX1['+this.index+']';

this.time =                                     time;
this.image =                                    image;
this.list =                                     list;
this.link =                                     link;

this.curr_nr =                                  0;
this.slideshow_flag =                           true;


   this.Main = function()
   {
      this.parent =                             document.getElementById(this.image + 0).parentNode;
      this.child_nr =                           this.parent.childNodes.length;
   }
   

   this.HideAll = function()
   {
      for (var i = 0; i < this.child_nr; i++)
      {
         document.getElementById(this.image + i).style.display = 'none';
         document.getElementById(this.link + i).style.background = '#FFFFFF';
         document.getElementById(this.link + i).style.color= '#000000';
      }
   }

   this.ShowDiv = function(slideshow_flag, nr)
   {
      this.slideshow_flag = slideshow_flag;

      if (!slideshow_flag)
      {
         this.curr_nr = 0;
      }

      this.HideAll();
      document.getElementById(this.image + nr).style.display = 'block';
      document.getElementById(this.link + nr).style.background = '#3260AF url(../_d/blogi/bullet2.gif) no-repeat top right';
      document.getElementById(this.link + nr).style.color= '#FFFFFF';
   }

   this.SlideShow = function()
   {
      if (this.slideshow_flag)
      {
         this.HideAll();
         this.ShowDiv(this.slideshow_flag, this.curr_nr);

         if (this.curr_nr < this.child_nr - 1)
         {
            this.curr_nr++;
         }
         else
         {
            this.curr_nr = 0;
         }
      }

      window.setTimeout(this.obj+'.SlideShow()', this.time);
   }

   this.Main();
}


var _ImageFX2 = new Array();


function ImageFX2(image_minus, image_plus)
{
this.index =                                    _ImageFX2.length;
_ImageFX2[this.index] =                         this;
this.obj =                                      '_ImageFX2['+this.index+']';

this.image_minus =                              image_minus;
this.image_plus =                               image_plus;

   this.Main = function()
   {
      this.parent =                             document.getElementById(this.image + 0).parentNode;
      this.child_nr =                           this.parent.childNodes.length;
   }
   
   this.HideAll = function()
   {
      for (var i = 0; i < (this.child_nr / 2); i++)
      {
         document.getElementById(this.image_minus + i).style.display = 'none';
         document.getElementById(this.image_plus + i).style.display = 'block';
      }
   }

   this.ShowDiv = function(full_flag, nr)
   {
      this.HideAll();
      document.getElementById(this.image_minus + nr).style.display = 'block';
      document.getElementById(this.image_plus + nr).style.display = 'none';
   }


   this.Main();
}


var _ImageFX3 = new Array();


function ImageFX3(time, image)
{

this.index =                                    _ImageFX3.length;
_ImageFX3[this.index] =                         this;
this.obj =                                      '_ImageFX3['+this.index+']';

this.time =                                     time;
this.image =                                    image;

this.curr_nr =                                  -1;
this.slideshow_flag =                           true;

   this.Main = function()
   {
      this.parent =                             document.getElementById(this.image + 0).parentNode;
      this.child_nr =                           this.parent.childNodes.length;
   }
   
   this.ChangeNr = function(value)
   {
      this.curr_nr += value;
      
      if (this.curr_nr > this.child_nr - 1)
      {
         this.curr_nr = 0;
      }
      if (this.curr_nr < 0)
      {
         this.curr_nr = this.child_nr - 1;
      }
   }

   this.HideAll = function()
   {
      for (var i = 0; i < this.child_nr; i++)
      {
         document.getElementById(this.image + i).style.display = 'none';
      }
   }

   this.ShowDiv = function(slideshow_flag, nr)
   {
      this.slideshow_flag = slideshow_flag;


      this.HideAll();
      document.getElementById(this.image + nr).style.display = 'block';
   }

   this.ChangeFlag = function()
   {
      this.slideshow_flag = !this.slideshow_flag;
   }

   this.Skip = function(value)
   {
      this.ChangeNr(value)

      this.HideAll();
      document.getElementById(this.image + this.curr_nr).style.display = 'block';
   }

   this.SlideShow = function()
   {
      if (this.slideshow_flag)
      {
         this.ChangeNr(1)

         this.ShowDiv(this.slideshow_flag, this.curr_nr);
      }

      window.setTimeout(this.obj+'.SlideShow()', this.time);
   }


   this.Main();
}

