﻿
/*******************************************************************/
/*                                                                 */
/* Copyright (c) 2005-2009 Jasob.com                               */
/*                                                                 */
/* This obfuscated code was created by Jasob 3.5 Trial Version.    */
/* The code may be used for evaluation purposes only.              */
/* To obtain full rights to the obfuscated code you have to        */
/* purchase the license key (http://www.jasob.com/Purchase.html).  */
/*                                                                 */
/*******************************************************************/

UPCOMScrollStockBoard=function(){this.scrollDirection=1;this.otxtTradingDay=$get('txtTradingDay');this.otxtVNIndex=$get('txtVNIndex');this.otxtTotalTrade=$get('txtTotalTrade');this.otxtTotalShares=$get('txtTotalShares');this.otxtTotalValue=$get('txtTotalValue');this.otxtUpCounter=$get('txtUpCounter');this.otxtStayCounter=$get('txtStayCounter');this.otxtDownCounter=$get('txtDownCounter');this.otxtMktStatus=$get('txtMktStatus');this.otxtOnlineCounter=$get('txtOnlineCounter');this.tblScrollBarStockInfo=$get('tblScrollBarStockInfo');this.otblBaner=$get('tblBaner');this.otblStockInfoHeader=$get('tblStockInfoHeader');this.otblFixedStockInfo=$get('tblFixedStockInfo');this.odivFixedStockInfo=$get('divFixedStockInfo');this.ochShowTheRest=$get('chShowTheRest');this.otxtSymbolSelector=$get('txtSymbolSelector');this.otxtSymbolRemover=$get('txtSymbolRemover');this.otblScrollStockInfo=$get('tblScrollBarStockInfo');this.odivScrollBarStockInfo=$get('divScrollBarStockInfo');this.otblStockSymbolList=$get('tblStockSymbolList');this.ochScroll2Directions=$get('chScroll2Directions');this.ochScrollInfinite=$get('chScrollInfinite');this.otblPutthroughList=$get('tblPutthroughList');this.ocboScrollOptions=$get('cboScrollOptions');this.otxtScrollStep=$get('txtScrollStep');this.otxtScrollDelay=$get('txtScrollDelay');this.ockShowTooltip=$get('ckShowTooltip');this.ockShowHistory=$get('ckShowHistory');this.otblBodyHistory=$get('tblBodyHistory');this.cssPutOdd=new Array('PutSymbol','PutVolume','PutValue','PutName');this.cssPutEven=new Array('PutSymbolEven','PutVolumeEven','PutValueEven','PutNameEven');this.ockVisibleTab=$get('ckVisibleTab');this.ockVisibleVNIndex=$get('ckVisibleVNIndex');this.pageDataIdx=0;this.pageRowIdx=0;this.otblForeignList=$get('tblForeignList');this.cssForeignOdd=new Array('PutSymbol','PutVolume','PutValue','PutVolume','PutValue','PutName');this.cssForeignEven=new Array('PutSymbolEven','PutVolumeEven','PutValueEven','PutVolumeEven','PutValueEven','PutNameEven');this.cssHistoryOdd=new Array('TimeHistory','PriceHistory','ChangeHistory','VolumnHistory');this.cssHistoryEven=new Array('TimeHistoryEven','PriceHistoryEven','ChangeHistoryEven','VolumnHistoryEven');this.iInfoColCount=25;this.ColSorting=new Array(0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1);this.index=new Array();this.value=new Array();this.isSorting=false;this.iLineHeight=25;this.iMaxFixedCount=10;this.global=null;this.cssPutthroughOdd=new Array('PutthroughStockCode','PutthroughPrice','Putthroughvolume','PutthroughStockName');this.cssPutthroughEven=new Array('PutthroughStockCodeEven','PutthroughPriceEven','PutthroughvolumeEven','PutthroughStockNameEven');this.chartInfo=new Array();this.odivChartIndex=$get('divChartIndex');this.chartIndexVersion=0;this.isCreatedNew=true;var today=new Date();this.timeZone=today.getTimezoneOffset();today.setFullYear(2009,1,1);today.setHours(0,0,0,0);this.iToday=today.getTime();this.rowEven="<tr>\
<td class='BasicPriceEven'></td>\
<td class='CeilingCellEven'></td>\
<td class='FloorCellEven borderWhite'></td>\
<td class='StockSymbolEven' onmousedown='objX.onStockCellClick(this);' onmouseover='objX.onRowOver(event);'></td>\
<td class='TotalOfferVolumeEven'></td>\
<td class='OfferPriceEven'></td>\
<td class='OfferVolumeEven' onmouseover='objX.showToolTipVolume(this,3);' onmouseout='toolTip();'></td>\
<td class='OfferPriceEven'></td>\
<td class='OfferVolumeEven' onmouseover='objX.showToolTipVolume(this,2);' onmouseout='toolTip();'></td>\
<td class='OfferPriceEven'></td>\
<td class='OfferVolumeEven borderWhite' onmouseover='objX.showToolTipVolume(this,1);' onmouseout='toolTip();'></td>\
<td class='TradedPriceEven'></td>\
<td class='TradedChangeEven'></td>\
<td class='TradedVolumeEven borderWhite'></td>\
<td class='BidPriceEven' ></td>\
<td class='BidVolumeEven' onmouseover='objX.showToolTipVolume(this,4);' onmouseout='toolTip();'></td>\
<td class='BidPriceEven'></td>\
<td class='BidVolumeEven' onmouseover='objX.showToolTipVolume(this,5);' onmouseout='toolTip();'></td>\
<td class='BidPriceEven'></td>\
<td class='BidVolumeEven borderWhite' onmouseover='objX.showToolTipVolume(this,6);' onmouseout='toolTip();'></td>\
<td class='TotalBidVolumeEven borderWhite'></td>\
<td class='VolumeTradeEven' ></td>\
<td class='PriceHightEven'></td>\
<td class='PriceLowestEven'></td>\
<td class='AvrerageEven borderWhite'></td>\
</tr>";this.rowOdd="<tr>\
<td class='BasicPrice'></td>\
<td class='CeilingCell'></td>\
<td class='FloorCell borderWhite'></td>\
<td class='StockSymbol' onmousedown='objX.onStockCellClick(this);' onmouseover='objX.onRowOver(event);' ></td>\
<td class='TotalOfferVolume'></td>\
<td class='OfferPrice'></td>\
<td class='OfferVolume' onmouseover='objX.showToolTipVolume(this,3);' onmouseout='toolTip();'></td>\
<td class='OfferPrice'></td>\
<td class='OfferVolume' onmouseover='objX.showToolTipVolume(this,2);' onmouseout='toolTip();'></td>\
<td class='OfferPrice '></td>\
<td class='OfferVolume borderWhite' onmouseover='objX.showToolTipVolume(this,1);' onmouseout='toolTip();'></td>\
<td class='TradedPrice'></td>\
<td class='TradedChange'></td>\
<td class='TradedVolume borderWhite'></td>\
<td class='BidPrice '></td>\
<td class='BidVolume' onmouseover='objX.showToolTipVolume(this,4);' onmouseout='toolTip();'></td>\
<td class='BidPrice'></td>\
<td class='BidVolume' onmouseover='objX.showToolTipVolume(this,5);' onmouseout='toolTip();'></td>\
<td class='BidPrice'></td>\
<td class='BidVolume borderWhite' onmouseover='objX.showToolTipVolume(this,6);' onmouseout='toolTip();'></td>\
<td class='TotalBidVolume borderWhite'></td>\
<td class='VolumeTrade'></td>\
<td class='PriceHight'></td>\
<td class='PriceLowest'></td>\
<td class='Avrerage borderWhite'></td>\
</tr>";this.tableScrollBarStockInfo="<table id='tblScrollBarStockInfo'  border='0' bordercolor='#505050' cellpadding='0' cellspacing='0' style='border-bottom: 1px solid #555555;border-top: 2px solid #555555;border-collapse: collapse; font-family: Arial;' width='100%'>\
<tr>\
<td width='3%' class='BasicPrice'>&nbsp;</td>\
<td width='3%' class='CeilingCell'>&nbsp;</td>\
<td width='3%' class='FloorCell borderWhite'>&nbsp;</td>\
<td width='4%' class='StockSymbol' onmousedown='objX.onStockCellClick(this);' onmouseover='objX.onRowOver(event);'>&nbsp;</td>\
<td width='6%' class='TotalOfferVolume'>&nbsp;</td>\
<td width='3%' class='OfferPrice'>&nbsp;</td>\
<td width='5%' class='OfferVolume' onmouseover='objX.showToolTipVolume(this,3);' onmouseout='toolTip();'>&nbsp;</td>\
<td width='3%' class='OfferPrice'>&nbsp;</td>\
<td width='5%' class='OfferVolume' onmouseover='objX.showToolTipVolume(this,2);' onmouseout='toolTip();'>&nbsp;</td>\
<td width='3%' class='OfferPrice '>&nbsp;</td>\
<td width='5%' class='OfferVolume borderWhite' onmouseover='objX.showToolTipVolume(this,1);' onmouseout='toolTip();'>&nbsp;</td>\
<td width='3%' class='TradedPrice'>&nbsp;</td>\
<td width='3%' class='TradedChange' >&nbsp;</td>\
<td width='5%' class='TradedVolume borderWhite'>&nbsp;</td>\
<td width='3%' class='BidPrice'>&nbsp;</td>\
<td width='5%' class='BidVolume' onmouseover='objX.showToolTipVolume(this,4);' onmouseout='toolTip();'>&nbsp;</td>\
<td width='3%' class='BidPrice'>&nbsp;</td>\
<td width='5%' class='BidVolume' onmouseover='objX.showToolTipVolume(this,5);' onmouseout='toolTip();'>&nbsp;</td>\
<td width='3%' class='BidPrice '>&nbsp;</td>\
<td width='5%' class='BidVolume borderWhite' onmouseover='objX.showToolTipVolume(this,6);' onmouseout='toolTip();'>&nbsp;</td>\
<td width='6%' class='TotalBidVolume borderWhite'>&nbsp;</td>\
<td width='7%' class='VolumeTrade'>&nbsp;</td>\
<td width='3%' class='PriceHight'>&nbsp;</td>\
<td width='3%' class='PriceLowest'>&nbsp;</td>\
<td width='3%' class='Avrerage borderWhite'>&nbsp;</td>\
</tr>";this.tableFixedStockInfo="<table id='tblFixedStockInfo' border='0px'  bordercolor='#505050' cellpadding='0' cellspacing='0' style='border-bottom: 2px solid #555555; border-collapse: collapse;font-family: Arial;' width='100%'>\
<tr>\
<td width='3%' class='BasicPrice'>&nbsp;</td>\
<td width='3%' class='CeilingCell'>&nbsp;</td>\
<td width='3%' class='FloorCell borderWhite'>&nbsp;</td>\
<td width='4%' class='StockSymbol ' onmousedown='objX.onStockCellClick(this);' onmouseover='objX.onRowOver(event);' >&nbsp;</td>\
<td width='6%' class='TotalOfferVolume'>&nbsp;</td>\
<td width='3%' class='OfferPrice'>&nbsp;</td>\
<td width='5%' class='OfferVolume' onmouseover='objX.showToolTipVolume(this,3);' onmouseout='toolTip();'>&nbsp;</td>\
<td width='3%' class='OfferPrice'>&nbsp;</td>\
<td width='5%' class='OfferVolume' onmouseover='objX.showToolTipVolume(this,2);' onmouseout='toolTip();'>&nbsp;</td>\
<td width='3%' class='OfferPrice '>&nbsp;</td>\
<td width='5%' class='OfferVolume borderWhite' onmouseover='objX.showToolTipVolume(this,1);' onmouseout='toolTip();'>&nbsp;</td>\
<td width='3%' class='TradedPrice'>&nbsp;</td>\
<td width='3%' class='TradedChange' >&nbsp;</td>\
<td width='5%' class='TradedVolume borderWhite'>&nbsp;</td>\
<td width='3%' class='BidPrice'>&nbsp;</td>\
<td width='5%' class='BidVolume' onmouseover='objX.showToolTipVolume(this,4);' onmouseout='toolTip();'>&nbsp;</td>\
<td width='3%' class='BidPrice'>&nbsp;</td>\
<td width='5%' class='BidVolume' onmouseover='objX.showToolTipVolume(this,5);' onmouseout='ttoolTip();'>&nbsp;</td>\
<td width='3%' class='BidPrice '>&nbsp;</td>\
<td width='5%' class='BidVolume borderWhite' onmouseover='objX.showToolTipVolume(this,6);' onmouseout='toolTip();'>&nbsp;</td>\
<td width='6%' class='TotalBidVolume borderWhite'>&nbsp;</td>\
<td width='7%' class='VolumeTrade'>&nbsp;</td>\
<td width='3%' class='PriceHight'>&nbsp;</td>\
<td width='3%' class='PriceLowest'>&nbsp;</td>\
<td width='3%' class='Avrerage borderWhite'>&nbsp;</td>\
</tr>";var i=0;this.ai=i++;this.ab=i++;this.ad=i++;this.f=i++;this.ax=i++;this.K=i++;this.ah=i++;this.J=i++;this.ag=i++;this.B=i++;this.ac=i++;this.A=i++;this.I=i++;this.v=i++;this.F=i++;this.T=i++;this.C=i++;this.V=i++;this.D=i++;this.U=i++;this.ae=i++;this.aj=i++;this.aa=i++;this.af=i++;this.aB=i++;this.IsSomethingChanged=false;this.isScroll2Directions=false;this.isScrollInfinite=false;this.leftChartVersion=0;this.infoDataVersion=0;this.chartVersion=0;this.chartCode='';this.chartTimer;this.isChartUpdating=false;this.lastKeyPressTime=new Date();this.keyPressedString='';this.FocusedRow=null;this.scrollStep=2;this.scrollDelay=70;this.preChangedCells=new Array();this.changedCells=new Array();};UPCOMScrollStockBoard.prototype={chartInfoParse:function(str){var pairs=str.split(';');chartInfo=new Object();if(pairs[0]!='')chartInfo.Price=parseInt(pairs[0],10)/1000;else chartInfo.Price=0;if(pairs[1]!=''){var time=objX.iToday+parseInt(pairs[1])*1000;chartInfo.Time=time;}else chartInfo.Time=objX.iToday;return chartInfo;},onGetChartUPComplete:function(arg){if(arg!=null){objX.chartIndexVersion=arg.DataVersion;var rows=arg.Update.split('|');if(rows.length>0){var i;for(i=0;i<rows.length;i++){var point=objX.chartInfoParse(rows[i]);objX.chartInfo.push([point.Time,point.Price]);}}if(objX.chartInfo.length>=2){if(objX.isCreatedNew){objX.lineReference=objX.chart.addSeries(new EJSC.LineSeries(new EJSC.ArrayDataHandler([[1,arg.Reference]]),{title:'Reference',color:'#FBF209',lineWidth:2}));objX.lineSeries=objX.chart.addSeries(new EJSC.LineSeries(new EJSC.ArrayDataHandler(objX.chartInfo),{title:'RPSoft',color:'#00FF00',lineWidth:1}));objX.isCreatedNew=false;objX.chart.hideTitlebar();}var startTime=new Date();startTime.setTime(objX.chartInfo[0][0]);startTime.setHours(10,00,0);var endTime=new Date();endTime.setTime(objX.chartInfo[0][0]);endTime.setHours(15,00,0);while(startTime>objX.chartInfo[0][0]){objX.chartInfo.splice(0,1);}objX.lineSeries.getDataHandler().setArray(objX.chartInfo);objX.lineReference.getDataHandler().setArray([[startTime.getTime(),arg.Reference],[endTime.getTime(),arg.Reference]]);objX.chart.axis_bottom.setExtremes(startTime.getTime(),endTime.getTime());objX.lineSeries.reload();objX.lineReference.reload();}}if(objX.Conf!=undefined)clearTimeout(objX.Conf);objX.Conf=setTimeout('var retIdx = StockBoard.DataFeeder.GetUPStockChartIndex(objX.chartIndexVersion, objX.onGetChartUPComplete, objX.onGetChartUPTimeout, objX.onGetChartUPError);',Conf.UpdateInfoInterval*5);},doShowHint:function(point,series,chart,hint_string){if(series==objX.lineSeries){hint_string='UPCom-Index [y] lúc [x]';}return hint_string;},showActiveMenu:function(){var tblFixedHeight=0;for(var h=0;h<objX.aFixedStockSymbol.length;h++){tblFixedHeight+=20;}var sumh=document.body.clientHeight-tblFixedHeight;if(objX.ockVisibleTab.checked==true){document.getElementById('trPanel').style.display='none';if(objX.ockVisibleVNIndex.checked==true){objX.odivScrollBarStockInfo.style.height=parseInt(sumh)-75+'px';}else{objX.odivScrollBarStockInfo.style.height=parseInt(sumh)-100+'px';}}else{document.getElementById('trPanel').style.display='';if(objX.ockVisibleVNIndex.checked==true){objX.odivScrollBarStockInfo.style.height=parseInt(sumh)+50+'px';}else{objX.odivScrollBarStockInfo.style.height=parseInt(sumh)-200+'px';}}},showActiveVNIndex:function(){var tblFixedHeight=0;for(var h=0;h<objX.aFixedStockSymbol.length;h++){tblFixedHeight+=20;}var sumh=document.body.clientHeight-tblFixedHeight;if(objX.ockVisibleVNIndex.checked==true){document.getElementById('trVNINDEX').style.display='none';if(objX.ockVisibleTab.checked==true){objX.odivScrollBarStockInfo.style.height=parseInt(sumh)-80+'px';}else{objX.odivScrollBarStockInfo.style.height=parseInt(sumh)-180+'px';}}else{document.getElementById('trVNINDEX').style.display='';if(objX.ockVisibleTab.checked==true){objX.odivScrollBarStockInfo.style.height=parseInt(sumh)-100+'px';}else{objX.odivScrollBarStockInfo.style.height=parseInt(sumh)-220+'px';}}},onchangeOption:function(cbOption){if(cbOption.options[cbOption.selectedIndex].value=='IntervalPage'){$get('g').innerHTML='Tốc đột lật trang';$get('txtScrollDelay').value='5000';sbObj.IsSomethingChanged=true;}else{$get('g').innerHTML='Tốc độ cuộn';$get('txtScrollDelay').value='70';sbObj.IsSomethingChanged=true;}},refreshImageAgain:function(imgId,url){var chartImage=$get(imgId);chartImage.src=url;chartImage.visible='true';},refreshLeftChart:function(symbol){var ret=StockBoard.DataFeeder.GetStockChartCode(symbol,objX.leftChartVersion,objX.onGetLeftChartComplete,objX.onGetLeftChartError,objX.onGetLeftChartError);},onGetLeftChartError:function(arg){},onGetLeftChartComplete:function(arg){if(arg==null)return;objX.refreshImageAgain('imgLeftChart','tmp/'+arg.SymbolName+arg.ImageName+'.png');objX.chartLeftVersion=arg.Version;},onGetUpComMktInfoComplete:function(arg){var record=dataConversion.mktInfoDataParse(arg.MarketUpdated);if(record.tradingDay!=undefined){objX.otxtTradingDay.innerHTML=record.tradingDay;if(objX.infoDataVersion!=0){objX.preChangedCells.push(objX.otxtTradingDay);objX.otxtTradingDay.style.backgroundColor=Conf.UpdatedColor;}}if(record.marketIndex!=undefined){var changePecent=(record.indexChange*100/(record.marketIndex-record.indexChange)).toFixed(2);var rec=new Object();rec.referencePrice=record.marketIndex-record.indexChange;rec.floorPrice=record.referencePrice*0.95;rec.ceilingPrice=record.referencePrice*1.05;objX.otxtVNIndex.style.color=misc.findPriceCellColorName(record.marketIndex,rec);objX.otxtTotalShares.style.color=misc.findPriceCellColorName(record.marketIndex,rec);objX.otxtTotalValue.style.color=misc.findPriceCellColorName(record.marketIndex,rec);objX.otxtVNIndex.innerHTML=RPSUtils.numToStringWithDgtGrp(record.marketIndex)+'&nbsp;'+misc.findPriceTrendingSignHASE(record.marketIndex,rec)+'&nbsp;('+RPSUtils.numToStringWithDgtGrp(record.indexChange)+';'+RPSUtils.numToStringWithDgtGrp(changePecent)+'&nbsp;%)';if(objX.infoDataVersion!=0){objX.preChangedCells.push(objX.otxtVNIndex);objX.otxtVNIndex.style.backgroundColor=Conf.UpdatedColor;}}if(record.totalTrade!=undefined){objX.otxtTotalTrade.innerHTML=RPSUtils.numToStringWithDgtGrp(record.totalTrade);if(objX.infoDataVersion!=0){objX.preChangedCells.push(objX.otxtTotalTrade);objX.otxtTotalTrade.style.backgroundColor=Conf.UpdatedColor;}}if(record.totalShares!=undefined){objX.otxtTotalShares.innerHTML=RPSUtils.numToStringWithDgtGrp(record.totalShares/1000);if(objX.infoDataVersion!=0){objX.preChangedCells.push(objX.otxtTotalShares);objX.otxtTotalShares.style.backgroundColor=Conf.UpdatedColor;}}if(record.totalValue!=undefined){objX.otxtTotalValue.innerHTML=RPSUtils.numToStringWithDgtGrp(Math.round(record.totalValue/1000000));if(objX.infoDataVersion!=0){objX.preChangedCells.push(objX.otxtTotalValue);objX.otxtTotalValue.style.backgroundColor=Conf.UpdatedColor;}}if(record.advances!=undefined){objX.otxtUpCounter.innerHTML=RPSUtils.numToStringWithDgtGrp(record.advances);if(objX.infoDataVersion!=0){objX.preChangedCells.push(objX.otxtUpCounter);objX.otxtUpCounter.style.backgroundColor=Conf.UpdatedColor;}}if(record.declines!=undefined){objX.otxtStayCounter.innerHTML=RPSUtils.numToStringWithDgtGrp(record.declines);if(objX.infoDataVersion!=0){objX.preChangedCells.push(objX.otxtStayCounter);objX.otxtStayCounter.style.backgroundColor=Conf.UpdatedColor;}}if(record.noChange!=undefined){objX.otxtDownCounter.innerHTML=RPSUtils.numToStringWithDgtGrp(record.noChange);if(objX.infoDataVersion!=0){objX.preChangedCells.push(objX.otxtDownCounter);objX.otxtDownCounter.style.backgroundColor=Conf.UpdatedColor;}}if(record.onlineCounter!=undefined){$get('txtOnlineCounter').innerHTML=RPSUtils.numToStringWithDgtGrp(record.onlineCounter);if(objX.infoDataVersion!=0){objX.preChangedCells.push($get('txtOnlineCounter'));objX.otxtOnlineCounter.style.backgroundColor=Conf.UpdatedColor;}}if(record.marketMessage!=undefined){objX.otxtMktStatus.innerHTML=record.marketMessage;objX.SaveHaMarketStatus=record.marketMessage;switch(Conf.LanguageSelect){case 'Vn':objX.otxtMktStatus.innerHTML=record.marketMessage;break;case 'En':switch(record.marketMessage){case 'Mở cửa':objX.otxtMktStatus.innerHTML='Open';break;case 'Đóng cửa':objX.otxtMktStatus.innerHTML='Close';break;case 'Nhận lệnh':objX.otxtMktStatus.innerHTML='Order receiving';break;}break;}if(objX.infoDataVersion!=0){objX.otxtMktStatus.style.backgroundColor=Conf.UpdatedColor;objX.preChangedCells.push(objX.otxtMktStatus);}}},keyPress:function(e){if(window.event){keynum=e.keyCode}else if(e.which){keynum=e.which;}if(keynum==13){objX.keyPressedString="";return;}theKey=String.fromCharCode(keynum);var delayTime=new Date()-objX.lastKeyPressTime;objX.lastKeyPressTime=new Date();if(delayTime<=Conf.keypressDelayTime)objX.keyPressedString+=theKey;else objX.keyPressedString=theKey;var row;var notFoundYet=true;for(i=0;i<objX.otblFixedStockInfo.rows.length;i++){row=objX.otblFixedStockInfo.rows[i];if(row.id.substring(1).indexOf(objX.keyPressedString)==0){if(objX.FocusedRow!=null)objX.unFocuseRow(objX.FocusedRow);objX.focuseRow(row);notFoundYet=false;break;}}if(notFoundYet)for(i=0;i<objX.otblScrollStockInfo.rows.length;i++){row=objX.otblScrollStockInfo.rows[i];if(row.id.substring(1).indexOf(objX.keyPressedString)==0){if(objX.FocusedRow!=null)objX.unFocuseRow(objX.FocusedRow);objX.focuseRow(row);var top=row.offsetTop-100;if(top<0)top=0;objX.odivScrollBarStockInfo.scrollTop=top;break;}}},sortCol:function(idx){var colName;for(i=0;i<objX.aStockInfo.length;i++){if(idx!=4)objX.value[i]=0;switch(idx){case 1:objX.value[i]=objX.aStockInfo[i].referencePrice;break;case 2:objX.value[i]=objX.aStockInfo[i].ceilingPrice;break;case 3:objX.value[i]=objX.aStockInfo[i].floorPrice;break;case 4:objX.value[i]=objX.aStockInfo[i].stockSymbol;break;case 12:objX.value[i]=objX.aStockInfo[i].lastPrice;break;case 13:objX.value[i]=objX.aStockInfo[i].lastPrice-objX.aStockInfo[i].referencePrice;break;case 14:objX.value[i]=objX.aStockInfo[i].lastVolume;break;case 21:objX.value[i]=objX.aStockInfo[i].totalTraded;break;case 22:objX.value[i]=objX.aStockInfo[i].highestPrice;break;case 23:objX.value[i]=objX.aStockInfo[i].lowestPrice;break;case 24:objX.value[i]=objX.aStockInfo[i].averagePrice;break;default:break;}objX.index[i]=i;}for(i=1;i<objX.iInfoColCount+1;i++){colName='Sort'+i;if($get(colName)!=null)$get(colName).innerHTML='';}objX.ColSorting[idx]= -1*objX.ColSorting[idx];colName='Sort'+idx;if(objX.ColSorting[idx]==1)$get(colName).innerHTML='&nbsp;<img src="Images/asc.gif" alt=" " />';else $get(colName).innerHTML='&nbsp;<img src="Images/desc.gif" alt=" " />';for(i=0;i<objX.aStockInfo.length-1;i++)for(j=i+1;j<objX.aStockInfo.length;j++)if((objX.ColSorting[idx]>0&&objX.value[objX.index[i]]>objX.value[objX.index[j]])||(objX.ColSorting[idx]<0&&objX.value[objX.index[i]]<objX.value[objX.index[j]])){k=objX.index[j];objX.index[j]=objX.index[i];objX.index[i]=k;}objX.isSorting=true;var oldDataVersion=objX.infoDataVersion;objX.infoDataVersion=0;objX.initTablesData();objX.infoDataVersion=oldDataVersion;objX.isSorting=false;},init:function(){var retIdx=StockBoard.DataFeeder.GetUPStockChartIndex(objX.chartIndexVersion,objX.onGetChartUPComplete,objX.onGetChartUPTimeout,objX.onGetChartUPError);var ret=StockBoard.DataFeeder.GetUpComInfo(0,objX.onInitComplete,objX.onInitInfoTimeout,objX.onInitInfoError);if(objX.otblStockInfoHeader!=null){objX.otblStockInfoHeader.style.width=(document.documentElement.clientWidth-23)+'px';}objX.ockShowTooltip.checked=true;objX.isShowTheRest=(RPSUtils.getCookie('UpComIsShowTheRest')!='false');objX.scrollType=RPSUtils.getCookie('UpComScrollType');if(objX.scrollType=="")objX.scrollType='NoScroll';var i=0;for(i=0;i<objX.ocboScrollOptions.length;i++)if(objX.ocboScrollOptions.options[i].value==objX.scrollType){objX.ocboScrollOptions.selectedIndex=i;break;}if(RPSUtils.getCookie('UpComScrollStep')!="")objX.scrollStep=RPSUtils.getCookie('UpComScrollStep');objX.otxtScrollStep.value=objX.scrollStep;if(RPSUtils.getCookie('UpComScrollDelay')!="")objX.scrollDelay=RPSUtils.getCookie('UpComScrollDelay');objX.otxtScrollDelay.value=objX.scrollDelay;if(objX.ochShowTheRest!=null){objX.ochShowTheRest.checked=objX.isShowTheRest;}if(RPSUtils.getCookie('LangSelect')==null)RPSUtils.setCookie('LangSelect','Vn',300);else if(RPSUtils.getCookie('LangSelect')=="Vn")changeLanguage(Conf.LanguageVn,RPSUtils.getCookie('LangSelect'),'UpCom');else if(RPSUtils.getCookie('LangSelect')=="En")changeLanguage(Conf.LanguageEn,RPSUtils.getCookie('LangSelect'),'UpCom');},onInitInfoTimeout:function(arg){setTimeout('var ret = StockBoard.DataFeeder.GetUpComInfo( 0, objX.onInitComplete, objX.onInitInfoTimeout, objX.onInitInfoError);',Conf.UpdateInfoInterval*5);},onInitInfoError:function(arg){setTimeout('var ret = StockBoard.DataFeeder.GetUpComInfo( 0, objX.onInitComplete, objX.onInitInfoTimeout, objX.onInitInfoError);',Conf.UpdateInfoInterval*5);},onGetChartUPTimeout:function(arg){setTimeout('var retIdx = StockBoard.DataFeeder.GetUPStockChartIndex(objX.chartIndexVersion, objX.onGetChartUPComplete, objX.onGetChartUPTimeout, objX.onGetChartUPError);',Conf.UpdateInfoInterval*5);},onGetChartUPError:function(arg){setTimeout('var retIdx = StockBoard.DataFeeder.GetUPStockChartIndex(objX.chartIndexVersion, objX.onGetChartUPComplete, objX.onGetChartUPTimeout, objX.onGetChartUPError);',Conf.UpdateInfoInterval*5);},onStockCellClick:function(cellID){var stockSymbol=cellID.parentNode.cells[objX.f].innerHTML;var link=Conf.InfoLink+stockSymbol;window.open(link,'','');},onRowOver:function(e){var targ;if(!e){var e=window.event;}if(e.target){targ=e.target;}else if(e.srcElement){targ=e.srcElement;}if(targ.nodeType==3){targ=targ.parentNode;}if(objX.ockShowTooltip.checked==true)objX.showTooltip(e.clientX,e.clientY,targ.innerHTML);},toolTipVolumnUpcom:function(e){},showTooltioUC:function(symbol,strVolumn,price){var list=new Array();if(strVolumn!=null&&strVolumn!=undefined)list=strVolumn.split('|');var currentKL=list[0];var currentNo=1;var groupNo=1;var returnValue='overflow:auto"><table border="1" cellpadding="0" cellspacing="0" width="120px" style="background-color:Black;color:White;font-family:Arial;font-size:12px;" ><tr><td colspan="2" style="font-weight:bold;background-color:#525152;">&nbsp;'+symbol+'<span id="lblPriceTooltip">-Giá</span> &nbsp;:&nbsp;'+price+'</td></tr><tr><td style="width: 60%"  align="center"><span id="lblVolumnTooltipUpcom">Khối lượng</span></td><td style="width: 40%"><span id="lblCommandsTooltipUpcom">Số lệnh</span></td></tr>';var i;for(i=1;i<list.length;i++){if(list[i]==currentKL){currentNo++;}else{returnValue=returnValue+'<tr><td style="width: 60%" align="right">'+currentKL+'</td><td style="width: 40%" align="center">'+currentNo+'</td></tr>';currentKL=list[i];currentNo=1;groupNo=groupNo+1;}}returnValue=returnValue+'<tr><td style="width: 60%" align="right">'+currentKL+'</td><td style="width: 40%" align="center">'+currentNo+'</td></tr>';if(groupNo>6){returnValue='<div style="height: auto; "'+returnValue+'</table></div>';}else{returnValue='<div style="'+returnValue+'</table></div>';}toolTip(returnValue);},showToolTipVolume:function(cell,idxs){var idx=RPSUtils.quickSearch(objX.aStockInfo,cell.parentNode.cells[objX.f].innerHTML,misc.cmpStockInfo);var stockInfo=objX.aStockInfo[idx];if(idxs==1){if(stockInfo.BuyQuantityDetail1!=null)objX.showTooltioUC(stockInfo.StockSymbol,stockInfo.BuyQuantityDetail1,RPSUtils.numToStringWithDgtGrp(stockInfo.bestBidPrice1/1000));}if(idxs==2){if(stockInfo.BuyQuantityDetail2!=null)objX.showTooltioUC(stockInfo.StockSymbol,stockInfo.BuyQuantityDetail2,RPSUtils.numToStringWithDgtGrp(stockInfo.bestBidPrice2/1000));}if(idxs==3){if(stockInfo.BuyQuantityDetail2!=null)objX.showTooltioUC(stockInfo.StockSymbol,stockInfo.BuyQuantityDetail3,RPSUtils.numToStringWithDgtGrp(stockInfo.bestBidPrice3/1000));}if(idxs==4){if(stockInfo.SellQuantityDetail1!=null)objX.showTooltioUC(stockInfo.StockSymbol,stockInfo.SellQuantityDetail1,RPSUtils.numToStringWithDgtGrp(stockInfo.bestOfferPrice1/1000));}if(idxs==5){if(stockInfo.SellQuantityDetail2!=null)objX.showTooltioUC(stockInfo.StockSymbol,stockInfo.SellQuantityDetail2,RPSUtils.numToStringWithDgtGrp(stockInfo.bestOfferPrice2/1000));}if(idxs==6){if(stockInfo.SellQuantityDetail3!=null)objX.showTooltioUC(stockInfo.StockSymbol,stockInfo.SellQuantityDetail3,RPSUtils.numToStringWithDgtGrp(stockInfo.bestOfferPrice3/1000));}},hideTooltipVolumn:function(){toolTipUpcom.hide();},showTooltip:function(clientX,clientY,stockSymbol){objX.onGetUPNameInfoBySymbol(stockSymbol);var idx=RPSUtils.quickSearch(objX.aStockInfo,stockSymbol,misc.cmpStockInfo);if(idx== -1)return;var stockInfo=objX.aStockInfo[idx];RPSUtils.showTooltip(clientX,clientY,Conf.messageTooltip);if(Conf.LanguageSelect=='Vn'){$get('lblTooltipOpenPrice').innerHTML='Giá mở cửa:';$get('lblTooltipClosePrice').innerHTML='Đóng cửa:';$get('lblTooltipHighestPrice').innerHTML='Giá cao nhất:';$get('lblTooltipLowestPrice').innerHTML='Thấp nhất:';$get('lblTooltipAveragePrice').innerHTML='Giá bình quân gia quyền:';$get('lblTooltipPutthroughVolume').innerHTML='GDTThuận-SL:';$get('lblTooltipPutthroughValue').innerHTML='CP - Giá trị:';$get('lblTooltipForeignBuyVolume').innerHTML='NĐT NN-Mua:';$get('lblTooltipForeignBuyValue').innerHTML='CP - Giá trị:';$get('lblTooltipForeignSellVolume').innerHTML='NĐT NN-Bán:';$get('lblTooltipForeignSellValue').innerHTML='CP - Giá trị:';$get('lblTotalBidVolume').innerHTML='Tổng dư mua:';$get('lblTooltipTotalOfferVolume').innerHTML='Tổng dư bán:';$get('lblTooltipTotalTraded').innerHTML='Tổng KL:';$get('lblTooltipTotalValue').innerHTML='Tổng giá trị:';$get('lblTooltipCurrentRoom').innerHTML='Room còn lại:';}else{$get('lblTooltipOpenPrice').innerHTML='Open price:';$get('lblTooltipClosePrice').innerHTML='Close price:';$get('lblTooltipHighestPrice').innerHTML='Highest price:';$get('lblTooltipLowestPrice').innerHTML='Lowest price:';$get('lblTooltipAveragePrice').innerHTML='Average price:';$get('lblTooltipPutthroughVolume').innerHTML='Putthrough volume:';$get('lblTooltipPutthroughValue').innerHTML='Putthrough value:';$get('lblTooltipForeignBuyVolume').innerHTML='Foreign buy volume:';$get('lblTooltipForeignBuyValue').innerHTML='Foreign buy value:';$get('lblTooltipForeignSellVolume').innerHTML='Foreign sell volume:';$get('lblTooltipForeignSellValue').innerHTML='Foreign sell value:';$get('lblTotalBidVolume').innerHTML='Total bid volume:';$get('lblTooltipTotalOfferVolume').innerHTML='Total offer volume:';$get('lblTooltipTotalTraded').innerHTML='Total traded';$get('lblTooltipTotalValue').innerHTML='Total value:';$get('lblTooltipCurrentRoom').innerHTML='Current room:';}$get('txtTooltipSymbol').innerHTML=stockInfo.StockSymbol;$get('trTooltipForeignSellVolume').style.display='';$get('trTooltipTotalBidAndOffer').style.display='';$get('txtTooltipOpenPrice').innerHTML=RPSUtils.numToStringWithDgtGrp((stockInfo.openPrice/1000).toFixed(1));$get('txtTooltipClosePrice').innerHTML=RPSUtils.numToStringWithDgtGrp((stockInfo.closePrice/1000).toFixed(1));$get('txtTooltipHighestPrice').innerHTML=RPSUtils.numToStringWithDgtGrp((stockInfo.highestPrice/1000).toFixed(1));$get('txtTooltipLowestPrice').innerHTML=RPSUtils.numToStringWithDgtGrp((stockInfo.lowestPrice/1000).toFixed(1));$get('txtTooltipAveragePrice').innerHTML=RPSUtils.numToStringWithDgtGrp((stockInfo.averagePrice/1000).toFixed(1));$get('txtTooltipPutthroughVolume').innerHTML=RPSUtils.numToStringWithDgtGrp(stockInfo.putthroughVolume);$get('txtTooltipPutthroughValue').innerHTML=RPSUtils.numToStringWithDgtGrp((stockInfo.putthroughValue/1000).toFixed(1));$get('txtTooltipForeignSellVolume').innerHTML=RPSUtils.numToStringWithDgtGrp(stockInfo.foreignSellVolume);$get('txtTooltipForeignSellValue').innerHTML=RPSUtils.numToStringWithDgtGrp((stockInfo.foreignSellValue/1000).toFixed(1));$get('txtTooltipTotalTraded').innerHTML=RPSUtils.numToStringWithDgtGrp((stockInfo.totalTraded/1000).toFixed(1));$get('txtTooltipTotalBidVolume').innerHTML=RPSUtils.numToStringWithDgtGrp(stockInfo.totalBidVolume/1000);$get('txtTooltipTotalOfferVolume').innerHTML=RPSUtils.numToStringWithDgtGrp(stockInfo.totalOfferVolume/1000);$get('txtTooltipTotalValue').innerHTML=RPSUtils.numToStringWithDgtGrp((stockInfo.totalValue/1000).toFixed(1));$get('txtTooltipCurrentRoom').innerHTML=RPSUtils.numToStringWithDgtGrp(stockInfo.currentRoom);},hideTooltip:function(){RPSUtils.hideTooltip();},IsScrollChanged:function(scroll){if(objX.ochScroll2Directions.checked&&objX.ochScrollInfinite.checked){if(scroll==1)objX.ochScroll2Directions.checked=false;if(scroll==2)objX.ochScrollInfinite.checked=false;}objX.IsSomethingChanged=true;},OnSettingOK:function(){if(objX.IsSomethingChanged){objX.scrollType=objX.ocboScrollOptions.options[objX.ocboScrollOptions.selectedIndex].value;RPSUtils.setCookie('UpComScrollType',objX.scrollType,300);objX.scrollStep=objX.otxtScrollStep.value;RPSUtils.setCookie('UpComScrollStep',objX.scrollStep,300);objX.scrollDelay=objX.otxtScrollDelay.value;RPSUtils.setCookie('UpComScrollDelay',objX.scrollDelay,300);if(objX.ockShowTooltip.checked)RPSUtils.setCookie('HoseShowTooltip','true',300);else RPSUtils.setCookie('HoseShowTooltip','false',300);var i;var chkObj;var selected=new Array();for(i=0;i<objX.aStockInfo.length;i++){chkObj=$get('chk'+objX.aStockInfo[i].StockSymbol);if(chkObj!=undefined&&chkObj.checked){selected.push(objX.aStockInfo[i].StockSymbol);}}if(objX.scrollType!='NoScroll'||selected.length==0)objX.ochShowTheRest.checked=true;if(objX.ochShowTheRest.checked)RPSUtils.setCookie('UpComIsShowTheRest','true',300);else RPSUtils.setCookie('UpComIsShowTheRest','false',300);objX.isShowTheRest=objX.ochShowTheRest.checked;selected.sort();objX.aFixedStockSymbol=selected;var cookieValue=selected.join(',');RPSUtils.setCookie('UpComFixedStockSymbol',cookieValue,300);objX.initTables();var oldDataVersion=objX.infoDataVersion;objX.infoDataVersion=0;objX.initTablesData();objX.infoDataVersion=oldDataVersion;}objX.IsSomethingChanged=false;},OnSettingRefreshPut:function(){objX.drawPutthroughList();},ShowmpePutthrough:function(){objX.drawPutthroughList();},OnSettingRefreshForeign:function(){objX.ShowmpeForeign();},ShowmpeForeign:function(){objX.drawForeignList();},OnSettingCancel:function(){var i;var chkObj;for(i=0;i<objX.aStockInfo.length;i++){chkObj=$get('chk'+objX.aStockInfo[i].StockSymbol);if(chkObj!=undefined){chkObj.checked=false;}}for(i=0;i<objX.aFixedStockSymbol.length;i++){chkObj=$get('chk'+objX.aFixedStockSymbol[i]);if(chkObj!=undefined){chkObj.checked=true;}}for(i=0;i<objX.ocboScrollOptions.length;i++)if(objX.ocboScrollOptions.options[i].value==objX.scrollType){objX.ocboScrollOptions.selectedIndex=i;break;}objX.ochShowTheRest.checked=objX.isShowTheRest;objX.IsSomethingChanged=false;},OnSettingSelectNone:function(){var i;var chkObj;for(i=0;i<objX.aStockInfo.length;i++){chkObj=$get('chk'+objX.aStockInfo[i].StockSymbol);if(chkObj!=undefined){objX.IsSomethingChanged=true;chkObj.checked=false;}}},onInitComplete:function(arg){if(arg==null)return setTimeout('var ret = StockBoard.DataFeeder.GetUpComInfo( 0, objX.onInitComplete, objX.onInitInfoTimeout, objX.onInitInfoError);',Conf.UpdateInfoInterval*5);if(arg.MarketUpdated.length>0)objX.onGetUpComMktInfoComplete(arg);if(arg.StockUpdated.length>0)objX.onInitStockComplete(arg);},onInitStockComplete:function(arg){objX.aStockInfo=new Array();var fixedStockSymbols=RPSUtils.getCookie('UpComFixedStockSymbol');var aStockSymbol=fixedStockSymbols.split(',');aStockSymbol.sort();var recordSet=arg.StockUpdated.split(';');var i;var record;var idx;objX.aFixedStockSymbol=new Array();for(i=0;i<recordSet.length;i++){if(recordSet[i].length>2){record=dataConversion.stockInfoDataParseUpCom(recordSet[i]);idx=RPSUtils.quickSearch(aStockSymbol,record.StockSymbol,misc.cmp2String);if(idx>=0)objX.aFixedStockSymbol.push(record.StockSymbol);objX.aStockInfo.push(record);}}objX.aStockInfo.sort(misc.cmp2StockInfo);objX.aFixedStockSymbol.sort();for(i=0;i<objX.aStockInfo.length;i++)objX.index[i]=i;objX.initTables();objX.initTablesData();objX.infoDataVersion=arg.DataVersion;var iCol=0;var j;var row=objX.otblStockSymbolList.rows[0];for(i=0;i<objX.aStockInfo.length;i++){row.cells[iCol*2].innerHTML='<input id="chk'+objX.aStockInfo[i].StockSymbol+'" type="checkbox" onclick="sbObj.IsSomethingChanged = true;" />';row.cells[iCol*2+1].innerHTML=objX.aStockInfo[i].StockSymbol;$get('chk'+objX.aStockInfo[i].StockSymbol).onclick=function(){objX.IsSomethingChanged=true;};iCol++;if(iCol>=10){iCol=0;row=objX.otblStockSymbolList.insertRow(objX.otblStockSymbolList.rows.length);for(j=0;j<20;j++){row.insertCell(j);}}}objX.infoDataVersion=arg.DataVersion;},onGetUPNameInfoBySymbol:function(pSymbol){var language;if(Conf.LanguageSelect=='Vn'){language=0;}else{language=1;}ret=StockBoard.DataFeeder.GetUPNameInfoBySymbol(pSymbol,language,objX.onGetStockSymbolDescListComlete,objX.onGetStockSymbolDescListError,objX.onGetStockSymbolDescListError);},onGetStockSymbolDescListComlete:function(arg){var i=0;var arr=arg.split(";");for(i=0;i<arr.length;i++){var vals=arr[i].split("|");$get('txtTooltipName').innerHTML=vals[0];}},onGetStockSymbolDescListError:function(){},initTables:function(){var tableDefinition=objX.tableFixedStockInfo;for(i=1;i<objX.aFixedStockSymbol.length;i++){if((i%2)==1){tableDefinition+=objX.rowOdd;}else{tableDefinition+=objX.rowEven;}};tableDefinition+="</table>";objX.odivFixedStockInfo.innerHTML=tableDefinition;objX.otblFixedStockInfo=$get('tblFixedStockInfo');objX.otblFixedStockInfo.style.width=objX.otblStockInfoHeader.style.width;var iTotalTableHeight=document.documentElement.clientHeight;if(objX.aFixedStockSymbol.length>0){if(!objX.isShowTheRest||objX.aStockInfo.length==objX.aFixedStockSymbol.length)objX.odivFixedStockInfo.style.height=iTotalTableHeight+'px';else if(objX.aFixedStockSymbol.length<=objX.iMaxFixedCount)objX.odivFixedStockInfo.style.height='auto';else objX.odivFixedStockInfo.style.height=(objX.iMaxFixedCount*objX.iLineHeight)+'px';objX.odivFixedStockInfo.style.display='block';}else objX.odivFixedStockInfo.style.display='none';if(objX.isShowTheRest){tableDefinition=objX.tableScrollBarStockInfo;for(i=1;i<objX.aStockInfo.length-objX.aFixedStockSymbol.length;i++){if((i%2)==0){tableDefinition+=objX.rowOdd;}else{tableDefinition+=objX.rowEven;}};tableDefinition+="</table></br>";objX.odivScrollBarStockInfo.innerHTML=tableDefinition;objX.otblScrollStockInfo=$get('tblScrollBarStockInfo');objX.otblScrollStockInfo.style.width=objX.otblStockInfoHeader.style.width;objX.odivScrollBarStockInfo.style.display='none';var iAvailableHeight=iTotalTableHeight-document.body.clientHeight;objX.odivScrollBarStockInfo.style.height=iAvailableHeight+'px';objX.odivScrollBarStockInfo.style.display='block';}else objX.odivScrollBarStockInfo.style.display='none';var heightTableRow=objX.odivScrollBarStockInfo.style.height.split('px');objX.iShowedLines=Math.floor(parseInt(heightTableRow[0])/20)},initTablesData:function(){var row;var coutRowsScrollStockInfo=0;var countRowsFixedStockInfo=0;for(i=0;i<objX.aStockInfo.length;i++){record=objX.aStockInfo[objX.index[i]];idx=RPSUtils.quickSearch(objX.aFixedStockSymbol,record.StockSymbol,misc.cmp2String);if(idx>=0){row=objX.otblFixedStockInfo.rows[countRowsFixedStockInfo];countRowsFixedStockInfo++;}else if(objX.isShowTheRest){row=objX.otblScrollStockInfo.rows[coutRowsScrollStockInfo];coutRowsScrollStockInfo++;}else continue;if(idx>=0||objX.scrollType!='IntervalPage'){var cell=row.cells[objX.f];cell.innerHTML=record.StockSymbol;cell.onmouseout=objX.hideTooltip;row.onmouseover=objX.onRowFocused;row.onmouseout=objX.onRowUnfocused;row.ondblclick=objX.onRowDblClick;row.id='@'+record.StockSymbol;record.TableRow=row;}else record.TableRow=null;var cellVolumnTooltip=null;objX.updateStockInfoRow(record,record);}if(objX.updateInfoTimer!=undefined)clearTimeout(objX.updateInfoTimer);if(objX.scrollTableTimer!=undefined)clearTimeout(objX.scrollTableTimer);objX.updateInfoTimer=setTimeout('objX.updateInfo()',Conf.UpdateInfoInterval);if(objX.isShowTheRest){objX.odivScrollBarStockInfo.style.overflow='auto';if(objX.scrollType!='NoScroll'){objX.odivScrollBarStockInfo.style.overflow='hidden';if(objX.scrollType=='IntervalPage'){objX.intervalPage();objX.odivScrollBarStockInfo.style.overflow='hidden';}else if(objX.scrollType=='UpDown'){objX.delayEndsScrollTables();}else{objX.otblScrollStockInfo.insertRow(objX.otblScrollStockInfo.rows.length);if(objX.scrollTableTimer!=undefined)clearTimeout(objX.scrollTableTimer);objX.scrollTableTimer=setTimeout('objX.scrollTableInfinite()',objX.crollDelay);}}}},focuseRow:function(row){for(j=0;j<objX.iInfoColCount;j++){if(row.cells[j]!=null)row.cells[j].style.backgroundColor=Conf.FocusedColor;}objX.FocusedRow=row;},unFocuseRow:function(row){if(row==null)return;for(j=0;j<objX.iInfoColCount;j++){if(row.cells[j]!=null)row.cells[j].style.backgroundColor='';}objX.FocusedRow=null;},showHistory:function(){objX.drawHistoryList(_currentSymbol);},drawHistoryList:function(symbol){his=StockBoard.DataFeeder.GetStockDetail(symbol,objX.onGetHistoryListComlete,objX.onGetHistoryListError,objX.onGetHistoryListError);},onGetHistoryListComlete:function(arg){var tblHistory=objX.otblBodyHistory;var row;while(tblHistory.rows.length>0)tblHistory.deleteRow(0);var details=arg.Details.split(';');var i;var j;var record;if(details!=null){for(i=0;i<details.length;i++){record=details[i].split('|');if(record.length!=3){continue;}row=tblHistory.insertRow(tblHistory.rows.length);for(j=0;j<4;j++){var cell=row.insertCell(j);if(((tblHistory.rows.length)%2)==1)cell.className=objX.cssHistoryOdd[j];else cell.className=objX.cssHistoryEven[j];}if(record[1]==0){row.cells[1].style.color='Yellow';row.cells[2].style.color='Yellow';}if(record[1]==arg.Celling){row.cells[1].style.color='#FF00FF';row.cells[2].style.color='#FF00FF';}else if(record[1]>arg.BasicPrice){row.cells[1].style.color='Lime';row.cells[2].style.color='Lime';}else if(record[1]==arg.BasicPrice){row.cells[1].style.color='Yellow';row.cells[2].style.color='Yellow';}else if(record[1]==arg.Floor){row.cells[1].style.color='#58abc9';row.cells[2].style.color='#58abc9';}else if(record[1]<arg.BasicPrice){row.cells[1].style.color='#FF0000';row.cells[2].style.color='#FF0000';}row.cells[0].width='25%';row.cells[0].innerHTML=record[0];row.cells[1].width='25%';row.cells[1].innerHTML=record[1];row.cells[2].width='25%';row.cells[2].innerHTML=(parseInt(record[1])-parseInt(arg.BasicPrice)).toFixed(1);row.cells[3].width='25%';row.cells[3].innerHTML=RPSUtils.numToStringWithDgtGrp(record[2]/1000);}}},onGetHistoryListError:function(){setTimeout('put = StockBoard.DataFeeder.GetStockDetail(objX.onGetPutThroughListComlete,objPutThrough.onGetPutThroughListError,objX.onGetPutThroughListError);',2000);},drawForeignList:function(){var j;var tb=objX.otblForeignList;var row;while(tb.rows.length>1)tb.deleteRow(1);for(i=0;i<objX.aStockInfo.length;i++){record=objX.aStockInfo[i];if((record.foreignBuyVolume!=undefined&&record.foreignBuyVolume!=0)||(record.foreignSellVolume!=undefined&&record.foreignSellVolume!=0)){row=tb.insertRow(tb.rows.length);for(j=0;j<6;j++){var cell=row.insertCell(j);if(((tb.rows.length)%2)==1)cell.className=objX.cssForeignOdd[j];else cell.className=objX.cssForeignEven[j];}row.cells[0].innerHTML=record.StockSymbol;if(Conf.LanguageSelect=='Vn')row.cells[5].innerHTML=record.Name;else row.cells[5].innerHTML=record.Name_en;if(record.foreignBuyVolume!=undefined&&record.foreignBuyVolume!=0){row.cells[1].innerHTML=RPSUtils.numToStringWithDgtGrp(record.foreignBuyVolume/1000);row.cells[2].innerHTML=RPSUtils.numToStringWithDgtGrp(record.foreignBuyValue/1000);}if(record.foreignSellVolume!=undefined&&record.foreignSellVolume!=0){row.cells[3].innerHTML=RPSUtils.numToStringWithDgtGrp(record.foreignSellVolume/1000);row.cells[4].innerHTML=RPSUtils.numToStringWithDgtGrp(record.foreignSellValue/1000);}}}},drawPutthroughList:function(){var j;var tb=objX.otblPutthroughList;var row;while(tb.rows.length>0)tb.deleteRow(0);if(objX.aStockInfo!=undefined){for(i=0;i<objX.aStockInfo.length;i++){record=objX.aStockInfo[i];if(record.putthroughVolume!=undefined&&record.putthroughVolume!=0){row=tb.insertRow(tb.rows.length);for(j=0;j<4;j++){var cell=row.insertCell(j);}row.cells[0].innerHTML=record.StockSymbol;row.cells[0].width='12%';row.cells[1].innerHTML=RPSUtils.numToStringWithDgtGrp(record.putthroughVolume/1000);row.cells[1].width='13%';row.cells[2].innerHTML=RPSUtils.numToStringWithDgtGrp(record.putthroughValue/1000);row.cells[2].width='15%';row.cells[3].innerHTML=record.Name;row.cells[3].width='60%';}}};},delayEndsScrollTables:function(){if(objX.scrollTableTimer!=undefined)clearTimeout(objX.scrollTableTimer);objX.scrollTableTimer=setTimeout('objX.scrollTable()',Conf.EndsScrollDelay);},scrollTable:function(){var scrollTop=objX.odivScrollBarStockInfo.scrollTop;scrollTop+=objX.scrollStep*objX.scrollDirection;if(scrollTop<0){objX.scrollDirection=1;objX.delayEndsScrollTables();}else if(scrollTop>objX.odivScrollBarStockInfo.scrollHeight){objX.scrollDirection= -1;objX.delayEndsScrollTables();}else{objX.odivScrollBarStockInfo.scrollTop=scrollTop;if(objX.odivScrollBarStockInfo.scrollTop!=scrollTop){objX.scrollDirection= -1;objX.delayEndsScrollTables();}else{if(objX.scrollTableTimer!=undefined)clearTimeout(objX.scrollTableTimer);objX.scrollTableTimer=setTimeout('objX.scrollTable()',objX.scrollDelay);}}},scrollTableInfinite:function(){if(objX.scrollTableTimer!=undefined)clearTimeout(objX.scrollTableTimer);objX.scrollTableTimer=setTimeout('objX.scrollTableInfinite()',objX.scrollDelay);var scrollTop=objX.odivScrollBarStockInfo.scrollTop;if(scrollTop>=objX.odivScrollBarStockInfo.scrollHeight-objX.odivScrollBarStockInfo.clientHeight){var firstRow=objX.otblScrollStockInfo.rows[0];var lastRow=objX.otblScrollStockInfo.rows[objX.otblScrollStockInfo.rows.length-1];var movedRowCount=objX.otblScrollStockInfo.rows.length-Math.ceil(objX.odivScrollBarStockInfo.clientHeight/(firstRow.clientHeight+1))-1;for(i=0;i<movedRowCount;i++){lastRow.parentNode.insertBefore(firstRow,lastRow);firstRow=objX.otblScrollStockInfo.rows[0];}scrollTop-=(firstRow.clientHeight+1)*movedRowCount;}scrollTop+=objX.scrollStep*objX.scrollDirection;objX.odivScrollBarStockInfo.scrollTop=scrollTop;},intervalPage:function(){var cell;while(objX.changedCells.length>0){cell=objX.changedCells.pop();cell.style.backgroundColor='';}while(objX.preChangedCells.length>0){cell=objX.preChangedCells.pop();cell.style.backgroundColor='';}var i;var idx;if(objX.CurrentStartIndex>=0){i=0;while(i<objX.iShowedLines){if(objX.CurrentStartIndex>=objX.aStockInfo.length)break;idx=RPSUtils.quickSearch(objX.aFixedStockSymbol,objX.aStockInfo[objX.CurrentStartIndex].StockSymbol,misc.cmp2String);if(idx<0){objX.aStockInfo[objX.CurrentStartIndex].TableRow=null;i++;}objX.CurrentStartIndex++;}if(objX.CurrentStartIndex>=objX.aStockInfo.length)objX.CurrentStartIndex=0;}else objX.CurrentStartIndex=0;idx=RPSUtils.quickSearch(objX.aFixedStockSymbol,objX.aStockInfo[objX.CurrentStartIndex].StockSymbol,misc.cmp2String);while(idx>=0){objX.CurrentStartIndex++;if(objX.CurrentStartIndex>=objX.aStockInfo.length)objX.CurrentStartIndex=0;idx=RPSUtils.quickSearch(objX.aFixedStockSymbol,objX.aStockInfo[objX.CurrentStartIndex].StockSymbol,misc.cmp2String);}i=0;var k=0;var oldDataVersion=objX.infoDataVersion;objX.infoDataVersion=0;while(k<objX.iShowedLines){if(objX.CurrentStartIndex+i>=objX.aStockInfo.length)break;var data=objX.aStockInfo[objX.CurrentStartIndex+i];idx=RPSUtils.quickSearch(objX.aFixedStockSymbol,data.StockSymbol,misc.cmp2String);if(idx<0){var row=objX.otblScrollStockInfo.rows[k];data.TableRow=row;row.cells[objX.f].innerHTML=data.StockSymbol;objX.updateStockInfoRow(data,data);k++;}i++;}objX.infoDataVersion=oldDataVersion;while(k<objX.iShowedLines){var row=objX.otblScrollStockInfo.rows[k];var j;for(j=0;j<objX.iInfoColCount;j++)row.cells[j].innerHTML='&nbsp;';k++;}if(objX.scrollTableTimer!=undefined)clearTimeout(objX.scrollTableTimer);if(objX.scrollType=='IntervalPage'){objX.scrollTableTimer=setTimeout('objX.intervalPage()',objX.scrollDelay);}},updateInfo:function(){if(objX.updateInfoTimer!=undefined)clearTimeout(objX.updateInfoTimer);var cell;while(objX.changedCells.length>0){cell=objX.changedCells.pop();cell.style.backgroundColor='';}while(objX.preChangedCells.length>0){cell=objX.preChangedCells.pop();cell.style.backgroundColor=Conf.FinishUpdatedColor;objX.changedCells.push(cell);}StockBoard.DataFeeder.GetUpComInfo(objX.infoDataVersion,objX.onUpdateInfoComplete,objX.onGetInfoTimeout,objX.onGetInfoError);},onGetInfoTimeout:function(arg){setTimeout('objX.updateInfo()',Conf.UpdateInfoInterval*5);},onGetInfoError:function(arg){setTimeout('objX.updateInfo()',Conf.UpdateInfoInterval*5);},onUpdateInfoComplete:function(arg){if(arg!=null){if(arg.StockUpdated.length>0)objX.onUpdateStockInfoComplete(arg);if(arg.MarketUpdated.length>0)objX.onGetUpComMktInfoComplete(arg);objX.infoDataVersion=arg.DataVersion;}if(objX.updateInfoTimer!=undefined)clearTimeout(objX.updateInfoTimer);objX.updateInfoTimer=setTimeout('objX.updateInfo()',Conf.UpdateInfoInterval);},onUpdateStockInfoComplete:function(arg){var recordSet=arg.StockUpdated.split(';');var i;var record;var idx;for(i=0;i<recordSet.length;i++){record=dataConversion.stockInfoDataParseUpCom(recordSet[i]);idx=RPSUtils.quickSearch(objX.aStockInfo,record,misc.cmp2StockInfo);if(idx>=0){objX.updateStockInfoRow(record,objX.aStockInfo[idx]);continue;}}},onRowDblClick:function(e){var targ;if(!e){var e=window.event;}if(e.target){targ=e.target.parentNode;}else if(e.srcElement){targ=e.srcElement.parentNode;}if(targ.nodeType==3){targ=targ.parentNode.parentNode;}var stockSymbol=targ.cells[objX.f].innerHTML;var i=RPSUtils.quickSearch(objX.aFixedStockSymbol,stockSymbol,misc.cmp2String);if(i<0){objX.aFixedStockSymbol.push(stockSymbol);objX.aFixedStockSymbol.sort();}else{arr=objX.aFixedStockSymbol.slice(0,i);arr=arr.concat(objX.aFixedStockSymbol.slice(i+1));objX.aFixedStockSymbol=arr;}for(i=0;i<objX.aStockInfo.length;i++){chkObj=$get('chk'+objX.aStockInfo[i].StockSymbol);if(chkObj!=undefined){chkObj.checked=false;}}for(i=0;i<objX.aFixedStockSymbol.length;i++){chkObj=$get('chk'+objX.aFixedStockSymbol[i]);if(chkObj!=undefined){chkObj.checked=true;}}RPSUtils.setCookie('UpComFixedStockSymbol',objX.aFixedStockSymbol.join(','),300);var oldDataVersion=objX.infoDataVersion;objX.initTables();objX.infoDataVersion=0;objX.initTablesData();objX.infoDataVersion=oldDataVersion;},onRowFocused:function(e){var targ;if(!e){var e=window.event;}if(e.target){targ=e.target.parentNode;}else if(e.srcElement){targ=e.srcElement.parentNode;}if(targ.nodeType==3){targ=targ.parentNode.parentNode;}if(objX.FocusedRow!=null){objX.unFocuseRow(objX.FocusedRow);}if(targ.cells!=undefined||targ.cells!=null){objX.focuseRow(targ);}},onRowUnfocused:function(e){var targ;if(!e){var e=window.event;}if(e.target){targ=e.target.parentNode;}else if(e.srcElement){targ=e.srcElement.parentNode;}if(targ.nodeType==3){targ=targ.parentNode.parentNode;}if(targ.cells!=undefined||targ.cells!=null){objX.unFocuseRow(targ);}},onGetPriceError:function(arg){},onGetPriceComplete:function(newVersion){if(newVersion!=0){var currentTime=new Date();var date=currentTime.getDate();var month=currentTime.getMonth()+1;month=(month<10?"0":"")+month;}},onPriceClick:function(e){var targ;if(!e){var e=window.event;}if(e.target){targ=e.target;}else if(e.srcElement){targ=e.srcElement;}if(targ.nodeType==3){targ=targ.parentNode;}targ=targ.parentNode;RPSoftOpenWindowChart(targ.cells[objX.f].innerHTML);},updateStockInfoRow:function(newRecord,oldRecord){var row=oldRecord.TableRow;if(newRecord.referencePrice!=undefined){oldRecord.referencePrice=newRecord.referencePrice;if(row!=undefined&&row!=null)row.cells[objX.ai].innerHTML=RPSUtils.numToStringWithDgtGrp(newRecord.referencePrice/1000);}if(newRecord.ceilingPrice!=undefined){oldRecord.ceilingPrice=newRecord.ceilingPrice;if(row!=undefined&&row!=null)row.cells[objX.ab].innerHTML=RPSUtils.numToStringWithDgtGrp(newRecord.ceilingPrice/1000);}if(newRecord.floorPrice!=undefined){oldRecord.ceilingPrice=newRecord.ceilingPrice;if(row!=undefined&&row!=null)row.cells[objX.ad].innerHTML=RPSUtils.numToStringWithDgtGrp(newRecord.floorPrice/1000);}var cell;if(newRecord.totalTraded!=undefined){oldRecord.totalTraded=newRecord.totalTraded;if(row!=undefined&&row!=null){cell=row.cells[objX.aj];if(objX.infoDataVersion!=0&& !objX.isSorting){objX.preChangedCells.push(cell);cell.style.backgroundColor=Conf.UpdatedColor;}if(oldRecord.totalTraded>0){cell.innerHTML=RPSUtils.numToStringWithDgtGrp(newRecord.totalTraded/1000);}else{cell.innerHTML='&nbsp;';row.cells[objX.aj].innerHTML='&nbsp;';}}}if(newRecord.totalBidVolume!=undefined||newRecord.totalTraded!=undefined){if(row!=undefined&&row!=null){cell=row.cells[objX.ax];if(objX.infoDataVersion!=0&& !objX.isSorting){objX.preChangedCells.push(cell);cell.style.backgroundColor=Conf.UpdatedColor;}if(newRecord.totalBidVolume-newRecord.totalTraded>0){cell.innerHTML=RPSUtils.numToStringWithDgtGrp((newRecord.totalBidVolume-newRecord.totalTraded)/1000);}else{cell.innerHTML='&nbsp;';}}}if(newRecord.bestBidPrice3!=undefined){if(row!=undefined&&row!=null){cell=row.cells[objX.K];if(objX.infoDataVersion!=0){objX.preChangedCells.push(cell);cell.style.backgroundColor=Conf.UpdatedColor;}cell.innerHTML=RPSUtils.numToStringWithDgtGrp(newRecord.bestBidPrice3/1000);cell.style.color=misc.findPriceCellColorName(newRecord.bestBidPrice3,newRecord);}}if(newRecord.bestBidVolume3!=undefined){if(row!=undefined&&row!=null){cell=row.cells[objX.ah];if(objX.infoDataVersion!=0){objX.preChangedCells.push(cell);cell.style.backgroundColor=Conf.UpdatedColor;}if(newRecord.bestBidVolume3>0){cell.innerHTML=RPSUtils.numToStringWithDgtGrp(newRecord.bestBidVolume3/1000);cell.style.color=misc.findPriceCellColorName(newRecord.bestBidPrice3,newRecord);}else{cell.innerHTML='&nbsp;';row.cells[objX.K].innerHTML='&nbsp;';}}}if(newRecord.bestBidPrice2!=undefined){if(row!=undefined&&row!=null){cell=row.cells[objX.J];if(objX.infoDataVersion!=0){objX.preChangedCells.push(cell);cell.style.backgroundColor=Conf.UpdatedColor;}cell.innerHTML=RPSUtils.numToStringWithDgtGrp(newRecord.bestBidPrice2/1000);cell.style.color=misc.findPriceCellColorName(newRecord.bestBidPrice2,newRecord);}}if(newRecord.bestBidVolume2!=undefined){if(row!=undefined&&row!=null){cell=row.cells[objX.ag];if(objX.infoDataVersion!=0){objX.preChangedCells.push(cell);cell.style.backgroundColor=Conf.UpdatedColor;}if(newRecord.bestBidVolume2>0){cell.innerHTML=RPSUtils.numToStringWithDgtGrp(newRecord.bestBidVolume2/1000);cell.style.color=misc.findPriceCellColorName(newRecord.bestBidPrice2,newRecord);}else{cell.innerHTML='&nbsp;';row.cells[objX.J].innerHTML='&nbsp;';}}}if(newRecord.bestBidPrice1!=undefined){if(row!=undefined&&row!=null){cell=row.cells[objX.B];if(objX.infoDataVersion!=0){objX.preChangedCells.push(cell);cell.style.backgroundColor=Conf.UpdatedColor;}cell.innerHTML=RPSUtils.numToStringWithDgtGrp(newRecord.bestBidPrice1/1000);cell.style.color=misc.findPriceCellColorName(newRecord.bestBidPrice1,newRecord);}}if(newRecord.bestBidVolume1!=undefined){if(row!=undefined&&row!=null){cell=row.cells[objX.ac];if(objX.infoDataVersion!=0){objX.preChangedCells.push(cell);cell.style.backgroundColor=Conf.UpdatedColor;}if(newRecord.bestBidVolume1>0){cell.innerHTML=RPSUtils.numToStringWithDgtGrp(newRecord.bestBidVolume1/1000);cell.style.color=misc.findPriceCellColorName(newRecord.bestBidPrice1,newRecord);}else{cell.innerHTML='&nbsp;';row.cells[objX.B].innerHTML='&nbsp;';}}}if(newRecord.lastPrice!=undefined){oldRecord.lastPrice=newRecord.lastPrice;if(row!=undefined&&row!=null){var reflectingColor=misc.findPriceCellColorName(oldRecord.lastPrice,oldRecord);if(oldRecord.lastPrice!=0){cell=row.cells[objX.A];if(objX.infoDataVersion!=0){objX.preChangedCells.push(cell);cell.style.backgroundColor=Conf.UpdatedColor;}cell.innerHTML=RPSUtils.numToStringWithDgtGrp(newRecord.lastPrice/1000);cell.id='$'+row.cells[objX.f].innerHTML;var trendingSign=misc.findPriceTrendingSignHASE(oldRecord.lastPrice,oldRecord);cell.style.color=reflectingColor;cell=row.cells[objX.I];cell.onmousedown=objX.onPriceClick;cell.title='Nhấn chuột để xem biểu đồ mã CK '+row.cells[objX.f].innerHTML;cell.style.cursor="pointer";var priceChanged=(oldRecord.lastPrice-oldRecord.referencePrice)/1000;if(objX.infoDataVersion!=0){objX.preChangedCells.push(cell);cell.style.backgroundColor=Conf.UpdatedColor;}cell.innerHTML=priceChanged;cell.style.color=reflectingColor;}else{row.cells[objX.A].innerHTML='&nbsp;';row.cells[objX.I].innerHTML='&nbsp;';row.cells[objX.v].innerHTML='&nbsp;';}row.cells[objX.f].style.color=reflectingColor;row.cells[objX.v].style.color=reflectingColor;}}if(newRecord.lastVolume!=undefined){oldRecord.lastVolume=newRecord.lastVolume;if(row!=undefined&&row!=null){cell=row.cells[objX.v];if(objX.infoDataVersion!=0){objX.preChangedCells.push(cell);cell.style.backgroundColor=Conf.UpdatedColor;}if(oldRecord.lastVolume>0){cell.innerHTML=RPSUtils.numToStringWithDgtGrp(newRecord.lastVolume/1000);}else{cell.innerHTML='&nbsp;';row.cells[objX.A].innerHTML='&nbsp;';}}}if(newRecord.bestOfferPrice1!=undefined){if(row!=undefined&&row!=null){cell=row.cells[objX.F];if(objX.infoDataVersion!=0){objX.preChangedCells.push(cell);cell.style.backgroundColor=Conf.UpdatedColor;}cell.innerHTML=RPSUtils.numToStringWithDgtGrp(newRecord.bestOfferPrice1/1000);row.cells[objX.f].style.color=reflectingColor;cell.style.color=misc.findPriceCellColorName(newRecord.bestOfferPrice1,newRecord);}}if(newRecord.bestOfferVolume1!=undefined){if(row!=undefined&&row!=null){cell=row.cells[objX.T];if(objX.infoDataVersion!=0){objX.preChangedCells.push(cell);cell.style.backgroundColor=Conf.UpdatedColor;}if(newRecord.bestOfferVolume1>0){cell.innerHTML=RPSUtils.numToStringWithDgtGrp(newRecord.bestOfferVolume1/1000);cell.style.color=misc.findPriceCellColorName(newRecord.bestOfferPrice1,newRecord);}else{cell.innerHTML='&nbsp;';row.cells[objX.F].innerHTML='&nbsp;';}}}if(newRecord.bestOfferPrice2!=undefined){if(row!=undefined&&row!=null){cell=row.cells[objX.C];if(objX.infoDataVersion!=0){objX.preChangedCells.push(cell);cell.style.backgroundColor=Conf.UpdatedColor;}cell.innerHTML=RPSUtils.numToStringWithDgtGrp(newRecord.bestOfferPrice2/1000);cell.style.color=misc.findPriceCellColorName(newRecord.bestOfferPrice2,newRecord);}}if(newRecord.bestOfferVolume2!=undefined){if(row!=undefined&&row!=null){cell=row.cells[objX.V];if(objX.infoDataVersion!=0){objX.preChangedCells.push(cell);cell.style.backgroundColor=Conf.UpdatedColor;}if(newRecord.bestOfferVolume2>0){cell.innerHTML=RPSUtils.numToStringWithDgtGrp(newRecord.bestOfferVolume2/1000);cell.style.color=misc.findPriceCellColorName(newRecord.bestOfferPrice2,newRecord);}else{cell.innerHTML='&nbsp;';row.cells[objX.C].innerHTML='&nbsp;';}}}if(newRecord.bestOfferPrice3!=undefined){if(row!=undefined&&row!=null){cell=row.cells[objX.D];if(objX.infoDataVersion!=0){objX.preChangedCells.push(cell);cell.style.backgroundColor=Conf.UpdatedColor;}cell.innerHTML=RPSUtils.numToStringWithDgtGrp(newRecord.bestOfferPrice3/1000);cell.style.color=misc.findPriceCellColorName(newRecord.bestOfferPrice3,newRecord);}}if(newRecord.bestOfferVolume3!=undefined){if(row!=undefined&&row!=null){cell=row.cells[objX.U];if(objX.infoDataVersion!=0){objX.preChangedCells.push(cell);cell.style.backgroundColor=Conf.UpdatedColor;}if(newRecord.bestOfferVolume3>0){cell.innerHTML=RPSUtils.numToStringWithDgtGrp(newRecord.bestOfferVolume3/1000);cell.style.color=misc.findPriceCellColorName(newRecord.bestOfferPrice3,newRecord);}else{cell.innerHTML='&nbsp;';row.cells[objX.D].innerHTML='&nbsp;';}}}if(newRecord.totalOfferVolume!=undefined||newRecord.totalTraded!=undefined){if(row!=undefined&&row!=null){cell=row.cells[objX.ae];if(objX.infoDataVersion!=0&& !objX.isSorting){objX.preChangedCells.push(cell);cell.style.backgroundColor=Conf.UpdatedColor;}if(newRecord.totalOfferVolume-newRecord.totalTraded>0){cell.innerHTML=RPSUtils.numToStringWithDgtGrp((newRecord.totalOfferVolume-newRecord.totalTraded)/1000);}else{cell.innerHTML='&nbsp;';row.cells[objX.ae].innerHTML='&nbsp;';}}}if(newRecord.totalRoom!=undefined){oldRecord.totalRoom=newRecord.totalRoom;}if(newRecord.currentRoom!=undefined){oldRecord.currentRoom=newRecord.currentRoom;}if(newRecord.totalTraded!=undefined)oldRecord.totalTraded=newRecord.totalTraded;if(newRecord.openPrice!=undefined)oldRecord.openPrice=newRecord.openPrice;if(newRecord.closePrice!=undefined)oldRecord.closePrice=newRecord.closePrice;if(newRecord.putthroughVolume!=undefined)oldRecord.putthroughVolume=newRecord.putthroughVolume;if(newRecord.putthroughValue!=undefined)oldRecord.putthroughValue=newRecord.putthroughValue;if(newRecord.totalValue!=undefined){if(newRecord.totalValue!=undefined)oldRecord.totalValue=newRecord.totalValue;if(objX.infoDataVersion!=0){objX.preChangedCells.push(cell);cell.style.backgroundColor=Conf.UpdatedColor;}}if(newRecord.averagePrice!=undefined){oldRecord.averagePrice=newRecord.averagePrice;if(row!=undefined&&row!=null){cell=row.cells[objX.aB];if(oldRecord.averagePrice>0){cell.innerHTML=RPSUtils.numToStringWithDgtGrp(oldRecord.averagePrice/1000);cell.style.color=misc.findPriceCellColorName(oldRecord.averagePrice,oldRecord);}else cell.innerHTML='&nbsp;';if(objX.infoDataVersion!=0){objX.preChangedCells.push(cell);cell.style.backgroundColor=Conf.UpdatedColor;}}}if(newRecord.highestPrice!=undefined){oldRecord.highestPrice=newRecord.highestPrice;if(row!=undefined&&row!=null){cell=row.cells[objX.aa];if(objX.infoDataVersion!=0){objX.preChangedCells.push(cell);cell.style.backgroundColor=Conf.UpdatedColor;}if(oldRecord.highestPrice>0){cell.innerHTML=RPSUtils.numToStringWithDgtGrp(oldRecord.highestPrice/1000);cell.style.color=misc.findPriceCellColorName(oldRecord.highestPrice,oldRecord);}else cell.innerHTML='&nbsp;';}}if(newRecord.lowestPrice!=undefined){oldRecord.lowestPrice=newRecord.lowestPrice;if(row!=undefined&&row!=null){cell=row.cells[objX.af];if(objX.infoDataVersion!=0){objX.preChangedCells.push(cell);cell.style.backgroundColor=Conf.UpdatedColor;}if(oldRecord.lowestPrice>0){cell.innerHTML=RPSUtils.numToStringWithDgtGrp(oldRecord.lowestPrice/1000);cell.style.color=misc.findPriceCellColorName(oldRecord.lowestPrice,oldRecord);}else cell.innerHTML='&nbsp;';}}if(newRecord.buyQuantityDetail1!=undefined)oldRecord.buyQuantityDetail1=newRecord.buyQuantityDetail1;if(newRecord.buyQuantityDetail2!=undefined)oldRecord.buyQuantityDetail2=newRecord.buyQuantityDetail2;if(newRecord.buyQuantityDetail3!=undefined)oldRecord.buyQuantityDetail3=newRecord.buyQuantityDetail3;if(newRecord.sellQuantityDetail1!=undefined)oldRecord.sellQuantityDetail1=newRecord.sellQuantityDetail1;if(newRecord.sellQuantityDetail2!=undefined)oldRecord.sellQuantityDetail2=newRecord.sellQuantityDetail2;if(newRecord.sellQuantityDetail3!=undefined)oldRecord.sellQuantityDetail3=newRecord.sellQuantityDetail3;}};var objX=new UPCOMScrollStockBoard();var sbObj=objX;objX.chart=new EJSC.Chart("divChartIndex",{title:'',legend_title:'',show_legend:false,allow_zoom:true,auto_zoom:'y',auto_find_point_by_x:true,onShowHint:objX.doShowHint,show_messages:false,background:{color:"#1D2B52",opacity:0,includeTitle:true},axis_bottom:{color:"#FFFFFF",caption:"",caption_class:"xCaption",label_class:"xLabelCaption",size:0,auto_resize:false,formatter:new EJSC.DateFormatter({format_string:"HH:NN",useUTC:false,timezoneOffset: -objX.timeZone}),crosshair:{color:'rgb(255,150,150)',show:true},grid:{color:'#BBF9F4',opacity:50,thickness:1,show:true},major_ticks:{color:'rgb(255,0,0)',count:8,offset:3,opacity:100,size:6,thickness:2,show:true}},axis_left:{color:'#FFFFFF',caption:'',caption_class:'yCaption',label_class:'yLabelCaption',size:25,formatter:new EJSC.NumberFormatter({forced_decimals:2,thousand_separator:','}),grid:{color:'#BBF9F4',opacity:50,thickness:1,show:true},major_ticks:{color:'rgb(255,0,0)',count:5,offset:3,opacity:100,size:5,thickness:2,show:true}}});objX.init();
