﻿// JScript File
var x = 4;
    var y = 1;
    var beltImg=new Array();
    var Img2;
    var count;
    var logoimage=new Array();
    var imgLogo;
    var ImgLogo2;
    var countLogo;
    var bImage=new Array();
    function initVar()
    {
        //Img=document.getElementById('hdnBeltImg');
        Img2='About-us.jpg,About-us1.jpg,About-us2.jpg,About-us3.jpg';
        beltImg=Img2.split(",");
        count=beltImg.length;
        
        //adding all the image's src into an image Object Src.
        for(i=0;i<count;i++)
        {
            var aa=new Image();
            bImage[i]=aa;
            bImage[i].src="images/" + beltImg[i];
        }
        
        document.getElementById("rndImg").src=bImage[0].src;
    }
    
    function startClock()
    {
        x = x-y;
        setTimeout("startClock()", 1500);
        if(x==0)
        {
            showBelt();
            //showLogo();
            x=5;
        }
    }
    
    function exchangebelt()
    {
        //This function increase the position of the elements in the array for ex 1st come to last and 2 to 1st 3 to 2nd position  
        var x = new Image();
        var x1 = new Image();
        var x2 = new Image();
        var tempVal;
        //tempVal=beltImg[0];
        tempVal=bImage[0];
        //alert(count);
        for(var i=0;i<count-1;i++)
        {
            //beltImg[i]=beltImg[i+1];
            bImage[i]=bImage[i+1];
        }
        bImage[i]=tempVal;
    }
    
    function showBelt()
    {
        document.getElementById("rndImg").src= bImage[0].src;
        exchangebelt();
    }
    
    function startBelt()
    {
        initVar();
        startClock();
    }


