//显示北京时区的当前时间
function ShowDate()
{
  tmpDate = new Date();
  date = tmpDate.getDate();
  month= tmpDate.getMonth() + 1 ;
  year= tmpDate.getYear();
  document.write(year);
  document.write("年");
  document.write(month);
  document.write("月");
  document.write(date);
  document.write("日 ");


  myArray=new Array(6);
  myArray[0]="星期日"
  myArray[1]="星期一"
  myArray[2]="星期二"
  myArray[3]="星期三"
  myArray[4]="星期四"
  myArray[5]="星期五"
  myArray[6]="星期六"
  weekday=tmpDate.getDay();
  if (weekday==0 | weekday==6)
  {document.write(myArray[weekday])}
  else
  {document.write(myArray[weekday])
  }
}


//每天早上9点进行时间变化
function ShowDiffDate()
{
  tmpDate = new Date();
  hrs=tmpDate.getHours();
  tmpHrs=hrs-9;
  tmpDate.setHours(tmpHrs);
  date = tmpDate.getDate();
  month= tmpDate.getMonth()+1;
  document.write((month)+"."+(date));
}

//显示不同时区的时间
function ShowTime()
{
  var strTime=""
  //设定时区差
  nhr=new Array(3)
  nhr[0]="纽约时间"
  nhr[1]="东京时间"
  nhr[2]="伦敦时间"
  tmpDate=new Date();
  tmpHrs=tmpDate.getHours();
  dhr=new Array(3)
  dhr[0]=-13
  dhr[1]=1
  dhr[2]=-8
   
  strTime=strTime+"<table width=100% cellspacing=0 cellpadding=0>"
  for (var i=0;i<3;i++)
  {
    strTime=strTime+"<tr><td height=20 align=center><font color=#003399>"+nhr[i]+" "
    //alert (tmpDate)
    tmpDate=new Date();
    tmpHrs=tmpDate.getHours();
    dhr[i]=tmpHrs+dhr[i]
    tmpDate.setHours(dhr[i]);
    date=tmpDate.getDate();
    month=tmpDate.getMonth()+1 ;
    hrs=tmpDate.getHours();
    mins=tmpDate.getMinutes();
    //secs=tmpDate.getSeconds();
    if(hrs<10)
    hrs="0"+hrs;
    if(mins<10)
    mins="0"+mins;
    //if(secs<10)
    //secs="0"+secs;
    strTime=strTime+(month);
    strTime=strTime+("/");
    strTime=strTime+(date);
    strTime=strTime+(" ");
    strTime=strTime+(hrs);
    strTime=strTime+(":");
    strTime=strTime+(mins);
    //strTime=strTime+(":");
    //strTime=strTime+(secs);
    strTime=strTime+"</font></td></tr>";
  }
  strTime=strTime+"</table>"  
  SpanTimeZone.innerHTML=strTime
  setTimeout('ShowTime()',1000);
}

function ShowWin(x)
{
  xx=screen.width/2-330;yy=screen.height/2-280;
  if (x==1)
  {
    cnt=0;Str=""
    for (i=0;i<document.form1.Item.length;i++)
    {
      if (document.form1.Item(i).checked)
      {
        cnt++;Str=Str+document.form1.Item(i).value+','
      }
    }
    if (cnt==0)
    {
      window.alert("请选择其中一项您感兴趣的内容！");return false
    }
    else
    {
      window.open('GetVote.asp?VoteStr='+Str,'','toolbar=no,height=300,width=490,left='+xx+',top='+yy+',status=no,scroll bars=no,resizable=no');
    }
  }
  else
  {
    window.open('ShowVote.asp','','toolbar=no,height=300,width=490,left='+xx+',top='+yy+',status=no,scroll bars=no,resizable=no');
  }
}



 function OpenWin(url,width,height)
 {
     
   window.open(url,'','width='+width+',height='+height+',scrollbars=no,location=no,toolbar=no')
 }

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
