﻿var t=null;var M=new Array();var dU=new Array();var dV=new Array();var bf=null;var ao=null;var dO=null;var dS=null;var basicRequestTimerID=null;var dB=null;var dQ=null;var dc=null;var G=null;var bX=null;var dataResult=null;var marketUpdatingData=null;var basicObject=null;var stockInfoObject=null;var dp=true;var aj=true;var af=0;var aq=0;var aZ=0;var L=false;var al=0;var headerRowCount=2;var dk=false;var displayedSymbolList=new Array();var selectedSymbolList=new Array();var unselectedSymbolList=new Array();var displayedSymbolsString="all";var clientId= -1;var displayedSymbolsSelectedList=new Array();var displayedSymbolsSelectedString="";var dH="";var showSelectedSymbolsOnTop=true;var am=false;var aK=false;var T=false;var U=false;var R=false;var O=false;var v=false;var P=false;var A=false;var ab=false;var D=false;var aa=false;var C=false;var extraColumnString="0000100";var J=24;var screenWidth="1000";var tdTime;var tdIndex;var tdChange;var tdGainersLosers;var tdTotalValue;var tdTotalMarketVolume;var tdMarketStatus;var bg=null;var tdSession1;var tdSession2;var tdSession3;var tdSession1Trading;var tdSession2Trading;var tdSession3Trading;var tdConnectedClientCount;var tablePutThrough=null;var tablePutThroughBuy=null;var tablePutThroughSell=null;var floatingHeader;var fixedHeader;var divScroll;var ds=0;var dj=0;var dh=0;var localizeVN=new LocalizeInfo();var localizeEN=new LocalizeInfo();var B="";var cT;var oldUnselectedSymbolList;var H=0;var ad=0;var orderedSymbolList=new Array();var an=false;var cV=false;var ak=false;var bP=true;var dP=true;var tableType=0;var fontStyle=1;var lineCount=20;var waitingTime=10000;var scrollInterval=30;var aX=1;var dC=0;var dz=0;var dw=0;var floorType="";var cq="";var boardName="Board1";var currentRowIndex= -1;var latestTime=new Date();var typedString="";var highlightRow=null;var quotesHistory=null;var currentGraphSymbol="";function BasicItemInfo(){this.CeilingPrice="";this.FloorPrice="";this.ReferencePrice="";this.CurrentPrice="";};function CellInfo(){this.symbol="";this.checkbox=null;this.cell=null;this.data=0;this.du=backColor1;this.dF=backColor1Selected;this.className="";};function LocalizeInfo(){};function KeyPress(e){if(am==true||aK==true)return;if(window.event){keynum=e.keyCode;}else if(e.which){keynum=e.which;}if(keynum==13){typedString="";return;}var keychar=String.fromCharCode(keynum);var delayTime=new Date()-latestTime;latestTime=new Date();if(delayTime<=keypressDelayTime)typedString=typedString+keychar;else typedString=keychar;var g=document.getElementById("tableQuote");var row;for(var i=0;i<g.rows.length;i++){row=g.rows[i];if(row.id.substring(2).indexOf(typedString)==0){if(highlightRow!=null){UnHighlight(highlightRow);highlightRow=null;}Highlight(row);highlightRow=row;var g=document.getElementById("tableQuote");window.scrollTo(0,row.offsetTop);break;}}};function Initialize(){switch(floorType){case "HOSE":localizeVN.ShowSession1Price="Hiển thị Giá phiên 1";localizeVN.ShowSession1Volume="Hiển thị Khối lượng phiên 1";localizeVN.ShowSession2Price="Hiển thị Giá phiên 2";localizeVN.ShowSession2Volume="Hiển thị Khối lượng phiên 2";localizeVN.ShowForeignBuy="Hiển thị Nhà đầu tư nước ngoài mua";localizeVN.exchangeName="SỞ GIAO DỊCH CHỨNG KHOÁN HỒ CHÍ MINH";localizeVN.session="Đợt";localizeVN.sessionValue="GTGD: ";localizeVN.ConnectedCount="Số kết nối HOSE:";localizeVN.Session1Price="Giá ph.1";localizeVN.Session1Volume="KL ph.1";localizeVN.Session2Price="Giá ph.2";localizeVN.Session2Volume="KL ph.2";localizeVN.ForeignBuy="NN mua";localizeEN.ShowSession1Price="Show Session 1 Price";localizeEN.ShowSession1Volume="Show Session 1 Volume";localizeEN.ShowSession2Price="Show Session 2 Price";localizeEN.ShowSession2Volume="Show Session 2 Volume";localizeEN.ShowForeignBuy="Show Foreign buy volume";localizeEN.exchangeName="HO CHI MINH STOCK EXCHANGE";localizeEN.session="Ses";localizeEN.sessionValue="Total value: ";localizeEN.ConnectedCount="HOSE connection count:";localizeEN.Session1Price="Ses.1 Price";localizeEN.Session1Volume="Ses.1 Vol";localizeEN.Session2Price="Ses.2 Price";localizeEN.Session2Volume="Ses.2 Vol";localizeEN.ForeignBuy="Frn buy";tdSession1=document.getElementById("tdSession1");tdSession2=document.getElementById("tdSession2");tdSession3=document.getElementById("tdSession3");tdSession1Trading=document.getElementById("tdSession1Trading");tdSession2Trading=document.getElementById("tdSession2Trading");tdSession3Trading=document.getElementById("tdSession3Trading");break;case "HASTC":localizeVN.exchangeName="SỞ GIAO DỊCH CHỨNG KHOÁN HÀ NỘI";localizeVN.ConnectedCount="Số kết nối HNX:";localizeEN.ConnectedCount="HNX connection count:";localizeEN.exchangeName="HA NOI STOCK EXCHANGE";break;case "OTC":localizeVN.exchangeName="SÀN GIAO DỊCH CHỨNG KHOÁN UPCOM";localizeVN.ConnectedCount="Số kết nối Upcom:";localizeEN.ConnectedCount="Upcom connection count:";localizeEN.exchangeName="UPCOM STOCK TRADING CENTER";break;case "MIXED":localizeVN.exchangeName="BẢNG GIÁ TỔNG HỢP";localizeVN.ConnectedCount="Số kết nối Mixed:";localizeEN.ConnectedCount="Mixed connection count:";localizeEN.exchangeName="MIXED STOCK QUOTES";break;}if(floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED"){localizeVN.ShowBuyVolume="Hiển thị Khối lượng mua";localizeVN.ShowSellVolume="Hiển thị Khối lượng bán";localizeVN.ShowBuyOrderCount="Hiển thị Số lệnh mua";localizeVN.ShowSellOrderCount="Hiển thị Số lệnh bán";localizeVN.ShowForeignBuy="Hiển thị Nhà đầu tư nước ngoài mua";localizeVN.ShowForeignSell="Hiển thị Nhà đầu tư nước ngoài bán";localizeVN.BuyVolume="KL mua";localizeVN.SellVolume="KL bán";localizeVN.BuyOrderCount="SL mua";localizeVN.SellOrderCount="SL bán";localizeVN.ForeignBuy="NN mua";localizeVN.ForeignSell="NN bán";localizeEN.ShowBuyVolume="Show Buy volume";localizeEN.ShowSellVolume="Show Sell volume";localizeEN.ShowBuyOrderCount="Show Buy order count";localizeEN.ShowSellOrderCount="Show Sell order count";localizeEN.ShowForeignBuy="Show Foreign buy volume";localizeEN.ShowForeignSell="Show Foreign sell volume";localizeEN.BuyVolume="Buy vol";localizeEN.SellVolume="Sell vol";localizeEN.BuyOrderCount="Buy count";localizeEN.SellOrderCount="Sell count";localizeEN.ForeignBuy="Frn buy";localizeEN.ForeignSell="Frn sell";}tablePutThroughBuy=document.getElementById("tablePutThroughBuy");tablePutThroughSell=document.getElementById("tablePutThroughSell");localizeVN.date="Ngày GD:";localizeVN.time="Giờ máy chủ:";localizeVN.change="Thay đổi:";localizeVN.dI="Số CK tăng/giảm:";localizeVN.totalMarketVolume="Tổng khối lượng:";localizeVN.totalValue="Tổng giá trị:";localizeVN.marketStatus="TTTT:";localizeVN.currencyUnit="tỷ";localizeVN.symbol="CK";localizeVN.ceiling="Trần";localizeVN.floor="Sàn";localizeVN.basic="TC";localizeVN.bid="Dư mua";localizeVN.ask="Dư bán";localizeVN.open="Mở cửa";localizeVN.high="Cao";localizeVN.low="Thấp";localizeVN.average="TB";localizeVN.cL="NN mua";localizeVN.totalVolume="Tổng KL";localizeVN.price="Giá";localizeVN.volume="KL";localizeVN.matching="Khớp lệnh";localizeVN.dK="Chọn tất cả";localizeVN.clearAll="Xóa tất cả";localizeVN.displayAll="Hiển thị tất cả CK";localizeVN.selectedSymbolsOnTop="Hiển thị những mã CK được đánh dấu lên đầu";localizeVN.ScreenWidth="Chọn kích thước màn hình:   ";localizeVN.cY="Giá: 1000 đồng";localizeVN.VolumeDescription="Khối lượng: 10 cổ phiếu";localizeVN.HitCount="Số lượt truy cập:";localizeVN.cX="Giao dịch thỏa thuận - Khớp lệnh";localizeVN.cZ="Giao dịch thỏa thuận - Chào mua";localizeVN.de="Giao dịch thỏa thuận - Chào bán";localizeVN.ar="Giá";localizeVN.da="Giá trị giao dịch (triệu đồng)";localizeVN.av="Khối lượng";localizeVN.au="Chứng khoán";localizeVN.cU="Thời gian";localizeVN.HistoryTime="Thời gian";localizeVN.HistoryChange="Thay đổi";localizeVN.HistoryChangePercent="% thay đổi";localizeVN.HistoryPrice="Giá";localizeVN.HistoryVolume="Khối lượng";localizeVN.HistoryTotalVolume="Tổng khối lượng";localizeVN.GraphTitle="Đồ thị giá và lịch sử giá khớp lệnh trong phiên";localizeVN.dD="Đơn vị giao dịch thỏa thuận: Giá: 1000 đồng - Khối lượng: 1 cổ phiếu";localizeVN.TableType="Kiểu bảng";localizeVN.Normal="Bảng bình thường";localizeVN.ScrollInfinite="Bảng tự động cuộn vô tận";localizeVN.Scroll2Directions="Bảng tự động cuộn 2 chiều";localizeVN.PageReplacement="Bảng lật trang";localizeVN.LineCount="Số dòng hiển thị (Đối với bảng cuộn) ";localizeVN.ScrollInterval="Độ trễ cuộn (mili giây - Đối với bảng cuộn) ";localizeVN.WaitingTime="Thời gian chờ (mili giây - Đối với bảng cuộn 2 chiều và lật trang) ";localizeVN.CurrentRoom="Room";localizeVN.ShowCurrentRoom="Hiển thị room nước ngoài còn lại";localizeVN.FontStyle="Kiểu chữ";localizeVN.FontNormal="Font chữ bình thường";localizeVN.FontBoldHalf="Font chữ đậm cho các cột chính";localizeVN.FontBoldAll="Font chữ đậm cho tất cả";localizeVN.ShowVolumeColor="Hiển thị màu sắc khối lượng theo màu giá CK";localizeVN.ShowGraph="Hiển thị đồ thị giá trong phiên";localizeVN.ShowSymbol2="Hiển thị mã chứng khoán trong cột khớp lệnh";localizeVN.OrderSelectedSymbols="Hiển thị mã chứng khoán được chọn theo thứ tự ABC";localizeVN.BoardName="Chọn bảng hiển thị:";localizeVN.GraphLinkTitle="Click để xem đồ thị và lịch sử giá trong phiên";localizeVN.GraphIndexLinkTitle="Click để xem đồ thị và lịch sử chỉ số trong phiên";localizeEN.date="Date:";localizeEN.time="Server time:";localizeEN.change="Change:";localizeEN.dI="Gainers/Losers:";localizeEN.totalMarketVolume="Total volume:";localizeEN.totalValue="Total value:";localizeEN.marketStatus="Market status:";localizeEN.currencyUnit="bil";localizeEN.symbol="Symbol";localizeEN.ceiling="Ceil";localizeEN.floor="Floor";localizeEN.basic="Basic";localizeEN.bid="Bid";localizeEN.ask="Ask";localizeEN.open="Open";localizeEN.high="High";localizeEN.low="Low";localizeEN.average="Avg";localizeEN.cL="Frn buy";localizeEN.totalVolume="Total vol";localizeEN.price="Prc";localizeEN.volume="Vol";localizeEN.matching="Matching";localizeEN.dK="Select all";localizeEN.clearAll="Clear all";localizeEN.displayAll="Display all symbols";localizeEN.selectedSymbolsOnTop="Show below marked symbols on top";localizeEN.ScreenWidth="Select screen width:   ";localizeEN.cY="Price unit: 1000 VND";localizeEN.VolumeDescription="Volume unit: 10 shares";localizeEN.HitCount="Hit count:";localizeEN.cX="Put through - Matching";localizeEN.cZ="Put through - Buy advertisement";localizeEN.de="Put through - Sell advertisement";localizeEN.ar="Price";localizeEN.da="Value (mil VND)";localizeEN.av="Volume";localizeEN.au="Symbol";localizeEN.cU="Time";localizeEN.HistoryTime="Time";localizeEN.HistoryChange="Change";localizeEN.HistoryChangePercent="Change percent";localizeEN.HistoryPrice="Price";localizeEN.HistoryVolume="Volume";localizeEN.HistoryTotalVolume="Total volume";localizeEN.GraphTitle="Matching result graph and history";localizeEN.dD="Put through unit: Price unit: 1000 VND - Volume unit: 1 share";localizeEN.TableType="Table type:";localizeEN.Normal="Normal";localizeEN.ScrollInfinite="Infinite scroll table";localizeEN.Scroll2Directions="2 directions scroll table";localizeEN.PageReplacement="Page replacement table";localizeEN.LineCount="Line count (for scroll table) ";localizeEN.ScrollInterval="Scroll interval (mili seconds - for scroll table) ";localizeEN.WaitingTime="Waiting time (mili seconds - for 2 directions scroll and page replacement table) ";localizeEN.CurrentRoom="Room";localizeEN.ShowCurrentRoom="Show current room";localizeEN.FontStyle="Font style:";localizeEN.FontNormal="Normal font";localizeEN.FontBoldHalf="Bold font for main columns";localizeEN.FontBoldAll="Bold font for all board";localizeEN.ShowVolumeColor="Display volume color like price color";localizeEN.ShowGraph="Display graph";localizeEN.ShowSymbol2="Show symbol in matching column";localizeEN.OrderSelectedSymbols="Show selected symbols by alphabet order";localizeEN.BoardName="Choose board:";localizeEN.GraphLinkTitle="Click to view matching graph and history";localizeEN.GraphIndexLinkTitle="Click to view Index graph and history";tdTime=document.getElementById("tdTime");tdIndex=document.getElementById("tdIndex");tdChange=document.getElementById("tdChange");tdGainersLosers=document.getElementById("tdGainersLosers");tdTotalValue=document.getElementById("tdTotalValue");tdTotalMarketVolume=document.getElementById("tdTotalMarketVolume");tdMarketStatus=document.getElementById("tdMarketStatus");tablePutThrough=document.getElementById("tablePutThrough");divScroll=document.getElementById("divScroll");floatingHeader=document.getElementById("floatingHeader");tdConnectedClientCount=document.getElementById("tdConnectedClientCount");ConfigLocalize();};function LoadHose(){floorType="HOSE";cq="Hose";AlphaStockBoard.UI.HoseStockQuotes.set_defaultUserContext("Default context");AlphaStockBoard.UI.HoseStockQuotes.set_defaultSucceededCallback(GetStockBoardChangedObjectSucceededCallback);AlphaStockBoard.UI.HoseStockQuotes.set_defaultFailedCallback(FailedCallback);Initialize();LoadCommon();};function LoadHastc(){floorType="HASTC";cq="Hastc";AlphaStockBoard.UI.HastcStockQuotes.set_defaultUserContext("Default context");AlphaStockBoard.UI.HastcStockQuotes.set_defaultSucceededCallback(GetStockBoardChangedObjectSucceededCallback);AlphaStockBoard.UI.HastcStockQuotes.set_defaultFailedCallback(FailedCallback);Initialize();LoadCommon();};function LoadOtc(){floorType="OTC";cq="Otc";AlphaStockBoard.UI.OtcStockQuotes.set_defaultUserContext("Default context");AlphaStockBoard.UI.OtcStockQuotes.set_defaultSucceededCallback(GetStockBoardChangedObjectSucceededCallback);AlphaStockBoard.UI.OtcStockQuotes.set_defaultFailedCallback(FailedCallback);Initialize();LoadCommon();};function LoadMixed(){floorType="MIXED";cq="Mixed";AlphaStockBoard.UI.MixedStockQuotes.set_defaultUserContext("Default context");AlphaStockBoard.UI.MixedStockQuotes.set_defaultSucceededCallback(GetStockBoardChangedObjectSucceededCallback);AlphaStockBoard.UI.MixedStockQuotes.set_defaultFailedCallback(FailedCallback);Initialize();LoadCommon();};function LoadCommon(){GetClientId();var onTop=readCookie("onTop");if(onTop!=null)if(onTop=="true")showSelectedSymbolsOnTop=true;else showSelectedSymbolsOnTop=false;if(readCookie("boardName")!=null)boardName=readCookie("boardName");LoadBoardCookie();if(readCookie("selectedSymbolList")!=null)selectedSymbolList=readCookie("selectedSymbolList").split(",");if(readCookie("extraColString")!=null){extraColumnString=readCookie("extraColString");}if(readCookie("screenWidth")!=null){screenWidth=readCookie("screenWidth");}if(readCookie("tableType")!=null){tableType=readCookie("tableType");}if(readCookie("fontStyle")!=null){fontStyle=readCookie("fontStyle");}if(readCookie("lineCount")!=null){lineCount=parseInt(readCookie("lineCount"));}if(readCookie("scrollInterval")!=null){scrollInterval=parseInt(readCookie("scrollInterval"));}if(readCookie("waitingTime")!=null){waitingTime=parseInt(readCookie("waitingTime"));}if(readCookie("isShowVolumeColor")!=null){isShowVolumeColor=(readCookie("isShowVolumeColor")=="true");}if(readGeneralCookie("isShowGraph")!=null){isShowGraph=(readGeneralCookie("isShowGraph")=="true");}if(readGeneralCookie("isShowSymbol2")!=null){isShowSymbol2=(readGeneralCookie("isShowSymbol2")=="true");}if(readGeneralCookie("isOrderSelectedSymbols")!=null){isOrderSelectedSymbols=(readGeneralCookie("isOrderSelectedSymbols")=="true");}SetTableWidth();var language=readCookie("lan");if(language==null)setLanguage("vi-VN");else setLanguage(language);if(floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED"){T=extraColumnString.charAt(0)=='1'?true:false;U=extraColumnString.charAt(1)=='1'?true:false;R=extraColumnString.charAt(2)=='1'?true:false;O=extraColumnString.charAt(3)=='1'?true:false;v=extraColumnString.charAt(4)=='1'?true:false;P=extraColumnString.charAt(5)=='1'?true:false;A=extraColumnString.charAt(6)=='1'?true:false;}else if(floorType=="HOSE"){ab=extraColumnString.charAt(0)=='1'?true:false;D=extraColumnString.charAt(1)=='1'?true:false;aa=extraColumnString.charAt(2)=='1'?true:false;C=extraColumnString.charAt(3)=='1'?true:false;v=extraColumnString.charAt(4)=='1'?true:false;A=extraColumnString.charAt(5)=='1'?true:false;}bP=false;CreateExtraHeaderCells("tableQuote");CreateExtraHeaderCells("tableFloatingHeader");CreateExtraHeaderCells("tableFixedHeader");bP=true;SetScroll();basicRequestTimerID=self.setInterval("GetBasicObject()",1*60*1000);if(aj==true){dB=self.setInterval("CheckResponse()",15000)}else{dB=self.setInterval("CheckResponse()",15*60*1000)}ResizeHeader();self.setInterval("ResizeHeader()",1000);SetTime();self.setInterval("SetTime()",1000);if(Sys.Browser.name=="Microsoft Internet Explorer"&&Sys.Browser.version<=6){floatingHeader.style.position="absolute";self.setInterval("ShowFloatingHeaderIE6()",300);}dQ=self.setInterval("SetClientInfo()",2*60*60*1000)};function LoadBoardCookie(){if(readCookie("displayedSymbolsString"+boardName)!=null){displayedSymbolsString=readCookie("displayedSymbolsString"+boardName);if(displayedSymbolsString!="all")displayedSymbolList=displayedSymbolsString.split(",");}else displayedSymbolsString="all";if(readCookie("displayedSymbolsSelectedString"+boardName)!=null){displayedSymbolsSelectedString=readCookie("displayedSymbolsSelectedString"+boardName);}else displayedSymbolsSelectedString="";};function SetFontStyle(){var fontStyle1;var fontStyle2;if(fontStyle==0){fontStyle1="normal";fontStyle2="normal";}else if(fontStyle==1){fontStyle1="normal";fontStyle2="bold";}else{fontStyle1="bold";fontStyle2="bold";}var g=document.getElementById("tableQuote");var row;for(var i=2;i<g.rows.length;i++){row=g.rows[i];for(var j=0;j<row.cells.length;j++){switch(j){case 0:case 1:case 2:case 3:case 10:case 11:case 12:case 19:case 20:row.cells[j].style.fontWeight=fontStyle2;break;case 4:case 5:case 6:case 7:case 8:case 9:case 13:case 14:case 15:case 16:case 17:case 18:row.cells[j].style.fontWeight=fontStyle1;break;case 21:if(floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED")row.cells[j].style.fontWeight=fontStyle2;else row.cells[j].style.fontWeight=fontStyle1;break;default:row.cells[j].style.fontWeight=fontStyle1;}}}};function SetLinksVisibility(){var tdExchangeLink=document.getElementById("tdExchangeLink");var spanFlags=document.getElementById("spanFlags");if(tableType==0){tdExchangeLink.style.visibility="visible";spanFlags.style.visibility="visible";}else{tdExchangeLink.style.visibility="hidden";spanFlags.style.visibility="hidden";}};function SetScroll(){var tableFooter=document.getElementById("tableFooter");var tableScrollFooter=document.getElementById("tableScrollFooter");var tableFixedHeader=document.getElementById("tableFixedHeader");var g=document.getElementById("tableQuote");if(G!=null){self.clearInterval(G);G=null;}if(bX!=null)self.clearTimeout(bX);SetLinksVisibility();if(tableType==0){tableFixedHeader.style.display="none";g.rows[0].style.display="";g.rows[1].style.display="";divScroll.style.height="100%";tableFooter.style.display="block";tableScrollFooter.style.display="none";divScroll.scrollTop=0;}else if(tableType==1||tableType==2||tableType==3){tableFixedHeader.style.display="block";g.rows[0].style.display="none";g.rows[1].style.display="none";tableFooter.style.display="none";tableScrollFooter.style.display="block";divScroll.style.height=lineCount*rowHeightScroll+2+"px";if(dP==true){if(G==null)if(tableType==3)G=self.setInterval("Scroll()",waitingTime);else G=self.setInterval("Scroll()",scrollInterval);}else{if(G!=null){self.clearInterval(G);G=null;}}}};function Scroll(){if(tableType==0)return;else if(tableType==1)aX=1;var g=document.getElementById("tableQuote");if(tableType==1){if(divScroll.scrollTop>=divScroll.scrollHeight-divScroll.clientHeight){if(g.rows.length-2<=lineCount)return;var replacedRow=g.rows[2];var row;for(var i=0;i<lineCount;i++){row=g.rows[g.rows.length-1];replacedRow.parentNode.insertBefore(row,replacedRow);replacedRow=row;}divScroll.scrollTop=0;}}else if(tableType==2){if(divScroll.scrollTop<=0&&aX== -1){aX=1;self.clearInterval(G);G=null;bX=self.setTimeout("WaitingScroll()",waitingTime);return;}else if(divScroll.scrollTop>=divScroll.scrollHeight-divScroll.clientHeight&&aX==1){aX= -1;self.clearInterval(G);G=null;bX=self.setTimeout("WaitingScroll()",waitingTime);return;}}else{}if(tableType==1||tableType==2)divScroll.scrollTop+=aX;else{if(currentRowIndex== -1){currentRowIndex=0;divScroll.scrollTop=0;}else{currentRowIndex=currentRowIndex+lineCount-1;if(currentRowIndex+2>g.rows.length-1){currentRowIndex=0;divScroll.scrollTop=0;}else divScroll.scrollTop=g.rows[currentRowIndex+2].offsetTop-2;}}};function WaitingScroll(){bX=null;if(G==null)G=self.setInterval("Scroll()",scrollInterval);};function SetTime(){var di=new Date();var aY=di.getHours()+dC;var d=di.getMinutes()+dz;var ax=di.getSeconds()+dw;var cW=new Date();cW.setHours(aY,d,ax,0);aY=cW.getHours();d=cW.getMinutes();ax=cW.getSeconds();if(aY<10)aY="0"+aY;if(d<10)d="0"+d;if(ax<10)ax="0"+ax;tdTime.innerHTML=aY+":"+d+":"+ax;};function SetTableWidth(){var tableContainer=document.getElementById("tableContainer");var tableFloatingHeader=document.getElementById("tableFloatingHeader");var tableFixedHeader=document.getElementById("tableFixedHeader");var tableScrollFooter=document.getElementById("tableScrollFooter");if(screenWidth=="Auto"){tableContainer.width="";tableFloatingHeader.width="";tableFixedHeader.width="";tableScrollFooter.width="";}else{tableFixedHeader.width=screenWidth;tableContainer.width=screenWidth;tableFloatingHeader.width=screenWidth;tableScrollFooter.width=screenWidth;}};function SelectScreen(width){var rbtWidth=document.getElementById("rbt"+width);rbtWidth.checked=true;};function SelectBoard(board){var rbtBoard=document.getElementById("rbt"+board);rbtBoard.checked=true;LoadBoardSymbols(board);};function LoadBoardSymbols(board){boardName=board;LoadBoardCookie();SetCheckedSymbolsForChoose(false);var chkDisplayAll=document.getElementById("chkDisplayAll");if(displayedSymbolsString=="all")chkDisplayAll.checked=true;else chkDisplayAll.checked=false;ToggleDisplayAll();};function SelectTableType(tableType){var rbtTableType=document.getElementById("rbt"+tableType);rbtTableType.checked=true;};function SelectFontStyle(fontStyle){var rbtFontStyle=document.getElementById("rbt"+fontStyle);rbtFontStyle.checked=true;};function ResizeHeader(){if(bP==true){ResizeTableHeader("tableFloatingHeader");if(tableType!=0)ResizeTableHeader("tableFixedHeader");}};function ResizeTableHeader(tableId){var r=document.getElementById("tableQuote");var g=document.getElementById(tableId);if(tableType==0){if(g.tHead.rows[0].cells.length<r.tHead.rows[0].cells.length)return;for(var i=0;i<r.tHead.rows[0].cells.length;i++){if(r.tHead.rows[0].cells[i].offsetWidth!=0)g.tHead.rows[0].cells[i].width=(r.tHead.rows[0].cells[i].offsetWidth)+'px';else g.tHead.rows[0].cells[i].width="";}for(var i=0;i<r.tHead.rows[1].cells.length;i++){if(r.tHead.rows[1].cells[i].offsetWidth!=0)g.tHead.rows[1].cells[i].width=(r.tHead.rows[1].cells[i].offsetWidth)+'px';else g.tHead.rows[1].cells[i].width="";}}else{if(r.rows.length>2){if(g.tHead.rows[0].cells.length-12<r.rows[2].cells.length-23)return;g.tHead.rows[0].cells[0].width=(r.rows[2].cells[0].offsetWidth+2)+'px';for(var i=1;i<4;i++){if(r.rows[2].cells[i].offsetWidth!=0)g.tHead.rows[0].cells[i].width=(r.rows[2].cells[i].offsetWidth)+'px';else g.tHead.rows[0].cells[i].width="";}for(var i=4;i<12;i++){if(r.rows[2].cells[i].offsetWidth!=0)g.tHead.rows[1].cells[i-4].width=(r.rows[2].cells[i].offsetWidth)+'px';else g.tHead.rows[1].cells[i-4].width="";}g.tHead.rows[0].cells[6].width=(r.rows[2].cells[12].offsetWidth)+'px';for(var i=13;i<19;i++){if(r.rows[2].cells[i].offsetWidth!=0)g.tHead.rows[1].cells[i-5].width=(r.rows[2].cells[i].offsetWidth)+'px';else g.tHead.rows[1].cells[i-5].width="";}for(var i=19;i<r.rows[3].cells.length;i++){if(r.rows[2].cells[i].offsetWidth!=0)g.tHead.rows[0].cells[i-11].width=(r.rows[2].cells[i].offsetWidth)+'px';else g.tHead.rows[0].cells[i-11].width="";}}}if(r.offsetWidth>0)g.width=r.offsetWidth+'px';};function setLanguage(lan){if(an==true||L==true)return;if(lan==B)return;B=lan;var tdExchangeName=document.getElementById("tdExchangeName");var tdDateTitle=document.getElementById("tdDateTitle");var tdTimeTitle=document.getElementById("tdTimeTitle");var tdChangeTitle=document.getElementById("tdChangeTitle");var tdGainersLosersTitle=document.getElementById("tdGainersLosersTitle");var tdTotalValueTitle=document.getElementById("tdTotalValueTitle");var tdTotalMarketVolumeTitle=document.getElementById("tdTotalMarketVolumeTitle");var tdMarketStatusTitle=document.getElementById("tdMarketStatusTitle");var tableSessionsRow;var tableIndicesRow;if(floorType=="HOSE")tableSessionsRow=document.getElementById("tableSessions").rows[0];else if(floorType=="MIXED")tableIndicesRow=document.getElementById("tableIndices").rows[0];var spanOnTop=document.getElementById("spanOnTop");var spanSelectAll=document.getElementById("spanSelectAll");var spanClearAll=document.getElementById("spanClearAll");var spanDisplayAll=document.getElementById("spanDisplayAll");var spanShowVolumeColor=document.getElementById("spanShowVolumeColor");var spanShowGraph=document.getElementById("spanShowGraph");var spanShowSymbol2=document.getElementById("spanShowSymbol2");var spanOrderSelectedSymbols=document.getElementById("spanOrderSelectedSymbols");var spanOption=document.getElementById("spanOption");var spanHide=document.getElementById("spanHide");var spanOK=document.getElementById("spanOK");var spanShowBuyVolume;var spanShowSellVolume;var spanShowBuyOrderCount;var spanShowSellOrderCount;var spanShowForeignBuy;var spanShowForeignSell;var spanShowSession1Price;var spanShowSession1Volume;var spanShowSession2Price;var spanShowSession2Volume;var spanShowCurrentRoom;if(floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED"){spanShowBuyVolume=document.getElementById("spanShowBuyVolume");spanShowSellVolume=document.getElementById("spanShowSellVolume");spanShowBuyOrderCount=document.getElementById("spanShowBuyOrderCount");spanShowSellOrderCount=document.getElementById("spanShowSellOrderCount");spanShowForeignSell=document.getElementById("spanShowForeignSell");}else if(floorType=="HOSE"){spanShowSession1Price=document.getElementById("spanShowSession1Price");spanShowSession1Volume=document.getElementById("spanShowSession1Volume");spanShowSession2Price=document.getElementById("spanShowSession2Price");spanShowSession2Volume=document.getElementById("spanShowSession2Volume");}spanShowForeignBuy=document.getElementById("spanShowForeignBuy");spanShowCurrentRoom=document.getElementById("spanShowCurrentRoom");var spanPriceDescription=document.getElementById("spanPriceDescription");var spanVolumeDescription=document.getElementById("spanVolumeDescription");var spanScrollPriceDescription=document.getElementById("spanScrollPriceDescription");var spanScrollVolumeDescription=document.getElementById("spanScrollVolumeDescription");var tdConnectedClientCountTitle=document.getElementById("tdConnectedClientCountTitle");var tdHitCounterTitle=document.getElementById("tdHitCounterTitle");var tdScreenWidth=document.getElementById("tdScreenWidth");var tdBoardName=document.getElementById("tdBoardName");var spanHidePutThrough=document.getElementById("spanHidePutThrough");var spanPutThroughDescription=document.getElementById("spanPutThroughDescription");var spanPutThroughImage=document.getElementById("spanPutThroughImage");var tdTableType=document.getElementById("tdTableType");var spanNormal=document.getElementById("spanNormal");var spanScrollInfinite=document.getElementById("spanScrollInfinite");var spanScroll2Directions=document.getElementById("spanScroll2Directions");var spanPageReplacement=document.getElementById("spanPageReplacement");var tbLineCount=document.getElementById("tbLineCount");var tdScrollInterval=document.getElementById("tdScrollInterval");var tdWaitingTime=document.getElementById("tdWaitingTime");var tdFontStyle=document.getElementById("tdFontStyle");var spanFontNormal=document.getElementById("spanFontNormal");var spanFontBoldHalf=document.getElementById("spanFontBoldHalf");var spanFontBoldAll=document.getElementById("spanFontBoldAll");var spanCopyright=document.getElementById("spanCopyright");var spanCopyright1=document.getElementById("spanCopyright1");var spanFooter=document.getElementById("spanFooter");var localizeObject;if(lan=="vi-VN"){localizeObject=localizeVN;if(am==false)spanOption.innerHTML="<img src=\"Images/tuychon.gif\" onclick=\"ToggleOption();\" style=\"pointer: hand; cursor: pointer;\">";else spanOption.innerHTML="<img src=\"Images/an.gif\" onclick=\"ToggleOption();\" style=\"pointer: hand; cursor: pointer;\">";spanHide.innerHTML="<img src=\"Images/an.gif\" onclick=\"HideOption();\" style=\"pointer: hand; cursor: pointer;\">";spanHidePutThrough.innerHTML="<img src=\"Images/an.gif\" onclick=\"HidePutThrough();\" style=\"pointer: hand; cursor: pointer;\">";spanOK.innerHTML="<img src=\"Images/dongy.gif\" onclick=\"OK();\" style=\"pointer: hand; cursor: pointer;\">";spanPutThroughImage.innerHTML="<img src=\"Images/gdthoathuan.gif\" onclick=\"TogglePutThrough();\" style=\"pointer: hand; cursor: pointer;\">";createCookie("lan","vi-VN",1000);}else{localizeObject=localizeEN;if(am==false)spanOption.innerHTML="<img src=\"Images/option.gif\" onclick=\"ToggleOption();\" style=\"pointer: hand; cursor: pointer;\">";else spanOption.innerHTML="<img src=\"Images/hide.gif\" onclick=\"ToggleOption();\" style=\"pointer: hand; cursor: pointer;\">";spanHide.innerHTML="<img src=\"Images/hide.gif\" onclick=\"HideOption();\" style=\"pointer: hand; cursor: pointer;\">";spanHidePutThrough.innerHTML="<img src=\"Images/hide.gif\" onclick=\"HidePutThrough();\" style=\"pointer: hand; cursor: pointer;\">";spanOK.innerHTML="<img src=\"Images/ok.gif\" onclick=\"OK();\" style=\"pointer: hand; cursor: pointer;\">";spanPutThroughImage.innerHTML="<img src=\"Images/put_Through.gif\" onclick=\"TogglePutThrough();\" style=\"pointer: hand; cursor: pointer;\">";createCookie("lan","en-US",1000);}spanOnTop.innerHTML=localizeObject.selectedSymbolsOnTop;tdExchangeName.innerHTML=localizeObject.exchangeName;tdDateTitle.innerHTML=localizeObject.date;tdTimeTitle.innerHTML=localizeObject.time;tdChangeTitle.innerHTML=localizeObject.change;tdGainersLosersTitle.innerHTML=localizeObject.dI;tdTotalValueTitle.innerHTML=localizeObject.totalValue;tdTotalMarketVolumeTitle.innerHTML=localizeObject.totalMarketVolume;tdMarketStatusTitle.innerHTML=localizeObject.marketStatus;tdTableType.innerHTML=localizeObject.TableType;spanNormal.innerHTML=localizeObject.Normal;spanScrollInfinite.innerHTML=localizeObject.ScrollInfinite;spanScroll2Directions.innerHTML=localizeObject.Scroll2Directions;spanPageReplacement.innerHTML=localizeObject.PageReplacement;tbLineCount.innerHTML=localizeObject.LineCount;tdScrollInterval.innerHTML=localizeObject.ScrollInterval;tdWaitingTime.innerHTML=localizeObject.WaitingTime;tdFontStyle.innerHTML=localizeObject.FontStyle;spanFontNormal.innerHTML=localizeObject.FontNormal;spanFontBoldHalf.innerHTML=localizeObject.FontBoldHalf;spanFontBoldAll.innerHTML=localizeObject.FontBoldAll;if(floorType=="HOSE"){tableSessionsRow.cells[1].innerHTML=localizeObject.session+" 1";tableSessionsRow.cells[5].innerHTML=localizeObject.session+" 2";tableSessionsRow.cells[9].innerHTML=localizeObject.session+" 3";tableSessionsRow.cells[3].innerHTML=localizeObject.sessionValue;tableSessionsRow.cells[7].innerHTML=localizeObject.sessionValue;tableSessionsRow.cells[11].innerHTML=localizeObject.sessionValue;}else if(floorType=="MIXED"){tableIndicesRow.cells[1].innerHTML="Hose";tableIndicesRow.cells[5].innerHTML="HNX";tableIndicesRow.cells[9].innerHTML="Upcom";tableIndicesRow.cells[3].innerHTML=localizeObject.sessionValue;tableIndicesRow.cells[7].innerHTML=localizeObject.sessionValue;tableIndicesRow.cells[11].innerHTML=localizeObject.sessionValue;}spanSelectAll.innerHTML=localizeObject.dK;spanClearAll.innerHTML=localizeObject.clearAll;spanDisplayAll.innerHTML=localizeObject.displayAll;if(floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED"){spanShowBuyVolume.innerHTML=localizeObject.ShowBuyVolume;spanShowSellVolume.innerHTML=localizeObject.ShowSellVolume;spanShowBuyOrderCount.innerHTML=localizeObject.ShowBuyOrderCount;spanShowSellOrderCount.innerHTML=localizeObject.ShowSellOrderCount;spanShowForeignSell.innerHTML=localizeObject.ShowForeignSell;}else if(floorType=="HOSE"){spanShowSession1Price.innerHTML=localizeObject.ShowSession1Price;spanShowSession1Volume.innerHTML=localizeObject.ShowSession1Volume;spanShowSession2Price.innerHTML=localizeObject.ShowSession2Price;spanShowSession2Volume.innerHTML=localizeObject.ShowSession2Volume;}spanShowForeignBuy.innerHTML=localizeObject.ShowForeignBuy;spanShowCurrentRoom.innerHTML=localizeObject.ShowCurrentRoom;spanPriceDescription.innerHTML=localizeObject.cY;spanVolumeDescription.innerHTML=localizeObject.VolumeDescription;spanScrollPriceDescription.innerHTML=localizeObject.cY;spanScrollVolumeDescription.innerHTML=localizeObject.VolumeDescription;spanShowVolumeColor.innerHTML=localizeObject.ShowVolumeColor;spanShowGraph.innerHTML=localizeObject.ShowGraph;spanShowSymbol2.innerHTML=localizeObject.ShowSymbol2;spanOrderSelectedSymbols.innerHTML=localizeObject.OrderSelectedSymbols;tdConnectedClientCountTitle.innerHTML=localizeObject.ConnectedCount;tdHitCounterTitle.innerHTML=localizeObject.HitCount;tdScreenWidth.innerHTML=localizeObject.ScreenWidth;tdBoardName.innerHTML=localizeObject.BoardName;spanCopyright.innerHTML=localizeObject.Copyright;spanCopyright1.innerHTML=localizeObject.Copyright;spanFooter.innerHTML=localizeObject.Footer;switch(floorType){case "HASTC":case "OTC":tablePutThrough.rows[0].cells[0].innerHTML=localizeObject.cX;tablePutThrough.rows[1].cells[0].innerHTML=localizeObject.au;tablePutThrough.rows[1].cells[1].innerHTML=localizeObject.ar;tablePutThrough.rows[1].cells[2].innerHTML=localizeObject.av;tablePutThrough.rows[1].cells[3].innerHTML=localizeObject.da;tablePutThrough.rows[1].cells[4].innerHTML=localizeObject.cU;tablePutThroughBuy.rows[0].cells[0].innerHTML=localizeObject.cZ;tablePutThroughBuy.rows[1].cells[0].innerHTML=localizeObject.au;tablePutThroughBuy.rows[1].cells[1].innerHTML=localizeObject.ar;tablePutThroughBuy.rows[1].cells[2].innerHTML=localizeObject.av;tablePutThroughSell.rows[0].cells[0].innerHTML=localizeObject.de;tablePutThroughSell.rows[1].cells[0].innerHTML=localizeObject.au;tablePutThroughSell.rows[1].cells[1].innerHTML=localizeObject.ar;tablePutThroughSell.rows[1].cells[2].innerHTML=localizeObject.av;break;case "HOSE":tablePutThrough.rows[0].cells[0].innerHTML=localizeObject.cX;tablePutThrough.rows[1].cells[0].innerHTML=localizeObject.au;tablePutThrough.rows[1].cells[1].innerHTML=localizeObject.ar;tablePutThrough.rows[1].cells[2].innerHTML=localizeObject.av;tablePutThrough.rows[1].cells[3].innerHTML=localizeObject.da;tablePutThroughBuy.rows[0].cells[0].innerHTML=localizeObject.cZ;tablePutThroughBuy.rows[1].cells[0].innerHTML=localizeObject.au;tablePutThroughBuy.rows[1].cells[1].innerHTML=localizeObject.ar;tablePutThroughBuy.rows[1].cells[2].innerHTML=localizeObject.av;tablePutThroughBuy.rows[1].cells[3].innerHTML=localizeObject.cU;tablePutThroughSell.rows[0].cells[0].innerHTML=localizeObject.de;tablePutThroughSell.rows[1].cells[0].innerHTML=localizeObject.au;tablePutThroughSell.rows[1].cells[1].innerHTML=localizeObject.ar;tablePutThroughSell.rows[1].cells[2].innerHTML=localizeObject.av;tablePutThroughSell.rows[1].cells[3].innerHTML=localizeObject.cU;break;case "MIXED":tablePutThrough.rows[0].cells[0].innerHTML=localizeObject.cX;tablePutThrough.rows[1].cells[0].innerHTML=localizeObject.au;tablePutThrough.rows[1].cells[1].innerHTML=localizeObject.ar;tablePutThrough.rows[1].cells[2].innerHTML=localizeObject.av;tablePutThrough.rows[1].cells[3].innerHTML=localizeObject.da;tablePutThrough.rows[1].cells[4].innerHTML=localizeObject.cU;tablePutThroughBuy.rows[0].cells[0].innerHTML=localizeObject.cZ;tablePutThroughBuy.rows[1].cells[0].innerHTML=localizeObject.au;tablePutThroughBuy.rows[1].cells[1].innerHTML=localizeObject.ar;tablePutThroughBuy.rows[1].cells[2].innerHTML=localizeObject.av;tablePutThroughBuy.rows[1].cells[3].innerHTML=localizeObject.cU;tablePutThroughSell.rows[0].cells[0].innerHTML=localizeObject.de;tablePutThroughSell.rows[1].cells[0].innerHTML=localizeObject.au;tablePutThroughSell.rows[1].cells[1].innerHTML=localizeObject.ar;tablePutThroughSell.rows[1].cells[2].innerHTML=localizeObject.av;tablePutThroughSell.rows[1].cells[3].innerHTML=localizeObject.cU;break;}if(isShowGraph==true){var tableHistoryHeader=document.getElementById("tableHistoryHeader");tableHistoryHeader.rows[0].cells[0].innerHTML=localizeObject.HistoryTime;tableHistoryHeader.rows[0].cells[1].innerHTML=localizeObject.HistoryPrice+" (x1000)";tableHistoryHeader.rows[0].cells[2].innerHTML=localizeObject.HistoryChange+" (x1000)";tableHistoryHeader.rows[0].cells[3].innerHTML=localizeObject.HistoryChangePercent;tableHistoryHeader.rows[0].cells[4].innerHTML=localizeObject.HistoryVolume+" (x10)";tableHistoryHeader.rows[0].cells[5].innerHTML=localizeObject.HistoryTotalVolume+" (x10)";}spanPutThroughDescription.innerHTML=localizeObject.dD;SetHeaderText("tableQuote",localizeObject);SetHeaderText("tableFixedHeader",localizeObject);SetHeaderText("tableFloatingHeader",localizeObject);if(isShowGraph==true){var divGraphTitle=document.getElementById("divGraphTitle");divGraphTitle.innerHTML=localizeObject.GraphTitle;}aZ=0;af=0;aq=0;if(t!=null){clearTimeout(t);t=null;}GetBasicObject();};function SetHeaderText(tableId,localizeObject){var table=document.getElementById(tableId);var trGridHeaderTop=table.rows[0];var trGridHeader=table.rows[1];switch(floorType){case "HASTC":case "OTC":case "MIXED":trGridHeaderTop.cells[0].innerHTML=localizeObject.symbol;trGridHeaderTop.cells[1].innerHTML=localizeObject.ceiling;trGridHeaderTop.cells[2].innerHTML=localizeObject.floor;trGridHeaderTop.cells[3].innerHTML=localizeObject.basic;trGridHeaderTop.cells[4].innerHTML=localizeObject.bid;trGridHeaderTop.cells[5].innerHTML=localizeObject.matching;trGridHeaderTop.cells[7].innerHTML=localizeObject.ask;trGridHeaderTop.cells[8].innerHTML=localizeObject.high;trGridHeaderTop.cells[9].innerHTML=localizeObject.low;trGridHeaderTop.cells[10].innerHTML=localizeObject.average;trGridHeaderTop.cells[11].innerHTML=localizeObject.totalVolume;trGridHeader.cells[0].innerHTML=localizeObject.price+" 3";trGridHeader.cells[1].innerHTML=localizeObject.volume+" 3";trGridHeader.cells[2].innerHTML=localizeObject.price+" 2";trGridHeader.cells[3].innerHTML=localizeObject.volume+" 2";trGridHeader.cells[4].innerHTML=localizeObject.price+" 1";trGridHeader.cells[5].innerHTML=localizeObject.volume+" 1";trGridHeader.cells[6].innerHTML=localizeObject.price;trGridHeader.cells[7].innerHTML=localizeObject.volume;trGridHeader.cells[8].innerHTML=localizeObject.price+" 1";trGridHeader.cells[9].innerHTML=localizeObject.volume+" 1";trGridHeader.cells[10].innerHTML=localizeObject.price+" 2";trGridHeader.cells[11].innerHTML=localizeObject.volume+" 2";trGridHeader.cells[12].innerHTML=localizeObject.price+" 3";trGridHeader.cells[13].innerHTML=localizeObject.volume+" 3";var columnIndex=12;if(T==true)trGridHeaderTop.cells[columnIndex++].innerHTML=localizeObject.BuyVolume;if(U==true)trGridHeaderTop.cells[columnIndex++].innerHTML=localizeObject.SellVolume;if(R==true)trGridHeaderTop.cells[columnIndex++].innerHTML=localizeObject.BuyOrderCount;if(O==true)trGridHeaderTop.cells[columnIndex++].innerHTML=localizeObject.SellOrderCount;if(v==true)trGridHeaderTop.cells[columnIndex++].innerHTML=localizeObject.ForeignBuy;if(P==true)trGridHeaderTop.cells[columnIndex++].innerHTML=localizeObject.ForeignSell;if(A==true)trGridHeaderTop.cells[columnIndex++].innerHTML=localizeObject.CurrentRoom;break;case "HOSE":trGridHeaderTop.cells[0].innerHTML=localizeObject.symbol;trGridHeaderTop.cells[1].innerHTML=localizeObject.ceiling;trGridHeaderTop.cells[2].innerHTML=localizeObject.floor;trGridHeaderTop.cells[3].innerHTML=localizeObject.basic;trGridHeaderTop.cells[4].innerHTML=localizeObject.bid;trGridHeaderTop.cells[5].innerHTML=localizeObject.matching;trGridHeaderTop.cells[7].innerHTML=localizeObject.ask;trGridHeaderTop.cells[8].innerHTML=localizeObject.high;trGridHeaderTop.cells[9].innerHTML=localizeObject.low;trGridHeaderTop.cells[10].innerHTML=localizeObject.totalVolume;trGridHeader.cells[0].innerHTML=localizeObject.price+" 3";trGridHeader.cells[1].innerHTML=localizeObject.volume+" 3";trGridHeader.cells[2].innerHTML=localizeObject.price+" 2";trGridHeader.cells[3].innerHTML=localizeObject.volume+" 2";trGridHeader.cells[4].innerHTML=localizeObject.price+" 1";trGridHeader.cells[5].innerHTML=localizeObject.volume+" 1";trGridHeader.cells[6].innerHTML=localizeObject.price;trGridHeader.cells[7].innerHTML=localizeObject.volume;trGridHeader.cells[8].innerHTML=localizeObject.price+" 1";trGridHeader.cells[9].innerHTML=localizeObject.volume+" 1";trGridHeader.cells[10].innerHTML=localizeObject.price+" 2";trGridHeader.cells[11].innerHTML=localizeObject.volume+" 2";trGridHeader.cells[12].innerHTML=localizeObject.price+" 3";trGridHeader.cells[13].innerHTML=localizeObject.volume+" 3";var columnIndex=11;if(ab==true)trGridHeaderTop.cells[columnIndex++].innerHTML=localizeObject.Session1Price;if(D==true)trGridHeaderTop.cells[columnIndex++].innerHTML=localizeObject.Session1Volume;if(aa==true)trGridHeaderTop.cells[columnIndex++].innerHTML=localizeObject.Session2Price;if(C==true)trGridHeaderTop.cells[columnIndex++].innerHTML=localizeObject.Session2Volume;if(v==true)trGridHeaderTop.cells[columnIndex++].innerHTML=localizeObject.ForeignBuy;if(A==true)trGridHeaderTop.cells[columnIndex++].innerHTML=localizeObject.CurrentRoom;break;}};function createCookie(name,value,days){name=cq+name;if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}else var expires="";document.cookie=name+"="+value+expires+"; path=/";};function readCookie(name){name=cq+name;var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}return null;};function createGeneralCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}else var expires="";document.cookie=name+"="+value+expires+"; path=/";};function readGeneralCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}return null;};function OnTopLinkClick(){var chkOnTop=document.getElementById("chkShowSelectedOnTop");chkOnTop.checked= !chkOnTop.checked;};function OK(){var dq;dq=extraColumnString;var dG=showSelectedSymbolsOnTop;var chkDisplayAll=document.getElementById("chkDisplayAll");var chkShowBuyVolume;var chkShowSellVolume;var chkShowBuyOrderCount;var chkShowSellOrderCount;var chkShowForeignBuy;var chkShowForeignSell;var chkShowCurrentRoom;var chkShowSession1Price;var chkShowSession1Volume;var chkShowSession2Price;var chkShowSession2Volume;var chkShowVolumeColor=document.getElementById("chkShowVolumeColor");var chkShowGraph=document.getElementById("chkShowGraph");var chkShowSymbol2=document.getElementById("chkShowSymbol2");var chkOrderSelectedSymbols=document.getElementById("chkOrderSelectedSymbols");var rbtNormal=document.getElementById("rbtNormal");var rbtScrollInfinite=document.getElementById("rbtScrollInfinite");var rbtScroll2Directions=document.getElementById("rbtScroll2Directions");var txtLineCount=document.getElementById("txtLineCount");var txtScrollInterval=document.getElementById("txtScrollInterval");var txtWaitingTime=document.getElementById("txtWaitingTime");var rbtFontNormal=document.getElementById("rbtFontNormal");var rbtFontBoldHalf=document.getElementById("rbtFontBoldHalf");var rbtFontBoldAll=document.getElementById("rbtFontBoldAll");var dR=tableType;var oldFontStyle=fontStyle;var needSetScroll=false;if(rbtNormal.checked==true)tableType=0;else if(rbtScrollInfinite.checked==true)tableType=1;else if(rbtScroll2Directions.checked==true)tableType=2;else tableType=3;if(rbtFontNormal.checked==true)fontStyle=0;else if(rbtFontBoldHalf.checked==true)fontStyle=1;else fontStyle=2;var oldShowVolumeColor=isShowVolumeColor;var oldShowGraph=isShowGraph;var oldShowSymbol2=isShowSymbol2;var oldOrderSelectedSymbols=isOrderSelectedSymbols;isShowVolumeColor=chkShowVolumeColor.checked;isShowGraph=chkShowGraph.checked;isShowSymbol2=chkShowSymbol2.checked;isOrderSelectedSymbols=chkOrderSelectedSymbols.checked;if(tableType!=dR||parseInt(txtLineCount.value)!=lineCount||parseInt(txtScrollInterval.value)!=scrollInterval||parseInt(txtWaitingTime.value)!=waitingTime)needSetScroll=true;lineCount=parseInt(txtLineCount.value);scrollInterval=parseInt(txtScrollInterval.value);waitingTime=parseInt(txtWaitingTime.value);if(floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED"){chkShowBuyVolume=document.getElementById("chkShowBuyVolume");chkShowSellVolume=document.getElementById("chkShowSellVolume");chkShowBuyOrderCount=document.getElementById("chkShowBuyOrderCount");chkShowSellOrderCount=document.getElementById("chkShowSellOrderCount");chkShowForeignBuy=document.getElementById("chkShowForeignBuy");chkShowForeignSell=document.getElementById("chkShowForeignSell");chkShowCurrentRoom=document.getElementById("chkShowCurrentRoom");T=chkShowBuyVolume.checked;U=chkShowSellVolume.checked;R=chkShowBuyOrderCount.checked;O=chkShowSellOrderCount.checked;v=chkShowForeignBuy.checked;P=chkShowForeignSell.checked;A=chkShowCurrentRoom.checked;extraColumnString="";extraColumnString+=T?"1":"0";extraColumnString+=U?"1":"0";extraColumnString+=R?"1":"0";extraColumnString+=O?"1":"0";extraColumnString+=v?"1":"0";extraColumnString+=P?"1":"0";extraColumnString+=A?"1":"0";}else if(floorType=="HOSE"){chkShowSession1Price=document.getElementById("chkShowSession1Price");chkShowSession1Volume=document.getElementById("chkShowSession1Volume");chkShowSession2Price=document.getElementById("chkShowSession2Price");chkShowSession2Volume=document.getElementById("chkShowSession2Volume");chkShowForeignBuy=document.getElementById("chkShowForeignBuy");chkShowCurrentRoom=document.getElementById("chkShowCurrentRoom");ab=chkShowSession1Price.checked;D=chkShowSession1Volume.checked;aa=chkShowSession2Price.checked;C=chkShowSession2Volume.checked;v=chkShowForeignBuy.checked;A=chkShowCurrentRoom.checked;extraColumnString="";extraColumnString+=ab?"1":"0";extraColumnString+=D?"1":"0";extraColumnString+=aa?"1":"0";extraColumnString+=C?"1":"0";extraColumnString+=v?"1":"0";extraColumnString+=A?"1":"0";}GetSelectedSymbolsForChoose();if(chkDisplayAll.checked==true)displayedSymbolsString="all";else{displayedSymbolsString=displayedSymbolsSelectedString;if(displayedSymbolsString!="all")displayedSymbolList=displayedSymbolsString.split(",");}var chkOnTop=document.getElementById("chkShowSelectedOnTop");showSelectedSymbolsOnTop=chkOnTop.checked;var screenWidthButtons=document.forms[0].ScreenWidth;var radioButton;for(var i=0;i<screenWidthButtons.length;i++){radioButton=screenWidthButtons[i];if(radioButton.checked==true){screenWidth=radioButton.value;break;}}SetTableWidth();if(floorType=="HASTC"||floorType=="HOSE"||floorType=="OTC"||floorType=="MIXED"){if(dq!=extraColumnString||needSetScroll==true){bP=false;CreateExtraHeaderCells("tableQuote");CreateExtraHeaderCells("tableFixedHeader");CreateExtraHeaderCells("tableFloatingHeader");bP=true;}if(oldOrderSelectedSymbols!=isOrderSelectedSymbols||oldShowGraph!=isShowGraph||oldShowSymbol2!=isShowSymbol2||dq!=extraColumnString||needSetScroll==true||dH!=displayedSymbolsString)CreateBasicRows(true);else{if(fontStyle!=oldFontStyle)SetFontStyle();if(dG!=showSelectedSymbolsOnTop)ToggleOnTop();if(oldShowVolumeColor!=isShowVolumeColor)ToggleShowVolumeColor();}}else{if(dH!=displayedSymbolsString)CreateBasicRows(true);else{if(fontStyle!=oldFontStyle)SetFontStyle();if(dG!=showSelectedSymbolsOnTop)ToggleOnTop();if(oldShowVolumeColor!=isShowVolumeColor)ToggleShowVolumeColor();}}if(needSetScroll==true)SetScroll();createCookie("onTop",showSelectedSymbolsOnTop,1000);createCookie("boardName",boardName,1000);createCookie("displayedSymbolsString"+boardName,displayedSymbolsString,1000);createCookie("displayedSymbolsSelectedString"+boardName,displayedSymbolsSelectedString,1000);createCookie("screenWidth",screenWidth,1000);createCookie("fontStyle",fontStyle,1000);createCookie("isShowVolumeColor",isShowVolumeColor,1000);createCookie("extraColString",extraColumnString,1000);createCookie("tableType",tableType,1000);createCookie("lineCount",lineCount,1000);createCookie("scrollInterval",scrollInterval,1000);createCookie("waitingTime",waitingTime,1000);createGeneralCookie("isShowGraph",isShowGraph,1000);createGeneralCookie("isShowSymbol2",isShowSymbol2,1000);createGeneralCookie("isOrderSelectedSymbols",isOrderSelectedSymbols,1000);HideOption();};function GetSelectedSymbolsForChoose(){displayedSymbolsSelectedString="";var theChooseSymbolsTable=document.getElementById("tableChooseSymbols");var theRow;var checkbox;for(var i=0;i<theChooseSymbolsTable.rows.length;i++){theRow=theChooseSymbolsTable.rows[i];for(var j=0;j<theRow.cells.length;j++){theCell=theRow.cells[j];checkbox=theCell.childNodes[0];if(checkbox.checked==true){if(displayedSymbolsSelectedString=="")displayedSymbolsSelectedString="'"+checkbox.name+"'";else displayedSymbolsSelectedString=displayedSymbolsSelectedString+",'"+checkbox.name+"'";}}}};function SetClientInfo(){if(clientId== -1)GetClientId();else{switch(floorType){case "HASTC":AlphaStockBoard.UI.HastcStockQuotes.SetClientInfo(clientId,displayedSymbolsString,extraColumnString,B);break;case "HOSE":AlphaStockBoard.UI.HoseStockQuotes.SetClientInfo(clientId,displayedSymbolsString,extraColumnString,B);break;case "OTC":AlphaStockBoard.UI.OtcStockQuotes.SetClientInfo(clientId,displayedSymbolsString,extraColumnString,B);break;case "MIXED":AlphaStockBoard.UI.MixedStockQuotes.SetClientInfo(clientId,displayedSymbolsString,extraColumnString,B);break;}}};function SetClientInfoAndGetData(){if(t!=null){clearTimeout(t);t=null;}if(clientId== -1)GetClientId();else{switch(floorType){case "HASTC":AlphaStockBoard.UI.HastcStockQuotes.SetClientInfoAndGetData(clientId,displayedSymbolsString,extraColumnString,B);break;case "HOSE":AlphaStockBoard.UI.HoseStockQuotes.SetClientInfoAndGetData(clientId,displayedSymbolsString,extraColumnString,B);break;case "OTC":AlphaStockBoard.UI.OtcStockQuotes.SetClientInfoAndGetData(clientId,displayedSymbolsString,extraColumnString,B);break;case "MIXED":AlphaStockBoard.UI.MixedStockQuotes.SetClientInfoAndGetData(clientId,displayedSymbolsString,extraColumnString,B);break;}}};function GetPutThroughObject(){switch(floorType){case "HASTC":AlphaStockBoard.UI.HastcStockQuotes.GetHastcPutThroughObject(B);break;case "HOSE":AlphaStockBoard.UI.HoseStockQuotes.GetHosePutThroughObject(B);break;case "OTC":AlphaStockBoard.UI.OtcStockQuotes.GetOtcPutThroughObject(B);break;case "MIXED":AlphaStockBoard.UI.MixedStockQuotes.GetMixedPutThroughObject(B);break;}};function GetQuotesHistory(symbol){switch(floorType){case "HASTC":AlphaStockBoard.UI.HastcStockQuotes.GetHastcQuotesHistory(symbol,B);break;case "HOSE":AlphaStockBoard.UI.HoseStockQuotes.GetHoseQuotesHistory(symbol,B);break;case "OTC":AlphaStockBoard.UI.OtcStockQuotes.GetOtcQuotesHistory(symbol,B);break;case "MIXED":AlphaStockBoard.UI.MixedStockQuotes.GetMixedQuotesHistory(symbol,B);break;}};function GetClientId(){switch(floorType){case "HASTC":AlphaStockBoard.UI.HastcStockQuotes.GetClientId();break;case "HOSE":AlphaStockBoard.UI.HoseStockQuotes.GetClientId();break;case "OTC":AlphaStockBoard.UI.OtcStockQuotes.GetClientId();break;case "MIXED":AlphaStockBoard.UI.MixedStockQuotes.GetClientId();break;}};function ToggleOption(){if(am==true){HideOption();}else{ShowOption();}};function ShowOption(){LoadSymbolsTableForChoose();dH=displayedSymbolsString;var chkOnTop=document.getElementById("chkShowSelectedOnTop");chkOnTop.checked=showSelectedSymbolsOnTop;if(floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED"){var chkShowBuyVolume=document.getElementById("chkShowBuyVolume");var chkShowSellVolume=document.getElementById("chkShowSellVolume");var chkShowBuyOrderCount=document.getElementById("chkShowBuyOrderCount");var chkShowSellOrderCount=document.getElementById("chkShowSellOrderCount");var chkShowForeignBuy=document.getElementById("chkShowForeignBuy");var chkShowForeignSell=document.getElementById("chkShowForeignSell");var chkShowCurrentRoom=document.getElementById("chkShowCurrentRoom");chkShowBuyVolume.checked=T;chkShowSellVolume.checked=U;chkShowBuyOrderCount.checked=R;chkShowSellOrderCount.checked=O;chkShowForeignBuy.checked=v;chkShowForeignSell.checked=P;chkShowCurrentRoom.checked=A;}else if(floorType=="HOSE"){var chkShowSession1Price=document.getElementById("chkShowSession1Price");var chkShowSession1Volume=document.getElementById("chkShowSession1Volume");var chkShowSession2Price=document.getElementById("chkShowSession2Price");var chkShowSession2Volume=document.getElementById("chkShowSession2Volume");var chkShowForeignBuy=document.getElementById("chkShowForeignBuy");var chkShowCurrentRoom=document.getElementById("chkShowCurrentRoom");chkShowSession1Price.checked=ab;chkShowSession1Volume.checked=D;chkShowSession2Price.checked=aa;chkShowSession2Volume.checked=C;chkShowForeignBuy.checked=v;chkShowCurrentRoom.checked=A;}var chkShowVolumeColor=document.getElementById("chkShowVolumeColor");var chkShowGraph=document.getElementById("chkShowGraph");var chkShowSymbol2=document.getElementById("chkShowSymbol2");var chkOrderSelectedSymbols=document.getElementById("chkOrderSelectedSymbols");if(isShowVolumeColor==true)chkShowVolumeColor.checked=true;else chkShowVolumeColor.checked=false;chkShowGraph.checked=isShowGraph;chkShowSymbol2.checked=isShowSymbol2;chkOrderSelectedSymbols.checked=isOrderSelectedSymbols;var pnlOption=document.getElementById("pnlOption");pnlOption.style.display='block';am=true;var spanOption=document.getElementById("spanOption");if(B=="vi-VN")spanOption.innerHTML="<img src=\"Images/an.gif\" onclick=\"ToggleOption();\" style=\"pointer: hand; cursor: pointer;\">";else spanOption.innerHTML="<img src=\"Images/hide.gif\" onclick=\"ToggleOption();\" style=\"pointer: hand; cursor: pointer;\">";var screenWidthButtons=document.forms[0].ScreenWidth;var radioButton;for(var i=0;i<screenWidthButtons.length;i++){radioButton=screenWidthButtons[i];if(radioButton.value==screenWidth){radioButton.checked=true;break;}}var boardNameButtons=document.forms[0].SelectBoard;for(var i=0;i<boardNameButtons.length;i++){radioButton=boardNameButtons[i];if(radioButton.value==boardName){radioButton.checked=true;break;}}var rbtNormal=document.getElementById("rbtNormal");var rbtScrollInfinite=document.getElementById("rbtScrollInfinite");var rbtScroll2Directions=document.getElementById("rbtScroll2Directions");var rbtPageReplacement=document.getElementById("rbtPageReplacement");var txtLineCount=document.getElementById("txtLineCount");var txtScrollInterval=document.getElementById("txtScrollInterval");var txtWaitingTime=document.getElementById("txtWaitingTime");var rbtFontNormal=document.getElementById("rbtFontNormal");var rbtFontBoldHalf=document.getElementById("rbtFontBoldHalf");var rbtFontBoldAll=document.getElementById("rbtFontBoldAll");if(tableType==0)rbtNormal.checked=true;else if(tableType==1)rbtScrollInfinite.checked=true;else if(tableType==2)rbtScroll2Directions.checked=true;else rbtPageReplacement.checked=true;if(fontStyle==0)rbtFontNormal.checked=true;else if(fontStyle==1)rbtFontBoldHalf.checked=true;else rbtFontBoldAll.checked=true;txtLineCount.value=lineCount;txtScrollInterval.value=scrollInterval;txtWaitingTime.value=waitingTime;};function HideOption(){var pnlOption=document.getElementById("pnlOption");pnlOption.style.display='none';am=false;var spanOption=document.getElementById("spanOption");if(B=="vi-VN")spanOption.innerHTML="<img src=\"Images/tuychon.gif\" onclick=\"ToggleOption();\" style=\"pointer: hand; cursor: pointer;\">";else spanOption.innerHTML="<img src=\"Images/option.gif\" onclick=\"ToggleOption();\" style=\"pointer: hand; cursor: pointer;\">";};function TogglePutThrough(){if(aK==true)HidePutThrough();else ShowPutThrough();};function ToggleVolumeColor(){var chkShowVolumeColor=document.getElementById("chkShowVolumeColor");chkShowVolumeColor.checked= !chkShowVolumeColor.checked;};function ToggleShowGraph(){var chkShowGraph=document.getElementById("chkShowGraph");chkShowGraph.checked= !chkShowGraph.checked;};function ToggleShowSymbol2(){var chkShowSymbol2=document.getElementById("chkShowSymbol2");chkShowSymbol2.checked= !chkShowSymbol2.checked;};function ToggleOrderSelectedSymbols(){var chkOrderSelectedSymbols=document.getElementById("chkOrderSelectedSymbols");chkOrderSelectedSymbols.checked= !chkOrderSelectedSymbols.checked;};function ShowPutThrough(){var pnlOption=document.getElementById("pnlPutThrough");pnlOption.style.display='block';aK=true;GetPutThroughObject();dc=self.setInterval("GetPutThroughObject()",10*1000);};function HidePutThrough(){var pnlOption=document.getElementById("pnlPutThrough");pnlOption.style.display='none';aK=false;self.clearInterval(dc);dc=null;};function ToggleOnTop(){if(tableType!=0)return;var chkSymbol;if(showSelectedSymbolsOnTop==true){selectedSymbolList=new Array();unselectedSymbolList=new Array();al=0;if(basicObject!=null){for(var itemKey in basicObject.ItemList){if(displayedSymbolsString=="all"||displayedSymbolsString.indexOf("'"+itemKey+"'")!= -1)unselectedSymbolList.push(itemKey);}for(var itemKey in basicObject.ItemList){if(displayedSymbolsString=="all"||displayedSymbolsString.indexOf("'"+itemKey+"'")!= -1){chkSymbol=document.getElementById("chk"+itemKey);if(chkSymbol!=null&&chkSymbol!="undefined"){if(chkSymbol.checked==true)Toggle(itemKey,false);}}}}}else{var symbol;var g=document.getElementById("tableQuote");var row;var dg;var replacedRow;if(isShowSeparator==true&&al>0)g.rows[headerRowCount+al-1].className="quoteRow";for(var j=0;j<selectedSymbolList.length;j++){symbol=selectedSymbolList[j];dg=al;row=document.getElementById("tr"+symbol);checkbox=document.getElementById("chk"+symbol);if(checkbox!="undefined"){for(var i=0;i<unselectedSymbolList.length;i++){if(unselectedSymbolList[i]>symbol){replacedRow=g.rows[dg+headerRowCount+i];replacedRow.parentNode.insertBefore(row,replacedRow);if(Sys.Browser.name=="Microsoft Internet Explorer"){if(Sys.Browser.version<=6)checkbox.checked=true;}if(isShowSelectedColor==false)SetRowBackColor(row);dg--;break;}}}}}};function DisplayAllLinkClick(){var chkDisplayAll=document.getElementById("chkDisplayAll");chkDisplayAll.checked= !chkDisplayAll.checked;ToggleDisplayAll();};function ToggleDisplayAll(){var chkDisplayAll=document.getElementById("chkDisplayAll");var theChooseSymbolsTable=document.getElementById("tableChooseSymbols");var theSelectAllSymbolsTable=document.getElementById("tableSelectSymbols");theSelectAllSymbolsTable.disabled=chkDisplayAll.checked;theChooseSymbolsTable.disabled=chkDisplayAll.checked;var theChooseSymbolsTable=document.getElementById("tableChooseSymbols");var theRow;var theCell;var checkbox;if(chkDisplayAll.checked==true){for(var i=0;i<theChooseSymbolsTable.rows.length;i++){theRow=theChooseSymbolsTable.rows[i];for(var j=0;j<theRow.cells.length;j++){theCell=theRow.cells[j];checkbox=theCell.childNodes[0];checkbox.disabled=true;}}}else{for(var i=0;i<theChooseSymbolsTable.rows.length;i++){theRow=theChooseSymbolsTable.rows[i];for(var j=0;j<theRow.cells.length;j++){theCell=theRow.cells[j];checkbox=theCell.childNodes[0];checkbox.disabled=false;}}}};function ToggleShowVolumeColor(){var g=document.getElementById("tableQuote");var row;for(var i=2;i<g.rows.length;i++){row=g.rows[i];if(isShowVolumeColor==true){row.cells[0].className=row.cells[10].className+"Code";row.cells[5].className=row.cells[4].className;row.cells[7].className=row.cells[6].className;row.cells[9].className=row.cells[8].className;row.cells[11].className=row.cells[10].className;row.cells[12].className=row.cells[10].className;row.cells[14].className=row.cells[10].className;row.cells[16].className=row.cells[15].className;row.cells[18].className=row.cells[17].className;}else{row.cells[0].className="cellCode";row.cells[5].className="normalVol";row.cells[7].className="normalVol";row.cells[9].className="normalVol";row.cells[11].className="normalVol";if(row.cells[10].className=="cellCeiling"||row.cells[10].className=="upPrice")row.cells[12].className="upPrice";else if(row.cells[10].className=="downPrice"||row.cells[10].className=="cellFloor")row.cells[12].className="downPrice";else row.cells[12].className="unchangePrice";row.cells[14].className="normalVol";row.cells[16].className="normalVol";row.cells[18].className="normalVol";}}};function SelectAll(){var chkDisplayAll=document.getElementById("chkDisplayAll");if(chkDisplayAll.checked==true)return;var theChooseSymbolsTable=document.getElementById("tableChooseSymbols");var theRow;var theCell;var checkbox;for(var i=0;i<theChooseSymbolsTable.rows.length;i++){theRow=theChooseSymbolsTable.rows[i];for(var j=0;j<theRow.cells.length;j++){theCell=theRow.cells[j];checkbox=theCell.childNodes[0];checkbox.checked=true;theCell.className="cellChooseSymbolSelected";checkbox.className="chkChooseSymbolSelected";}}};function ClearAll(){var chkDisplayAll=document.getElementById("chkDisplayAll");if(chkDisplayAll.checked==true)return;var theChooseSymbolsTable=document.getElementById("tableChooseSymbols");var theRow;var theCell;var checkbox;for(var i=0;i<theChooseSymbolsTable.rows.length;i++){theRow=theChooseSymbolsTable.rows[i];for(var j=0;j<theRow.cells.length;j++){theCell=theRow.cells[j];checkbox=theCell.childNodes[0];checkbox.checked=false;theCell.className="cellChooseSymbol";checkbox.className="chkChooseSymbol";}}};function ChooseSymbolLinkClick(symbol){var chkDisplayAll=document.getElementById("chkDisplayAll");if(chkDisplayAll.checked==true)return;var checkbox=document.getElementById("chkChoose"+symbol);checkbox.checked= !checkbox.checked;ToggleChooseSymbol(symbol);};function ToggleChooseSymbol(symbol){var checkbox=document.getElementById("chkChoose"+symbol);var td=document.getElementById("tdChoose"+symbol);if(checkbox.checked==true){td.className="cellChooseSymbolSelected";checkbox.className="chkChooseSymbolSelected";}else{td.className="cellChooseSymbol";checkbox.className="chkChooseSymbol";}};function ShowColumnLinkClick(dL){var checkbox=document.getElementById("chk"+dL);checkbox.checked= !checkbox.checked;};function Toggle(symbol,isFinishBasicRows){if(tableType!=0)return;var checkbox=document.getElementById("chk"+symbol);if(an==true){checkbox.checked=false;return;}var row=document.getElementById("tr"+symbol);var g=document.getElementById("tableQuote");var cellIndex;var replacedRow;if(checkbox.checked==true){var movedPosition=al+headerRowCount;var dr=row.rowIndex;if(showSelectedSymbolsOnTop==true&&isFinishBasicRows==false){replacedRow=g.rows[al+headerRowCount];replacedRow.parentNode.insertBefore(row,replacedRow);if(isShowSeparator==true){if(al>0)g.rows[al+headerRowCount-1].className="quoteRow";row.className="quoteRowSeparator";}if(Sys.Browser.name=="Microsoft Internet Explorer"){if(Sys.Browser.version<=6)checkbox.checked=true;}}selectedSymbolList.push(symbol);for(var i=0;i<unselectedSymbolList.length;i++){if(unselectedSymbolList[i]==symbol){unselectedSymbolList.splice(i,1);break;}}if(isFinishBasicRows==false&&showSelectedSymbolsOnTop==true){var index1;if(isShowSelectedColor==true)index1=headerRowCount+al+1;else index1=headerRowCount;for(var i=index1;i<=dr;i++)if(g.rows[i].id!="tr"+bg)SetRowBackColor(g.rows[i]);}if((isShowSelectedColor==true||showSelectedSymbolsOnTop==false)&&(bg!=symbol||(showSelectedSymbolsOnTop==true&&dr!=movedPosition))){cellIndex=0;row.cells[cellIndex++].style.backgroundColor=backColorSymbolSelected;row.cells[cellIndex++].style.backgroundColor=backColor2Selected;row.cells[cellIndex++].style.backgroundColor=backColor2Selected;row.cells[cellIndex++].style.backgroundColor=backColor2Selected;row.cells[cellIndex++].style.backgroundColor=backColor1Selected;row.cells[cellIndex++].style.backgroundColor=backColor1Selected;row.cells[cellIndex++].style.backgroundColor=backColor1SelectedAlt;row.cells[cellIndex++].style.backgroundColor=backColor1SelectedAlt;row.cells[cellIndex++].style.backgroundColor=backColor1Selected;row.cells[cellIndex++].style.backgroundColor=backColor1Selected;row.cells[cellIndex++].style.backgroundColor=backColor2Selected;row.cells[cellIndex++].style.backgroundColor=backColor2Selected;row.cells[cellIndex++].style.backgroundColor=backColor2Selected;row.cells[cellIndex++].style.backgroundColor=backColor1Selected;row.cells[cellIndex++].style.backgroundColor=backColor1Selected;row.cells[cellIndex++].style.backgroundColor=backColor1SelectedAlt;row.cells[cellIndex++].style.backgroundColor=backColor1SelectedAlt;row.cells[cellIndex++].style.backgroundColor=backColor1Selected;row.cells[cellIndex++].style.backgroundColor=backColor1Selected;row.cells[cellIndex++].style.backgroundColor=backColor2Selected;row.cells[cellIndex++].style.backgroundColor=backColor2Selected;if(floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED")row.cells[cellIndex++].style.backgroundColor=backColor2Selected;row.cells[cellIndex++].style.backgroundColor=backColor1Selected;var lastIndex;if(floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED")lastIndex=23;else lastIndex=22;for(var i=lastIndex;i<row.cells.length;i++)row.cells[i].style.backgroundColor=backColor1Selected;}al++;}else{for(var i=0;i<selectedSymbolList.length;i++){if(selectedSymbolList[i]==symbol){selectedSymbolList.splice(i,1);break;}}var movedPosition= -1;var dr=row.rowIndex;if(unselectedSymbolList.length>0&&unselectedSymbolList[unselectedSymbolList.length-1]<symbol){unselectedSymbolList.push(symbol);{if(showSelectedSymbolsOnTop==true&&isFinishBasicRows==false){UnHighlight(row);if(isShowSeparator==true&&al>0)g.rows[al+headerRowCount-1].className="quoteRow";replacedRow=g.rows[g.rows.length-1];replacedRow.parentNode.insertBefore(row);if(isShowSeparator==true&&al-1>0)g.rows[al+headerRowCount-2].className="quoteRowSeparator";}}}else for(var i=0;i<unselectedSymbolList.length;i++){if(unselectedSymbolList[i]>symbol){unselectedSymbolList.splice(i,0,symbol);{if(showSelectedSymbolsOnTop==true&&isFinishBasicRows==false){UnHighlight(row);if(isShowSeparator==true&&al>0)g.rows[al+headerRowCount-1].className="quoteRow";movedPosition=al+headerRowCount+i;replacedRow=g.rows[movedPosition];replacedRow.parentNode.insertBefore(row,replacedRow);if(isShowSeparator==true&&al-1>0)g.rows[al+headerRowCount-2].className="quoteRowSeparator";}}break;}}if(showSelectedSymbolsOnTop==true){var index1;if(isShowSelectedColor==true)index1=headerRowCount+al-1;else index1=dr;for(var i=index1;i<=row.rowIndex;i++)if(g.rows[i].id!="tr"+bg)SetRowBackColor(g.rows[i]);}al--;}createCookie("selectedSymbolList",selectedSymbolList,1000);};function SetRowBackColor(row){var symbol=row.id.substring(2);var isChecked=false;var checkbox=document.getElementById("chk"+symbol);if(checkbox==null)return;isChecked=checkbox.checked;var cellIndex=0;var colorSymbol;var color1,color1Alt,color2;if(isChecked==true&&(isShowSelectedColor==true||showSelectedSymbolsOnTop==false)){colorSymbol=backColorSymbolSelected;color1=backColor1Selected;color2=backColor2Selected;color1Alt=backColor1SelectedAlt;}else{if(row.rowIndex%2==0){colorSymbol=backColorSymbol;color1=backColor1;color2=backColor2;color1Alt=backColor1Alt;}else{colorSymbol=backColorSymbolR2;color1=backColor1R2;color2=backColor2R2;color1Alt=backColor1AltR2;}}row.cells[cellIndex++].style.backgroundColor=colorSymbol;row.cells[cellIndex++].style.backgroundColor=color2;row.cells[cellIndex++].style.backgroundColor=color2;row.cells[cellIndex++].style.backgroundColor=color2;row.cells[cellIndex++].style.backgroundColor=color1;row.cells[cellIndex++].style.backgroundColor=color1;row.cells[cellIndex++].style.backgroundColor=color1Alt;row.cells[cellIndex++].style.backgroundColor=color1Alt;row.cells[cellIndex++].style.backgroundColor=color1;row.cells[cellIndex++].style.backgroundColor=color1;row.cells[cellIndex++].style.backgroundColor=color2;row.cells[cellIndex++].style.backgroundColor=color2;row.cells[cellIndex++].style.backgroundColor=color2;row.cells[cellIndex++].style.backgroundColor=color1;row.cells[cellIndex++].style.backgroundColor=color1;row.cells[cellIndex++].style.backgroundColor=color1Alt;row.cells[cellIndex++].style.backgroundColor=color1Alt;row.cells[cellIndex++].style.backgroundColor=color1;row.cells[cellIndex++].style.backgroundColor=color1;row.cells[cellIndex++].style.backgroundColor=color2;row.cells[cellIndex++].style.backgroundColor=color2;if(floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED")row.cells[cellIndex++].style.backgroundColor=color2;row.cells[cellIndex++].style.backgroundColor=color1;var lastIndex;if(floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED")lastIndex=23;else lastIndex=22;for(var i=lastIndex;i<row.cells.length;i++)row.cells[i].style.backgroundColor=color1;};function GetBasicObject(){if(t!=null){clearTimeout(t);t=null;}switch(floorType){case "HASTC":AlphaStockBoard.UI.HastcStockQuotes.GetStockBoardBasicObject(clientId,aZ,B);break;case "HOSE":AlphaStockBoard.UI.HoseStockQuotes.GetStockBoardBasicObject(clientId,aZ,B);break;case "OTC":AlphaStockBoard.UI.OtcStockQuotes.GetStockBoardBasicObject(clientId,aZ,B);break;case "MIXED":AlphaStockBoard.UI.MixedStockQuotes.GetStockBoardBasicObject(clientId,aZ,B);break;}};function CheckResponse(){if(dp==false){if(aj==true)StartRequest();}else{dp=false;}};function StartRequest(){if(t!=null){clearTimeout(t);t=null;}switch(floorType){case "HASTC":AlphaStockBoard.UI.HastcStockQuotes.GetStockBoardChangedObject(clientId,af,B);break;case "HOSE":AlphaStockBoard.UI.HoseStockQuotes.GetStockBoardChangedObject(clientId,af,aq,B);break;case "OTC":AlphaStockBoard.UI.OtcStockQuotes.GetStockBoardChangedObject(clientId,af,B);break;case "MIXED":AlphaStockBoard.UI.MixedStockQuotes.GetStockBoardChangedObject(clientId,af,B);break;}};function GetStockInfo(){switch(floorType){case "HASTC":AlphaStockBoard.UI.HastcStockQuotes.GetStockInfoObject(-1,B);break;case "HOSE":AlphaStockBoard.UI.HoseStockQuotes.GetStockInfoObject(-1,B);break;case "OTC":AlphaStockBoard.UI.OtcStockQuotes.GetStockInfoObject(-1,B);break;case "MIXED":AlphaStockBoard.UI.MixedStockQuotes.GetStockInfoObject(-1,B);break;}};function UpdateMarketImmediately(){if(dataResult.AC!="")ds=dataResult.AC;if(dataResult.DC!="")dh=dataResult.DC;if(dataResult.NC!="")dj=dataResult.NC;UpdateMarketData();};function UpdateMarketData(){var localizeObject;if(B=="vi-VN")localizeObject=localizeVN;else localizeObject=localizeEN;if(dataResult.I!=""){if(isShowGraph==true&&tableType==0){var graphLink="<a class='lnkGraph' id='lnkGraph"+floorType+"' href=\"javascript:OpenGraph('"+floorType+"', '"+floorType+"')\"><img width=\"12\" height=\"12\" title='"+localizeObject.GraphIndexLinkTitle+"' src=\"Images\\Graph.png\"/></a>";tdIndex.innerHTML=graphLink+" "+dataResult.I;}else tdIndex.innerHTML=dataResult.I;}tdGainersLosers.innerHTML="<img src=\"images/btup.gif\" /><span class=\"headerInfoValueUp\">"+ds+"</span>";tdGainersLosers.innerHTML+=" <img src=\"images/btdown.gif\" /><span class=\"headerInfoValueDown\">"+dh+"</span>";tdGainersLosers.innerHTML+=" <img src=\"images/btnochange.jpg\" /><span class=\"headerInfoValueUnchange\">"+dj+"</span>";if(floorType=="HOSE"||floorType=="MIXED"){var marketIndices=dataResult.SI.split(";");if(marketIndices[0]!="")UpdateSessionInfoImmediately(tdSession1,marketIndices[0],marketIndices[1],marketIndices[2]);if(marketIndices[4]!="")UpdateSessionInfoImmediately(tdSession2,marketIndices[4],marketIndices[5],marketIndices[6]);if(marketIndices[8]!="")UpdateSessionInfoImmediately(tdSession3,marketIndices[8],marketIndices[9],marketIndices[10]);tdSession2.style.width=tdSession1.style.width;if(marketIndices[3]!="")tdSession1Trading.innerHTML=marketIndices[3]+" "+localizeObject.currencyUnit;if(marketIndices[7]!="")tdSession2Trading.innerHTML=marketIndices[7]+" "+localizeObject.currencyUnit;if(marketIndices[11]!="")tdSession3Trading.innerHTML=marketIndices[11]+" "+localizeObject.currencyUnit;}if(dataResult.TVal!="")tdTotalValue.innerHTML=dataResult.TVal+" "+localizeObject.currencyUnit;if(dataResult.TVol!="")tdTotalMarketVolume.innerHTML=dataResult.TVol;if(dataResult.MS!="")tdMarketStatus.innerHTML=dataResult.MS;if(dataResult.IC!=""){if(dataResult.IC.substr(0,1)=="-"){tdIndex.className="headerInfoValueDown";tdChange.className="headerInfoValueDown";tdChange.innerHTML=dataResult.IC+" <img src=\"images/btdown.gif\" />"+" ("+dataResult.ICP+"%)";}else if(dataResult.IC=="0"){tdIndex.className="headerInfoValueUnchange";tdChange.className="headerInfoValueUnchange";tdChange.innerHTML=dataResult.IC+" <img src=\"images/btnochange.jpg\" />"+" ("+dataResult.ICP+"%)";}else{tdIndex.className="headerInfoValueUp";tdChange.className="headerInfoValueUp";tdChange.innerHTML=dataResult.IC+" <img src=\"images/btup.gif\" />"+" ("+dataResult.ICP+"%)";}}};function UpdateSessionInfoImmediately(cell,index,change,percent){if(change.substr(0,1)=="-"){cell.className="sessionInfoValueDown";cell.innerHTML=index+"  <img src=\"images/btdown.gif\" /> "+change+" "+" ("+percent+"%)";}else if(change=="0"){cell.className="sessionInfoValueUnchange";cell.innerHTML=index+"  <img src=\"images/btnochange.jpg\" /> "+change+" "+" ("+percent+"%)";}else{cell.className="sessionInfoValueUp";cell.innerHTML=index+"  <img src=\"images/btup.gif\" /> "+change+" "+" ("+percent+"%)";}};function UpdateMarket(){if(bf!=null){self.clearTimeout(bf);bf=null;ClearMarketBgColor();}if(dataResult.I!="")tdIndex.style.backgroundColor=updatingBackColor;if(dataResult.AC!=""||dataResult.DC!=""||dataResult.NC!=""){tdGainersLosers.style.backgroundColor=updatingBackColor;if(dataResult.AC!="")ds=dataResult.AC;if(dataResult.DC!="")dh=dataResult.DC;if(dataResult.NC!="")dj=dataResult.NC;}if(floorType=="HOSE"||floorType=="MIXED"){var marketIndices=dataResult.SI.split(";");if(marketIndices[0]!="")tdSession1.style.backgroundColor=updatingBackColor;if(marketIndices[4]!="")tdSession2.style.backgroundColor=updatingBackColor;if(marketIndices[8]!="")tdSession3.style.backgroundColor=updatingBackColor;if(marketIndices[3]!="")tdSession1Trading.style.backgroundColor=updatingBackColor;if(marketIndices[7]!="")tdSession2Trading.style.backgroundColor=updatingBackColor;if(marketIndices[11]!="")tdSession3Trading.style.backgroundColor=updatingBackColor;}if(dataResult.TVal!="")tdTotalValue.style.backgroundColor=updatingBackColor;if(dataResult.TVol!="")tdTotalMarketVolume.style.backgroundColor=updatingBackColor;if(dataResult.IC!="")tdChange.style.backgroundColor=updatingBackColor;if(dataResult.MS!="")tdMarketStatus.style.backgroundColor=updatingBackColor;dO=self.setTimeout("DisplayMarketUpdateData()",500)};function DisplayMarketUpdateData(){UpdateMarketData();marketUpdatingData=dataResult;bf=self.setTimeout("ClearMarketBgColor()",5000)};function ClearMarketBgColor(){if(marketUpdatingData==null)return;if(marketUpdatingData.I!="")tdIndex.style.backgroundColor="";if(marketUpdatingData.AC!=""||marketUpdatingData.DC!=""||marketUpdatingData.NC!="")tdGainersLosers.style.backgroundColor="";if(marketUpdatingData.TVal!="")tdTotalValue.style.backgroundColor="";if(marketUpdatingData.TVol!="")tdTotalMarketVolume.style.backgroundColor="";if(marketUpdatingData.IC!="")tdChange.style.backgroundColor="";if(marketUpdatingData.MS!="")tdMarketStatus.style.backgroundColor="";if(floorType=="HOSE"||floorType=="MIXED"){var marketIndices=marketUpdatingData.SI.split(";");if(marketIndices[0]!="")tdSession1.style.backgroundColor="";if(marketIndices[4]!="")tdSession2.style.backgroundColor="";if(marketIndices[8]!="")tdSession3.style.backgroundColor="";if(marketIndices[3]!="")tdSession1Trading.style.backgroundColor="";if(marketIndices[7]!="")tdSession2Trading.style.backgroundColor="";if(marketIndices[11]!="")tdSession3Trading.style.backgroundColor="";}marketUpdatingData=null;bf=null;};function StartUpdate(){if(dataResult==null||basicObject==null)return;if(L==true||an==true){var dA=self.setTimeout("UpdateImmediately()",50);return;}if(ao!=null){self.clearTimeout(ao);ao=null;ClearBgColor();}var ap;ap=dataResult.ItemList;M=new Array();var quoteItem;var i=0;var f;var cellIndex;for(var item in ap){quoteItem=ap[item];f=quoteItem.V.split(";");changedRow=document.getElementById("tr"+item);if(changedRow!=null){cellIndex=4;if(changedRow.rowIndex%2==0){UpdateCellData(item,f[0],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],i++,true,backColor1,backColor1Selected,false);UpdateCellData(item,f[1],changedRow.cells[cellIndex++],null,i++,false,backColor1,backColor1Selected,false);UpdateCellData(item,f[2],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],i++,true,backColor1Alt,backColor1SelectedAlt,false);UpdateCellData(item,f[3],changedRow.cells[cellIndex++],null,i++,false,backColor1Alt,backColor1SelectedAlt,false);UpdateCellData(item,f[4],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],i++,true,backColor1,backColor1Selected,false);UpdateCellData(item,f[5],changedRow.cells[cellIndex++],null,i++,false,backColor1,backColor1Selected,false);UpdateCellData(item,f[6],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],i++,true,backColor2,backColor2Selected,false);UpdateCellData(item,f[7],changedRow.cells[cellIndex++],null,i++,false,backColor2,backColor2Selected,false);UpdateCellData(item,f[8],changedRow.cells[cellIndex++],null,i++,true,backColor2,backColor2Selected,true,f[6]);if(isShowVolumeColor==true&&f[6]!=""){M[i-3].ExtraCellVolume1=changedRow.cells[0];M[i-3].ExtraCellVolume2=changedRow.cells[12];}UpdateCellData(item,f[9],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],i++,true,backColor1,backColor1Selected,false);UpdateCellData(item,f[10],changedRow.cells[cellIndex++],null,i++,false,backColor1,backColor1Selected,false);UpdateCellData(item,f[11],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],i++,true,backColor1Alt,backColor1SelectedAlt,false);UpdateCellData(item,f[12],changedRow.cells[cellIndex++],null,i++,false,backColor1Alt,backColor1SelectedAlt,false);UpdateCellData(item,f[13],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],i++,true,backColor1,backColor1Selected,false);UpdateCellData(item,f[14],changedRow.cells[cellIndex++],null,i++,false,backColor1,backColor1Selected,false);if(floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED"){UpdateCellData(item,f[16],changedRow.cells[cellIndex++],null,i++,true,backColor2,backColor2Selected,false);UpdateCellData(item,f[17],changedRow.cells[cellIndex++],null,i++,true,backColor2,backColor2Selected,false);UpdateCellData(item,f[18],changedRow.cells[cellIndex++],null,i++,true,backColor2,backColor2Selected,false);UpdateCellData(item,f[19],changedRow.cells[cellIndex++],null,i++,false,backColor1,backColor1Selected,false)}else{UpdateCellData(item,f[15],changedRow.cells[cellIndex++],null,i++,true,backColor2,backColor2Selected,false);UpdateCellData(item,f[16],changedRow.cells[cellIndex++],null,i++,true,backColor2,backColor2Selected,false);UpdateCellData(item,f[17],changedRow.cells[cellIndex++],null,i++,false,backColor1,backColor1Selected,false)}if(floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED"){if(T==true){UpdateCellData(item,f[20],changedRow.cells[cellIndex++],null,i++,false,backColor1,backColor1Selected,false)}if(U==true){UpdateCellData(item,f[21],changedRow.cells[cellIndex++],null,i++,false,backColor1,backColor1Selected,false)}if(R==true){UpdateCellData(item,f[22],changedRow.cells[cellIndex++],null,i++,false,backColor1,backColor1Selected,false)}if(O==true){UpdateCellData(item,f[23],changedRow.cells[cellIndex++],null,i++,false,backColor1,backColor1Selected,false)}if(v==true){UpdateCellData(item,f[24],changedRow.cells[cellIndex++],null,i++,false,backColor1,backColor1Selected,false)}if(P==true){UpdateCellData(item,f[25],changedRow.cells[cellIndex++],null,i++,false,backColor1,backColor1Selected,false)}if(A==true){UpdateCellData(item,f[26],changedRow.cells[cellIndex++],null,i++,false,backColor1,backColor1Selected,false)}}else if(floorType=="HOSE"){if(ab==true){if(D==true)UpdateCellData(item,f[18],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],i++,true,backColor1,backColor1Selected,false);else UpdateCellData(item,f[18],changedRow.cells[cellIndex++],null,i++,true,backColor1,backColor1Selected,false)}if(D==true){UpdateCellData(item,f[19],changedRow.cells[cellIndex++],null,i++,false,backColor1,backColor1Selected,false)}if(aa==true){if(C==true)UpdateCellData(item,f[20],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],i++,true,backColor1,backColor1Selected,false);else UpdateCellData(item,f[20],changedRow.cells[cellIndex++],null,i++,true,backColor1,backColor1Selected,false)}if(C==true){UpdateCellData(item,f[21],changedRow.cells[cellIndex++],null,i++,false,backColor1,backColor1Selected,false)}if(v==true){UpdateCellData(item,f[22],changedRow.cells[cellIndex++],null,i++,false,backColor1,backColor1Selected,false)}if(A==true){UpdateCellData(item,f[23],changedRow.cells[cellIndex++],null,i++,false,backColor1,backColor1Selected,false)}}}else{UpdateCellData(item,f[0],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],i++,true,backColor1R2,backColor1Selected,false);UpdateCellData(item,f[1],changedRow.cells[cellIndex++],null,i++,false,backColor1R2,backColor1Selected,false);UpdateCellData(item,f[2],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],i++,true,backColor1AltR2,backColor1SelectedAlt,false);UpdateCellData(item,f[3],changedRow.cells[cellIndex++],null,i++,false,backColor1AltR2,backColor1SelectedAlt,false);UpdateCellData(item,f[4],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],i++,true,backColor1R2,backColor1Selected,false);UpdateCellData(item,f[5],changedRow.cells[cellIndex++],null,i++,false,backColor1R2,backColor1Selected,false);UpdateCellData(item,f[6],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],i++,true,backColor2R2,backColor2Selected,false);UpdateCellData(item,f[7],changedRow.cells[cellIndex++],null,i++,false,backColor2R2,backColor2Selected,false);UpdateCellData(item,f[8],changedRow.cells[cellIndex++],null,i++,true,backColor2R2,backColor2Selected,true,f[6]);if(isShowVolumeColor==true&&f[6]!=""){M[i-3].ExtraCellVolume1=changedRow.cells[0];M[i-3].ExtraCellVolume2=changedRow.cells[12];}UpdateCellData(item,f[9],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],i++,true,backColor1R2,backColor1Selected,false);UpdateCellData(item,f[10],changedRow.cells[cellIndex++],null,i++,false,backColor1R2,backColor1Selected,false);UpdateCellData(item,f[11],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],i++,true,backColor1AltR2,backColor1SelectedAlt,false);UpdateCellData(item,f[12],changedRow.cells[cellIndex++],null,i++,false,backColor1AltR2,backColor1SelectedAlt,false);UpdateCellData(item,f[13],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],i++,true,backColor1R2,backColor1Selected,false);UpdateCellData(item,f[14],changedRow.cells[cellIndex++],null,i++,false,backColor1R2,backColor1Selected,false);if(floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED"){UpdateCellData(item,f[16],changedRow.cells[cellIndex++],null,i++,true,backColor2R2,backColor2Selected,false);UpdateCellData(item,f[17],changedRow.cells[cellIndex++],null,i++,true,backColor2R2,backColor2Selected,false);UpdateCellData(item,f[18],changedRow.cells[cellIndex++],null,i++,true,backColor2R2,backColor2Selected,false);UpdateCellData(item,f[19],changedRow.cells[cellIndex++],null,i++,false,backColor1R2,backColor1Selected,false)}else{UpdateCellData(item,f[15],changedRow.cells[cellIndex++],null,i++,true,backColor2R2,backColor2Selected,false);UpdateCellData(item,f[16],changedRow.cells[cellIndex++],null,i++,true,backColor2R2,backColor2Selected,false);UpdateCellData(item,f[17],changedRow.cells[cellIndex++],null,i++,false,backColor1R2,backColor1Selected,false)}if(floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED"){if(T==true){UpdateCellData(item,f[20],changedRow.cells[cellIndex++],null,i++,false,backColor1R2,backColor1Selected,false)}if(U==true){UpdateCellData(item,f[21],changedRow.cells[cellIndex++],null,i++,false,backColor1R2,backColor1Selected,false)}if(R==true){UpdateCellData(item,f[22],changedRow.cells[cellIndex++],null,i++,false,backColor1R2,backColor1Selected,false)}if(O==true){UpdateCellData(item,f[23],changedRow.cells[cellIndex++],null,i++,false,backColor1R2,backColor1Selected,false)}if(v==true){UpdateCellData(item,f[24],changedRow.cells[cellIndex++],null,i++,false,backColor1R2,backColor1Selected,false)}if(P==true){UpdateCellData(item,f[25],changedRow.cells[cellIndex++],null,i++,false,backColor1R2,backColor1Selected,false)}}else if(floorType=="HOSE"){if(ab==true){if(D==true)UpdateCellData(item,f[18],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],i++,true,backColor1R2,backColor1Selected,false);else UpdateCellData(item,f[18],changedRow.cells[cellIndex++],null,i++,true,backColor1R2,backColor1Selected,false)}if(D==true){UpdateCellData(item,f[19],changedRow.cells[cellIndex++],null,i++,false,backColor1R2,backColor1Selected,false)}if(aa==true){if(C==true)UpdateCellData(item,f[20],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],i++,true,backColor1R2,backColor1Selected,false);else UpdateCellData(item,f[20],changedRow.cells[cellIndex++],null,i++,true,backColor1R2,backColor1Selected,false)}if(C==true){UpdateCellData(item,f[21],changedRow.cells[cellIndex++],null,i++,false,backColor1R2,backColor1Selected,false)}if(v==true){UpdateCellData(item,f[22],changedRow.cells[cellIndex++],null,i++,false,backColor1R2,backColor1Selected,false)}if(A==true){UpdateCellData(item,f[23],changedRow.cells[cellIndex++],null,i++,false,backColor1R2,backColor1Selected,false)}}}}}dS=self.setTimeout("DisplayUpdateData()",500)};function UpdateCellData(symbol,data,cell,volumeCell,i,dm,backColor,backColorSelected,dn,currentPrice){if(L==true)return;if(data!=""){var cellInfo=new CellInfo();cellInfo.cell=cell;if(tableType==0){var chkSymbol=document.getElementById("chk"+symbol);cellInfo.checkbox=chkSymbol;}else cellInfo.checkbox=null;cellInfo.du=backColor;cellInfo.dF=backColorSelected;cellInfo.data=data;cellInfo.symbol=symbol;cellInfo.ExtraCellVolume1=null;cellInfo.ExtraCellVolume2=null;M[i]=cellInfo;if(dm==true){var basicItem=basicObject.ItemList[symbol];var basicValueArray=basicItem.V.split(";");var basicItemInfo=new BasicItemInfo();basicItemInfo.CeilingPrice=basicValueArray[0];basicItemInfo.FloorPrice=basicValueArray[1];basicItemInfo.ReferencePrice=basicValueArray[2];if(basicItem!=null){if(dn==false){if(data==" "){cell.className="normalPrice";if(isShowVolumeColor==true&&volumeCell!=null)volumeCell.className="normalPriceCode";}else if(data==basicItemInfo.CeilingPrice){cellInfo.className="cellCeiling";if(isShowVolumeColor==true&&volumeCell!=null)volumeCell.className="cellCeiling";}else if(data==basicItemInfo.FloorPrice){cellInfo.className="cellFloor";if(isShowVolumeColor==true&&volumeCell!=null)volumeCell.className="cellFloor";}else if(data=="ATO"||data=="ATC"){cellInfo.className="ATOATC";if(isShowVolumeColor==true&&volumeCell!=null)volumeCell.className="ATOATC";}else if(data.length>basicItemInfo.ReferencePrice.length||(data.length==basicItemInfo.ReferencePrice.length&&data>basicItemInfo.ReferencePrice)){cellInfo.className="upPrice";if(isShowVolumeColor==true&&volumeCell!=null)volumeCell.className="upPrice";}else if(data!="0"&&(data.length<basicItemInfo.ReferencePrice.length||(data.length==basicItemInfo.ReferencePrice.length&&data<basicItemInfo.ReferencePrice))){cellInfo.className="downPrice";if(isShowVolumeColor==true&&volumeCell!=null)volumeCell.className="downPrice";}else{cellInfo.className="unchangePrice";if(isShowVolumeColor==true&&volumeCell!=null)volumeCell.className="unchangePrice";}}else{if(data.length>0&&data.substr(0,1)=="-"){if(isShowVolumeColor==false)cellInfo.className="downPrice";if(isThreeColors==false)if(isShowSymbol2==true)cellInfo.data=symbol+" <img src=\"images/btdown.gif\" /> "+data;else cellInfo.data=data+" <img src=\"images/btdown.gif\" />";}else if(data=="0"){if(isShowVolumeColor==false)cellInfo.className="unchangePrice";if(isThreeColors==false)if(isShowSymbol2==true)cellInfo.data=symbol;else cellInfo.data=data+" <img src=\"images/btnochange.jpg\" />";}else{if(isShowVolumeColor==false)cellInfo.className="upPrice";if(isThreeColors==false)if(isShowSymbol2==true)cellInfo.data=symbol+" <img src=\"images/btup.gif\" /> +"+data;else cellInfo.data=data+" <img src=\"images/btup.gif\" />";}if(isThreeColors==true){if(isShowSymbol2==true){if(currentPrice==basicItemInfo.CeilingPrice){cellInfo.data=symbol+" "+"CE+"+data;}else if(currentPrice==basicItemInfo.FloorPrice){cellInfo.data=symbol+" "+"FL "+data;}else if(data.length>0&&data.substr(0,1)=="-"){cellInfo.data=symbol+" "+data;}else if(data=="0")cellInfo.data=symbol;else cellInfo.data=symbol+" +"+data;}else{if(currentPrice==basicItemInfo.CeilingPrice){cellInfo.data="CE+"+data;}else if(currentPrice==basicItemInfo.FloorPrice){cellInfo.data="FL "+data;}}}}}}else{}cell.style.backgroundColor=updatingBackColor;}};function DisplayUpdateData(){if(L==true){var dA=self.setTimeout("DisplayUpdateData()",300);return;}var cellInfo;for(var i=0;i<M.length;i++){if(M[i]!=null){cellInfo=M[i];cellInfo.cell.innerHTML=cellInfo.data;if(cellInfo.className!=""){cellInfo.cell.className=cellInfo.className;if(cellInfo.ExtraCellVolume1!=null){cellInfo.ExtraCellVolume1.className=cellInfo.className+"Code";cellInfo.ExtraCellVolume2.className=cellInfo.className;}}}}if(aj==true&&t==null)t=self.setTimeout("StartRequest()",1500);clearTimeout(ao);ao=self.setTimeout("ClearBgColor()",5000)};function ClearBgColor(){if(L==true)return;var cellInfo;for(var i=0;i<M.length;i++){if(M[i]!=null){cellInfo=M[i];if(cellInfo.symbol!=bg){if(tableType==0)if(cellInfo.checkbox!=null&&cellInfo.checkbox.checked==true&&(isShowSelectedColor==true||showSelectedSymbolsOnTop==false))cellInfo.cell.style.backgroundColor=cellInfo.dF;else cellInfo.cell.style.backgroundColor=cellInfo.du;else cellInfo.cell.style.backgroundColor=cellInfo.du;}else{cellInfo.cell.style.backgroundColor=mouseOverBackColor;}}}self.clearTimeout(ao);ao=null;};function UpdateImmediately(){if(dataResult==null)return;if(basicObject==null||L==true||(ad>=H)){var dA=self.setTimeout("UpdateImmediately()",50);return;}var ap;ap=dataResult.ItemList;var quoteItem;var f;var i=0;var chkSymbol=null;var basicItem;var basicValueArray;var basicItemInfo;var i=0;var maxIndex;var minIndex;var cellIndex;var item;if(cV==true){if(isFixSymbolsWhenScroll==true&&tableType!=0){minIndex=0;maxIndex=cT.length+2;}else{minIndex=0;maxIndex=2;}}else{if(ad==0)if(isFixSymbolsWhenScroll==true&&tableType!=0)minIndex=cT.length+2;else minIndex=2;else minIndex=ad;maxIndex=ad+30;if(maxIndex>H)maxIndex=H;}for(i=minIndex;i<maxIndex;i++){item=orderedSymbolList[i];quoteItem=ap[item];if(quoteItem==null)continue;f=quoteItem.V.split(";");changedRow=document.getElementById("tr"+item);if(changedRow!=null){if(tableType==0)chkSymbol=document.getElementById("chk"+item);basicItem=basicObject.ItemList[item];if(basicItem!=null){basicValueArray=basicItem.V.split(";");basicItemInfo=new BasicItemInfo();basicItemInfo.CeilingPrice=basicValueArray[0];basicItemInfo.FloorPrice=basicValueArray[1];basicItemInfo.ReferencePrice=basicValueArray[2];basicItemInfo.Symbol=item;cellIndex=4;if(changedRow.rowIndex%2==0){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[0],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],true,backColor1,backColor1Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[1],changedRow.cells[cellIndex++],null,false,backColor1,backColor1Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[2],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],true,backColor1Alt,backColor1SelectedAlt,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[3],changedRow.cells[cellIndex++],null,false,backColor1Alt,backColor1SelectedAlt,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[4],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],true,backColor1,backColor1Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[5],changedRow.cells[cellIndex++],null,false,backColor1,backColor1Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[6],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],true,backColor2,backColor2Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[7],changedRow.cells[cellIndex++],null,false,backColor2,backColor2Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[8],changedRow.cells[cellIndex++],null,true,backColor2,backColor2Selected,true,f[6]);if(isShowVolumeColor==true&&f[6]!=""){changedRow.cells[0].className=changedRow.cells[10].className+"Code";changedRow.cells[12].className=changedRow.cells[10].className;}UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[9],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],true,backColor1,backColor1Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[10],changedRow.cells[cellIndex++],null,false,backColor1,backColor1Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[11],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],true,backColor1Alt,backColor1SelectedAlt,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[12],changedRow.cells[cellIndex++],null,false,backColor1Alt,backColor1SelectedAlt,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[13],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],true,backColor1,backColor1Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[14],changedRow.cells[cellIndex++],null,false,backColor1,backColor1Selected,false);if(floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED"){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[16],changedRow.cells[cellIndex++],null,true,backColor2,backColor2Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[17],changedRow.cells[cellIndex++],null,true,backColor2,backColor2Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[18],changedRow.cells[cellIndex++],null,true,backColor2,backColor2Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[19],changedRow.cells[cellIndex++],null,false,backColor1,backColor1Selected,false)}else{UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[15],changedRow.cells[cellIndex++],null,true,backColor2,backColor2Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[16],changedRow.cells[cellIndex++],null,true,backColor2,backColor2Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[17],changedRow.cells[cellIndex++],null,false,backColor1,backColor1Selected,false)}if(floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED"){if(T==true){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[20],changedRow.cells[cellIndex++],null,false,backColor1,backColor1Selected,false)}if(U==true){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[21],changedRow.cells[cellIndex++],null,false,backColor1,backColor1Selected,false)}if(R==true){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[22],changedRow.cells[cellIndex++],null,false,backColor1,backColor1Selected,false)}if(O==true){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[23],changedRow.cells[cellIndex++],null,false,backColor1,backColor1Selected,false)}if(v==true){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[24],changedRow.cells[cellIndex++],null,false,backColor1,backColor1Selected,false)}if(P==true){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[25],changedRow.cells[cellIndex++],null,false,backColor1,backColor1Selected,false)}if(A==true){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[26],changedRow.cells[cellIndex++],null,false,backColor1,backColor1Selected,false)}}else if(floorType=="HOSE"){if(ab==true){if(D==true)UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[18],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],true,backColor1,backColor1Selected,false);else UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[18],changedRow.cells[cellIndex++],null,true,backColor1,backColor1Selected,false);}if(D==true){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[19],changedRow.cells[cellIndex++],null,false,backColor1,backColor1Selected,false)}if(aa==true){if(C==true)UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[20],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],true,backColor1,backColor1Selected,false);else UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[20],changedRow.cells[cellIndex++],null,true,backColor1,backColor1Selected,false)}if(C==true){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[21],changedRow.cells[cellIndex++],null,false,backColor1,backColor1Selected,false)}if(v==true){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[22],changedRow.cells[cellIndex++],null,false,backColor1,backColor1Selected,false)}if(A==true){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[23],changedRow.cells[cellIndex++],null,false,backColor1,backColor1Selected,false)}}}else{UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[0],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],true,backColor1R2,backColor1Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[1],changedRow.cells[cellIndex++],null,false,backColor1R2,backColor1Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[2],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],true,backColor1AltR2,backColor1SelectedAlt,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[3],changedRow.cells[cellIndex++],null,false,backColor1AltR2,backColor1SelectedAlt,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[4],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],true,backColor1R2,backColor1Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[5],changedRow.cells[cellIndex++],null,false,backColor1R2,backColor1Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[6],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],true,backColor2R2,backColor2Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[7],changedRow.cells[cellIndex++],null,false,backColor2R2,backColor2Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[8],changedRow.cells[cellIndex++],null,true,backColor2R2,backColor2Selected,true,f[6]);if(isShowVolumeColor==true&&f[6]!=""){changedRow.cells[0].className=changedRow.cells[10].className+"Code";changedRow.cells[12].className=changedRow.cells[10].className;}UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[9],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],true,backColor1R2,backColor1Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[10],changedRow.cells[cellIndex++],null,false,backColor1R2,backColor1Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[11],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],true,backColor1AltR2,backColor1SelectedAlt,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[12],changedRow.cells[cellIndex++],null,false,backColor1AltR2,backColor1SelectedAlt,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[13],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],true,backColor1R2,backColor1Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[14],changedRow.cells[cellIndex++],null,false,backColor1R2,backColor1Selected,false);if(floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED"){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[16],changedRow.cells[cellIndex++],null,true,backColor2R2,backColor2Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[17],changedRow.cells[cellIndex++],null,true,backColor2R2,backColor2Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[18],changedRow.cells[cellIndex++],null,true,backColor2R2,backColor2Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[19],changedRow.cells[cellIndex++],null,false,backColor1R2,backColor1Selected,false)}else{UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[15],changedRow.cells[cellIndex++],null,true,backColor2R2,backColor2Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[16],changedRow.cells[cellIndex++],null,true,backColor2R2,backColor2Selected,false);UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[17],changedRow.cells[cellIndex++],null,false,backColor1R2,backColor1Selected,false)}if(floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED"){if(T==true){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[20],changedRow.cells[cellIndex++],null,false,backColor1R2,backColor1Selected,false)}if(U==true){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[21],changedRow.cells[cellIndex++],null,false,backColor1R2,backColor1Selected,false)}if(R==true){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[22],changedRow.cells[cellIndex++],null,false,backColor1R2,backColor1Selected,false)}if(O==true){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[23],changedRow.cells[cellIndex++],null,false,backColor1R2,backColor1Selected,false)}if(v==true){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[24],changedRow.cells[cellIndex++],null,false,backColor1R2,backColor1Selected,false)}if(P==true){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[25],changedRow.cells[cellIndex++],null,false,backColor1R2,backColor1Selected,false)}if(A==true){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[26],changedRow.cells[cellIndex++],null,false,backColor1R2,backColor1Selected,false)}}else if(floorType=="HOSE"){if(ab==true){if(D==true)UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[18],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],true,backColor1R2,backColor1Selected,false);else UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[18],changedRow.cells[cellIndex++],null,true,backColor1R2,backColor1Selected,false)}if(D==true){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[19],changedRow.cells[cellIndex++],null,false,backColor1R2,backColor1Selected,false)}if(aa==true){if(C==true)UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[20],changedRow.cells[cellIndex++],changedRow.cells[cellIndex],true,backColor1R2,backColor1Selected,false);else UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[20],changedRow.cells[cellIndex++],null,true,backColor1R2,backColor1Selected,false)}if(C==true){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[21],changedRow.cells[cellIndex++],null,false,backColor1R2,backColor1Selected,false)}if(v==true){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[22],changedRow.cells[cellIndex++],null,false,backColor1R2,backColor1Selected,false)}if(A==true){UpdateCellDataImmediately(chkSymbol,basicItemInfo,f[23],changedRow.cells[cellIndex++],null,false,backColor1R2,backColor1Selected,false)}}}}}}ad=maxIndex;var Q=orderedSymbolList.length;if(cV==false){if(ad<Q)var dN=self.setTimeout("UpdateImmediately()",100);else{cV=true;ad=0;var dN=self.setTimeout("UpdateImmediately()",100);}}else if(aj==true&&t==null)t=self.setTimeout("StartRequest()",1000)};function UpdateCellDataImmediately(chkSymbol,basicItemInfo,data,cell,volumeCell,dm,backColor,backColorSelected,dn,currentPrice){if(L==true)return;if(data!=""){cell.innerHTML=data;if(tableType==0)if(chkSymbol.checked==true&&(isShowSelectedColor==true||showSelectedSymbolsOnTop==false))cell.style.backgroundColor=backColorSelected;else cell.style.backgroundColor=backColor;else cell.style.backgroundColor=backColor;if(dm==true){if(dn==false){if(data==" "){cell.className="normalPrice";if(isShowVolumeColor==true&&volumeCell!=null)volumeCell.className="normalPriceCode";}else if(data==basicItemInfo.CeilingPrice){cell.className="cellCeiling";if(isShowVolumeColor==true&&volumeCell!=null)volumeCell.className="cellCeiling";}else if(data==basicItemInfo.FloorPrice){cell.className="cellFloor";if(isShowVolumeColor==true&&volumeCell!=null)volumeCell.className="cellFloor";}else if(data=="ATO"||data=="ATC"){cell.className="ATOATC";if(isShowVolumeColor==true&&volumeCell!=null)volumeCell.className="ATOATC";}else if(data.length>basicItemInfo.ReferencePrice.length||(data.length==basicItemInfo.ReferencePrice.length&&data>basicItemInfo.ReferencePrice)){cell.className="upPrice";if(isShowVolumeColor==true&&volumeCell!=null)volumeCell.className="upPrice";}else if(data!="0"&&(data.length<basicItemInfo.ReferencePrice.length||(data.length==basicItemInfo.ReferencePrice.length&&data<basicItemInfo.ReferencePrice))){cell.className="downPrice";if(isShowVolumeColor==true&&volumeCell!=null)volumeCell.className="downPrice";}else{cell.className="unchangePrice";if(isShowVolumeColor==true&&volumeCell!=null)volumeCell.className="unchangePrice";}}else{if(data.length>0&&data.substr(0,1)=="-"){if(isShowVolumeColor==false)cell.className="downPrice";if(isThreeColors==false)if(isShowSymbol2==true)cell.innerHTML=basicItemInfo.Symbol+" <img src=\"images/btdown.gif\" /> "+data;else cell.innerHTML=data+" <img src=\"images/btdown.gif\" />";}else if(data=="0"){if(isShowVolumeColor==false)cell.className="unchangePrice";if(isThreeColors==false)if(isShowSymbol2==true)cell.innerHTML=basicItemInfo.Symbol;else cell.innerHTML=data+" <img src=\"images/btnochange.jpg\" />";}else{if(isShowVolumeColor==false)cell.className="upPrice";if(isThreeColors==false)if(isShowSymbol2==true)cell.innerHTML=basicItemInfo.Symbol+" <img src=\"images/btup.gif\" /> +"+data;else cell.innerHTML=data+" <img src=\"images/btup.gif\" />";}if(isThreeColors==true){if(isShowSymbol2==true){if(currentPrice==basicItemInfo.CeilingPrice){cell.innerHTML=basicItemInfo.Symbol+" "+"CE+"+data;}else if(currentPrice==basicItemInfo.FloorPrice){cell.innerHTML=basicItemInfo.Symbol+" "+"FL "+data;}else if(data.length>0&&data.substr(0,1)=="-"){cell.innerHTML=basicItemInfo.Symbol+" "+data;}else if(data=="0")cell.innerHTML=basicItemInfo.Symbol;else cell.innerHTML=basicItemInfo.Symbol+" +"+data;}else{if(currentPrice==basicItemInfo.CeilingPrice){cell.innerHTML="CE+"+data;}else if(currentPrice==basicItemInfo.FloorPrice){cell.innerHTML="FL "+data;}}}}}}};function OnMouseOverQuote(){if(an==true)return;if(new Date()-latestTime<=500)return;if(highlightRow!=null)UnHighlight(highlightRow);Highlight(this);highlightRow=this;};function Highlight(row){var cell;bg=row.id.substring(2);for(var i=0;i<row.cells.length;i++){cell=row.cells[i];cell.style.backgroundColor=mouseOverBackColor;}};function UnHighlight(row){bg="";var symbol=row.id.substring(2);var isChecked=false;if(tableType==0){var checkbox=document.getElementById("chk"+symbol);if(checkbox==null)return;isChecked=checkbox.checked;}var cell;for(var i=0;i<row.cells.length;i++){cell=row.cells[i];switch(i){case 0:if((isShowSelectedColor==true||showSelectedSymbolsOnTop==false)&&isChecked==true)cell.style.backgroundColor=backColorSymbolSelected;else if(row.rowIndex%2==0)cell.style.backgroundColor=backColorSymbol;else cell.style.backgroundColor=backColorSymbolR2;break;case 4:case 5:case 8:case 9:case 13:case 14:case 17:case 18:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:if((isShowSelectedColor==true||showSelectedSymbolsOnTop==false)&&isChecked==true)cell.style.backgroundColor=backColor1Selected;else if(row.rowIndex%2==0)cell.style.backgroundColor=backColor1;else cell.style.backgroundColor=backColor1R2;break;case 1:case 2:case 3:case 10:case 11:case 12:case 19:case 20:if((isShowSelectedColor==true||showSelectedSymbolsOnTop==false)&&isChecked==true)cell.style.backgroundColor=backColor2Selected;else if(row.rowIndex%2==0)cell.style.backgroundColor=backColor2;else cell.style.backgroundColor=backColor2R2;break;case 21:if(floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED"){if((isShowSelectedColor==true||showSelectedSymbolsOnTop==false)&&isChecked==true)cell.style.backgroundColor=backColor2Selected;else if(row.rowIndex%2==0)cell.style.backgroundColor=backColor2;else cell.style.backgroundColor=backColor2R2;}else{if((isShowSelectedColor==true||showSelectedSymbolsOnTop==false)&&isChecked==true)cell.style.backgroundColor=backColor1Selected;else if(row.rowIndex%2==0)cell.style.backgroundColor=backColor1;else cell.style.backgroundColor=backColor1R2;}break;default:if((isShowSelectedColor==true||showSelectedSymbolsOnTop==false)&&isChecked==true)cell.style.backgroundColor=backColor1SelectedAlt;else if(row.rowIndex%2==0)cell.style.backgroundColor=backColor1Alt;else cell.style.backgroundColor=backColor1AltR2;break;}}};function OnMouseOutQuote(){if(an==true)return;UnHighlight(this);};function LoadSymbolsTableForChoose(){if(dk==true)return;SetCheckedSymbolsForChoose(true);dk=true;};function SetCheckedSymbolsForChoose(insertNewRows){var theChooseSymbolsTable=document.getElementById("tableChooseSymbols");if(insertNewRows==true)for(var i=theChooseSymbolsTable.rows.length-1;i>=0;i--){theChooseSymbolsTable.deleteRow(i);}if(basicObject!=null&&basicObject.ItemList!=null&&basicObject.ItemCount>0){var index=0;var chooseSymbolNewRow;var chooseSymbolNewCell;for(var itemKey in basicObject.ItemList){if(insertNewRows==true){if(index%15==0){chooseSymbolNewRow=theChooseSymbolsTable.insertRow(-1);}chooseSymbolNewCell=chooseSymbolNewRow.insertCell(-1);chooseSymbolNewCell.id="tdChoose"+itemKey;}else chooseSymbolNewCell=document.getElementById("tdChoose"+itemKey);if(chooseSymbolNewCell!=null&&chooseSymbolNewCell!="undefined"){if(displayedSymbolsSelectedString.indexOf("'"+itemKey+"'")!= -1){chooseSymbolNewCell.className="cellChooseSymbolSelected";chooseSymbolNewCell.innerHTML="<input type=\"checkbox\" class=\"chkChooseSymbolSelected\" checked=\"true\" id=\"chkChoose"+itemKey+"\" name=\""+itemKey+"\" onClick=\"ToggleChooseSymbol('"+itemKey+"');\"/><a href=\"javascript:ChooseSymbolLinkClick('"+itemKey+"')\">"+itemKey+"</a>";}else{chooseSymbolNewCell.className="cellChooseSymbol";chooseSymbolNewCell.innerHTML="<input type=\"checkbox\" class=\"chkChooseSymbol\" id=\"chkChoose"+itemKey+"\" name=\""+itemKey+"\" onClick=\"ToggleChooseSymbol('"+itemKey+"');\"/><a href=\"javascript:ChooseSymbolLinkClick('"+itemKey+"')\">"+itemKey+"</a>";}}index++;}}var chkDisplayAll=document.getElementById("chkDisplayAll");if(displayedSymbolsString=="all")chkDisplayAll.checked=true;else chkDisplayAll.checked=false;ToggleDisplayAll();};function CreateExtraHeaderCells(tableId){var g=document.getElementById(tableId);var theHeaderRow=g.rows[0];var dE=false;if(theHeaderRow.style.display=="none"){dE=true;theHeaderRow.style.display="block";}var lastIndex;if(floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED")lastIndex=11;else lastIndex=10;for(var i=theHeaderRow.cells.length-1;i>=lastIndex+1;i--){theHeaderRow.deleteCell(i);}var k;if(B=="vi-VN"){localizeObject=localizeVN;}else{localizeObject=localizeEN;}if(floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED")J=24;else J=23;if(T==true){k=theHeaderRow.insertCell(-1);k.innerHTML=localizeObject.BuyVolume;k.className="tableHeader6";k.rowSpan=2;J++;}if(U==true){k=theHeaderRow.insertCell(-1);k.innerHTML=localizeObject.SellVolume;k.className="tableHeader6";k.rowSpan=2;J++;}if(R==true){k=theHeaderRow.insertCell(-1);k.innerHTML=localizeObject.BuyOrderCount;k.className="tableHeader7";k.rowSpan=2;J++;}if(O==true){k=theHeaderRow.insertCell(-1);k.innerHTML=localizeObject.SellOrderCount;k.className="tableHeader7";k.rowSpan=2;J++;}if(ab==true){k=theHeaderRow.insertCell(-1);k.innerHTML=localizeObject.Session1Price;k.className="tableHeader6";k.rowSpan=2;J++;}if(D==true){k=theHeaderRow.insertCell(-1);k.innerHTML=localizeObject.Session1Volume;k.className="tableHeader6";k.rowSpan=2;J++;}if(aa==true){k=theHeaderRow.insertCell(-1);k.innerHTML=localizeObject.Session2Price;k.className="tableHeader6";k.rowSpan=2;J++;}if(C==true){k=theHeaderRow.insertCell(-1);k.innerHTML=localizeObject.Session2Volume;k.className="tableHeader6";k.rowSpan=2;J++;}if(v==true){k=theHeaderRow.insertCell(-1);k.innerHTML=localizeObject.ForeignBuy;k.className="tableHeader8";k.rowSpan=2;J++;}if(P==true){k=theHeaderRow.insertCell(-1);k.innerHTML=localizeObject.ForeignSell;k.className="tableHeader8";k.rowSpan=2;J++;}if(A==true){k=theHeaderRow.insertCell(-1);k.innerHTML=localizeObject.CurrentRoom;k.className="tableHeader8";k.rowSpan=2;J++;}if(dE==true)theHeaderRow.style.display="none";};function CreateBasicRows(setClientInfo){cV=false;af=0;if(floorType=="HOSE")aq=0;if(setClientInfo==true)SetClientInfoAndGetData();else StartRequest();var tableQuote=document.getElementById("tableQuote");var tableFixedHeader=document.getElementById("tableFixedHeader");var g;var tdDate=document.getElementById("tdDate");var graphLink="";if(basicObject==null||basicObject.ItemList==null)return;an=true;L=true;tdDate.innerHTML=basicObject.Date;for(var i=tableQuote.rows.length-1;i>=0;i--){if(i>=headerRowCount)tableQuote.deleteRow(i);}if(isFixSymbolsWhenScroll==true){for(var i=tableFixedHeader.rows.length-1;i>=0;i--){if(i>=headerRowCount)tableFixedHeader.deleteRow(i);}}var basicItem;var f;var newRow;var newCell;var fontStyle1;var fontStyle2;if(fontStyle==0){fontStyle1="normal";fontStyle2="normal";}else if(fontStyle==1){fontStyle1="normal";fontStyle2="bold";}else{fontStyle1="bold";fontStyle2="bold";}cT=selectedSymbolList;oldUnselectedSymbolList=unselectedSymbolList;selectedSymbolList=new Array();unselectedSymbolList=new Array();al=0;var i=0;H=0;var tempSelectedSymbolString=cT.join();orderedSymbolList=new Array();var itemKey;if(isOrderSelectedSymbols==true){for(var itemKey in basicObject.ItemList){if(tempSelectedSymbolString.indexOf(itemKey)>=0&&(displayedSymbolsString=="all"||displayedSymbolsString.indexOf("'"+itemKey+"'")>=0))orderedSymbolList.push(itemKey);}}else{for(var i=0;i<=cT.length-1;i++){itemKey=cT[i];if(basicObject.ItemList[itemKey]!=null&&(displayedSymbolsString=="all"||displayedSymbolsString.indexOf("'"+itemKey+"'")>=0))orderedSymbolList.push(itemKey);}}var selectedSymbolsCount=orderedSymbolList.length;for(var itemKey in basicObject.ItemList){if(tempSelectedSymbolString.indexOf(itemKey)== -1&&(displayedSymbolsString=="all"||displayedSymbolsString.indexOf("'"+itemKey+"'")>=0))orderedSymbolList.push(itemKey);}var maxBasicIndex;if(isFixSymbolsWhenScroll==true&&tableType!=0){maxBasicIndex=selectedSymbolsCount;g=tableFixedHeader;}else{maxBasicIndex=30;if(orderedSymbolList.length<30)maxBasicIndex=orderedSymbolList.length;g=tableQuote;}var localizeObject;if(B=="vi-VN")localizeObject=localizeVN;else localizeObject=localizeEN;for(H=0;H<maxBasicIndex;H++){itemKey=orderedSymbolList[H];unselectedSymbolList.push(itemKey);basicItem=basicObject.ItemList[itemKey];f=basicItem.V.split(";");if(isShowGraph==true)graphLink="<a class='lnkGraph' id='lnkGraph"+itemKey+"' href=\"javascript:OpenGraph('"+itemKey+"', '"+floorType+"')\"><img width=\"12\" height=\"12\" title='"+localizeObject.GraphLinkTitle+"' src=\"Images\\Graph.png\"/></a>";if(H==0){if(isFixSymbolsWhenScroll==true&&tableType!=0)newRow=InsertFirstRow(g,itemKey,graphLink,fontStyle1,fontStyle2,f,false,false);else newRow=InsertFirstRow(g,itemKey,graphLink,fontStyle1,fontStyle2,f,true,true);}else{newRow=InsertNextRow(g,itemKey,graphLink,fontStyle1,fontStyle2,f,H,false);}}if(isFixSymbolsWhenScroll==true&&tableType!=0){maxBasicIndex=H+2;if(orderedSymbolList.length<maxBasicIndex)maxBasicIndex=orderedSymbolList.length;g=tableQuote;var rowIndex=0;for(;H<maxBasicIndex;H++){itemKey=orderedSymbolList[H];unselectedSymbolList.push(itemKey);basicItem=basicObject.ItemList[itemKey];f=basicItem.V.split(";");if(isShowGraph==true)graphLink="<a class='lnkGraph' id='lnkGraph"+itemKey+"' href=\"javascript:OpenGraph('"+itemKey+"', '"+floorType+"')\"><img width=\"12\" height=\"12\" title='"+localizeObject.GraphLinkTitle+"' src=\"Images\\Graph.png\"/></a>";if(rowIndex==0){if(isFixSymbolsWhenScroll==true&&tableType!=0)newRow=InsertFirstRow(g,itemKey,graphLink,fontStyle1,fontStyle2,f,true,true);else newRow=InsertFirstRow(g,itemKey,graphLink,fontStyle1,fontStyle2,f,false,false);}else{newRow=InsertNextRow(g,itemKey,graphLink,fontStyle1,fontStyle2,f,rowIndex,true);}rowIndex++;}}L=false;var Q;if(displayedSymbolsString=="all")Q=basicObject.ItemCount;else Q=displayedSymbolList.length;if(H<Q)var dM=self.setTimeout("CreateBasicRowsCont()",10);else FinishCreateBasicRows();};function CreateBasicRowsCont(){L=true;var g=document.getElementById("tableQuote");var basicItem;var f;var newRow;var newCell;var maxBasicIndex=H+30;if(orderedSymbolList.length<maxBasicIndex)maxBasicIndex=orderedSymbolList.length;var itemKey;var localizeObject;if(B=="vi-VN")localizeObject=localizeVN;else localizeObject=localizeEN;for(;H<maxBasicIndex;H++){itemKey=orderedSymbolList[H];if(H%2==0)newRow=g.rows[2].cloneNode(true);else newRow=g.rows[3].cloneNode(true);newRow.id="tr"+itemKey;g.rows[2].parentNode.appendChild(newRow);var graphLink="";if(isShowGraph==true)graphLink="<a class='lnkGraph' id='lnkGraph"+itemKey+"' href=\"javascript:OpenGraph('"+itemKey+"', '"+floorType+"')\"><img width=\"12\" height=\"12\" title='"+localizeObject.GraphLinkTitle+"' src=\"Images\\Graph.png\"/></a>";if(tableType==0)if(stockUrl=="")newRow.cells[0].innerHTML="<input type=\"checkbox\" id=\"chk"+itemKey+"\" onClick=\"Toggle('"+itemKey+"', false);\"/>"+graphLink+itemKey;else newRow.cells[0].innerHTML="<input type=\"checkbox\" id=\"chk"+itemKey+"\" onClick=\"Toggle('"+itemKey+"', false);\"/>"+graphLink+"<a id='lnk"+itemKey+"' href='"+stockUrl+itemKey+stockUrl2+"'>"+itemKey+"</a>";else if(stockUrl=="")newRow.cells[0].innerHTML=itemKey;else newRow.cells[0].innerHTML="<a href='"+stockUrl+itemKey+stockUrl2+"'>"+itemKey+"</a>";unselectedSymbolList.push(itemKey);basicItem=basicObject.ItemList[itemKey];f=basicItem.V.split(";");newRow.cells[1].innerHTML=f[0];newRow.cells[2].innerHTML=f[1];newRow.cells[3].innerHTML=f[2];newRow.onmouseover=OnMouseOverQuote;newRow.onmouseout=OnMouseOutQuote;}L=false;var Q;if(displayedSymbolsString=="all")Q=basicObject.ItemCount;else Q=displayedSymbolList.length;if(H<Q)var dM=self.setTimeout("CreateBasicRowsCont()",1);else FinishCreateBasicRows();};function FinishCreateBasicRows(){L=true;an=false;if(tableType==0){var db;for(var i=0;i<cT.length;i++){db=cT[i];var chkSymbol=document.getElementById("chk"+db);if(chkSymbol!=null&&chkSymbol!="undefined"){chkSymbol.checked=true;Toggle(db,true);}}if(showSelectedSymbolsOnTop==true&&isShowSeparator==true&&al>0){var g=document.getElementById("tableQuote");g.rows[al+headerRowCount-1].className="quoteRowSeparator";}}else{unselectedSymbolList=oldUnselectedSymbolList;selectedSymbolList=cT;}L=false;if(aK==true)GetPutThroughObject();if(isShowTooltip==true&&tableType==0){var stockInfoTimerID=self.setTimeout("UpdateStockInfoTooltip()",2000);}};function InsertNewCell(newRow,className,width,style,isSetCellWidth,value){var newCell=newRow.insertCell(-1);newCell.className=className;if(isSetCellWidth==true)newCell.style.width=width;newCell.style.fontWeight=style;if(value!=null)newCell.innerHTML=value;return newCell;};function InsertFirstRow(g,itemKey,graphLink,fontStyle1,fontStyle2,f,isSetCellWidth,isSetCellWidth2){var newRow=g.insertRow(-1);newRow.style.height=rowHeight;newRow.id="tr"+itemKey;newRow.onmouseover=OnMouseOverQuote;newRow.onmouseout=OnMouseOutQuote;var newCell=newRow.insertCell(-1);newCell.className="cellCode";if(tableType==0){if(stockUrl=="")newCell.innerHTML="<input type=\"checkbox\" id=\"chk"+itemKey+"\" onClick=\"Toggle('"+itemKey+"', false);\"/>"+graphLink+itemKey;else newCell.innerHTML="<input type=\"checkbox\" id=\"chk"+itemKey+"\" onClick=\"Toggle('"+itemKey+"', false);\"/>"+graphLink+"<a id='lnk"+itemKey+"' href='"+stockUrl+itemKey+stockUrl2+"'>"+itemKey+"</a>";}else{newCell.style.fontSize="12pt";newCell.style.paddingLeft="4px";if(stockUrl=="")newCell.innerHTML=itemKey;else newCell.innerHTML="<a href='"+stockUrl+itemKey+stockUrl2+"'>"+itemKey+"</a>";}if(isSetCellWidth==true)newCell.style.width="5%";newCell.style.fontWeight=fontStyle2;newCell.style.wordWrap="normal";InsertNewCell(newRow,"cellCeiling","3%",fontStyle2,isSetCellWidth,f[0]);InsertNewCell(newRow,"cellFloor","3%",fontStyle2,isSetCellWidth,f[1]);InsertNewCell(newRow,"cellRef","3%",fontStyle2,isSetCellWidth,f[2]);newRow.cells[0].style.backgroundColor=backColorSymbol;newRow.cells[1].style.backgroundColor=backColor2;newRow.cells[2].style.backgroundColor=backColor2;newRow.cells[3].style.backgroundColor=backColor2;InsertNewCell(newRow,"normalPrice","3%",fontStyle1,isSetCellWidth);InsertNewCell(newRow,"normalVol","3.5%",fontStyle1,isSetCellWidth);InsertNewCell(newRow,"normalPrice","3%",fontStyle1,isSetCellWidth);InsertNewCell(newRow,"normalVol","3.5%",fontStyle1,isSetCellWidth);InsertNewCell(newRow,"normalPrice","3%",fontStyle1,isSetCellWidth);InsertNewCell(newRow,"normalVol","3.5%",fontStyle1,isSetCellWidth);InsertNewCell(newRow,"normalMatchingPrice","3.5%",fontStyle2,isSetCellWidth);InsertNewCell(newRow,"normalMatchingVol","3.5%",fontStyle2,isSetCellWidth);newCell=InsertNewCell(newRow,"normalChange","4.5%",fontStyle2,isSetCellWidth);newCell.style.wordWrap="normal";if(isShowSymbol2==true){newCell.style.textAlign="left";newCell.style.paddingLeft="3px";}InsertNewCell(newRow,"normalPrice","3%",fontStyle1,isSetCellWidth);InsertNewCell(newRow,"normalVol","3.5%",fontStyle1,isSetCellWidth);InsertNewCell(newRow,"normalPrice","3%",fontStyle1,isSetCellWidth);InsertNewCell(newRow,"normalVol","3.5%",fontStyle1,isSetCellWidth);InsertNewCell(newRow,"normalPrice","3%",fontStyle1,isSetCellWidth);InsertNewCell(newRow,"normalVol","3.5%",fontStyle1,isSetCellWidth);InsertNewCell(newRow,"normalHighLowPrice","3.8%",fontStyle2,isSetCellWidth);InsertNewCell(newRow,"normalHighLowPrice","3.8%",fontStyle2,isSetCellWidth);switch(floorType){case "HASTC":case "OTC":case "MIXED":InsertNewCell(newRow,"normalHighLowPrice","3.8%",fontStyle2,isSetCellWidth);InsertNewCell(newRow,"normalVol","3.8%",fontStyle1,isSetCellWidth);if(T==true)InsertNewCell(newRow,"extraBuyVol","3.8%",fontStyle1,isSetCellWidth2);if(U==true)InsertNewCell(newRow,"extraSellVol","3.8%",fontStyle1,isSetCellWidth2);if(R==true)InsertNewCell(newRow,"extraBuyVol","3.5%",fontStyle1,isSetCellWidth2);if(O==true)InsertNewCell(newRow,"extraSellVol","3.5%",fontStyle1,isSetCellWidth2);if(v==true)InsertNewCell(newRow,"extraBuyVol","3.8%",fontStyle1,isSetCellWidth2);if(P==true)InsertNewCell(newRow,"extraSellVol","3.8%",fontStyle1,isSetCellWidth2);if(A==true)InsertNewCell(newRow,"extraSellVol","3.8%",fontStyle1,isSetCellWidth2);break;case "HOSE":InsertNewCell(newRow,"normalVol","3.8%",fontStyle1,isSetCellWidth);if(ab==true)InsertNewCell(newRow,"normalPrice","3.8%",fontStyle1,isSetCellWidth2);if(D==true)InsertNewCell(newRow,"normalVol","3.8%",fontStyle1,isSetCellWidth2);if(aa==true)InsertNewCell(newRow,"normalPrice","3.5%",fontStyle1,isSetCellWidth2);if(C==true)InsertNewCell(newRow,"normalVol","3.5%",fontStyle1,isSetCellWidth2);if(v==true)InsertNewCell(newRow,"extraBuyVol","3.5%",fontStyle1,isSetCellWidth2);if(A==true)InsertNewCell(newRow,"extraSellVol","3.8%",fontStyle1,isSetCellWidth2);break;}return newRow;};function InsertNextRow(g,itemKey,graphLink,fontStyle1,fontStyle2,f,rowIndex,isSetCellWidth){var newRow;if(rowIndex==1){newRow=g.rows[2].cloneNode(true);g.rows[2].parentNode.appendChild(newRow);newRow.cells[0].style.backgroundColor=backColorSymbolR2;newRow.cells[1].style.backgroundColor=backColor2R2;newRow.cells[2].style.backgroundColor=backColor2R2;newRow.cells[3].style.backgroundColor=backColor2R2;}else if(rowIndex%2==0){newRow=g.rows[2].cloneNode(true);g.rows[2].parentNode.appendChild(newRow);}else{newRow=g.rows[3].cloneNode(true);g.rows[3].parentNode.appendChild(newRow);}newRow.id="tr"+itemKey;if(tableType==0)if(stockUrl=="")newRow.cells[0].innerHTML="<input type=\"checkbox\" id=\"chk"+itemKey+"\" onClick=\"Toggle('"+itemKey+"', false);\"/>"+graphLink+itemKey;else newRow.cells[0].innerHTML="<input type=\"checkbox\" id=\"chk"+itemKey+"\" onClick=\"Toggle('"+itemKey+"', false);\"/>"+graphLink+"<a id='lnk"+itemKey+"' href='"+stockUrl+itemKey+stockUrl2+"'>"+itemKey+"</a>";else if(stockUrl=="")newRow.cells[0].innerHTML=itemKey;else newRow.cells[0].innerHTML="<a href='"+stockUrl+itemKey+stockUrl2+"'>"+itemKey+"</a>";newRow.cells[1].innerHTML=f[0];newRow.cells[2].innerHTML=f[1];newRow.cells[3].innerHTML=f[2];newRow.onmouseover=OnMouseOverQuote;newRow.onmouseout=OnMouseOutQuote;};function GetStockBoardChangedObjectSucceededCallback(result,userContext,methodName){switch(methodName){case("GetStockBoardBasicObject"):{if(result!=null){aj=result.IsTradingTime;if(result.VId==0)break;if(result.VId<aZ)break;aZ=result.VId;var df=result.Time.split(":");var dv=new Date();dC=df[0]-dv.getHours();dz=df[1]-dv.getMinutes();dw=df[2]-dv.getSeconds();tdConnectedClientCount.innerHTML=result.Connected;if(result.ItemList!=null&&result.ItemCount>0){dk=false;if(am==true)LoadSymbolsTableForChoose();basicObject=result;if(isShowTooltip==true)GetStockInfo();CreateBasicRows(false);}}break;}case("SetClientInfoAndGetData"):case("GetStockBoardChangedObject"):{dp=true;if(result==null){if(aj==true&&t==null)t=self.setTimeout("StartRequest()",2000);break;}if(result.VId== -1){GetBasicObject();if(aj==true&&t==null)t=self.setTimeout("StartRequest()",2000);break;}if(result.VId<af)break;if(floorType=="HOSE")if(result.MVId<aq)break;dataResult=result.Data;if(dataResult!=null){if(af==0){af=result.VId;if(floorType=="HOSE")aq=result.MVId;UpdateMarketImmediately();ad=0;UpdateImmediately();}else{af=result.VId;if(floorType=="HOSE")aq=result.MVId;UpdateMarket();StartUpdate();}}else{af=result.VId;if(floorType=="HOSE")aq=result.MVId;if(aj==true&&t==null)t=self.setTimeout("StartRequest()",2000)}break;}case("GetHosePutThroughObject"):case("GetHastcPutThroughObject"):case("GetOtcPutThroughObject"):case("GetMixedPutThroughObject"):{DeletePutThroughTable(tablePutThrough);DeletePutThroughTable(tablePutThroughBuy);DeletePutThroughTable(tablePutThroughSell);if(result==null)return;if(result.ML!=null)UpdatePutThroughTable(tablePutThrough,result.ML,true);if(result.BL!=null)UpdatePutThroughTable(tablePutThroughBuy,result.BL,false);if(result.SL!=null)UpdatePutThroughTable(tablePutThroughSell,result.SL,false);break;}case("GetClientId"):{if(result>0){clientId=result;SetClientInfo();}break;}case("GetStockInfoObject"):{if(result==null)return;stockInfoObject=result;break;}case("GetHastcQuotesHistory"):case("GetHoseQuotesHistory"):case("GetOtcQuotesHistory"):case("GetMixedQuotesHistory"):{if(result==null)return;quotesHistory=result;CreateQuotesHistory(false);break;}}};function UpdateStockInfoTooltip(){if(stockInfoObject==null||stockInfoObject.ItemList==null)return;var g=document.getElementById("tableQuote");var symbol;var stockInfo;var link;for(var i=0;i<g.rows.length;i++){symbol=g.rows[i].id.substring(2);stockInfo=stockInfoObject.ItemList[symbol];if(stockInfo!=null){link=document.getElementById("lnk"+symbol);if(link!=null)link.title=stockInfo;}}};function ClearCurrentData(){var img=document.getElementById("img");img.innerHTML="";var g=document.getElementById("tableHistory");for(var i=g.rows.length-1;i>=0;i--){g.deleteRow(i);}};function CreateQuotesHistory(isShowAll){var item;var newRow;var newCell;var newCellChange;var newCellPercent;var F;var basicItem;var basicValueArray;var basicItemInfo;var g=document.getElementById("tableHistory");var showAllHistory=document.getElementById("showAllHistory");var localizeObject;if(B=="vi-VN")localizeObject=localizeVN;else localizeObject=localizeEN;if(currentGraphSymbol=="HOSE"||currentGraphSymbol=="HASTC"||currentGraphSymbol=="OTC"||currentGraphSymbol=="MIXED"){var tableHistoryHeader=document.getElementById("tableHistoryHeader");tableHistoryHeader.rows[0].cells[0].innerHTML=localizeObject.HistoryTime;tableHistoryHeader.rows[0].cells[1].innerHTML="Index";tableHistoryHeader.rows[0].cells[2].innerHTML=localizeObject.HistoryChange;tableHistoryHeader.rows[0].cells[3].innerHTML=localizeObject.HistoryChangePercent;tableHistoryHeader.rows[0].cells[4].innerHTML=localizeObject.HistoryVolume;tableHistoryHeader.rows[0].cells[5].innerHTML=localizeObject.HistoryTotalVolume;}else{var tableHistoryHeader=document.getElementById("tableHistoryHeader");tableHistoryHeader.rows[0].cells[0].innerHTML=localizeObject.HistoryTime;tableHistoryHeader.rows[0].cells[1].innerHTML=localizeObject.HistoryPrice+" (x1000)";tableHistoryHeader.rows[0].cells[2].innerHTML=localizeObject.HistoryChange+" (x1000)";tableHistoryHeader.rows[0].cells[3].innerHTML=localizeObject.HistoryChangePercent;tableHistoryHeader.rows[0].cells[4].innerHTML=localizeObject.HistoryVolume+" (x10)";tableHistoryHeader.rows[0].cells[5].innerHTML=localizeObject.HistoryTotalVolume+" (x10)";}var rowCount=maxHistoryRowCount;if(isShowAll==false){if(quotesHistory.length<rowCount){showAllHistory.disabled=true;rowCount=quotesHistory.length;}else showAllHistory.disabled=false;}else{showAllHistory.disabled=true;rowCount=quotesHistory.length;}for(var i=0;i<rowCount;i++){item=quotesHistory[i];F=item.split(";");newRow=g.insertRow(-1);newRow.style.height=rowHeightHistory;InsertNewHistoryCell(newRow,"normalTimeHistory","20%",true,F[5]);newCell=InsertNewHistoryCell(newRow,"normalPriceHistory","18%",true,F[0]);newCell.style.textAlign="center";newCellChange=InsertNewHistoryCell(newRow,"normalPriceHistory","12%",true,F[1]);newCellPercent=InsertNewHistoryCell(newRow,"normalPriceHistory","10%",true,F[2]);if(currentGraphSymbol=="HOSE"||currentGraphSymbol=="HASTC"||currentGraphSymbol=="OTC"||currentGraphSymbol=="MIXED"){if(F[1]=="0"){newCell.className="unchangePriceHistory";newCellChange.className="unchangePriceHistory";newCellPercent.className="unchangePriceHistory";newCellChange.innerHTML+=" <img src=\"images/quotes_ref.gif\" />"}else if(F[1].substr(0,1)=="-"){newCell.className="downPriceHistory";newCellChange.className="downPriceHistory";newCellPercent.className="downPriceHistory";newCellChange.innerHTML+=" <img src=\"images/quotes_down.gif\" />"}else{newCell.className="upPriceHistory";newCellChange.className="upPriceHistory";newCellPercent.className="upPriceHistory";newCellChange.innerHTML+=" <img src=\"images/quotes_up.gif\" />"}}else{basicItem=null;if(basicObject!=null)basicItem=basicObject.ItemList[currentGraphSymbol];if(basicItem!=null){basicValueArray=basicItem.V.split(";");basicItemInfo=new BasicItemInfo();basicItemInfo.CeilingPrice=basicValueArray[0];basicItemInfo.FloorPrice=basicValueArray[1];basicItemInfo.ReferencePrice=basicValueArray[2];if(F[0]==basicItemInfo.CeilingPrice){newCell.className="cellCeilingHistory";newCellChange.className="upPriceHistory";newCellPercent.className="upPriceHistory";newCellChange.innerHTML+=" <img src=\"images/btup.gif\" />"}else if(F[0]==basicItemInfo.FloorPrice){newCell.className="cellFloorHistory";newCellChange.className="downPriceHistory";newCellPercent.className="downPriceHistory";newCellChange.innerHTML+=" <img src=\"images/btdown.gif\" />"}else if(F[0].length>basicItemInfo.ReferencePrice.length||F[0]>basicItemInfo.ReferencePrice){newCell.className="upPriceHistory";newCellChange.className="upPriceHistory";newCellPercent.className="upPriceHistory";newCellChange.innerHTML+=" <img src=\"images/btup.gif\" />"}else if(F[0]!="0"&&(F[0].length<basicItemInfo.ReferencePrice.length||F[0]<basicItemInfo.ReferencePrice)){newCell.className="downPriceHistory";newCellChange.className="downPriceHistory";newCellPercent.className="downPriceHistory";newCellChange.innerHTML+=" <img src=\"images/btdown.gif\" />"}else{newCell.className="unchangePriceHistory";newCellChange.className="unchangePriceHistory";newCellPercent.className="unchangePriceHistory";newCellChange.innerHTML+=" <img src=\"images/btnochange.jpg\" />"}if(isThreeColors==true){if(F[0]==basicItemInfo.CeilingPrice){newCellChange.innerHTML="CE+"+newCellChange.innerHTML;}else if(F[0]==basicItemInfo.FloorPrice){newCellChange.innerHTML="FL "+newCellChange.innerHTML;}}}else{newCell.className="normalPriceHistory";}}InsertNewHistoryCell(newRow,"normalVolHistory","15%",true,F[3]);InsertNewHistoryCell(newRow,"normalVolHistory","20%",true,F[4]);InsertNewHistoryCell(newRow,"normalVolHistory","5%",true);}};function InsertNewHistoryCell(newRow,className,width,isSetCellWidth,value){var newCell=newRow.insertCell(-1);newCell.className=className;if(isSetCellWidth==true)newCell.style.width=width;if(value!=null)newCell.innerHTML=value;return newCell;};function ShowAllHistory(){var g=document.getElementById("tableHistory");for(var i=g.rows.length-1;i>=0;i--){g.deleteRow(i);}CreateQuotesHistory(true);};function DeletePutThroughTable(g){for(var i=g.rows.length-1;i>=0;i--){if(i>=2)g.deleteRow(i);}};function UpdatePutThroughTable(g,dataList,dJ){var item;var newRow;var newCell;var F;var basicItem;var basicValueArray;var basicItemInfo;for(var i=0;i<dataList.length;i++){item=dataList[i];F=item.split(";");newRow=g.insertRow(-1);newRow.style.height=rowHeightPutThrough;InsertNewPutThroughCell(newRow,"cellCode",F[0]);newCell=InsertNewPutThroughCell(newRow,"normalPrice",F[1]);basicItem=null;if(basicObject!=null)basicItem=basicObject.ItemList[F[0]];if(basicItem!=null){basicValueArray=basicItem.V.split(";");basicItemInfo=new BasicItemInfo();basicItemInfo.CeilingPrice=basicValueArray[0];basicItemInfo.FloorPrice=basicValueArray[1];basicItemInfo.ReferencePrice=basicValueArray[2];if(F[1]==basicItemInfo.CeilingPrice){newCell.className="cellCeiling"}else if(F[1]==basicItemInfo.FloorPrice){newCell.className="cellFloor"}else if(F[1].length>basicItemInfo.ReferencePrice.length||F[1]>basicItemInfo.ReferencePrice){newCell.className="upPrice"}else if(F[1]!="0"&&(F[1].length<basicItemInfo.ReferencePrice.length||F[1]<basicItemInfo.ReferencePrice)){newCell.className="downPrice"}else{newCell.className="unchangePrice"}}else{newCell.className="normalPrice";}InsertNewPutThroughCell(newRow,"normalVol",F[2]);if((floorType=="HASTC"||floorType=="OTC"||floorType=="MIXED")&&dJ==true){InsertNewPutThroughCell(newRow,"normalValue",F[3]);InsertNewPutThroughCell(newRow,"normalTime",F[4]);}else if(floorType=="HOSE"||floorType=="MIXED"){if(dJ==true)InsertNewPutThroughCell(newRow,"normalValue",F[3]);else InsertNewPutThroughCell(newRow,"normalTime",F[3]);}}};function InsertNewPutThroughCell(newRow,className,value){var newCell=newRow.insertCell(-1);newCell.innerHTML=value;newCell.className=className;return newCell;};function OnScroll(){var currentY=GetPageTop();var topY=120;if(am==true){var pnlOption=document.getElementById("pnlOption");topY+=pnlOption.offsetHeight;}if(aK==true){var pnlPutThrough=document.getElementById("pnlPutThrough");topY+=pnlPutThrough.offsetHeight;}if(currentY>=topY&&tableType==0){if(ak==false){floatingHeader.style.display='block';ak=true;}}else{if(ak==true){floatingHeader.style.display='none';ak=false;}}};function ShowFloatingHeaderIE6(){var currentY=GetPageTop();var topY=120;if(am==true){var pnlOption=document.getElementById("pnlOption");topY+=pnlOption.offsetHeight;}if(aK==true){var pnlPutThrough=document.getElementById("pnlPutThrough");topY+=pnlPutThrough.offsetHeight;}if(currentY>=topY){floatingHeader.style.top=currentY;if(ak==false){floatingHeader.style.display='block';ak=true;}}else{if(ak==true){floatingHeader.style.display='none';ak=false;}}};function GetPageTop(){if(document.documentElement&&document.documentElement.scrollTop)return document.documentElement.scrollTop;else if(document.body)return document.body.scrollTop;else if(window.pageYOffset)return window.pageYOffset;else return 0;};function FailedCallback(error,userContext,methodName){};function DisplayMessage(message){};if(typeof(Sys)!=="undefined")Sys.Application.notifyScriptLoaded();