var ListUpdater=function(){this.K=null;this.G=[];this.H=[];this.Y={};this.V=-1;this.R=10*1000;this.L=null;this.W=-1;this.Q=2*1000;this.U=0;this.S=40;this.P=0;this.T=0;this.ab=function(){return(new Date()).getTime();};this.N=function(w){return document.getElementById(w);};this.J=function(l){var F=this;return function(){return l.apply(F,arguments);};};this.O=function(f){var k=document.createElement("script");k.type="text/javascript";k.src="http://hq.sinajs.cn/rn="+this.ab()+"&list="+f.join(",");k[document.all?"onreadystatechange":"onload"]=function(){if(document.all&&this.readyState!="loaded"&&this.readyState!="complete"){return;}window["processListUpdater"]();this[document.all?"onreadystatechange":"onload"]=null;this.parentNode.removeChild(this);};this.K.appendChild(k);};this.aa=function(){for(var i=0;i<this.G.length;i++){if(typeof window["hq_str_"+this.G[i]]!="undefined"){var e=window["hq_str_"+this.G[i]].split(",");if(window["hq_str_"+this.G[i]]!=""){if(e[3]*1==0){for(var j=1;j<34;j++){if(j!=2){e[j]="--";}}e[3]="--";e[34]="black";e[35]=this.G[i];}else{e[8]=(e[8]*1/100).toFixed(0);e[9]=(e[9]*1/10000).toFixed(2);e[32]=(e[3]-e[2]).toFixed(2);e[33]=(e[32]/e[2]*100).toFixed(2);e[34]=e[32]>0?"red":(e[32]<0?"green":"black");e[35]=this.G[i];}this.Y["key_"+this.G[i]]=e;}}}this.M();};this.X=function(){var g=0;var f=[];for(var i=0;i<this.G.length;i++){f.push(this.G[i]);g++;if(g>=40){g=0;this.O(f);f=[];}}if(f.length>0){this.O(f);}};this.I=function(n){if(n==this.P){return["","down","up"][this.T];}else{return "";}};this.M=function(){var v="";v+='<table class="datatbl" id="datatbl"><thead><tr><th>名称</th><td><a href="#" onclick="return window[\'reorderListUpdater\'](33)">涨跌幅(%)</a><label class="'+this.I(33)+'">&nbsp;&nbsp;</label></td><td><a href="#" onclick="return window[\'reorderListUpdater\'](3)">最新价</a><label class="'+this.I(3)+'">&nbsp;&nbsp;</label></td><td><a href="#" onclick="return window[\'reorderListUpdater\'](32)">涨跌额</a><label class="'+this.I(32)+'">&nbsp;&nbsp;</label></td><td><a href="#" onclick="return window[\'reorderListUpdater\'](6)">买入价</a><label class="'+this.I(6)+'">&nbsp;&nbsp;</label></td><td><a href="#" onclick="return window[\'reorderListUpdater\'](7)">卖出价</a><label class="'+this.I(7)+'">&nbsp;&nbsp;</label></td><td><a href="#" onclick="return window[\'reorderListUpdater\'](8)">成交量(手)</a><label class="'+this.I(8)+'">&nbsp;&nbsp;</label></td><td><a href="#" onclick="return window[\'reorderListUpdater\'](9)">成交额(万)</a><label class="'+this.I(9)+'">&nbsp;&nbsp;</label></td><td><a href="#" onclick="return window[\'reorderListUpdater\'](1)">今开盘</a><label class="'+this.I(1)+'">&nbsp;&nbsp;</label></td><td><a href="#" onclick="return window[\'reorderListUpdater\'](2)">昨收盘</a><label class="'+this.I(2)+'">&nbsp;&nbsp;</label></td><td><a href="#" onclick="return window[\'reorderListUpdater\'](4)">最高价</a><label class="'+this.I(4)+'">&nbsp;&nbsp;</label></td><td><a href="#" onclick="return window[\'reorderListUpdater\'](5)">最低价</a><label class="'+this.I(5)+'">&nbsp;&nbsp;</label></td></tr></thead>';var g=0;var o=1;for(var i=0;i<this.G.length;i++){if(typeof this.Y["key_"+this.G[i]]!="undefined"){if(g==0){v+=this.U==o?'<tbody>':'<tbody style="display:none;">';o++;}var e=this.Y["key_"+this.G[i]];v+='<tr class="'+e[34]+'"><th><a href="http://finance.sina.com.cn/realstock/company/'+e[35]+'/nc.shtml" target="_blank">'+e[0]+'</a></th><td'+(this.P==33?" class=\"sorting\"":"")+'>'+e[33]+'</td><td'+(this.P==3?" class=\"sorting\"":"")+'>'+e[3]+'</td><td'+(this.P==32?" class=\"sorting\"":"")+'>'+e[32]+'</td><td'+(this.P==6?" class=\"sorting\"":"")+'>'+e[6]+'</td><td'+(this.P==7?" class=\"sorting\"":"")+'>'+e[7]+'</td><td'+(this.P==8?" class=\"sorting\"":"")+'>'+e[8]+'</td><td'+(this.P==9?" class=\"sorting\"":"")+'>'+e[9]+'</td><td'+(this.P==1?" class=\"sorting\"":"")+'>'+e[1]+'</td><td'+(this.P==2?" class=\"sorting\"":"")+'>'+e[2]+'</td><td'+(this.P==4?" class=\"sorting\"":"")+'>'+e[4]+'</td><td'+(this.P==5?" class=\"sorting\"":"")+'>'+e[5]+'</td></tr>';g++;if(g>=this.S){g=0;v+='</tbody>';}}}if(g>0){v+='</tbody>';}v+='</table>';var C='';for(var i=1;i<o;i++){C+=this.U==i?' ['+i+'] ':' <a href="'+i+'" onclick="return window[\'pageListUpdater\']('+i+')">['+i+']</a> ';}v='<div class="datatbl_index"><div class="datatbl_link">'+this.af+'</div><div class="datatbl_pages_up">'+C+'</div></div>'+v+'<div class="datatbl_pages_down">'+C+'</div>';if(v!=this.L.innerHTML){this.L.innerHTML=v;}};this.Z=function(o){this.U=o;this.M();return false;};this.ae=function(c,d){var r=c[0]=="--"||c[0]=="--"?Number.NEGATIVE_INFINITY:c[0]*1;var t=d[0]=="--"||d[0]=="--"?Number.NEGATIVE_INFINITY:d[0]*1;if(r>t){return 1;}else if(r==t){return 0;}else{return-1;}};this.ad=function(c,d){var r=c[0]=="--"||c[0]=="--"?Number.NEGATIVE_INFINITY:c[0]*1;var t=d[0]=="--"||d[0]=="--"?Number.NEGATIVE_INFINITY:d[0]*1;if(r<t){return 1;}else if(r==t){return 0;}else{return-1;}};this.ac=function(m){if(this.P!=m){this.P=m;this.T=1;}else{this.T=[1,2,0][this.T];}if(this.T==0){this.P=0;}var f=[];for(var i=0;i<this.G.length;i++){if(typeof this.Y["key_"+this.G[i]]!="undefined"){f.push([this.Y["key_"+this.G[i]][this.P],this.G[i]]);}}this.G=[];switch(this.T){case 0:this.G=this.H;break;case 1:f.sort(this.ad);for(var i=0;i<f.length;i++){this.G.push(f[i][1]);}break;case 2:f.sort(this.ae);for(var i=0;i<f.length;i++){this.G.push(f[i][1]);}break;}this.M();return false;};this.boot=function(z,A,B,D){this.af=z;this.L=this.N(D);this.K=this.N(B);this.G=A.split(",");this.H=A.split(",");window["processListUpdater"]=this.J(this.aa);window["pageListUpdater"]=this.J(this.Z);window["reorderListUpdater"]=this.J(this.ac);this.U=1;this.X();this.V=setInterval(this.J(this.X),this.R);};}; 
