<!--
function adjImg(img)
{
 var h=img.height;
 var w=img.width;
 if (w>maxWidth)
 {
  img.width=maxWidth;
  img.height=parseInt(h*maxWidth/w);
 }
}
function errorImg(img)
{
  img.src='img/error.gif';
}
function adjDivPos()
{
// by liubin
  var b_divt= document.getElementById('mydivtop');
  var topleft = b_divt.style.left;

  var divb=document.getElementById('divBot');
  var byp=dyp1>dyp2?dyp1:dyp2;
  divb.style.left=topleft-75; //leftxp;
  divb.style.top=byp;

  divb=document.getElementById('divrt');
  divb.style.left=leftxp+525;
  divb.style.height=byp-150;

  divb=document.getElementById('divbg');
  divb.style.left=leftxp;
  divb.style.width=750;
  divb.style.height=byp-150;
}
function showLogin()
{
  var divlog=document.getElementById('loginTab');
  if (!divlog) return;
  divlog.style.display='';
  dyp2=150+document.getElementById('rdiv0').offsetHeight;
  setDivPos(divlog,0);
  var i;
  for (i=1;i<20;i++)
  {
    var nowdiv=document.getElementById('rdiv'+i);
    if (nowdiv) setDivPos(nowdiv,0);
  }
  adjDivPos();
}
function hidenlog()
{
  var divlog=document.getElementById('loginTab');
  divlog.style.display='none';
  dyp2=150+document.getElementById('rdiv0').offsetHeight;
  var i;
  for (i=1;i<20;i++)
  {
    var nowdiv=document.getElementById('rdiv'+i);
    if (nowdiv) setDivPos(nowdiv,0);
  }
   adjDivPos();
}
function reAdjDiv()
{
  var i;
  dyp1=150;
  dyp2=150;
  for (i=0;i<20;i++)
  {
    var nowdiv=document.getElementById('rdiv'+i);
    if (nowdiv) setDivPos(nowdiv,0);
  }
   for (i=0;i<25;i++)
  {
    var nowdiv=document.getElementById('ldiv'+i);
    if (nowdiv) setDivPos(nowdiv,1);
  }
  adjDivPos();
}

function movDiv(tdiv,adxp)
{
	var nlay=document.getElementById(tdiv);
	if (!nlay) return;
	var loc=nlay.style.left;
	loc=loc.substr(0,loc.indexOf('px'));
	if (!loc) loc='0';
	loc=eval(loc)+adxp;
	nlay.style.left=loc;
}
function setAllDiv()
{
  var nwidth=document.body.clientWidth;
  var adxp=parseInt((nwidth-750)/2)-leftxp;
  var i=0;
  var mydivs=new Array('mydivtop','divBot','divbg','divrt','loginTab');
  if(adxp<0)
  {
    adxp=0-adxp;
	if (adxp>leftxp) adxp=leftxp;
	adxp=0-adxp;
  }
  if (adxp!=0)
  {
	for (i=0;i<5;i++) movDiv(mydivs[i],adxp);
	for (i=0;i<20;i++) movDiv('rdiv'+i,adxp);
	for (i=0;i<20;i++) movDiv('ldiv'+i,adxp);
	leftxp+=adxp;
  }
  preWidth=nwidth;
}
function setDivPos(did,left)
{
  did.style.display='';
  if (left)
  {
    did.style.left=leftxp+15;
	did.style.top=dyp1;
	dyp1+=did.offsetHeight;
	did.style.width=490;
	document.getElementById('divbg').style.height=dyp1;
	document.getElementById('divrt').style.height=dyp1;
  }
  else
  {
    did.style.left=leftxp+540;
	did.style.top=dyp2;
	dyp2+=did.offsetHeight;
	did.style.width=200;
  }
}
var colors=new Array("#333333","#555555","#666666","#999999","#aaaaaa","#bbbbbb","#cccccc","#ffffff");
var ncid=0;
function chgcolor()
{
  if (document.getElementById('faibiao'))
  {
     var obj=document.getElementById('faibiao');
     obj.color=colors[ncid];
     ncid=(ncid+1)%8;
  }
}
function ShowTime()
{
 var now=new Date();
 var hours = now.getHours();
 var minu =now.getMinutes();
 var sec=now.getSeconds();
 mydate.innerText=(hours<10?"0":"")+hours+":"+(minu<10?"0":"")+minu+":"+(sec<10?"0":"")+sec;
 //setTimeout("ShowTime()",300);
}
var myTit='勤有功 戏无益';
var myTitBlnk='　　　　　　　　　　　　　　　　　　　　';
var myTitLen=myTit.length;
var myTitP=0;
var wlp=0;
var wld=1;
function showTit()
{
/*   if (myTitP<=myTitLen) top.document.title=myTit.substr(0,myTitP);
   else if(myTitP<=myTitLen+10)
   {
     if (myTitP%2) top.document.title=myTit;
	 else top.document.title=myTitBlnk;
   }
   else myTitP=0;
   myTitP++;
*/ // commented by liubin, I do not like shining header   
}
var isAdj=0;
function mycyc()
{
  ShowTime();
  chgcolor();
  showTit();
  if (isAdj==0)
  {
    myadj();
    reAdjDiv();
    isAdj=1;
  }
  if (document.body.clientWidth!=preWidth) setAllDiv();
  setTimeout("mycyc()",200);
}

function checkBrowser() 
{ 
 this.ver=navigator.appVersion 
 this.dom=document.getElementById?1:0 
 this.ie6=(this.ver.indexOf("MSIE")>-1 && this.dom)?1:0; 
 this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; 
 this.ie4=(document.all && !this.dom)?1:0; 
 this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
 this.ns4=(document.layers && !this.dom)?1:0; 
 this.mac=(this.ver.indexOf('Mac') > -1) ?1:0; 
 this.ope=(navigator.userAgent.indexOf('Opera')>-1); 
 this.ie=(this.ie6 || this.ie5 || this.ie4) 
 this.ns=(this.ns4 || this.ns5) 
 this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns5 || this.ns4 || this.mac || this.ope) 
 this.nbw=(!this.bw) 
 return this; 
}

function ie()
{
  var theie=checkBrowser();
  return (theie.ie && !theie.ope && !theie.ns);
}
var isIE=ie();
function myadj()
{
  var i=0;
  picrd=1;
  while (document.images[i])
  {
   adjImg(document.images[i]);
   i++;
  }
}
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function setVal(vid,val)
{
  document.getElementById('sel_'+vid).value=val;
}
function myvote(vid)
{
 if (document.getElementById('sel_'+vid).value==0)
 {
   alert('您还没有选择投票选项');
   return;
  }
  else
  {
    var url='dovote.php?act=do&vid='+vid+'&iid='+document.getElementById('sel_'+vid).value;
	showModalDialog(url, "", "dialogWidth:400px;dialogHeight:400px;status:no;help:no;scrollbar:no");
  }
}
function view_vote(vid)
{
  var url='dovote.php?vid='+vid;
  showModalDialog(url, "", "dialogWidth:400px;dialogHeight:400px;status:no;help:no;scrollbar:no");
  //popUpWindow(url, 200, 200, 400, 400);
}
//->