﻿
function show_link()
{
//  rand_no=Math.floor(Math.random()*20+1);
//  if (rand_no<=10)
//  {
//  no=100-rand_no;
//  }
//  else
//  {
//  no=100+rand_no;
//  }
//document.getElementById('online').innerHTML="線上人數： "+no+"人";
var now=new Date();
var hours=now.getHours();
var minutes=now.getMinutes();
var seconds=now.getSeconds();

if (hours>=0 && hours<=4)
{
  rand_no=Math.floor(Math.random()*20+1);
  if (seconds%30==0)
  {
  no=95+50+50+50+rand_no;
  }
  else if (seconds%5==0)
  {
  no=105+50+50+50-rand_no;
  }
}

if (hours>=5 && hours<=14)
{
  rand_no=Math.floor(Math.random()*50+1);
  if (seconds%30==0)
  {
  no=140+50+50+20+200+100+rand_no;
  }
  else if (seconds%5==0)
  {
  no=135+50+50+20+200+100-rand_no;
  }
}

if (hours>=15 && hours<=23)
{
  rand_no=Math.floor(Math.random()*50+1);
  if (seconds%30==0)
  {
  no=170+100+50+20+300+100-rand_no;
  }
  else if (seconds%5==0)
  {
  no=165+100+50+20+300+100-rand_no;
  }
}

document.getElementById('online').innerHTML="線上人數： "+no;
}
