var config=null,vNewJsonData=null,vSellData=null,vLastCur=-1,vHourTime=3,vMinite=0;var vSellAll=0,vBuyAll=0,vSellMax=0,vBuyMax=0,vMax=0,g_vRefreshTime=5,g_vSleepTime=5*60,g_vInitTime=0;var loadJson=function(scriptUrl,scriptId){scriptUrl+="?"+Math.random();JsLoader.load(scriptId,scriptUrl,function(){if(typeof g_Code!="undefined")zqdm=g_Code;if(typeof g_Type!="undefined")zqlx=g_Type;var condition=eval("typeof v_hq_"+zqdm+"_"+zqlx+"!='undefined'");if(condition){eval("vStData = v_hq_"+zqdm+"_"+zqlx);if(vStData!=null){vNewJsonData=vStData.split("~");var aTmp=vNewJsonData[29].split("|");if(zqlx!="100"&&zqlx!="200"){vSellData=new Array();aTmpSell=new Array(parseInt(vNewJsonData[28]),parseInt(vNewJsonData[26]),parseInt(vNewJsonData[24]),parseInt(vNewJsonData[22]),parseInt(vNewJsonData[20]));aTmpBuy=new Array(parseInt(vNewJsonData[10]),parseInt(vNewJsonData[12]),parseInt(vNewJsonData[14]),parseInt(vNewJsonData[16]),parseInt(vNewJsonData[18]));vSellMax=aTmpSell.sort(function(m,n){return n-m;})[0];vBuyMax=aTmpBuy.sort(function(m,n){return n-m;})[0];vBuyMax>vSellMax?vMax=vBuyMax:vMax=vSellMax;vSellAll=parseInt(vNewJsonData[28])+parseInt(vNewJsonData[26])+parseInt(vNewJsonData[24])+parseInt(vNewJsonData[22])+parseInt(vNewJsonData[20]);vBuyAll=parseInt(vNewJsonData[10])+parseInt(vNewJsonData[12])+parseInt(vNewJsonData[14])+parseInt(vNewJsonData[16])+parseInt(vNewJsonData[18]);for(var i=0;i<aTmp.length;i++){var aTmp2=aTmp[i].split("/");vSellData.push(aTmp2);}}$("InfoShow").innerHTML=TrimPath.processDOMTemplate("xInfo").replace(/(<!--)|(-->)/g,"");$("StockShow").innerHTML=TrimPath.processDOMTemplate("xStock").replace(/(<!--)|(-->)/g,"");document.title=vNewJsonData[1]+" "+vNewJsonData[3]+" "+vNewJsonData[31]+"("+vNewJsonData[32]+"%) - ÌÚÑ¶Ö¤È¯";if($("dCjmx")!=null){$("dCjmx").innerHTML=TrimPath.processDOMTemplate("xCjmx",vSellData).replace(/(<!--)|(-->)/g,"");}var time=vNewJsonData[30].split(" ")[1].substr(2);if(!(parseInt(time.split(":")[0])==vHourTime&&parseInt(time.split(":")[1])>=vMinite)){setFlash($("sCurpri1"),"fonttitle1 fontblack","#FFFFFF");setFlash($("sCurpri2"),"fontblack","#FFFFFF");if(vNewJsonData[3]>vLastCur&&vLastCur!=-1){setFlash($("sCurpri"),"fonttitle fontblack","#F6CFCF");}else if(vNewJsonData[3]<vLastCur&&vLastCur!=-1){setFlash($("sCurpri"),"fonttitle fontblack","#CAEEAB");}else{setFlash($("sCurpri"),"fonttitle fontblack","#FFFFFF");}}else{config._RefreshTime=0;}vLastCur=vNewJsonData[3];vNewJsonData=null;}}});};function LoadData(){if(config==null){config=new _Config(stockurl,g_vRefreshTime);}loadJson(config._DataUrl[0],"_stock_script");if(config._FirstVisit){config._FirstVisit=false;}else{if(typeof(pgvMain)=='function'){pvCurDomain="stock2.finance.qq.com";pvCurUrl="/flowPv.htm";pvRepeatCount=1;pgvMain();}}window.clearTimeout(config._Timer);g_vInitTime=getNewTime();config._RefreshTime=g_vSleepTime;}function setFlash(oObj,vClass,vBgcolor){var vOrig=oObj.getAttribute("className");var vOrigBg=oObj.style.backgroundColor;setTimeout(function(){oObj.setAttribute("className",vClass);oObj.style.backgroundColor=vBgcolor;},800);setTimeout(function(){oObj.setAttribute("className",vOrig);oObj.style.backgroundColor=vOrigBg;},1000);setTimeout(function(){oObj.setAttribute("className",vClass);oObj.style.backgroundColor=vBgcolor;},1200);setTimeout(function(){oObj.setAttribute("className",vOrig);oObj.style.backgroundColor=vOrigBg;},1400);}function getNewTime(){time=new Date();return time.getTime()}function UpdateLoad(){if(config._RefreshTime!=0){window.clearTimeout(config._Timer);g_vInitTime=getNewTime();config._Timer=window.setTimeout(LoadData,config._RefreshTime*1000);config._RefreshTime=g_vSleepTime;}}function changeState(){if(config!=null&&config!="undefined"&&config._RefreshTime!=0){if(config._RefreshTime==g_vSleepTime){config._RefreshTime=g_vRefreshTime;config._Timer=window.setTimeout(LoadData,config._RefreshTime*1000);if(getNewTime()-g_vInitTime>g_vRefreshTime*1000){g_vInitTime=getNewTime();LoadData();}}}}