﻿//-----------------------------------------
    delay = 2000;            // delay time of the animations (.1 sec.)
    imgNumber = 0;          // number of the image in the animation 
    totalimgNumber = 4;     // total number of images
    anim = new Array();     // images array

    // creating image array
    for (i = 0; i < totalimgNumber; i++) 
    {
        anim[i] = new Image (239, 390);
        anim[i].src = '../images/anim/0' + (i + 1) + '.jpg';
    } 
    // switching images
    function Switch() 
    {   
        document.waveanim.src = anim[imgNumber].src;
        imgNumber++;
           if(imgNumber >= totalimgNumber) 
                imgNumber = 0; 
    }
    // animating
    function animate() 
    {
        Switch();
        setTimeout( "animate()", delay);
    }    

//-------------------------------

    delay1 = 3000;            // delay time of the animations (.1 sec.)
    imgNumber1 = 0;          // number of the image in the animation 
    totalimgNumber1 = 4;     // total number of images
    anim1 = new Array();     // images array

    // creating image array
    for (i = 0; i < totalimgNumber1; i++) 
    {
        anim1[i] = new Image(239, 390);
        anim1[i].src = '../images/anim/2' + (i + 1) + '.jpg';
    } 
    // switching images
    function Switch1() 
    {   
        document.waveanim1.src = anim1[imgNumber1].src;
        imgNumber1++;
           if(imgNumber1 >= totalimgNumber1) 
                imgNumber1 = 0; 
    }
    // animating
    function animate1() 
    {
        Switch1();
        setTimeout( "animate1()", delay1);
    }
//------------------------------

    delay2 = 300;            // delay time of the animations (.1 sec.)
    imgNumber2 = 0;          // number of the image in the animation 
    totalimgNumber2 = 2;     // total number of images
    anim2 = new Array();     // images array

    // creating image array
    for (i = 0; i < totalimgNumber2; i++) 
    {
        anim2[i] = new Image(239, 390);
        anim2[i].src = '../images/anim/1' + (i + 1) + '.jpg';
    } 
    // switching images
    function Switch2() 
    {   
        document.waveanim2.src = anim2[imgNumber2].src;
        imgNumber2++;
           if(imgNumber2 >= totalimgNumber2) 
                imgNumber2 = 0; 
    }
    // animating
    function animate2() 
    {
        Switch2();
        setTimeout( "animate2()", delay2);
    }

//-----------------------------

    delay3 = 5700;            // delay time of the animations (.1 sec.)
    imgNumber3 = 0;          // number of the image in the animation 
    totalimgNumber3 = 3;     // total number of images
    anim3 = new Array();     // images array

    // creating image array
    for (i = 0; i < totalimgNumber3; i++) 
    {
        anim3[i] = new Image(239, 390);
        anim3[i].src = '../images/anim/3' + (i + 1) + '.jpg';
    } 
    // switching images
    function Switch3() 
    {   
        document.waveanim3.src = anim3[imgNumber3].src;
        imgNumber3++;
           if(imgNumber3 >= totalimgNumber3) 
                imgNumber3 = 0; 
    }
    // animating
    function animate3() 
    {
        Switch3();
        setTimeout( "animate3()", delay3);
    }

//-----------------------------

function init()
{
    document.waveanim = new Object();
    document.waveanim1 = new Object();
    document.waveanim2 = new Object();   
}

function start()
{
    init();
    animate();
    animate1();
}


