//////////////////////////////
//(c)inti.pl
//////////////////////////////


var pCurrentSlideIdx = 0;
var pSlideshowTimeout;
var pSlideArray, pSlideBox;
var pShowtime;

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
function iSlideShow()
   {
   for (var i=0; i < pSlideArray.length; i++)
     {
     if (i == pCurrentSlideIdx)
        pSlideArray[i].className = "slideS";
     else
        pSlideArray[i].className = "slideH";
     }

   if (pCurrentSlideIdx == (pSlideArray.length - 1))
      pCurrentSlideIdx = 0;
   else
      pCurrentSlideIdx++;

   pSlideshowTimeout = setTimeout("iSlideShow()", pShowtime);
   }

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
function iNextSlide()
   {
   clearTimeout(pSlideshowTimeout);
   iSlideShow();
   }

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
function iPrevSlide()
   {
   clearTimeout(pSlideshowTimeout);
   dx = pCurrentSlideIdx - 2;
   if (dx >= 0)
      pCurrentSlideIdx = dx;
   else
      pCurrentSlideIdx = pSlideArray.length + dx;

   if (pCurrentSlideIdx < 0)
      pCurrentSlideIdx = 0;

   iSlideShow();
   }

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
function iSlideShowInit (slideName, _showtime)
   {
   pShowtime = _showtime;
   clearTimeout(pSlideshowTimeout);
   pCurrentSlideIdx = 0;

   var pSlideBox = document.getElementById(slideName);//.getElementsByTagName("li");
   if (pSlideBox != null)
      {
      pSlideArray = pSlideBox.getElementsByTagName("div");

      if (pSlideArray != null)
         iSlideShow();
      }
   }



//Drop down menu
sfHover = function() {
    if (document.all && document.getElementById) {
        var sfEls = document.getElementById("nav");//.getElementsByTagName("li");
        if (sfEls != null)
           {
           sfEls = sfEls.getElementsByTagName("li");
           for (var i=0; i < sfEls.length; i++) {
               sfEls[i].onmouseover = function() {
                   this.className += " sfhover";
               }
               sfEls[i].onmouseout = function() {
                   this.className = this.className.replace(new RegExp(" sfhover\\b"), "");
               }
           }
        }
    }
}

