function calcTime(offset) 
{
    d = new Date();
    local = d.getTime() 
 
    // create new Date object for different city
    // using supplied offset
    nd = new Date(local + (3600000*offset));
    
    // return time as a string
    return nd.toLocaleString();
}
 
				
function show()
{
  showDT = new Date();
  var Digital=new Date(calcTime(0));
  var dy=showDT.getDate();
  var mth=showDT.getMonth()+1;
  var yr=showDT.getFullYear();
  var hours=Digital.getHours();
  var minutes=Digital.getMinutes();
  var seconds=Digital.getSeconds();
  
 //document.write(hours)
  
  if (hours<=9)
    hours="0"+hours
 
  if (minutes<=9)
   minutes="0"+minutes
 
  if (seconds<=9)
   seconds="0"+seconds
   var ctime="" +yr+'年'+mth+'月'+dy+"日&nbsp;"+hours+":"+minutes+":"+seconds+" (GMT+8)"
 
   document.getElementById('tick').innerHTML=ctime
   setTimeout("show()",1000)
}


function func1(){tablelist();}
function func2(){show();}
function addLoadEvent(func){
var oldonload=window.onload;
if(typeof window.onload!="function"){window.onload=func;}
	else{window.onload=function(){oldonload();func();}};
}
addLoadEvent(func1);
addLoadEvent(func2);

//func1=window.onload;
//window.onload=function(){tablelist();show();}
 
 
 
    function Notice_popUp(URL) 
   {
    id = "Notice"
    eval("page" + id + " = window.open(URL, '" + id + "', 'resizable=no,scrollbars=auto,width=1030,height=800,left=470,top=200');");
   }
 
   function Soccer_popUp(URL) 
   {
    id = "sportsbook"
    eval("page" + id + " = window.open(URL, '" + id + "', 'resizable=no,scrollbars=auto,width=1030,height=720,left=470,top=200');");
   }
   
   
   function Lotto_popUp(URL) 
   {
    id = "Lotto"
    eval("page" + id + " = window.open(URL, '" + id + "', 'resizable=no,scrollbars=yes,width=1110,height=720,left=470,top=200');");
   }
   
   
   //popup window
    var popUpWin=0;
    function popUpWindow(URLStr, width, height)
    {
      var left = (screen.width/2) - width/2;
      var top = (screen.height/2) - height/2;
        
      if(popUpWin)
      {
        if(!popUpWin.closed) popUpWin.close();
      }
      popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
    }



// ----------- Add to Bookmark ----------- //
function addBookmark(title,url) {
	if (window.sidebar){
		window.sidebar.addPanel(title, url,""); }
	else if( document.all ){
		window.external.AddFavorite( url, title);}
	else if( window.opera && window.print ){
		return true;}
	else {
		alert("添加收藏失败，请使用组合快捷键'Ctrl+D'添加！")} /* CHROME,SAFARI */
		}





