if(typeof(Baidu.Finance)=="undefined"||typeof(Baidu.Finance.Refresh)=="undefined")Baidu.namespace("Baidu.Finance.Refresh");var dm=document.domain.split("."),ttdm=dm[dm.length-2]+"."+dm[dm.length-1],BFR=Baidu.Finance.Refresh;BFR.init=function(){BFR.params.init();BFR.frontend.init();BFR.events.init();BFR.vcr.init()};BFR.DataCache=function(){var $={};this.put=function(A,B,_){if(!$[A])$[A]={};$[A][B]=_};this.get=function(A,B){var _=null;if($[A])_=$[A][B];return _}};BFR.D_IFrame=function(C){var _=null,A=null,B=(C)?C:"RSIFrame",$=function(){if(!document.createElement)return true;if(!_&&document.createElement){try{var D=document.createElement("iframe");D.setAttribute("id",B);D.style.border="0px";D.style.width="0px";D.style.height="0px";_=document.body.appendChild(D);if(document.frames)_=document.frames[B]}catch($){iframeHTML="<iframe id=\""+B+"\" style=\"";iframeHTML+="border:0px;";iframeHTML+="width:0px;";iframeHTML+="height:0px;";iframeHTML+="display:none;";iframeHTML+="hidden:true;";iframeHTML+="\"></iframe>";document.body.innerHTML+=iframeHTML;_=new Object();_.document=new Object();_.document.location=new Object();_.document.location.iframe=BFR.util.$(B);_.document.location.replace=function($){this.iframe.src=$}}}if(navigator.userAgent.indexOf("Gecko")!=-1&&!_.contentDocument){setTimeout("createIFrame()",10);return false}try{if(_.contentDocument)A=_.contentDocument;else if(_.contentWindow)A=_.contentWindow.document;else if(_.document)A=_.document;else return true}catch(C){return false}return false};this.loadURL=function(C,$){if($)document.domain=$;try{A.location.replace(C)}catch(D){try{_.location.replace(C)}catch(B){}}return false};this.destroyScriptTags=function(){if(!_)return;var $=_.contentDocument;if(!$)$=_.document;if($){var B=$.getElementsByTagName("script"),C=B.length,A=null;for(i=0;i<C;i++){A=B[0];A.parentNode.removeChild(A);delete(A)}}};$()};BFR.events={hasFocus:true,hasActivity_snz:false,scount_snz:0,nowtime:"",isSnoozing:false,isRefreshing:true,isClose:false,IERecentFocusFlag:false,ignoreFakeMouseMoveCheck:false,snzTimer:null,adsTimer:null,serveAdsTimer:null,_ns:(navigator.appName.indexOf("Netscape")!=-1),_mouseX:0,_mouseY:0,SNOOZE_CHK_INTVL:10*60,SNOOZE_CHK_SLICE:10,init:function(){this._initEvtHandlers();this.snzStatusCheck(this.SNOOZE_CHK_INTVL,this.SNOOZE_CHK_SLICE)},_initEvtHandlers:function(){Baidu.util.Event.addListener(document,"keydown",function($){BFR.events.handleKeyEvt($)});Baidu.util.Event.addListener(window,"focus",function($){BFR.events.handleFocus($)});Baidu.util.Event.addListener(window,"error",function($){BFR.events.handleError($)});Baidu.util.Event.addListener(window,"blur",function($){BFR.events.handleFocus($)});Baidu.util.Event.addListener(document,"mousemove",function($){BFR.events.handleMouseEvt($)});Baidu.util.Event.addListener(document,"click",function($){BFR.events.handleMouseEvt($)})},notify:function($){if($=="Refresh_NO")this.isRefreshing=false;else if($=="Refresh_YES"){this.isRefreshing=true;this.snzStatusCheck(this.SNOOZE_CHK_INTVL,this.SNOOZE_CHK_SLICE)}},handleFocus:function(A){var $=(A.type=="focus")?true:false;if($&&!this._ns){this.IERecentFocusFlag=true;setTimeout(function(){BFR.events.IERecentFocusFlag=false},100)}if($!=this.hasFocus){if(!$&&!this._ns){var _=Baidu.util.Event;if(this._pointerInsideIEBrowser(_.getPageX(A),_.getPageY(A)))$=true;else if(this.IERecentFocusFlag)$=true}this.hasFocus=$;this.hasActivity_snz=true}},_pointerInsideIEBrowser:function(A,_){var $=document.body;if(A<$.scrollLeft+$.clientWidth&&_<$.scrollTop+$.clientHeight)return true;return false},handleMouseEvt:function(_){if(this.ignoreFakeMouseMoveCheck===false){var $=Baidu.util.Event.getPageX(_),A=Baidu.util.Event.getPageY(_);if($==this._mouseX&&A==this._mouseY)return;this._mouseX=$;this._mouseY=A}this.hasActivity_snz=true},handleKeyEvt:function($){this.hasActivity_snz=true;var _=$.keyCode;if(_==27)Baidu.util.Event.stopEvent($)},snzStatusCheck:function(_,B){if(this.snzTimer)clearTimeout(this.snzTimer);var C=0,A=this.timejudgement();if(A[0]||A[1])if((!BFR.params.rf_params.r||BFR.params.rf_params.r!="1")){C=1;this.isClose=true;BFR.vcr.setReS(A[0],A[1])}if(this.isClose&&C==0){this.isSnoozing=true;this.isClose=false}if(!this.isRefreshing&&!this.isSnoozing)return;var $=Math.floor(_/B);if(C==0){if(this.hasFocus&&this.hasActivity_snz){this.scount_snz=0;if(this.isSnoozing){this.isSnoozing=false;BFR.frontend.RefreshManager({stop:false});return}}else if(!this.isSnoozing){this.scount_snz++;if(this.scount_snz==$*2){this.scount_snz=0;BFR.frontend.RefreshManager({stop:true});this.isSnoozing=true}}this.hasActivity_snz=false}this.snzTimer=setTimeout(function(){BFR.events.snzStatusCheck(_,B)},1000*B/2)},timejudgement:function(){var _=this.nowtime,$=_.substring(11,_.length).split(":"),B=parseFloat($[0]),A=parseFloat($[1]),C={};if(B<9||(B==9&&A<30))C[0]=true;else if(B>15||(B==15&&A>1))C[0]=true;else C[0]=false;if(B<10)C[1]=true;else if(B>16||(B==16&&A>2))C[1]=true;else C[1]=false;if((B>=0&&B<4)||(B>21&&B<=23))C[2]=false;else if((B==4&&A<20)||(B==21&&A>30))C[2]=false;else C[2]=true;return C},handleError:function($){return true}};BFR.params=function(){return{rf_params:{arrowAsChangeSign:true,throttleInterval:"500",STREAMER_SERVER:"http://baidu.hexun.com/stock/q4fn.php"},init:function(){if(BFR.util.$("bdfn_para_autor"))this.initialParams(this.rf_params,"bdfn_para_autor")},initialParams:function(para,anchor,appender){var elem=anchor;if(typeof anchor==="string")elem=BFR.util.$(anchor);if(!elem)return;var p=eval("("+elem.innerHTML+")");for(var key in p)if(appender&&appender.append===true){if(typeof para[key]==="undefined"||!para[key])para[key]=p[key];else if(!BFR.util.isEmpty(p[key]))para[key]+=p[key]}else para[key]=p[key]}}}();BFR.vcr={fx168:"",isFirst:0,loopnum:0,url:null,url2:null,params:null,tempdata:"",sh_push:false,bfn_rf_iframe:null,_evtListeners:[],domain:(ttdm=="hexun.com"?"hexun.com":"baidu.com"),stopRe:false,stopReHK:false,stopReUS:false,init:function(){this.params=BFR.params.rf_params;if(this.getzjfwtoPara()){var _=this.tempdata.split(","),$="",A="";for(i=0;i<_.length;i++)if(_[i].substr(_[i].indexOf("."),3)==".hk")$+=","+_[i];else A+=","+_[i];this.params.s1+=$;this.params.s2+=A}this.stophandler=new BFR.vcr.stophandler({bufs:[new BFR.vcr.ThrottleBuffer(0),new BFR.vcr.ThrottleBuffer(1)],intvl:parseInt(BFR.params.rf_params.throttleInterval)});this.fx168=this.params.fx_server;this._addEventListener(BFR.events);this._addEventListener(BFR.markettime);this._addEventListener(this.stophandler);BFR.frontend.RefreshManager({stop:BFR.util.cookieMgr.existsInCookie("PRF","sq=0")})},getzjfwtoPara:function(){var _=1,$=new BFR.util.ElementHash("span","id","temp_para");while(elem=$.getElemForUniqueAttr(uid="temp_para"+"_"+_++))this.tempdata+=elem.innerHTML;return true},updatedata:function($){BFR.frontend.updateOneTicker($)},updateMarkettime:function($){BFR.frontend.updateMarkettime($)},setReS:function(A,$,_){this.stopRe=A;this.stopReHK=$;this.stopReUS=_;return A},_addEventListener:function($){if($)this._evtListeners.push($)},_notifyListeners:function(A){for(var _ in this._evtListeners){var $=this._evtListeners[_];if($.notify)$.notify(A)}},startRefresh:function(){var $=this.params.start?this.params.start*1000:0;this.sh_push=false;this.stopRe=false;this.stopReHK=false;this.stopReUS=false;if(BFR.vcr.isFirst==0)setTimeout(function(){BFR.vcr.load(BFR.vcr.fx168,BFR.vcr.isFirst==0?false:true)},$);else BFR.vcr.load(BFR.vcr.fx168,BFR.vcr.isFirst==0?false:true);this._notifyListeners("Refresh_YES")},load:function(_,A){this.loopnum=0;var $=this.params.load_intev?this.params.load_intev*1000:30000;if(this.stopRe==false){url=this.makeRequestUrl("st");if(url){if(!this.bfn_rf_iframe)this.bfn_rf_iframe=new BFR.D_IFrame("df1");this.bfn_rf_iframe.loadURL(url,this.domain)}url2=this.makeRequestUrl("gegu");if(url2){if(!this.bfn_rf_iframe2)this.bfn_rf_iframe2=new BFR.D_IFrame("df2");this.bfn_rf_iframe2.loadURL(url2,this.domain)}}else if(this.stopReHK==false){url2=this.makeRequestUrl("hk");if(url2){if(!this.bfn_rf_iframe2)this.bfn_rf_iframe2=new BFR.D_IFrame("df2");this.bfn_rf_iframe2.loadURL(url2,this.domain)}}else if(this.stopReUS==false){url2=this.makeRequestUrl("us");if(url2){if(!this.bfn_rf_iframe2)this.bfn_rf_iframe2=new BFR.D_IFrame("df2");this.bfn_rf_iframe2.loadURL(url2,this.domain)}}if(_){url3=this.makeRequestUrl("fx");if(url3){if(!this.bfn_rf_iframe3)this.bfn_rf_iframe3=new BFR.D_IFrame("df3");this.bfn_rf_iframe3.loadURL(url3,this.domain)}}if(!A)setTimeout(function(){BFR.vcr.load(_,A)},$)},makeRequestUrl:function(_){reqUrl_prefix=this.params.bdfn_server;if(ttdm=="hexun.com")reqUrl_prefix="http://bdcjhq.hexun.com/quote";else reqUrl_prefix="http://cjhq.baidu.com/quote";switch(_){case"st":var $=reqUrl_prefix+"?s2="+this.params.s2;if(this.params.s1&&this.stopReHK==false)$+=","+this.params.s1;if(this.params.s3){var A=this.params.s3;A=A.replace(/(^\s*)/g,"");$+=","+A}break;case"fx":$=this.params.fx_server;return $;break;case"hk":if(this.params.s1)$=reqUrl_prefix+"?s2="+this.params.s1;else return null;break;case"gegu":if(this.params.s4)$=reqUrl_prefix+"?s1="+this.params.s4;else return null;break;case"us":if(this.params.s1)$=reqUrl_prefix+"?s2="+this.params.s1;else return null;break;default:break}$=$.replace(/,,+/g,",");$=$.replace(/,+/g,"%2C");return $},stopRefresh:function(){this.sh_push=true;BFR.vcr.setReS(true,true);this._notifyListeners("Refresh_NO")},isRefreshing:function(){return(!this.sh_push)},pushFrameCount:0,updateOneFrame:function($){window.status="Done";this.stophandler.startThrottleIfStopped();for(var _ in $){$[_].ticker=_;this.stophandler.getCurrBuf().add(_,$[_])}if(this.pushFrameCount++>=1000){this.bfn_rf_iframe.destroyScriptTags();this.pushFrameCount=0}}};BFR.vcr.stophandler=function(_){var G=_.bufs,$=0,B=null,C=(_.intvl)?_.intvl:500;this.getCurrBuf=function(){return G[$]};var F=function(){return G[($+1)%2]},E=function(){$=($+1)%2},A=function(){var $=F();$.sendToDisplay()};this.startThrottleIfStopped=function(){if(B)return;this.startThrottle()};this.startThrottle=function(){if(B)clearInterval(B);B=setInterval(function(){if(G[$].size()>0){E();A()}else D()},C)};this.stopThrottle=function(){if(B){clearInterval(B);B=null}};var D=this.stopThrottle;this.notify=function($){if($=="Refresh_NO")this.stopThrottle();else if($=="Refresh_YES")this.startThrottle()}};BFR.vcr.ThrottleBuffer=function(B){var $=B,C=0,_={},D=[],A;this.add=function(A,B){if(!_[A]){C++;_[A]={}}for(var $ in B)_[A][$]=B[$]};this.size=function(){return C};this.sendToDisplay=function(){var A=0,$=1,E=1;if(BFR.vcr.isFirst==0){for(var B in _){BFR.frontend.updateOneTicker(_[B]);delete(_[B]);C--;BFR.vcr.isFirst=1}}else if(BFR.vcr.isFirst==1)for(B in _){D[$]=_[B];setTimeout(function(){BFR.vcr.updatedata(D[E]);E++},A);A=(A+1000)%10000;delete(_[B]);C--;$++}if(D[1])BFR.vcr.updateMarkettime(D[1]["time"])}};bdcallback=function($){BFR.vcr.updateOneFrame($)};BFR.frontend={Arrow_up:"<img src='img/up.gif' alt='+'>",Arrow_down:"<img src='img/down.gif' alt='-'>",UP_CLASS:"upRed",DOWN_CLASS:"downGreen",CHG_UP_CLASS:"upRedArrow",CHG_DOWN_CLASS:"downGreenArrow",flashingDatums:"vo,tu,la,zde,zdf,zj,rate,earn,val2,val3,val5,val6,val7,val8",dCache:null,elemHash:null,switches:["bfn_onoff"],init:function(){this.dCache=new BFR.DataCache();this.elemHash=new BFR.util.ElementHash("span","id","bfn_");for(var $ in this.switches){var _=BFR.util.$(this.switches[$]);if(_&&_.style)_.style.display=""}},updateOneTicker:function(K){var D=K.ticker,E=0;D=D.toLowerCase();for(var M in K){if(K["is"]&&parseInt(K["is"])>0)if(parseInt(K["is"])==1){var G=K["time"],A=G.substring(11,G.length).split(":"),H=parseFloat(A[0]),I=parseFloat(A[1]);if(H<10||(H==10&&I<30))continue}else continue;var B=K[M];if(!B)continue;switch(M){case"ticker":break;case"hi":case"lo":case"op":if(parseFloat(K[M])==parseFloat(K["pc"]))UorD=0;else if(parseFloat(K[M])>parseFloat(K["pc"]))UorD=1;else UorD=-1;this.updateElem(D,M,this.formatNumberInsertCommasDots(B,true),"valueColor",K["la"],true,"st",UorD);break;case"sz":case"vo":case"pc":case"sy":if(parseFloat(B)>0)this.updateElem(D,M,this.formatNumberInsertCommasDots(B,true),"asIs",K["la"],true,"st");else this.updateElem(D,M,"-","asIs",K["la"],true,"st");break;case"bp1":case"bv1":if(parseFloat(K["bp1"])>parseFloat(K["pc"]))BorA=1;else if(K["bp1"]==K["pc"])BorA=0;else BorA=-1;this.updateElem(D,M,this.formatNumberInsertCommasDots(B,true),"valueColor",K["la"],true,"st",BorA);break;case"bp2":case"bv2":if(parseFloat(K["bp2"])>parseFloat(K["pc"]))BorA=1;else if(K["bp2"]==K["pc"])BorA=0;else BorA=-1;this.updateElem(D,M,this.formatNumberInsertCommasDots(B,true),"valueColor",K["la"],true,"st",BorA);break;case"bp3":case"bv3":if(parseFloat(K["bp3"])>parseFloat(K["pc"]))BorA=1;else if(K["bp3"]==K["pc"])BorA=0;else BorA=-1;this.updateElem(D,M,this.formatNumberInsertCommasDots(B,true),"valueColor",K["la"],true,"st",BorA);break;case"bp4":case"bv4":if(parseFloat(K["bp4"])>parseFloat(K["pc"]))BorA=1;else if(K["bp4"]==K["pc"])BorA=0;else BorA=-1;this.updateElem(D,M,this.formatNumberInsertCommasDots(B,true),"valueColor",K["la"],true,"st",BorA);break;case"bp5":case"bv5":if(parseFloat(K["bp5"])>parseFloat(K["pc"]))BorA=1;else if(K["bp5"]==K["pc"])BorA=0;else BorA=-1;this.updateElem(D,M,this.formatNumberInsertCommasDots(B,true),"valueColor",K["la"],true,"st",BorA);break;case"ap1":case"av1":if(parseFloat(K["ap1"])>parseFloat(K["pc"]))BorA=1;else if(K["ap1"]==K["pc"])BorA=0;else BorA=-1;this.updateElem(D,M,this.formatNumberInsertCommasDots(B,true),"valueColor",K["la"],true,"st",BorA);break;case"ap2":case"av2":if(parseFloat(K["ap2"])>parseFloat(K["pc"]))BorA=1;else if(K["ap2"]==K["pc"])BorA=0;else BorA=-1;this.updateElem(D,M,this.formatNumberInsertCommasDots(B,true),"valueColor",K["la"],true,"st",BorA);break;case"ap3":case"av3":if(parseFloat(K["ap3"])>parseFloat(K["pc"]))BorA=1;else if(K["ap3"]==K["pc"])BorA=0;else BorA=-1;this.updateElem(D,M,this.formatNumberInsertCommasDots(B,true),"valueColor",K["la"],true,"st",BorA);break;case"ap4":case"av4":if(parseFloat(K["ap4"])>parseFloat(K["pc"]))BorA=1;else if(K["ap4"]==K["pc"])BorA=0;else BorA=-1;this.updateElem(D,M,this.formatNumberInsertCommasDots(B,true),"valueColor",K["la"],true,"st",BorA);break;case"ap5":case"av5":if(parseFloat(K["ap5"])>parseFloat(K["pc"]))BorA=1;else if(K["ap5"]==K["pc"])BorA=0;else BorA=-1;this.updateElem(D,M,this.formatNumberInsertCommasDots(B,true),"valueColor",K["la"],true,"st",BorA);break;case"wb":case"wbc":case"lt":case"na":this.updateElem(D,M,B,"asIs",K["la"],true,"st");break;case"tu":var N=parseInt(parseFloat(K["tu"])*10000/parseFloat(K["vo"]))/100;N=N?N.toString():"-";if(parseInt(K["type"])==1){var L=Math.round(parseFloat(K["tu"])/10)/1000;this.updateElem(D,M,L.toString(),"asIs",K["la"],true,"st")}else this.updateElem(D,M,B,"asIs",K["la"],true,"st");this.updateElem(D,"zj",N.toString(),"asIs",K["la"],true,"st");break;case"zde":if(parseFloat(K["la"])==0)this.updateElem(D,M,"-","asIs",K["la"],true,"st");else this.updateElem(D,M,this.formatNumberInsertCommasDots(B,true),"arrowColorAbs",K["la"],true,"st",{nodecimalformat:true});break;case"zdf":if(parseFloat(K["la"])==0)this.updateElem(D,M,"-","asIs",K["la"],true,"st");else this.updateElem(D,M,B,"arrowColorAbsPercent",K["la"],true,"st");break;case"hs":this.updateElem(D,M,B,"parensAbsPercent",K["la"],true,"st");break;case"is":break;case"time":this.updateElem(D,M,B,"asIs",K["la"],true,"st");BFR.events.nowtime=K[M];break;case"val9":this.updateElem(D,M,B,"asIs",K["la"],true,"st");break;case"la":if(parseFloat(K["la"])>parseFloat(K["pc"]))UorD=1;else if(parseFloat(K["la"])==parseFloat(K["pc"]))UorD=0;else UorD=-1;if(BFR.util.$("paidprice_"+D)){var C=BFR.util.$("paidprice_"+D).value,J=BFR.util.$("paidnumber_"+D).value,P=parseInt(((K["la"]-C)-(K["la"]*0.001+K["la"]*0.002)-(C*0.001+C*0.002))/C*10000+0.5)/100,_=parseInt(J*P*C)/100;if(P&&parseFloat(P)!=0)this.updateElem(D,"rate",this.formatNumber(P.toString(),2,true),"arrowColorAbsPercent",K["la"],true,"st");else this.updateElem(D,"rate","-","asIs",0,true,"ind");this.updateElem(D,"earn",this.formatNumber(this.formatNumberInsertCommasDots(_,true),2,true),"valueColor",K["la"],true,"st",P)}if(!K["zde"])if((parseFloat(K["op"])!=0)&&(K["op"]!="-")&&(K["op"]!="")){var F=parseFloat(K["la"])-parseFloat(K["pc"]),O=F/parseFloat(K["pc"]);O=Math.round(O*10000)/10000*100;var $=parseInt(K["type"])==2?2:3;if(BFR.params.rf_params.type=="index")$=2;this.updateElem(D,"zde",this.formatNumber(this.formatNumberInsertCommasDots(F,true),$,true),"arrowColorAbs",K["la"],true,"st",{nodecimalformat:true});this.updateElem(D,"zdf",this.formatNumber(O,2,true),"arrowColorAbsPercent",K["la"],true,"st")}else{this.updateElem(D,"zde","-","asIs",0,true,"ind");this.updateElem(D,"zdf","-","asIs",0,true,"ind")}this.updateElem(D,M,this.formatNumberInsertCommasDots(B,true),"valueColor",K["la"],true,"st",UorD);this.updateMap(D,K["time"],K["type"]);break;case"val1":case"val4":case"val7":case"val8":this.updateElem(D,M,this.formatNumberInsertCommasDots(B,true),"asIs",B,false,"re");break;case"val6":if(parseFloat(K["val1"])==0)this.updateElem(D,M,"-","asIs",0,true,"ind");else this.updateElem(D,M,B,"arrowColorAbs",0,true,"ind",{nodecimalformat:true},0,true,"ind");break;case"val2":case"val3":case"val5":if(parseFloat(K[M])==parseFloat(K["val4"]))this.updateElem(D,M,this.formatNumberInsertCommasDots(B,true),"asIs",0,true,"ind");else{if(parseFloat(K[M])>parseFloat(K["val4"]))UorD=1;else UorD=-1;this.updateElem(D,M,this.formatNumberInsertCommasDots(B,true),"valueColor",0,true,"ind",UorD)}break}}},updateMarkettime:function($){if(BFR.util.$("markettime"))BFR.util.$("markettime").innerHTML=$},updateMap:function(A,B,_){A=A.toLowerCase();if(BFR.util.$("rtmap_"+A)){var $=BFR.util.getCurrTimeStamp(),D="",C=A.indexOf(".");if(BFR.params.rf_params.type=="index")D="http://bdchart.hexun.com/stock/chart/index/index_1_"+A.substr(0,C).toUpperCase()+".png?"+$;else if(BFR.params.rf_params.type=="gegu")if(A.indexOf("hk")>-1){if(parseInt(_)==1)D="http://bdchart.hexun.com/hkstock/chart/chart/bf/1/"+A.substr(0,C).toUpperCase()+".png?"+$;else D="http://bdchart.hexun.com/hkstock/chart/chart/bf/0/"+A.substr(0,C).toUpperCase()+".png?"+$}else if(A.indexOf("sh")>-1)D="http://bdchart.hexun.com/stock/chart/bf/0/"+A.substr(0,C).toUpperCase()+".png?"+$;else D="http://bdchart.hexun.com/stock/chart/bf/1/"+A.substr(0,C).toUpperCase()+".png?"+$;if(D!="")BFR.util.$("rtmap_"+A).src=D}},updateElem:function(A,L,$,E,F,N,D,K){var _,M=1,B="bfn_"+L+"_"+A,H="";switch(D){case"re":var I=this.dCache.get(A,"val4");break;case"ind":I=this.dCache.get(A,L);F=$;break;default:I=this.dCache.get(A,"la");break}var G=this.dCache.get(A,L);while((_=this.elemHash.getElemForUniqueAttr(H=B+"_"+M++))){if(Baidu.util.Dom.hasClass(_,"refresh-inactive"))return true;var J=this.renderFuncLib[E],C="";if($==null||BFR.util.isInvalidNumber($))C="-";else if($.toLowerCase()=="n/a")C="N/A";else C=J?J($,K):$;_.innerHTML=C;if(this.flashingDatums.indexOf(L.substring(0,3))!=-1&&(N||(G!=$)))this.highlightValueChange(H,I,F)}this.dCache.put(A,L,$)},onUP_Chg_COLOR:"onChangeRed",onDOWN_Chg_COLOR:"onChangeGreen",HIGHLIGHT_INTVL:500,highlightValueChange:function(A,B,_){if(B==null||_==null||B==_)return;var $=this.elemHash.getElemForUniqueAttr(A);B=parseFloat(B.toString().replace(/,/g,""));_=parseFloat(_.toString().replace(/,/g,""));if(isNaN(B)||isNaN(_)||_=="-"||_=="-%"||B==_)return;var C=(_>B)?this.onUP_Chg_COLOR:this.onDOWN_Chg_COLOR;BFR.webfx.highlightBG({el:$,id:A,hlclass:C,intvl:this.HIGHLIGHT_INTVL})},isZero:function($){if(parseFloat($)==0)$="-";return $},renderFuncLib:{BeRed:function($){$=BFR.frontend.isZero($);ret="<span class=\""+BFR.frontend.UP_CLASS+"\">"+$+"</span>";return ret},BeGreen:function($){$=BFR.frontend.isZero($);ret="<span class=\""+BFR.frontend.DOWN_CLASS+"\">"+$+"</span>";return ret},valueColor:function($,A){$=BFR.frontend.isZero($);var _="";if(A>0){_="<span class=\""+BFR.frontend.UP_CLASS+"\">"+$+"</span>";return _}else if(A<0){_="<span class=\""+BFR.frontend.DOWN_CLASS+"\">"+$+"</span>";return _}else return $},asIs:function($){$=BFR.frontend.isZero($);return $},arrowColorAbs:function($,C){var B=BFR.frontend.getChangeIcon($),_=BFR.frontend.signMap[BFR.frontend.getSign($)],A="";if(BFR.params.rf_params.arrowAsChangeSign)A="<span class=\""+BFR.frontend.getChangeColorArrowClass($)+"\">"+BFR.frontend.getAbs($)+"</span>";else A="<span class=\""+BFR.frontend.getChangeColorArrowClass($)+"\">"+_+BFR.frontend.getAbs($)+"</span>";return A},arrowColorAbsPercent:function($){var B=BFR.frontend.getChangeIcon($),_=BFR.frontend.signMap[BFR.frontend.getSign($)],A="";if(BFR.params.rf_params.arrowAsChangeSign)A=" <span class=\""+BFR.frontend.getChangeColorArrowClass($)+"\">"+BFR.frontend.getAbs($)+"%</span>";else A="<span class=\""+BFR.frontend.getChangeColorClass($)+"\">"+BFR.frontend.getAbs($)+"%</span>";return A},parensColorAbsPercent:function($){return"<span class=\""+BFR.frontend.getChangeColorClass($)+"\">"+BFR.frontend.getAbs($.toString())+"%</span>"},parensAbsPercent:function($){var _=BFR.frontend.signMap[BFR.frontend.getSign($)];$=BFR.frontend.isZero($);return"<span>"+_+BFR.frontend.getAbs($)+"%</span>"}},formatNumber:function($,G,B){$=$.toString().replace(/\,/g,"");if(isNaN($)){$=0;return"-"}var H=($>=0);$=Math.abs($);var E=Math.floor($).toString(),D=G;switch(D){case 2:var A=100,F="00";break;case 3:A=1000,F="000";break;case 4:A=10000,F="0000";break}var C=Math.floor($*A+0.5)%A;if(C<(A/10))C=F.substring(C.toString().length)+C;for(var _=0;_<Math.floor((E.length-(_+1))/3);_++)E=E.substring(0,E.length-(4*_+3))+","+E.substring(E.length-(4*_+3));return(((H)?"":"-")+E+((!B)?"":"."+C))},formatNumberInsertCommasDots:function($,A){$=$.toString().replace(/\,/g,"");if(isNaN($))return"0";var F=($>=0),E=$.indexOf("."),C=Math.floor(Math.abs($)).toString(),B="";if(E!=-1){B=$.substr(E);if(B===".")B=""}var D=1;for(var _=0;_<Math.floor((C.length-(_+1))/3);_++)if(D==1){C=C.substring(0,C.length-(4*_+3))+","+C.substring(C.length-(4*_+3));D++}else C=C.substring(0,C.length-(4*_+3))+","+C.substring(C.length-(4*_+3));return(((F)?"":"-")+C+((!A)?"":B))},padNumber:function($,_){$=$.toString();while($.length<_)$="0"+$;return $},getAbs:function($){$=$.toString();var _=$.substring(0,1);if(_=="-"||_=="+")$=$.substring(1,$.length);if(isNaN($.replace(/,+/g,"")))return"-";return $},getChangeColorClass:function($){switch(this.getSign($)){case-1:return this.CHG_DOWN_CLASS;case 1:return this.CHG_UP_CLASS;default:return""}},getChangeColorArrowClass:function($){switch(this.getSign($)){case-1:return this.CHG_DOWN_CLASS;case 1:return this.CHG_UP_CLASS;default:return""}},getChangeIcon:function($){switch(this.getSign($)){case-1:return this.Arrow_down;case 1:return this.Arrow_up;default:return""}},getSign:function($){if($==null)return 0;if($<0)return-1;else if($>0)return 1;else{var _=$.toString().substring(0,1);if(_==="+")return 1;else if(_==="-")return-1;else return 0}},signMap:{"-1":"-","1":"","0":""},RefreshManager:function(_){var $=BFR.util.$("bfn_onoff");if(_.stop){BFR.vcr.stopRefresh();if($)$.innerHTML="<a class=\"off\" href=\"javascript:void(0)\" onclick=\"BFR.frontend.onoff.toggleOnoffText('on'); return false;\">\u6253\u5f00\u81ea\u52a8\u66f4\u65b0</a>";if(_.setcookie)BFR.util.cookieMgr.setInCookie("PRF","sq=0")}else{if($)$.innerHTML="<a class=\"on\" href=\"javascript:void(0)\" onclick=\"BFR.frontend.onoff.toggleOnoffText('off'); return false;\">\u5173\u95ed\u81ea\u52a8\u66f4\u65b0</a>";if(_.setcookie)BFR.util.cookieMgr.removeFromCookie("PRF","sq=0");BFR.vcr.startRefresh()}},onoff:{toggleOnoffText:function($,_){if($==="on")this.turnOn();else this.turnOff()},turnOn:function(){if(!BFR.vcr.isRefreshing()){BFR.vcr.setReS(false,false);BFR.frontend.RefreshManager({stop:false,setcookie:true})}},turnOff:function(){if(BFR.vcr.isRefreshing()){BFR.vcr.setReS(true,true);BFR.frontend.RefreshManager({stop:true,setcookie:true})}}}};BFR.webfx={highlightTimerMap:{},highlightBG:function($){if(this.highlightTimerMap[$.id]){clearTimeout(this.highlightTimerMap[$.id]);this.highlightTimerMap[$.id]=null}if($.reset){Baidu.util.Dom.deleteClass($.el,BFR.frontend.onUP_Chg_COLOR);Baidu.util.Dom.deleteClass($.el,BFR.frontend.onDOWN_Chg_COLOR);return}else{Baidu.util.Dom.addClass($.el,$.hlclass);this.highlightTimerMap[$.id]=setTimeout(function(){BFR.webfx.highlightBG({el:$.el,id:$.id,hlclass:$.hlclass,reset:true,intvl:$.intvl})},$.intvl)}}};BFR.util={$:Baidu.util.Dom.get,isEmpty:function($){if(!$||$==="")return true;return false},getCurrTimeStamp:function(){var $=new Date(),_=$.getHours()*3600+$.getMinutes()*60+$.getSeconds()+$.getMilliseconds()/1000;return _},cookieMgr:{EXPIRES_DAYS:3650,setInCookie:function($,_){var A=this._readCookie($);if(!A)A=_;else if(A.indexOf(_)==-1)A=_+"&"+A;this._createCookie($,A,this.EXPIRES_DAYS)},removeFromCookie:function($,A){var B=this._readCookie($);if(!B||B.indexOf(A)==-1)return;var _=B.indexOf(A);B=B.substring(0,_)+B.substring(_+A.length);_=B.indexOf("&&");if(_!=-1)B=B.substring(0,_)+B.substring(_+1);if(B[B.length-1]=="&")B=B.substring(0,B.length-1);if(B[0]=="&")B=B.substring(1);this._createCookie($,B,this.EXPIRES_DAYS)},existsInCookie:function($,_){var A=this._readCookie($);return(A&&A.indexOf(_)!=-1)},_readCookie:function($){var C=$+"=",A=document.cookie.split(";");for(var _=0;_<A.length;_++){var B=A[_];while(B.charAt(0)==" ")B=B.substring(1,B.length);if(B.indexOf(C)===0)return B.substring(C.length,B.length)}return null},_createCookie:function(_,A,$){var D="";if($){var C=new Date();C.setTime(C.getTime()+($*24*60*60*1000));D="; expires="+C.toGMTString()}var B="; domain=finance.Baidu.com";document.cookie=_+"="+A+D+B+"; path=/"}},isInvalidNumber:function($){if(typeof($)=="number"&&(Math.abs($)==Infinity||isNaN($)))return true;return false}};BFR.util.ElementHash=function(F,G,H){var I={},B={},E={},_=function($){if(B[$])B[$]+=1;else{B[$]=1;E[$]=0}return $+"_"+B[$]},D=document.getElementsByTagName(F);for(var $=0;$<D.length;$++){var A=D[$].getAttribute(G);if(A&&H&&A.length>=H.length&&A.indexOf(H)!=-1){var C=_(A);I[C]=D[$]}}this.getElemForUniqueAttr=function($){return I[$]}}