if(typeof $=="undefined"){$=function(A){return document.getElementById(A)}}if(typeof $C=="undefined"){$C=function(A){return document.createElement(A)}}Function.prototype.Bind=function(){var D=this,B=arguments[0],A=new Array();for(var C=1;C<arguments.length;C++){A.push(arguments[C])}return function(){return D.apply(B,A)}};Function.prototype.BindForEvent=function(){var D=this,B=arguments[0],A=new Array();for(var C=1;C<arguments.length;C++){A.push(arguments[C])}return function(E){return D.apply(B,[(E||window.event)].concat(A))}};var isIE=false;var userAgent=navigator.userAgent.toLowerCase();if((userAgent.indexOf("msie")!=-1)&&(userAgent.indexOf("opera")==-1)){isIE=true}if(typeof IO=="undefined"){IO={}}IO.Script=function(){this.Init.apply(this,arguments)};IO.Script.prototype={_scriptCharset:"gb2312",_oScript:null,Init:function(A){this._setOptions(A)},_setOptions:function(A){if(typeof A!="undefined"){if(A.script_charset){this._scriptCharset=A.script_charset}}},_clearScriptObj:function(){if(this._oScript){try{this._oScript.onload=null;if(this._oScript.onreadystatechange){this._oScript.onreadystatechange=null}this._oScript.parentNode.removeChild(this._oScript)}catch(A){}}},_callbackWrapper:function(A){if(this._oScript.onreadystatechange){if(this._oScript.readyState!="loaded"&&this._oScript.readyState!="complete"){return }}if(typeof A!="undefined"){A()}this._clearScriptObj()},load:function(A,B){this._oScript=document.createElement("SCRIPT");this._oScript.type="text/javascript";if(isIE){this._oScript.onreadystatechange=this._callbackWrapper.Bind(this,B)}else{this._oScript.onload=this._callbackWrapper.Bind(this,B)}this._oScript.charset=this._scriptCharset;this._oScript.src=A;$("for_loader").appendChild(this._oScript)}};var QmxCtrl={hqUrl:"http://hq.sinajs.cn/rn=@RN@&list=",hqHTML:'<ul><li><a href="http://finance.sina.com.cn/realstock/company/@CODE@/nc.shtml" target="_blank">@NAME@</a></li><li>@PRICE@</li><li>@CHANGE@</li></ul>',sSpan:'<span style="color:@C@">@T@</span>',Init:function(){if(window.qmx_industry){this.oData=window.qmx_industry;this.aCodes=this.oData.symbols.split(",");this.hq_container=$("dl_hyfl")}else{return }if(this.oData.name=="新能源"){this.hq_container.parentNode.style.display="none";var A=this.hq_container.parentNode.previousSibling;if(A.innerHTML=="以下是本文可能影响或涉及到的板块个股："){A.style.display="none"}else{A.previousSibling.style.display="none"}return }this.renderName();this.load()},renderName:function(){$("title_hyfl").innerHTML=$("title_hyfl").innerHTML.replace("行业个股行情一览",this.oData.name+"行业个股行情一览")},load:function(){var A=new IO.Script();A.load(this.hqUrl.replace("@RN@",(new Date()).getTime())+this.oData.symbols,this.update.Bind(this))},update:function(){this.hq_container.innerHTML="";for(var C=0;C<this.aCodes.length;C++){var A=window["hq_str_"+this.aCodes[C]].split(",");var D=$C("DD");var B=A[3]!=0?A[3]-A[2]:0;var E=B==0?0+"%":(B/A[2]*100).toFixed(2)+"%";D.innerHTML=this.hqHTML.replace("@CODE@",this.aCodes[C]).replace("@NAME@",A[0]).replace("@PRICE@",this.colorize(B,A[3])).replace("@CHANGE@",this.colorize(B,E));this.hq_container.appendChild(D)}},colorize:function(A,B){if(A>0){return this.sSpan.replace("@C@","#f00").replace("@T@",B)}else{if(A<0){return this.sSpan.replace("@C@","#008000").replace("@T@",B)}else{return B}}}};QmxCtrl.Init();
