﻿var l_basicObject=null;var l_dataChanged=null;var l_flagOnCompleteSetting=false;var l_flagDeletingTableQuoteRows=false;var l_flagStartRequestAgain=false;var l_arrayCellChanged=new Array();var l_arrayCellBasicObjectValue=new Array();var l_arrayCellChangedClearColor=new Array();var l_arrayCellMarketChanged=new Array();var l_arrayCellMarketChangedClearColor=new Array();var l_flagClearBackGroundColor;var l_flagDisplayUpdateData;var l_flagUpdateMarketHeaderData;var l_flagDisplayUpdateMarketData;var l_flagClearBackGroundColorOfMarketData;var l_flagIntervalGetPutThroughObject;var l_flagTimeOutCreateBasicRows;var l_flagTimeOutDisplayObjBasicData;var l_timeServerHour=0;var l_timeServerMinute=0;var l_timeServerSecond=0;var l_objTdTime;var l_objTdIndex;var l_objTdChange;var l_objTdGainersLosers;var l_objTdTotalMarketVolume;var l_objTdTotalValue;var l_objTdMarketStatus;var l_objClientID=0;var l_objTablePutThroughBuy;var l_objTablePutThroughSell;var l_objTablePutThrough;var l_flagRowCreating=false;var l_flagShowVolumeColor=true;var l_objHighlightRow=null;var l_StartRequestTimeOutID=null;var l_ClearBgColorTimeOutID=null;var l_headerRowCount=2;var l_flagShowPannelOption=false;var l_flagShowVolumeTime1=false;var l_flagShowVolumeTime2=false;var l_flagShowBuyOrderCount=false;var l_flagShowSellOrderCount=false;var l_flagShowForeignBuy=false;var l_flagShowForeignSell=false;var l_flagShowVolumeTime3=false;var l_flagShowCurrentRoom=false;var l_flagShowHighestPrice=false;var l_flagShowLowestPrice=false;var l_flagShowOpenPrice=false;var l_flagShowSumActionQuantity=false;var l_TypeStockBoard=0;var l_scrollInterval=30;var l_lineCount=20;var l_waitingTime=10000;var l_flagShowSymbolSelectedOnTop=true;var screenWidth="1000";var extraColumnString="000000000";var TypeOfCookieName="HSX"
var l_flagOK=false;var l_numberColumnTableQuote=24;var l_flagCreateExtraHeaderCells;var l_SetScrollIntervalID;var l_WaitingScrollTimeOut;var l_RowIndexScroll=1;var l_divScroll;var l_flagShowPutThrough=false;var l_flagDishplayFloatingHeader=false;var l_rowID=null;var l_arraySymbolChecked=new Array();var selectedSymbolList=new Array();var unselectedSymbolList=new Array();var oldUnselectedSymbolList;var l_NumberRowChecked=null;var l_floatingHeader;var latestTime=new Date();var typedString="";var l_flagTimeOutKeypressId;function cls_BasicCellInfo(){this.cell=null;this.data=0;this.className="";};function cls_CellInfo(){this.cell=null;this.data=0;this.dataRealOutOfPicture=0;this.classNameNormal="";this.stockSymbol="";this.isPrice=true;this.isSpecial=true;this.time="";this.flagUpDownPicture=false;this.typeUpDown=0;this.EvenOdd=0;};function cls_basicItemInfo(){this.CeilingPrice=0;this.FloorPrice=0;this.ReferencePrice=0;this.RowIndex=0;}var localizeVN=new clsStockLanguages();function clsStockLanguages(){}function Start(){StockBoard.Service.StockBoardService.set_defaultUserContext("Default context");StockBoard.Service.StockBoardService.set_defaultSucceededCallback(OnRequestComplete);StockBoard.Service.StockBoardService.set_defaultFailedCallback(FailedCallback);Initialize();LoadCommon();}function Initialize(){localizeVN.exchangeName="SỞ  GIAO DỊCH CHỨNG KHOÁN HỒ CHÍ MINH";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";localizeVN.CurrentRoom="NN room";localizeVN.mCK="CK";localizeVN.HighestPrice="Cao";localizeVN.LowestPrice="Thấp";localizeVN.AvrPrice="TB";localizeVN.SumActionQuantity="Tổng KL";localizeVN.OpenPrice="Mở";localizeVN.VolumeTime1="KL ph.1";localizeVN.VolumeTime2="KL ph.2";localizeVN.VolumeTime3="KL ph.3";l_objTablePutThroughBuy=document.getElementById("tablePutThroughBuy");l_objTablePutThroughSell=document.getElementById("tablePutThroughSell");l_objTdTime=document.getElementById("tdTime");l_objTdIndex=document.getElementById("tdIndex");l_objTdChange=document.getElementById("tdChange");l_objTdGainersLosers=document.getElementById("tdGainersLosers");l_objTdTotalValue=document.getElementById("tdTotalValue");l_objTdTotalMarketVolume=document.getElementById("tdTotalMarketVolume");l_objTdMarketStatus=document.getElementById("tdMarketStatus");l_objTablePutThrough=document.getElementById("tablePutThrough");l_divScroll=document.getElementById("divScroll");l_floatingHeader=document.getElementById("floatingHeader");};function LoadCommon(){var onTop=readCookie("onTop");if(onTop!=null)if(onTop=="true")l_flagShowSymbolSelectedOnTop=true;else l_flagShowSymbolSelectedOnTop=false;if(readCookie("extraColString")!=null){extraColumnString=readCookie("extraColString");}if(readCookie("screenWidth")!=null){screenWidth=readCookie("screenWidth");}if(readCookie("tableType")!=null){l_TypeStockBoard=readCookie("tableType");}if(readCookie("lineCount")!=null){l_lineCount=parseInt(readCookie("lineCount"));}if(readCookie("scrollInterval")!=null){l_scrollInterval=parseInt(readCookie("scrollInterval"));}if(readCookie("waitingTime")!=null){l_waitingTime=parseInt(readCookie("waitingTime"));}SetTableWidth();if(l_StartRequestTimeOutID!=null){clearTimeout(l_StartRequestTimeOutID);l_StartRequestTimeOutID=null;}if(readCookie("selectedSymbolList")!=null){selectedSymbolList=readCookie("selectedSymbolList").split(",");}GetBasicObject();l_flagShowVolumeTime1=extraColumnString.charAt(0)=='1'?true:false;l_flagShowVolumeTime2=extraColumnString.charAt(1)=='1'?true:false;l_flagShowVolumeTime3=extraColumnString.charAt(2)=='1'?true:false;l_flagShowForeignBuy=extraColumnString.charAt(3)=='1'?true:false;l_flagShowCurrentRoom=extraColumnString.charAt(4)=='1'?true:false;l_flagShowHighestPrice=extraColumnString.charAt(5)=='1'?true:false;l_flagShowLowestPrice=extraColumnString.charAt(6)=='1'?true:false;l_flagShowOpenPrice=extraColumnString.charAt(7)=='1'?true:false;l_flagShowSumActionQuantity=extraColumnString.charAt(8)=='1'?true:false;l_flagCreateExtraHeaderCells=false;CreateExtraHeaderCells("tableQuote");CreateExtraHeaderCells("tableFixedHeader");CreateExtraHeaderCells("tableFloatingHeader");l_flagCreateExtraHeaderCells=true;SetScroll();ResizeHeader();self.setInterval("ResizeHeader()",1000);SetTime();self.setInterval("SetTime()",1000);if(Sys.Browser.name=="Microsoft Internet Explorer"&&Sys.Browser.version<=6){l_floatingHeader.style.position="absolute";self.setInterval("ShowFloatingHeaderIE6()",300);}};function ShowFloatingHeaderIE6(){var currentY=GetPageTop();var topY=120;if(l_flagShowPannelOption==true){var pnlOption=document.getElementById("pnlOption");topY+=pnlOption.offsetHeight;}if(l_flagShowPutThrough==true){var pnlPutThrough=document.getElementById("pnlPutThrough");topY+=pnlPutThrough.offsetHeight;}if(currentY>=topY){l_floatingHeader.style.top=currentY;if(l_flagDishplayFloatingHeader==false){l_floatingHeader.style.display='block';l_flagDishplayFloatingHeader=true;}}else{if(l_flagDishplayFloatingHeader==true){l_floatingHeader.style.display='none';l_flagDishplayFloatingHeader=false;}}};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 OK(){l_flagOK=true;var needSetScroll=false;var chkShowVolumeTime1=document.getElementById("chkShowVolumeTime1");var chkShowVolumeTime2=document.getElementById("chkShowVolumeTime2");var chkShowVolumeTime3=document.getElementById("chkShowVolumeTime3");var chkShowForeignBuy=document.getElementById("chkShowForeignBuy");var chkShowCurrentRoom=document.getElementById("chkShowCurrentRoom");var chkShowHighestPrice=document.getElementById("chkShowHighestPrice");var chkShowLowestPrice=document.getElementById("chkShowLowestPrice");var chkShowOpenPrice=document.getElementById("chkShowOpenPrice");var chkShowSumActionQuantity=document.getElementById("chkShowSumActionQuantity");var chkShowVolumeColor=document.getElementById("chkShowVolumeColor");l_flagShowVolumeTime1=chkShowVolumeTime1.checked;l_flagShowVolumeTime2=chkShowVolumeTime2.checked;l_flagShowVolumeTime3=chkShowVolumeTime3.checked;l_flagShowForeignBuy=chkShowForeignBuy.checked;l_flagShowCurrentRoom=chkShowCurrentRoom.checked;l_flagShowHighestPrice=chkShowHighestPrice.checked;l_flagShowLowestPrice=chkShowLowestPrice.checked;l_flagShowOpenPrice=chkShowOpenPrice.checked;l_flagShowSumActionQuantity=chkShowSumActionQuantity.checked;var tmp_extraColumnString=extraColumnString;extraColumnString="";extraColumnString+=l_flagShowVolumeTime1?"1":"0";extraColumnString+=l_flagShowVolumeTime2?"1":"0";extraColumnString+=l_flagShowVolumeTime3?"1":"0";extraColumnString+=l_flagShowForeignBuy?"1":"0";extraColumnString+=l_flagShowCurrentRoom?"1":"0";extraColumnString+=l_flagShowHighestPrice?"1":"0";extraColumnString+=l_flagShowLowestPrice?"1":"0";extraColumnString+=l_flagShowOpenPrice?"1":"0";extraColumnString+=l_flagShowSumActionQuantity?"1":"0";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 tmp_typeStockB=l_TypeStockBoard;if(rbtNormal.checked==true)l_TypeStockBoard=0;else if(rbtScrollInfinite.checked==true)l_TypeStockBoard=1;else if(rbtScroll2Directions.checked==true)l_TypeStockBoard=2;else l_TypeStockBoard=3;if(tmp_typeStockB!=l_TypeStockBoard||parseInt(txtLineCount.value)!=l_lineCount||parseInt(txtScrollInterval.value)!=l_scrollInterval||parseInt(txtWaitingTime.value)!=l_waitingTime)needSetScroll=true;if(needSetScroll==true){l_lineCount=parseInt(txtLineCount.value);l_scrollInterval=parseInt(txtScrollInterval.value);l_waitingTime=parseInt(txtWaitingTime.value);}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(tmp_extraColumnString!=extraColumnString||needSetScroll==true){l_flagCreateExtraHeaderCells=false;CreateExtraHeaderCells("tableQuote");CreateExtraHeaderCells("tableFixedHeader");CreateExtraHeaderCells("tableFloatingHeader");l_flagCreateExtraHeaderCells=true;GetBasicObject();}if(needSetScroll==true){SetScroll();}createCookie("onTop",l_flagShowSymbolSelectedOnTop,1000);createCookie("screenWidth",screenWidth,1000);createCookie("extraColString",extraColumnString,1000);createCookie("tableType",l_TypeStockBoard,1000);createCookie("lineCount",l_lineCount,1000);createCookie("scrollInterval",l_scrollInterval,1000);createCookie("waitingTime",l_waitingTime,1000);createCookie("selectedSymbolList",selectedSymbolList,1000);HideOption();};function createCookie(name,value,days){name=TypeOfCookieName+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=TypeOfCookieName+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 ResizeHeader(){if(l_flagCreateExtraHeaderCells==true){if(l_TypeStockBoard==0)ResizeTableHeader("tableFloatingHeader");else ResizeTableHeader("tableFixedHeader");}};function ResizeTableHeader(tableId){var v_tableQuote=document.getElementById("tableQuote");var v_tableResizing=document.getElementById(tableId);if(l_TypeStockBoard==0){if(v_tableResizing.tHead.rows[0].cells.length<v_tableQuote.tHead.rows[0].cells.length)return;for(var i=0;i<v_tableQuote.tHead.rows[0].cells.length;i++){if(v_tableQuote.tHead.rows[0].cells[i].offsetWidth!=0)v_tableResizing.tHead.rows[0].cells[i].width=(v_tableQuote.tHead.rows[0].cells[i].offsetWidth)+'px';else v_tableResizing.tHead.rows[0].cells[i].width="";}for(var i=0;i<v_tableQuote.tHead.rows[1].cells.length;i++){if(v_tableQuote.tHead.rows[1].cells[i].offsetWidth!=0)v_tableResizing.tHead.rows[1].cells[i].width=(v_tableQuote.tHead.rows[1].cells[i].offsetWidth)+'px';else v_tableResizing.tHead.rows[1].cells[i].width="";}}else{if(v_tableQuote.rows.length>2){if(v_tableResizing.tHead.rows[0].cells.length-12<v_tableQuote.rows[2].cells.length-23)return;v_tableResizing.tHead.rows[0].cells[0].width=(v_tableQuote.rows[2].cells[0].offsetWidth)+'px';for(var i=1;i<4;i++){if(v_tableQuote.rows[2].cells[i].offsetWidth!=0)v_tableResizing.tHead.rows[0].cells[i].width=(v_tableQuote.rows[2].cells[i].offsetWidth)+'px';else v_tableResizing.tHead.rows[0].cells[i].width="";}for(var i=4;i<12;i++){if(v_tableQuote.rows[2].cells[i].offsetWidth!=0)v_tableResizing.tHead.rows[1].cells[i-4].width=(v_tableQuote.rows[2].cells[i].offsetWidth)+'px';else v_tableResizing.tHead.rows[1].cells[i-4].width="";}v_tableResizing.tHead.rows[0].cells[6].width=(v_tableQuote.rows[2].cells[12].offsetWidth)+'px';v_tableResizing.tHead.rows[0].cells[7].width=(v_tableQuote.rows[2].cells[13].offsetWidth)+'px';for(var i=15;i<19;i++){if(v_tableQuote.rows[2].cells[i].offsetWidth!=0)v_tableResizing.tHead.rows[1].cells[i-5].width=(v_tableQuote.rows[2].cells[i].offsetWidth)+'px';else v_tableResizing.tHead.rows[1].cells[i-5].width="";}for(var i=19;i<v_tableQuote.rows[3].cells.length;i++){if(v_tableQuote.rows[2].cells[i].offsetWidth!=0)v_tableResizing.tHead.rows[0].cells[i-11].width=(v_tableQuote.rows[2].cells[i].offsetWidth)+'px';else v_tableResizing.tHead.rows[0].cells[i-11].width="";}}}if(v_tableQuote.offsetWidth>0)v_tableResizing.width=v_tableQuote.offsetWidth+'px';};function FailedCallback(error,userContext,methodName){window.location.reload(true);};function OnRequestComplete(result,userContext,methodName){switch(methodName){case"GetStockBoardBasicOject":l_basicObject=eval('('+result+')');if(l_basicObject!=null){CreateBasicRows(true);}break;case"GetHosePutThroughObject":DeletePutThroughTable(l_objTablePutThrough);{DeletePutThroughTable(l_objTablePutThroughBuy);DeletePutThroughTable(l_objTablePutThroughSell);}var v_result=eval('('+result+')');if(v_result==null)return;if(v_result.ML!=null)UpdatePutThroughTable(l_objTablePutThrough,v_result.ML);{if(v_result.BL!=null)UpdatePutThroughTable(l_objTablePutThroughBuy,v_result.BL);if(v_result.SL!=null)UpdatePutThroughTable(l_objTablePutThroughSell,v_result.SL);}break;case"GetChangedObjectCompare":l_dataChanged=eval('('+result+')');if(l_dataChanged==null){if(l_StartRequestTimeOutID==null)l_StartRequestTimeOutID=self.setTimeout("StartRequest()",l_timeout_requestData);}else{l_objClientID=l_dataChanged.ClientID;BeginUpdate();var v_timeServer=l_dataChanged.Time.split(":");var v_now=new Date();l_timeServerHour=v_timeServer[0]-v_now.getHours();l_timeServerMinute=v_timeServer[1]-v_now.getMinutes();l_timeServerSecond=v_timeServer[2]-v_now.getSeconds();}break;}}function SetTime(){var v_now=new Date();var v_Hour=v_now.getHours()+l_timeServerHour;var v_Minute=v_now.getMinutes()+l_timeServerMinute;var v_Second=v_now.getSeconds()+l_timeServerSecond;v_now=new Date();v_now.setHours(v_Hour,v_Minute,v_Second,0);v_Hour=v_now.getHours();v_Minute=v_now.getMinutes();v_Second=v_now.getSeconds();if(v_Hour<10)v_Hour="0"+v_Hour;if(v_Minute<10)v_Minute="0"+v_Minute;if(v_Second<10)v_Second="0"+v_Second;l_objTdTime.innerHTML=v_Hour+":"+v_Minute+":"+v_Second;}function SetClientInfoAndGetData(){if(l_StartRequestTimeOutID!=null){clearTimeout(l_StartRequestTimeOutID);l_StartRequestTimeOutID=null;}l_flagOK=false;l_objClientID=0;StockBoard.Service.StockBoardService.GetChangedObjectCompare(l_objClientID);}function StartRequest(){if(l_StartRequestTimeOutID!=null){clearTimeout(l_StartRequestTimeOutID);l_StartRequestTimeOutID=null;}StockBoard.Service.StockBoardService.GetChangedObjectCompare(l_objClientID);};function deleteAllRowInTable(mytable){for(var i=mytable.rows.length-1;i>-1;i--){if(mytable.rows[i].id!="")mytable.deleteRow(i);}}function white_space(field){field=field.replace(/^\s*|\s*$/g,'');return field;}function fCallLoadStockInfo(pCode){pCode=white_space(pCode);var l_ObjStock=null;var data=oc;if(data&&data.length){for(var i=0;i<data.length;i++){if(data[i].c.toLowerCase()==pCode.toLowerCase()){l_ObjStock=data[i];break;}}}if(l_ObjStock!=null)return"<a onmouseover=\"Tip(popquote(this, ''), BGCOLOR, '#525152', BORDERCOLOR, '#525152', TITLE, '"+l_ObjStock.m+"', CLICKCLOSE, true, FIX, [this, 23, -19]);\">"+pCode+"</a>";else return pCode;}function CreateBasicRows(pflagStartRequest){l_flagRowCreating=true;if(l_flagOK==true){SetClientInfoAndGetData();}else if(pflagStartRequest==true){StartRequest();}var v_tableQuote;v_tableQuote=document.getElementById("tableQuote");deleteAllRowInTable(v_tableQuote);var v_basicItem;var v_arrayValue;var v_newRow;var v_newCell;var v_fontstyle;var v_fontstyle1;var v_cellBasicInfo;var v_iRun=0;var v_fShowCompanyInfo="";v_fontstyle="normal";v_fontstyle1="bold";if(l_basicObject==null||l_basicObject.Items==null)return;l_arraySymbolChecked=selectedSymbolList;oldUnselectedSymbolList=unselectedSymbolList;selectedSymbolList=new Array();unselectedSymbolList=new Array();l_arrayCellBasicObjectValue=new Array();l_NumberRowChecked=0;for(var itemKey in l_basicObject.Items){unselectedSymbolList.push(itemKey);v_basicItem=l_basicObject.Items[itemKey];v_arrayValue=v_basicItem.V.split(";");v_fShowCompanyInfo=fCallLoadStockInfo(itemKey);if(v_iRun==0){v_newRow=v_tableQuote.insertRow(-1);v_newRow.style.height="21px";v_newRow.id="tr"+itemKey;v_newCell=v_newRow.insertCell(-1);v_newCell.className="cellCode";if(l_TypeStockBoard==0){v_newCell.innerHTML="<input value=\""+v_iRun+"\" type=\"checkbox\" id=\"chk"+itemKey+"\" onClick=\"OnRowChecked('"+itemKey+"'); \"/>"+v_fShowCompanyInfo;}else{v_newCell.innerHTML="<input value=\""+v_iRun+"\" type=\"hidden\" id=\"chk"+itemKey+"\" />"+itemKey;}v_newCell.style.width="4.5%";v_newCell.style.backgroundColor=backColorSymbol;v_newCell.style.fontWeight=v_fontstyle1;v_newCell=v_newRow.insertCell(-1);v_newCell.style.width="3%";v_newCell.innerHTML=v_arrayValue[0];v_newCell.className="cellCeiling"
v_newCell.style.backgroundColor=backColor2;v_newCell.style.fontWeight=v_fontstyle1;v_newCell=v_newRow.insertCell(-1);v_newCell.style.width="3%";v_newCell.innerHTML=v_arrayValue[1];v_newCell.className="cellFloor"
v_newCell.style.backgroundColor=backColor2;v_newCell.style.fontWeight=v_fontstyle1;v_newCell=v_newRow.insertCell(-1);v_newCell.style.width="3%";v_newCell.innerHTML=v_arrayValue[2];v_newCell.className="cellRef"
v_newCell.style.backgroundColor=backColor2;v_newCell.style.fontWeight=v_fontstyle1;v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalPrice";v_newCell.style.width="3.0%";v_newCell.style.backgroundColor=backColor1;v_newCell.style.fontWeight=v_fontstyle;v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalVol";v_newCell.style.width="3.5%";v_newCell.style.backgroundColor=backColorVolume1;v_newCell.style.fontWeight=v_fontstyle;v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalPrice";v_newCell.style.width="3.0%";v_newCell.style.backgroundColor=backColor1;v_newCell.style.fontWeight=v_fontstyle;v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalVol";v_newCell.style.width="3.5%";v_newCell.style.backgroundColor=backColorVolume1;v_newCell.style.fontWeight=v_fontstyle;v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalPrice";v_newCell.style.width="3.0%";v_newCell.style.backgroundColor=backColor1;v_newCell.style.fontWeight=v_fontstyle;v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalVol";v_newCell.style.width="3.5%";v_newCell.style.backgroundColor=backColorVolume1;v_newCell.style.fontWeight=v_fontstyle;v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalMatchingPrice";v_newCell.style.width="4.5%";v_newCell.style.backgroundColor=backColor1Alt;v_newCell.style.fontWeight=v_fontstyle;v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalMatchingVol";v_newCell.style.width="3.5%";v_newCell.style.backgroundColor=backColorVolume1Alt;v_newCell.style.fontWeight=v_fontstyle;v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalChange";v_newCell.style.backgroundColor=backColor1Alt;v_newCell.style.width="4.0%";v_newCell.style.fontWeight=v_fontstyle;v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalPrice";v_newCell.style.width="3.0%";v_newCell.style.backgroundColor=backColor1;v_newCell.style.fontWeight=v_fontstyle;v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalVol";v_newCell.style.width="3.5%";v_newCell.style.backgroundColor=backColorVolume1;v_newCell.style.fontWeight=v_fontstyle;v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalPrice";v_newCell.style.width="3.0%";v_newCell.style.backgroundColor=backColor1;v_newCell.style.fontWeight=v_fontstyle;v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalVol";v_newCell.style.width="3.5%";v_newCell.style.backgroundColor=backColorVolume1;v_newCell.style.fontWeight=v_fontstyle;v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalPrice";v_newCell.style.width="3.0%";v_newCell.style.backgroundColor=backColor1;v_newCell.style.fontWeight=v_fontstyle;v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalVol";v_newCell.style.width="3.5%";v_newCell.style.backgroundColor=backColorVolume1;v_newCell.style.fontWeight=v_fontstyle;if(l_flagShowHighestPrice==true){v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalHighLowPrice";v_newCell.style.width="3.8%";v_newCell.style.backgroundColor=backColor1Alt;v_newCell.style.fontWeight=v_fontstyle;}if(l_flagShowLowestPrice==true){v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalHighLowPrice";v_newCell.style.width="3.8%";v_newCell.style.backgroundColor=backColor1Alt;v_newCell.style.fontWeight=v_fontstyle;}if(l_flagShowOpenPrice==true){v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalHighLowPrice";v_newCell.style.width="3.8%";v_newCell.style.backgroundColor=backColor1Alt;v_newCell.style.fontWeight=v_fontstyle;}if(l_flagShowSumActionQuantity==true){v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalVol";v_newCell.style.width="3.8%";v_newCell.style.backgroundColor=backColorVolume1;v_newCell.style.fontWeight=v_fontstyle;}if(l_flagShowVolumeTime1==true){v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalVol";v_newCell.style.width="3.8%";v_newCell.style.backgroundColor=backColorVolume1;v_newCell.style.fontWeight=v_fontstyle;}if(l_flagShowVolumeTime2==true){v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalVol";v_newCell.style.width="3.8%";v_newCell.style.backgroundColor=backColorVolume1;v_newCell.style.fontWeight=v_fontstyle;}if(l_flagShowVolumeTime3==true){v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalVol";v_newCell.style.width="3.8%";v_newCell.style.backgroundColor=backColorVolume1;v_newCell.style.fontWeight=v_fontstyle;}if(l_flagShowForeignBuy==true){v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalVol";v_newCell.style.width="3.8%";v_newCell.style.backgroundColor=backColorVolume1Alt;v_newCell.style.fontWeight=v_fontstyle;}if(l_flagShowCurrentRoom==true){v_newCell=v_newRow.insertCell(-1);v_newCell.className="normalVol";v_newCell.style.width="3.8%";v_newCell.style.backgroundColor=backColorVolume1Alt;v_newCell.style.fontWeight=v_fontstyle;}v_newCell=v_newRow.insertCell(-1);v_newCell.className="cellCodeRight";v_newCell.innerHTML=itemKey;v_newCell.style.width="3%";v_newCell.style.backgroundColor=backColorSymbol;v_newCell.style.fontWeight=v_fontstyle1;}else{if(v_iRun==1){v_newRow=v_tableQuote.rows[2].cloneNode(true);v_tableQuote.rows[2].parentNode.appendChild(v_newRow);UpdateOddRowBackColor(v_newRow);}else if(v_iRun%2==0){v_newRow=v_tableQuote.rows[2].cloneNode(true);v_tableQuote.rows[2].parentNode.appendChild(v_newRow);}else{v_newRow=v_tableQuote.rows[3].cloneNode(true);v_tableQuote.rows[3].parentNode.appendChild(v_newRow);}v_newRow.id="tr"+itemKey
if(l_TypeStockBoard==0){v_newRow.cells[0].innerHTML="<input value=\""+v_iRun+"\" type=\"checkbox\" id=\"chk"+itemKey+"\" onClick=\"OnRowChecked('"+itemKey+"'); \"/>"+v_fShowCompanyInfo;}else{v_newRow.cells[0].innerHTML="<input value=\""+v_iRun+"\" type=\"hidden\" id=\"chk"+itemKey+"\" />"+itemKey;}v_newRow.cells[1].innerHTML=v_arrayValue[0];v_newRow.cells[2].innerHTML=v_arrayValue[1];v_newRow.cells[3].innerHTML=v_arrayValue[2];v_newRow.cells[v_newRow.cells.length-1].innerHTML=itemKey;}v_iRun=v_iRun+1;}l_flagRowCreating=false;FinishCreateBasicRows();};function FinishCreateBasicRows(){if(l_TypeStockBoard==0){var v_symbol;for(var i=0;i<l_arraySymbolChecked.length;i++){v_symbol=l_arraySymbolChecked[i];var chkSymbol=document.getElementById("chk"+v_symbol);if(chkSymbol!=null&&chkSymbol!="undefined"){chkSymbol.checked=true;OnRowChecked(v_symbol);}}}else{unselectedSymbolList=oldUnselectedSymbolList;selectedSymbolList=l_arraySymbolChecked;}};function UpdateOddRowBackColor(pRowOdd){var v_index=0;pRowOdd.cells[v_index++].style.backgroundColor=backColorSymbolR2;pRowOdd.cells[v_index++].style.backgroundColor=backColor2R2;pRowOdd.cells[v_index++].style.backgroundColor=backColor2R2;pRowOdd.cells[v_index++].style.backgroundColor=backColor2R2;pRowOdd.cells[v_index++].style.backgroundColor=backColor1R2;pRowOdd.cells[v_index++].style.backgroundColor=backColorVolume1R2;pRowOdd.cells[v_index++].style.backgroundColor=backColor1R2;pRowOdd.cells[v_index++].style.backgroundColor=backColorVolume1R2;pRowOdd.cells[v_index++].style.backgroundColor=backColor1R2;pRowOdd.cells[v_index++].style.backgroundColor=backColorVolume1R2;pRowOdd.cells[v_index++].style.backgroundColor=backColor1AltR2;pRowOdd.cells[v_index++].style.backgroundColor=backColorVolume1AltR2
pRowOdd.cells[v_index++].style.backgroundColor=backColor1AltR2;pRowOdd.cells[v_index++].style.backgroundColor=backColor1R2;pRowOdd.cells[v_index++].style.backgroundColor=backColorVolume1R2;pRowOdd.cells[v_index++].style.backgroundColor=backColor1R2;pRowOdd.cells[v_index++].style.backgroundColor=backColorVolume1R2;pRowOdd.cells[v_index++].style.backgroundColor=backColor1R2;pRowOdd.cells[v_index++].style.backgroundColor=backColorVolume1R2;if(l_flagShowHighestPrice==true){pRowOdd.cells[v_index++].style.backgroundColor=backColor1R2;}if(l_flagShowLowestPrice==true){pRowOdd.cells[v_index++].style.backgroundColor=backColor1R2;}if(l_flagShowOpenPrice==true){pRowOdd.cells[v_index++].style.backgroundColor=backColor1R2;}if(l_flagShowSumActionQuantity==true){pRowOdd.cells[v_index++].style.backgroundColor=backColorVolume1R2;}if(l_flagShowVolumeTime1==true){pRowOdd.cells[v_index++].style.backgroundColor=backColorVolume1R2;}if(l_flagShowVolumeTime2==true){pRowOdd.cells[v_index++].style.backgroundColor=backColorVolume1R2;}if(l_flagShowVolumeTime3==true){pRowOdd.cells[v_index++].style.backgroundColor=backColorVolume1R2;}if(l_flagShowForeignBuy==true){pRowOdd.cells[v_index++].style.backgroundColor=backColorVolume1R2;}if(l_flagShowCurrentRoom==true){pRowOdd.cells[v_index++].style.backgroundColor=backColorVolume1R2;}pRowOdd.cells[v_index++].style.backgroundColor=backColorSymbolR2;}function BeginUpdate(){if(l_dataChanged==null&&l_basicObject==null)return;if(l_flagDisplayUpdateData!=null){clearTimeout(l_flagDisplayUpdateData);l_flagDisplayUpdateData=null;}l_flagDisplayUpdateData=setTimeout("DisplayUpdateData()",50);if(l_flagClearBackGroundColor!=null){clearTimeout(l_flagClearBackGroundColor);l_flagClearBackGroundColor=null;}l_flagClearBackGroundColor=setTimeout("ClearBackGroundColor()",50);if(l_flagUpdateMarketHeaderData!=null){clearTimeout(l_flagUpdateMarketHeaderData);l_flagUpdateMarketHeaderData=null;}l_flagUpdateMarketHeaderData=setTimeout("UpdateMarketHeaderData()",50);var v_arrItemsValue=new Array();var cellIndex=0;var v_index=0;var v_changedRow=null;var quoteItem=null;var v_basicItemInfo=null;for(var item in l_dataChanged.Items){quoteItem=l_dataChanged.Items[item];v_arrItemsValue=quoteItem.V.split(";");v_changedRow=document.getElementById("tr"+item);if(v_changedRow!=null){cellIndex=4;v_index=0;UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalPrice",true,false,item);UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalVol",false,false,item);UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalPrice",true,false,item);UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalVol",false,false,item);UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalPrice",true,false,item);UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalVol",false,false,item);UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalMatchingPrice",true,true,item);UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalMatchingVol",false,true,item);UpdateCellDataImage(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalMatchingPrice",true,true,item,v_arrItemsValue[6]);UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalPrice",true,false,item);UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalVol",false,false,item);UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalPrice",true,false,item);UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalVol",false,false,item);UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalPrice",true,false,item);UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalVol",false,false,item);if(l_flagShowHighestPrice==true){UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalHighLowPrice",true,true,item);}else{v_index++;}if(l_flagShowLowestPrice==true){UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalHighLowPrice",true,true,item);}else{v_index++;}if(l_flagShowOpenPrice==true){UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalHighLowPrice",true,true,item);}else{v_index++;}if(l_flagShowSumActionQuantity==true){UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalVol",false,false,item);}else{v_index++;}if(l_flagShowVolumeTime1==true){UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalVol",false,false,item);}else{v_index++;}if(l_flagShowVolumeTime2==true){UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalVol",false,false,item);}else{v_index++;}if(l_flagShowVolumeTime3==true){UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalVol",false,false,item);}else{v_index++;}if(l_flagShowForeignBuy==true){UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalVol",false,false,item);}else{v_index++;}if(l_flagShowCurrentRoom==true){UpdateCellData(v_changedRow.cells[cellIndex++],v_arrItemsValue[v_index++],"normalVol",false,false,item);}else{v_index++;}}}if(l_StartRequestTimeOutID!=null){clearTimeout(l_StartRequestTimeOutID);l_StartRequestTimeOutID=null;}l_StartRequestTimeOutID=setTimeout("StartRequest()",l_timeout_requestData);};function UpdateCellDataImage(cell,data,className,isPrice,isSpecial,stocksymbol,priceCompare){if(l_flagRowCreating==true){return;}if(data!=undefined&&data!=""){var v_cellInfo=new cls_CellInfo();v_cellInfo.cell=cell;v_cellInfo.dataRealOutOfPicture=parseFloat(data);v_cellInfo.classNameNormal=className;v_cellInfo.isPrice=isPrice;v_cellInfo.isSpecial=isSpecial;v_cellInfo.stockSymbol=stocksymbol;var v_chkItem=null;v_chkItem=document.getElementById("chk"+stocksymbol);if(parseInt(v_chkItem.value)%2==0){v_cellInfo.EvenOdd=0;}else{v_cellInfo.EvenOdd=1;}if(v_cellInfo.dataRealOutOfPicture<0){v_cellInfo.data=data+" <img src=\"images/btdown.gif\" />";v_cellInfo.typeUpDown=1;}else if(v_cellInfo.dataRealOutOfPicture==0){v_cellInfo.data=data+" <img src=\"images/btnochange.jpg\" />";v_cellInfo.typeUpDown=0;}else{v_cellInfo.data=data+" <img src=\"images/btup.gif\" />";v_cellInfo.typeUpDown=2;}if(v_cellInfo.isPrice==true){var v_basicItem=l_basicObject.Items[v_cellInfo.stockSymbol];var v_arrayValue=v_basicItem.V.split(";");var v_basicItemInfo=new cls_basicItemInfo();v_basicItemInfo.CeilingPrice=v_arrayValue[0];v_basicItemInfo.FloorPrice=v_arrayValue[1];if(priceCompare==v_basicItemInfo.FloorPrice){v_cellInfo.data=data+" <b>FL</b>";}else if(priceCompare==v_basicItemInfo.CeilingPrice){v_cellInfo.data=data+" <b>CE</b>";}}v_cellInfo.flagUpDownPicture=true;l_arrayCellChanged.push(v_cellInfo);}}function UpdateCellData(cell,data,className,isPrice,isSpecial,stocksymbol){if(l_flagRowCreating==true){return;}if(data!=undefined&&data!=""){var v_cellInfo=new cls_CellInfo();v_cellInfo.cell=cell;v_cellInfo.dataRealOutOfPicture=parseFloat(data);v_cellInfo.classNameNormal=className;v_cellInfo.isPrice=isPrice;v_cellInfo.isSpecial=isSpecial;v_cellInfo.stockSymbol=stocksymbol;v_cellInfo.data=data;v_cellInfo.flagUpDownPicture=false;var v_chkItem=null;v_chkItem=document.getElementById("chk"+stocksymbol);if(parseInt(v_chkItem.value)%2==0){v_cellInfo.EvenOdd=0;}else{v_cellInfo.EvenOdd=1;}l_arrayCellChanged.push(v_cellInfo);}};function DisplayUpdateData(){if(l_flagDisplayUpdateData!=null){clearTimeout(l_flagDisplayUpdateData);l_flagDisplayUpdateData=null;}if(l_flagRowCreating==true){l_flagDisplayUpdateData=setTimeout("DisplayUpdateData()",50);return;}if(l_arrayCellChanged.length==0){l_flagDisplayUpdateData=setTimeout("DisplayUpdateData()",50);return;}var v_cellInfo=new cls_CellInfo();for(var i=0;i<l_arrayCellChanged.length;i++){v_cellInfo=l_arrayCellChanged[i];l_arrayCellChanged.splice(i,1);if(v_cellInfo.flagUpDownPicture==false){if(v_cellInfo.cell.innerHTML!=""&&v_cellInfo.data!=v_cellInfo.cell.innerHTML){v_cellInfo.cell.style.backgroundColor="";v_cellInfo.cell.className="CellVolumeChange";if(v_cellInfo.isPrice==true){v_basicItem=l_basicObject.Items[v_cellInfo.stockSymbol];var v_arrayValue=v_basicItem.V.split(";");var v_basicItemInfo=new cls_basicItemInfo();v_basicItemInfo.CeilingPrice=v_arrayValue[0];v_basicItemInfo.FloorPrice=v_arrayValue[1];v_basicItemInfo.ReferencePrice=v_arrayValue[2];if(v_cellInfo.dataRealOutOfPicture>v_basicItemInfo.ReferencePrice){v_cellInfo.cell.className="CellChangeUp";}else if(v_cellInfo.dataRealOutOfPicture<v_basicItemInfo.ReferencePrice){v_cellInfo.cell.className="CellChangeDown";}else if(v_cellInfo.dataRealOutOfPicture=v_basicItemInfo.ReferencePrice){v_cellInfo.cell.className="CellChange";}}var v_now=new Date();v_cellInfo.time=v_now.getHours()*60*60+v_now.getMinutes()*60+v_now.getSeconds();l_arrayCellChangedClearColor.push(v_cellInfo);}else{v_cellInfo.cell.className=v_cellInfo.classNameNormal;if(v_cellInfo.isPrice==true){v_basicItem=l_basicObject.Items[v_cellInfo.stockSymbol];var v_arrayValue=v_basicItem.V.split(";");var v_basicItemInfo=new cls_basicItemInfo();v_basicItemInfo.CeilingPrice=v_arrayValue[0];v_basicItemInfo.FloorPrice=v_arrayValue[1];v_basicItemInfo.ReferencePrice=v_arrayValue[2];if(v_cellInfo.dataRealOutOfPicture==v_basicItemInfo.CeilingPrice){if(v_cellInfo.isSpecial==false)v_cellInfo.cell.className="cellCeiling";else v_cellInfo.cell.className="cellCeiling2";}else if(v_cellInfo.dataRealOutOfPicture==v_basicItemInfo.FloorPrice){if(v_cellInfo.isSpecial==false)v_cellInfo.cell.className="cellFloor";else v_cellInfo.cell.className="cellFloor2";}else if(v_cellInfo.dataRealOutOfPicture==v_basicItemInfo.ReferencePrice){if(v_cellInfo.isSpecial==false)v_cellInfo.cell.className="cellRef";else v_cellInfo.cell.className="cellRef2";}else if(v_cellInfo.dataRealOutOfPicture>v_basicItemInfo.ReferencePrice){if(v_cellInfo.isSpecial==false)v_cellInfo.cell.className="upPrice";else v_cellInfo.cell.className="upPrice2";}else if(v_cellInfo.dataRealOutOfPicture<v_basicItemInfo.ReferencePrice){if(v_cellInfo.isSpecial==false)v_cellInfo.cell.className="downPrice";else v_cellInfo.cell.className="downPrice2";}switch(v_cellInfo.EvenOdd){case 0:if(v_cellInfo.isSpecial==false)v_cellInfo.cell.style.backgroundColor=backColor1;else v_cellInfo.cell.style.backgroundColor=backColor1Alt;break;case 1:if(v_cellInfo.isSpecial==false)v_cellInfo.cell.style.backgroundColor=backColor1R2;else v_cellInfo.cell.style.backgroundColor=backColor1AltR2;break;}}else{switch(v_cellInfo.EvenOdd){case 0:if(v_cellInfo.isSpecial==false)v_cellInfo.cell.style.backgroundColor=backColorVolume1;else v_cellInfo.cell.style.backgroundColor=backColorVolume1Alt;break;case 1:if(v_cellInfo.isSpecial==false)v_cellInfo.cell.style.backgroundColor=backColorVolume1R2;else v_cellInfo.cell.style.backgroundColor=backColorVolume1AltR2;break;}}}}else{if(v_cellInfo.cell.innerHTML!=""&&v_cellInfo.dataRealOutOfPicture!=getDataFromInnerHTMLCellPicture(v_cellInfo.cell.innerHTML)){v_cellInfo.cell.style.backgroundColor="";v_cellInfo.cell.className="CellChange";switch(v_cellInfo.typeUpDown){case 1:v_cellInfo.cell.className="CellChangeDown";break;case 2:v_cellInfo.cell.className="CellChangeUp";break;}var v_now=new Date();v_cellInfo.time=v_now.getHours()*60*60+v_now.getMinutes()*60+v_now.getSeconds();l_arrayCellChangedClearColor.push(v_cellInfo);}else{v_cellInfo.cell.className=v_cellInfo.classNameNormal;switch(v_cellInfo.typeUpDown){case 1:v_cellInfo.cell.className="downPrice2";break;case 2:v_cellInfo.cell.className="upPrice2";break;}switch(v_cellInfo.EvenOdd){case 0:v_cellInfo.cell.style.backgroundColor=backColor1Alt;break;case 1:v_cellInfo.cell.style.backgroundColor=backColor1AltR2;break;}}}v_cellInfo.cell.innerHTML=v_cellInfo.data;}if(l_flagDisplayUpdateData!=null){clearTimeout(l_flagDisplayUpdateData);l_flagDisplayUpdateData=null;}l_flagDisplayUpdateData=setTimeout("DisplayUpdateData()",50);};function getDataFromInnerHTMLCellPicture(pInnerText){var v_text=pInnerText.toString();var v_index=v_text.indexOf('<');v_text=v_text.substr(0,v_index);return parseFloat(v_text);}function ClearBackGroundColor(){if(l_flagClearBackGroundColor!=null){clearTimeout(l_flagClearBackGroundColor);l_flagClearBackGroundColor=null;}if(l_flagRowCreating==true){l_flagClearBackGroundColor=setTimeout("ClearBackGroundColor()",50);return;}if(l_arrayCellChangedClearColor.length==0){l_flagClearBackGroundColor=setTimeout("ClearBackGroundColor()",50);return;}var v_cellInfo;var v_endTime=0;for(var i=0;i<l_arrayCellChangedClearColor.length;i++){var v_date=new Date();var v_now=v_date.getHours()*60*60+v_date.getMinutes()*60+v_date.getSeconds();v_cellInfo=l_arrayCellChangedClearColor[i];v_endTime=v_now-v_cellInfo.time;if(v_endTime>l_timeout_clearColor){l_arrayCellChangedClearColor.splice(i,1);v_cellInfo.cell.className=v_cellInfo.classNameNormal;if(v_cellInfo.flagUpDownPicture==true){switch(v_cellInfo.typeUpDown){case 1:v_cellInfo.cell.className="downPrice2";break;case 2:v_cellInfo.cell.className="upPrice2";break;}switch(v_cellInfo.EvenOdd){case 0:v_cellInfo.cell.style.backgroundColor=backColor1Alt;break;case 1:v_cellInfo.cell.style.backgroundColor=backColor1AltR2;break;}}else{if(v_cellInfo.isPrice==true){v_basicItem=l_basicObject.Items[v_cellInfo.stockSymbol];var v_arrayValue=v_basicItem.V.split(";");var v_basicItemInfo=new cls_basicItemInfo();v_basicItemInfo.CeilingPrice=v_arrayValue[0];v_basicItemInfo.FloorPrice=v_arrayValue[1];v_basicItemInfo.ReferencePrice=v_arrayValue[2];if(v_cellInfo.dataRealOutOfPicture==v_basicItemInfo.CeilingPrice){if(v_cellInfo.isSpecial==false)v_cellInfo.cell.className="cellCeiling";else v_cellInfo.cell.className="cellCeiling2";}else if(v_cellInfo.dataRealOutOfPicture==v_basicItemInfo.FloorPrice){if(v_cellInfo.isSpecial==false)v_cellInfo.cell.className="cellFloor";else v_cellInfo.cell.className="cellFloor2";}else if(v_cellInfo.dataRealOutOfPicture==v_basicItemInfo.ReferencePrice){if(v_cellInfo.isSpecial==false)v_cellInfo.cell.className="cellRef";else v_cellInfo.cell.className="cellRef2";}else if(v_cellInfo.dataRealOutOfPicture>v_basicItemInfo.ReferencePrice){if(v_cellInfo.isSpecial==false)v_cellInfo.cell.className="upPrice";else v_cellInfo.cell.className="upPrice2";}else if(v_cellInfo.dataRealOutOfPicture<v_basicItemInfo.ReferencePrice){if(v_cellInfo.isSpecial==false)v_cellInfo.cell.className="downPrice";else v_cellInfo.cell.className="downPrice2";}switch(v_cellInfo.EvenOdd){case 0:if(v_cellInfo.isSpecial==false)v_cellInfo.cell.style.backgroundColor=backColor1;else v_cellInfo.cell.style.backgroundColor=backColor1Alt;break;case 1:if(v_cellInfo.isSpecial==false)v_cellInfo.cell.style.backgroundColor=backColor1R2;else v_cellInfo.cell.style.backgroundColor=backColor1AltR2;break;}}else{switch(v_cellInfo.EvenOdd){case 0:if(v_cellInfo.isSpecial==false)v_cellInfo.cell.style.backgroundColor=backColorVolume1;else v_cellInfo.cell.style.backgroundColor=backColorVolume1Alt;break;case 1:if(v_cellInfo.isSpecial==false)v_cellInfo.cell.style.backgroundColor=backColorVolume1R2;else v_cellInfo.cell.style.backgroundColor=backColorVolume1AltR2;break;}}}}}if(l_flagClearBackGroundColor!=null){clearTimeout(l_flagClearBackGroundColor);l_flagClearBackGroundColor=null;}l_flagClearBackGroundColor=setTimeout("ClearBackGroundColor()",50);};function UpdateMarketHeaderData(){if(l_flagRowCreating==true){return;}var v_TypeUpDownIndex=0;if(l_dataChanged.Ic!=undefined&&l_dataChanged.Ic!=""){if(l_dataChanged.Ic.substr(0,1)=="-"){v_TypeUpDownIndex=1;}else if(parseFloat(l_dataChanged.Ic)==0){v_TypeUpDownIndex=0;}else{v_TypeUpDownIndex=2;}}else{var v_tempValue=getDataFromInnerHTMLCellPicture(l_objTdChange.innerHTML);if(v_tempValue==0){v_TypeUpDownIndex=0;}else if(v_tempValue<0){v_TypeUpDownIndex=1;}else if(v_tempValue>0){v_TypeUpDownIndex=2;}}UpdateCellMarketHeaderData(l_objTdIndex,l_dataChanged.I,"headerInfoValue",false,true,false,"",v_TypeUpDownIndex);UpdateCellMarketHeaderData(l_objTdChange,l_dataChanged.Ic+"|"+l_dataChanged.Icp,"headerInfoValue",true,true,false,"",v_TypeUpDownIndex);UpdateCellMarketHeaderData(l_objTdTotalMarketVolume,l_dataChanged.Tvol,"headerInfoValue",false,false,false,"",v_TypeUpDownIndex);UpdateCellMarketHeaderData(l_objTdTotalValue,l_dataChanged.Tval,"headerInfoValue",false,false,false,"",v_TypeUpDownIndex);UpdateCellMarketHeaderData(l_objTdMarketStatus,l_dataChanged.TtGd,"headerInfoValue",false,false,false,"",v_TypeUpDownIndex);DisplayUpdateMarketData();ClearBackGroundColorOfMarketData();}function UpdateCellMarketHeaderData(cell,data,className,flagUpDownPicture,isPrice,isSpecial,stocksymbol,typeUpDown){if(l_flagRowCreating==true){return;}if(data!=undefined&&data!=""){var v_cellInfo=new cls_CellInfo();if(flagUpDownPicture==false){v_cellInfo.data=data;v_cellInfo.flagUpDownPicture=false;}else{var v_dataSplit=data.split("|");var v_Icp=v_dataSplit[1];data=v_dataSplit[0];if(data=="undefined"||data==""||v_Icp=="undefined"||v_Icp==""){return;}if(typeUpDown==0){v_cellInfo.data=data+" <img src=\"images/btnochange.jpg\" />";}else if(typeUpDown==1){v_cellInfo.data=data+" <img src=\"images/btdown.gif\" />";}else if(typeUpDown==2){v_cellInfo.data=data+" <img src=\"images/btup.gif\" />";}v_cellInfo.data=v_cellInfo.data+" ("+v_Icp+"%)";v_cellInfo.flagUpDownPicture=true;}v_cellInfo.cell=cell;v_cellInfo.typeUpDown=typeUpDown;v_cellInfo.dataRealOutOfPicture=parseFloat(data);v_cellInfo.classNameNormal=className;v_cellInfo.isPrice=isPrice;v_cellInfo.isSpecial=isSpecial;v_cellInfo.stockSymbol=stocksymbol;l_arrayCellMarketChanged.push(v_cellInfo);}};function DisplayUpdateMarketData(){if(l_flagDisplayUpdateMarketData!=null){clearTimeout(l_flagDisplayUpdateMarketData);l_flagDisplayUpdateMarketData=null;}if(l_flagRowCreating==true){l_flagDisplayUpdateMarketData=setTimeout("DisplayUpdateMarketData()",50);return;}if(l_arrayCellMarketChanged.length==0){l_flagDisplayUpdateMarketData=setTimeout("DisplayUpdateMarketData()",50);return;}var v_cellInfo=new cls_CellInfo();for(var i=0;i<l_arrayCellMarketChanged.length;i++){v_cellInfo=l_arrayCellMarketChanged[i];l_arrayCellMarketChanged.splice(i,1);if(v_cellInfo.flagUpDownPicture==false){if(v_cellInfo.cell.innerHTML!=""&&v_cellInfo.data!=v_cellInfo.cell.innerHTML){v_cellInfo.cell.className="headerInfoValueChange";if(v_cellInfo.isPrice==true){switch(v_cellInfo.typeUpDown){case 1:v_cellInfo.cell.className="headerInfoValueDownChange";break;case 2:v_cellInfo.cell.className="headerInfoValueUpChange";break;}}var v_now=new Date();v_cellInfo.time=v_now.getHours()*60*60+v_now.getMinutes()*60+v_now.getSeconds();l_arrayCellMarketChangedClearColor.push(v_cellInfo);}else{v_cellInfo.cell.className=v_cellInfo.classNameNormal;if(v_cellInfo.isPrice==true){switch(v_cellInfo.typeUpDown){case 1:v_cellInfo.cell.className="headerInfoValueDown";break;case 2:v_cellInfo.cell.className="headerInfoValueUp";break;}}}}else{if(v_cellInfo.cell.innerHTML!=""&&v_cellInfo.dataRealOutOfPicture!=getDataFromInnerHTMLCellPicture(v_cellInfo.cell.innerHTML)){v_cellInfo.cell.className="headerInfoValueChange";if(v_cellInfo.isPrice==true){switch(v_cellInfo.typeUpDown){case 1:v_cellInfo.cell.className="headerInfoValueDownChange";break;case 2:v_cellInfo.cell.className="headerInfoValueUpChange";break;}}var v_now=new Date();v_cellInfo.time=v_now.getHours()*60*60+v_now.getMinutes()*60+v_now.getSeconds();l_arrayCellMarketChangedClearColor.push(v_cellInfo);}else{v_cellInfo.cell.className=v_cellInfo.classNameNormal;if(v_cellInfo.isPrice==true){switch(v_cellInfo.typeUpDown){case 1:v_cellInfo.cell.className="headerInfoValueDown";break;case 2:v_cellInfo.cell.className="headerInfoValueUp";break;}}}}v_cellInfo.cell.innerHTML=v_cellInfo.data;}if(l_flagDisplayUpdateMarketData!=null){clearTimeout(l_flagDisplayUpdateMarketData);l_flagDisplayUpdateMarketData=null;}l_flagDisplayUpdateMarketData=setTimeout("DisplayUpdateMarketData()",50);}function ClearBackGroundColorOfMarketData(){if(l_flagClearBackGroundColorOfMarketData!=null){clearTimeout(l_flagClearBackGroundColorOfMarketData);l_flagClearBackGroundColorOfMarketData=null;}if(l_flagRowCreating==true){l_flagClearBackGroundColorOfMarketData=setTimeout("ClearBackGroundColorOfMarketData()",50);return;}if(l_arrayCellMarketChangedClearColor.length==0){l_flagClearBackGroundColorOfMarketData=setTimeout("ClearBackGroundColorOfMarketData()",50);return;}var v_cellInfo;var v_endTime=0;for(var i=0;i<l_arrayCellMarketChangedClearColor.length;i++){var v_date=new Date();var v_now=v_date.getHours()*60*60+v_date.getMinutes()*60+v_date.getSeconds();v_cellInfo=l_arrayCellMarketChangedClearColor[i];v_endTime=v_now-v_cellInfo.time;if(v_endTime>l_timeout_clearColor){l_arrayCellMarketChangedClearColor.splice(i,1);v_cellInfo.cell.className=v_cellInfo.classNameNormal;if(v_cellInfo.isPrice==true){switch(v_cellInfo.typeUpDown){case 0:v_cellInfo.cell.className="headerInfoValueUnchange";break;case 1:v_cellInfo.cell.className="headerInfoValueDown";break;case 2:v_cellInfo.cell.className="headerInfoValueUp";break;}}}}if(l_flagClearBackGroundColorOfMarketData!=null){clearTimeout(l_flagClearBackGroundColorOfMarketData);l_flagClearBackGroundColorOfMarketData=null;}l_flagClearBackGroundColorOfMarketData=setTimeout("ClearBackGroundColorOfMarketData()",50);};function CreatePanelChooseSymbol(){var theChooseSymbolsTable=document.getElementById("tableChooseSymbols");for(var i=theChooseSymbolsTable.rows.length-1;i>=0;i--)theChooseSymbolsTable.deleteRow(i);if(l_basicObject!=null&&l_basicObject.Items!=null){var index=0;var chooseSymbolNewRow;var chooseSymbolNewCell;for(var itemKey in l_basicObject.Items){if(index%15==0){chooseSymbolNewRow=theChooseSymbolsTable.insertRow(-1);}chooseSymbolNewCell=chooseSymbolNewRow.insertCell(-1);chooseSymbolNewCell.id="tdChoose"+itemKey;chooseSymbolNewCell.className="cellChooseSymbol";chooseSymbolNewCell.innerHTML="<input type=\"checkbox\" class=\"chkChooseSymbol\" id=\"chkChoose"+itemKey+"\" name=\""+itemKey+"\" onClick=\"G('"+itemKey+"'); \"/><a href=\"javascript : O('"+itemKey+"')\">"+itemKey+"</a>";index++;}}};function togglePanelOption(){if(l_flagShowPannelOption==true){HideOption();}else{l_flagShowPannelOption=true;showPanelOption();}};function HideOption(){var pnlOption=document.getElementById("pnlOption");pnlOption.style.display='none';l_flagShowPannelOption=false;var spanOption=document.getElementById("spanOption");spanOption.innerHTML="<img src=\"images/tuychon.gif\" onclick=\"togglePanelOption(); \" style=\"pointer : hand; cursor : pointer; \">";};function showPanelOption(){var chkShowVolumeTime1=document.getElementById("chkShowVolumeTime1");var chkShowVolumeTime2=document.getElementById("chkShowVolumeTime2");var chkShowVolumeTime3=document.getElementById("chkShowVolumeTime3");var chkShowBuyOrderCount=document.getElementById("chkShowBuyOrderCount");var chkShowSellOrderCount=document.getElementById("chkShowSellOrderCount");var chkShowForeignBuy=document.getElementById("chkShowForeignBuy");var chkShowCurrentRoom=document.getElementById("chkShowCurrentRoom");chkShowVolumeTime1.checked=l_flagShowVolumeTime1;chkShowVolumeTime2.checked=l_flagShowVolumeTime2;chkShowForeignBuy.checked=l_flagShowForeignBuy;chkShowVolumeTime3.checked=l_flagShowVolumeTime3;chkShowCurrentRoom.checked=l_flagShowCurrentRoom;var pnlOption=document.getElementById("pnlOption");pnlOption.style.display='block';var spanOption=document.getElementById("spanOption");spanOption.innerHTML="<img src=\"images/an.gif\" onclick=\"togglePanelOption(); \" 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 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");if(l_TypeStockBoard==0)rbtNormal.checked=true;else if(l_TypeStockBoard==1)rbtScrollInfinite.checked=true;else if(l_TypeStockBoard==2)rbtScroll2Directions.checked=true;else rbtPageReplacement.checked=true;txtLineCount.value=l_lineCount;txtScrollInterval.value=l_scrollInterval;txtWaitingTime.value=l_waitingTime;};function Scroll(){if(l_TypeStockBoard==0)return;else if(l_TypeStockBoard==1)l_RowIndexScroll=1;var v_tableQuote=document.getElementById("tableQuote");if(l_TypeStockBoard==1){if(l_divScroll.scrollTop>=l_divScroll.scrollHeight-l_divScroll.clientHeight){if(v_tableQuote.rows.length-2<=l_lineCount)return;var v_replacedRow=v_tableQuote.rows[2];var v_row;for(var i=0;i<l_lineCount;i++){var v_row=v_tableQuote.rows[v_tableQuote.rows.length-1];v_replacedRow.parentNode.insertBefore(v_row,v_replacedRow);v_replacedRow=v_row;}l_divScroll.scrollTop=0;}}else if(l_TypeStockBoard==2){if(l_divScroll.scrollTop<=0&&l_RowIndexScroll==-1){l_RowIndexScroll=1;clearInterval(l_SetScrollIntervalID);l_SetScrollIntervalID=null;l_WaitingScrollTimeOut=self.setTimeout("WaitingScroll()",l_waitingTime);return;}else if(l_divScroll.scrollTop>=l_divScroll.scrollHeight-l_divScroll.clientHeight&&l_RowIndexScroll==1){l_RowIndexScroll=-1;clearInterval(l_SetScrollIntervalID);l_SetScrollIntervalID=null;l_WaitingScrollTimeOut=self.setTimeout("WaitingScroll()",l_waitingTime);return;}}else{}if(l_TypeStockBoard==1||l_TypeStockBoard==2)l_divScroll.scrollTop+=l_RowIndexScroll;else{if(l_RowIndexScroll==-1){l_RowIndexScroll=0;l_divScroll.scrollTop=0;}else{l_RowIndexScroll=l_RowIndexScroll+l_lineCount-1;if(l_RowIndexScroll+2>v_tableQuote.rows.length-1){l_RowIndexScroll=0;l_divScroll.scrollTop=0;}else l_divScroll.scrollTop=v_tableQuote.rows[l_RowIndexScroll+2].offsetTop-2;}}};function WaitingScroll(){if(l_WaitingScrollTimeOut!=null)clearTimeout(l_WaitingScrollTimeOut);l_WaitingScrollTimeOut=null;if(l_SetScrollIntervalID==null)l_SetScrollIntervalID=self.setInterval("Scroll()",l_scrollInterval);};function SetScroll(){var tableFooter=document.getElementById("tableFooter");var tableScrollFooter=document.getElementById("tableScrollFooter");var tableFixedHeader=document.getElementById("tableFixedHeader");var v_tableQuote=document.getElementById("tableQuote");if(l_SetScrollIntervalID!=null){clearInterval(l_SetScrollIntervalID);l_SetScrollIntervalID=null;}if(l_WaitingScrollTimeOut!=null){clearTimeout(l_WaitingScrollTimeOut);l_WaitingScrollTimeOut=null;}SetLinksVisibility();if(l_TypeStockBoard==0){tableFixedHeader.style.display="none";v_tableQuote.rows[0].style.display="";v_tableQuote.rows[1].style.display="";l_divScroll.style.height="100%";tableFooter.style.display="block";tableScrollFooter.style.display="none";l_divScroll.scrollTop=0;}else if(l_TypeStockBoard==1||l_TypeStockBoard==2||l_TypeStockBoard==3){tableFixedHeader.style.display="block";v_tableQuote.rows[0].style.display="none";v_tableQuote.rows[1].style.display="none";tableFooter.style.display="none";tableScrollFooter.style.display="block";l_divScroll.style.height=l_lineCount*22+2+"px";if(l_SetScrollIntervalID==null){if(l_TypeStockBoard==3)l_SetScrollIntervalID=self.setInterval("Scroll()",l_waitingTime);else l_SetScrollIntervalID=self.setInterval("Scroll()",l_scrollInterval);}}};function SetLinksVisibility(){var tdExchangeLink=document.getElementById("tdExchangeLink");var rightLinks=document.getElementById("rightLinks");if(l_TypeStockBoard==0){tdExchangeLink.style.visibility="visible";rightLinks.style.visibility="visible";}else{tdExchangeLink.style.visibility="hidden";rightLinks.style.visibility="hidden";}};function CreateExtraHeaderCells(tableId){var v_tmpTable=document.getElementById(tableId);if(v_tmpTable.rows.length==0)return;var theHeaderRow=v_tmpTable.rows[0];var v_flag=false;if(theHeaderRow.style.display=="none"){v_flag=true;theHeaderRow.style.display="block";}var lastIndex;lastIndex=7;for(var i=theHeaderRow.cells.length-1;i>=lastIndex+1;i--){theHeaderRow.deleteCell(i);}var v_rowTemp;if(l_flagShowHighestPrice==true){v_rowTemp=theHeaderRow.insertCell(-1);v_rowTemp.innerHTML=localizeVN.HighestPrice;v_rowTemp.className="tableHeader6";v_rowTemp.rowSpan=2;l_numberColumnTableQuote++;}if(l_flagShowLowestPrice==true){v_rowTemp=theHeaderRow.insertCell(-1);v_rowTemp.innerHTML=localizeVN.LowestPrice;v_rowTemp.className="tableHeader6";v_rowTemp.rowSpan=2;l_numberColumnTableQuote++;}if(l_flagShowOpenPrice==true){v_rowTemp=theHeaderRow.insertCell(-1);v_rowTemp.innerHTML=localizeVN.OpenPrice;v_rowTemp.className="tableHeader6";v_rowTemp.rowSpan=2;l_numberColumnTableQuote++;}if(l_flagShowSumActionQuantity==true){v_rowTemp=theHeaderRow.insertCell(-1);v_rowTemp.innerHTML=localizeVN.SumActionQuantity;v_rowTemp.className="tableHeader6";v_rowTemp.rowSpan=2;l_numberColumnTableQuote++;}if(l_flagShowVolumeTime1==true){v_rowTemp=theHeaderRow.insertCell(-1);v_rowTemp.innerHTML=localizeVN.VolumeTime1;v_rowTemp.className="tableHeader6";v_rowTemp.rowSpan=2;l_numberColumnTableQuote++;}if(l_flagShowVolumeTime2==true){v_rowTemp=theHeaderRow.insertCell(-1);v_rowTemp.innerHTML=localizeVN.VolumeTime2;v_rowTemp.className="tableHeader6";v_rowTemp.rowSpan=2;l_numberColumnTableQuote++;}if(l_flagShowVolumeTime3==true){v_rowTemp=theHeaderRow.insertCell(-1);v_rowTemp.innerHTML=localizeVN.VolumeTime3;v_rowTemp.className="tableHeader8";v_rowTemp.rowSpan=2;l_numberColumnTableQuote++;}if(l_flagShowForeignBuy==true){v_rowTemp=theHeaderRow.insertCell(-1);v_rowTemp.innerHTML=localizeVN.ForeignBuy;v_rowTemp.className="tableHeader8";v_rowTemp.rowSpan=2;l_numberColumnTableQuote++;}if(l_flagShowCurrentRoom==true){v_rowTemp=theHeaderRow.insertCell(-1);v_rowTemp.innerHTML=localizeVN.CurrentRoom;v_rowTemp.className="tableHeader8";v_rowTemp.rowSpan=2;l_numberColumnTableQuote++;}v_rowTemp=theHeaderRow.insertCell(-1);v_rowTemp.innerHTML=localizeVN.mCK;v_rowTemp.className="tableHeader8";v_rowTemp.rowSpan=2;l_numberColumnTableQuote++;if(v_flag==true)theHeaderRow.style.display="none";};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 OnScroll(){var currentY=GetPageTop();var topY=120;if(l_flagShowPannelOption==true){var pnlOption=document.getElementById("pnlOption");topY+=pnlOption.offsetHeight;}if(l_flagShowPutThrough==true){var pnlPutThrough=document.getElementById("pnlPutThrough");topY+=pnlPutThrough.offsetHeight;}if(currentY>=topY&&l_TypeStockBoard==0){if(l_flagDishplayFloatingHeader==false){l_floatingHeader.style.display='block';l_flagDishplayFloatingHeader=true;}}else{if(l_flagDishplayFloatingHeader==true){l_floatingHeader.style.display='none';l_flagDishplayFloatingHeader=false;}}};function toggleCheckAll(){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 OnRowChecked(StockSymbol){var v_checkbox=document.getElementById("chk"+StockSymbol);var v_row=document.getElementById("tr"+StockSymbol);var v_tableQuote=document.getElementById("tableQuote");var v_tableFloatingHeader=document.getElementById("tableFloatingHeader");var v_cellIndex;var v_replacedRow;var replaceRowFloatingHeader;if(v_checkbox.checked==true){var movedPosition=l_NumberRowChecked+l_headerRowCount;if(l_flagShowSymbolSelectedOnTop==true){v_replacedRow=v_tableQuote.rows[movedPosition];v_replacedRow.parentNode.insertBefore(v_row,v_replacedRow);if(Sys.Browser.name=="Microsoft Internet Explorer"){if(Sys.Browser.version<=6)v_checkbox.checked=true;}selectedSymbolList.push(StockSymbol);for(var i=0;i<unselectedSymbolList.length;i++){if(unselectedSymbolList[i]==StockSymbol){unselectedSymbolList.splice(i,1);break;}}}l_NumberRowChecked++;}else{for(var i=0;i<selectedSymbolList.length;i++){if(selectedSymbolList[i]==StockSymbol){selectedSymbolList.splice(i,1);break;}}var movedPosition=-1;for(var i=0;i<unselectedSymbolList.length;i++){if(unselectedSymbolList[i]>StockSymbol){unselectedSymbolList.splice(i,0,StockSymbol);if(l_flagShowSymbolSelectedOnTop==true){movedPosition=l_NumberRowChecked+l_headerRowCount+i;v_replacedRow=v_tableQuote.rows[movedPosition];v_replacedRow.parentNode.insertBefore(v_row,v_replacedRow);}break;}}l_NumberRowChecked--;}createCookie("selectedSymbolList",selectedSymbolList,1000);};function GetBasicObject(){if(l_StartRequestTimeOutID!=null){clearTimeout(l_StartRequestTimeOutID);l_StartRequestTimeOutID=null;}StockBoard.Service.StockBoardService.GetStockBoardBasicOject();};function ShowFloatingHeaderIE6(){var currentY=GetPageTop();var topY=120;if(l_flagShowPannelOption==true){var pnlOption=document.getElementById("pnlOption");topY+=pnlOption.offsetHeight;}if(l_flagShowPutThrough==true){var pnlPutThrough=document.getElementById("pnlPutThrough");topY+=pnlPutThrough.offsetHeight;}if(currentY>=topY){l_floatingHeader.style.top=currentY;if(l_flagDishplayFloatingHeader==false){l_floatingHeader.style.display='block';l_flagDishplayFloatingHeader=true;}}else{if(l_flagDishplayFloatingHeader==true){l_floatingHeader.style.display='none';l_flagDishplayFloatingHeader=false;}}};function ChangeCellbgColorOnMouseOver(){if(l_flagRowCreating==true)return;var v_cell;l_rowID=this.id.substring(2);for(var i=0;i<this.cells.length;i++){cell=this.cells[i];cell.style.backgroundColor=l_mouseOverBackColor;}};function ChangeCellbgColorOnMouseOut(){if(l_flagRowCreating==true)return;l_rowID="";var cell;var symbol=this.id.substring(2);var isChecked=false;if(l_TypeStockBoard==0){var checkbox=document.getElementById("chk"+symbol);isChecked=checkbox.checked;}var row=document.getElementById("tr"+symbol);for(var i=0;i<row.cells.length;i++){cell=this.cells[i];switch(i){case 0:if(isChecked==true)cell.style.backgroundColor=l_bgColorLever3;else if(row.rowIndex%2==0)cell.style.backgroundColor=l_bgColorLevel1;else cell.style.backgroundColor=l_bgColorLevel2;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(isChecked==true)cell.style.backgroundColor=l_bgColorLever3;else if(row.rowIndex%2==0)cell.style.backgroundColor=l_bgColorLevel1;else cell.style.backgroundColor=l_bgColorLevel2;break;case 1:case 2:case 3:case 10:case 11:case 12:case 19:case 20:if(isChecked==true)cell.style.backgroundColor=l_bgColorLevel5;else if(row.rowIndex%2==0)cell.style.backgroundColor=l_bgColor_tran_san_tc;else cell.style.backgroundColor=l_bgColorLevel4;break;case 21:if(isChecked==true)cell.style.backgroundColor=l_bgColorLevel5;else if(row.rowIndex%2==0)cell.style.backgroundColor=l_bgColor_tran_san_tc;else cell.style.backgroundColor=l_bgColorLevel4;break;default:if(isChecked==true)cell.style.backgroundColor=l_bgColorLevel2;else if(row.rowIndex%2==0)cell.style.backgroundColor=l_bgColorLevel1;else cell.style.backgroundColor=l_bgColorLevel2;break;}}};function ShowPutThrough(){var pnlOption=document.getElementById("pnlPutThrough");pnlOption.style.display='block';l_flagShowPutThrough=true;GetPutThroughObject();l_flagIntervalGetPutThroughObject=self.setInterval("GetPutThroughObject()",10*1000);};function TogglePutThrough(){if(l_flagShowPutThrough==true)HidePutThrough();else ShowPutThrough();};function HidePutThrough(){var pnlOption=document.getElementById("pnlPutThrough");pnlOption.style.display='none';l_flagShowPutThrough=false;self.clearInterval(l_flagIntervalGetPutThroughObject);l_flagIntervalGetPutThroughObject=null;};function GetPutThroughObject(){StockBoard.Service.StockBoardService.GetHosePutThroughObject();};function DeletePutThroughTable(pTable){for(var i=pTable.rows.length-1;i>=0;i--){if(i>=2)pTable.deleteRow(i);}};function UpdateCellPutThroughTable(cell,data,isPrice,pBasicItemInfo){newCell.className="normalPrice";cell.innerHTML=data;if(isPrice==true&&pBasicItemInfo!=null){var fdata=parseFloat(data);if(fdata==pBasicItemInfo.CeilingPrice){cell.className="cellCeiling"}else if(fdata==pBasicItemInfo.FloorPrice){cell.className="cellFloor"}else if(fdata>pBasicItemInfo.ReferencePrice){newCell.className="upPrice"}else if(fdata<pBasicItemInfo.ReferencePrice){newCell.className="downPrice"}else{newCell.className="unchangePrice"}}}function UpdatePutThroughTable(pTable,dataList){var item;var v_newRow;var v_newCell;var v_Fvalue;var v_FArrayValue;var v_basicItem;var v_basicValueArray;var v_basicItemInfo;for(var iRun=0;iRun<dataList.length;iRun++){v_Fvalue=dataList[iRun];v_FArrayValue=v_Fvalue.split(";");if(l_basicObject!=null){v_basicItem=l_basicObject.Items[v_FArrayValue[0]];v_basicValueArray=v_basicItem.V.split(";");v_basicItemInfo=new cls_basicItemInfo();v_basicItemInfo.CeilingPrice=v_basicValueArray[0];v_basicItemInfo.FloorPrice=v_basicValueArray[1];v_basicItemInfo.ReferencePrice=v_basicValueArray[2];}else{v_basicItemInfo=null;}newRow=pTable.insertRow(-1);newRow.style.height="19px";newCell=newRow.insertCell(-1);newCell.className="cellCode";newCell.innerHTML=v_FArrayValue[0];newCell=newRow.insertCell(-1);UpdateCellPutThroughTable(newCell,v_FArrayValue[1],true,v_basicItemInfo);newCell=newRow.insertCell(-1);newCell.innerHTML=v_FArrayValue[2];newCell.className="normalVol";}};function searchMatchCode(){if(typedString.length>0){var g=document.getElementById("tableQuote");var row;typedString=typedString.toUpperCase();for(var i=0;i<g.rows.length;i++){row=g.rows[i];if(row.id.substring(2).indexOf(typedString)==0){if(l_objHighlightRow!=null){UnHighlight(l_objHighlightRow);l_objHighlightRow=null;}Highlight(row);l_objHighlightRow=row;window.scrollTo(0,row.offsetTop);break;}}typedString="";}};function KeyPress(e){var v_code;var v_letter;v_code=(document.all)?e.keyCode:e.which;v_letter=String.fromCharCode(v_code);typedString+=v_letter;if(typedString.length>0){self.clearTimeout(l_flagTimeOutKeypressId);l_flagTimeOutKeypressId=self.setTimeout("searchMatchCode()",keypressDelayTime);}};function OnMouseOverQuote(){if(l_flagRowCreating==true)return;if(new Date()-latestTime<=500)return;if(l_objHighlightRow!=null)UnHighlight(l_objHighlightRow);Highlight(this);l_objHighlightRow=this;};function OnMouseOutQuote(){if(l_flagRowCreating==true)return;UnHighlight(this);};function Highlight(row){var cell;l_rowID=row.id.substring(2);for(var i=0;i<10;i++){cell=row.cells[i];cell.style.backgroundColor=mouseOverBackColor;}};function UnHighlight(row){l_rowID="";var symbol=row.id.substring(2);var isChecked=false;if(l_TypeStockBoard==0){var checkbox=document.getElementById("chk"+symbol);if(checkbox==null)return;isChecked=checkbox.checked;}var cell;for(var i=0;i<10;i++){cell=row.cells[i];switch(i){case 0:if(l_flagShowSymbolSelectedOnTop==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 6:case 7:case 8:case 9:case 13:case 14:case 15:case 16:case 17:case 18:case 26:case 27:case 28:case 29:case 30:if(l_flagShowSymbolSelectedOnTop==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:case 21:case 22:case 23:case 24:case 25:if(l_flagShowSymbolSelectedOnTop==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:break;default:if(l_flagShowSymbolSelectedOnTop==false&&isChecked==true)cell.style.backgroundColor=backColor1SelectedAlt;else if(row.rowIndex%2==0)cell.style.backgroundColor=backColor1Alt;else cell.style.backgroundColor=backColor1AltR2;break;}}};function log(message){if(!log.window_||log.window_.closed){var win=window.open("",null,"width=400,height=200,"+"scrollbars=yes,resizable=yes,status=no,"+"location=no,menubar=no,toolbar=no");if(!win)return;var doc=win.document;doc.write("<html><head><title>Debug Log</title></head>"+"<body></body></html>");doc.close();log.window_=win;}var logLine=log.window_.document.createElement("div");var v_date=new Date();logLine.appendChild(log.window_.document.createTextNode(v_date.getMinutes()+":"+v_date.getSeconds()+":"+v_date.getMilliseconds()+":"+message));log.window_.document.body.appendChild(logLine);log.window_.scrollBy(0,500);}