function $(id){
    return document.getElementById(id);
}

function show(id){
    document.getElementById(id).style.display="";
}

function hide(id){
    document.getElementById(id).style.display="none";
}

function showtime(t1,t2,t3,t4,t5,t6,type)
{
	var t = new Date(t1,t2,t3,t4,t5,t6);
	t = new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds())); 
	var Y=t.getFullYear();
	var S=Y.toString().substring(2);
    var M=t.getMonth()+1;    
    var d=t.getDate();
    var h=t.getHours();
    var m=t.getMinutes();
    if(M<10) M="0" + M;
    if(d<10) d="0" + d;
    if(h<10) h="0" + h;
    if(m<10) m="0" + m;
    if(type==1)
        document.write(M+"/" + d +" " +h+":"+m);
    else if(type==2)
        document.write(M+"/" + d +"/"+S+" " +h+":"+m);
    else if(type==3)
        document.write(M+"/" + d +"/"+Y);
    else if(type==4)
       document.write(M+"/" + d +"/"+S+"<br>" +h+":"+m);
    else
       document.write(M+"/" + d +"/"+Y+" " +h+":"+m);
}

function BaskOdds(id){
    window.open('http://data.nowgoal.com/OddsCompBasket.aspx?id='+id,'_blank');
}
function thai_BaskOdds(id){
    window.open('http://data.nowgoal.com/thai/OddsCompBasket.aspx?id='+id,'_blank');
}

function OddsDetail(id,flag){
    var window_width = 500;
    var window_height = 300;
    var window_top = 200;
    var window_left = (screen.width-window_width)/2;
    newWindow=window.open('http://data.nowgoal.com/NBA/OddsDetail.aspx?oddsID='+id+"&flag="+flag,'odds','width=' + window_width + ',height=' + window_height + ',top=' + window_top + ',left=' + window_left + '');
}
function thai_OddsDetail(id,flag){
    var window_width = 500;
    var window_height = 300;
    var window_top = 200;
    var window_left = (screen.width-window_width)/2;
    newWindow=window.open('http://data.nowgoal.com/thai/NBA/OddsDetail.aspx?oddsID='+id+"&flag="+flag,'odds','width=' + window_width + ',height=' + window_height + ',top=' + window_top + ',left=' + window_left + '');
}

function BaskAnalysis(id){
    window.open('/nbaAnalysis/'+id+'.html','_blank');
}

function thai_BaskAnalysis(id){
    window.open('/thai/nbaAnalysis/'+id+'.html','_blank');
}

function SetNodes(id,ifshow){
    var arr=document.getElementsByName(id);
    for(i=0;i<arr.length;i++)
    {
        if(ifshow)
            arr[i].style.display="";
        else
            arr[i].style.display="none";            
    }
}

function showcompanyodds(id,name)
{
   window.open('http://data.nowgoal.com/NBA/Company.aspx?id='+id+'&company='+name,'_blank');
}
function thai_showcompanyodds(id,name)
{
   window.open('http://data.nowgoal.com/thai/NBA/Company.aspx?id='+id+'&company='+name,'_blank');
}
