﻿// JScript File
// Created  : 12.12-2008 ELY
// Add animation to productdetails, if there is more than 1 image on the product
//---------------------------------------------------------------------------
// Handle Product show detail image animation
//---------------------------------------------------------------------------
    var elem = "";
    var counter = 0;
    var tTimer; 
    var aImage = new Array;
//---------------------------------------------------------------------------
    function ShowImage()
    {
        elem.src = aImage[counter];
        counter +=1;
        
        if (counter >= aImage.length)
            counter = 0;
        tTimer = window.setTimeout("ShowImage()",5000);    
    }
//---------------------------------------------------------------------------
    function StartToogleImage(sImages, sClientId)
    {
        elem = document.getElementById(sClientId);
        aImage = sImages.split(';');
        elem.src= aImage[counter].toString();
        counter = 1;
        tTimer = window.setTimeout("ShowImage()",5000);
   }
//---------------------------------------------------------------------------
    function StopImageAnimation(action, o)
    {
        if (action)
        {
            window.clearTimeOut(tTimer);
        }
        else
        {
            tTimer = window.setTimeout("ShowImage()",5000);
        }   
    }
//---------------------------------------------------------------------------
    function test()
    {
        alert (typeof(tTimer));
    }
