	function delayer(){
    window.location = "/" 
    }
var arrImageRotatorVideoId = new Array(10);
arrImageRotatorVideoId[0] = 10;
arrImageRotatorVideoId[1] = 11;
arrImageRotatorVideoId[2] = 22;
arrImageRotatorVideoId[3] = 33;
arrImageRotatorVideoId[4] = 44;
arrImageRotatorVideoId[5] = 55;
arrImageRotatorVideoId[6] = 66;
arrImageRotatorVideoId[7] = 77;
arrImageRotatorVideoId[8] = 88;
arrImageRotatorVideoId[9] = 99;

var currentIndex=0;
var isRoll = true;
var isChangeRollTime = true;
var _pre = "divVideo";
var timer = null;
var timeSpan = 5000;
var firstImageTimeSpan = 5000;
function go(flag)
{
    if (flag == 1)
    {
        if(isRoll || !isChangeRollTime)
        {
            if (currentIndex == arrImageRotatorVideoId.length - 1)
            {
                currentIndex = 0;
            }
            else
            {
                currentIndex += 1;
            }
            
            show(arrImageRotatorVideoId[currentIndex]);
        }
        
        
        if (timer != null)
        {
            clearTimeout(timer);
            timer = null;
        }
        
        goOnMove();
        
        isRoll = true;
     }
    
    if (flag == -1)
    {
        if(isRoll || !isChangeRollTime)
        {
            if (currentIndex == 0)
            {
                currentIndex = arrImageRotatorVideoId.length -1;
            }
            else
            {
                currentIndex -= 1;
            }
            
            show(arrImageRotatorVideoId[currentIndex]);
        }
        
        clearTimeout(timer);
        timer = null;
        isRoll = false;
    }
    
    if (flag == 0)
    {
        pause();
    }
}

function show(videoId)
{            
    
    for (i = 0;i < arrImageRotatorVideoId.length; i ++)
    {   
        if (arrImageRotatorVideoId[i] == videoId)
        {
            document.getElementById(_pre + arrImageRotatorVideoId[i]).style.display = "block";
            document.getElementById(_pre + arrImageRotatorVideoId[i]).style.visibility = "visible";
        }
        else
        {
            document.getElementById(_pre + arrImageRotatorVideoId[i]).style.display = "none";
            document.getElementById(_pre + arrImageRotatorVideoId[i]).style.visibility = "hidden";
        }
    }    
    
}


function goOnMove()
{
    if (currentIndex == 0)
    {
        timer = setTimeout("go(1)", firstImageTimeSpan);
    }
    else
    {
        timer = setTimeout("go(1)", timeSpan);
    }
}
if (arrImageRotatorVideoId.length > 0)
{
    show(arrImageRotatorVideoId[0]);
    currentIndex = 0;    
    goOnMove();
}

