﻿var tolongboMaxDis = 670;
var tabCount = 3;
var x_val = 500;
var newCitizen;
var timer;
function switchTab(tabId)
{
if(tabId<1 || tabId>tabCount){return;}
var currentTab = document.getElementById("tab" + tabId);
if (currentTab != null) {
    currentTab.style.visibility = "visible";
    currentTab.style.zIndex = 200;
}
 var tempTab;
 for(i=1; i<=tabCount; i++)
 {
  if(i!=tabId)
    {
     tempTab = document.getElementById("tab"+i);
     if (tempTab != null) { tempTab.style.visibility = "hidden"; }
    
    }
 }
}


function starttimer() {
    document.getElementById('ctl00_tolongbo').style.visibility = "visible";
    document.getElementById('ctl00_tolongbo').style.position = "relative";
    document.getElementById('ctl00_tolongbo').style.left = +x_val;
    x_val++;

    if (x_val >= tolongboMaxDis) {
        stoptimer();
    }
    else {
        timer = setTimeout("starttimer()", 10);
    }
}
function stoptimer() {
    clearTimeout(timer);
    timer = null;
}
