﻿        function ShowPublicationData(DataArgs) {
           // RowFontFamily, RowFontSize,AltRowBackgroundColor
           // call this function from <body onload event>
           var PublicationDateSpan = document.getElementById("PublicationDateSpan");
           var TransactionDateSpan = document.getElementById("TransactionDateSpan");
           PublicationDateSpan.innerHTML = PublicationDate; //from DailyPrices.txt
           TransactionDateSpan.innerHTML = TransactionDate; //from DailyPrices.txt
           var FootnoteTagSpanStyle = document.getElementById("FootnoteTag").style;
           var FootnoteRowStyle = document.getElementById("FootnoteRow").style;
           var FootnoteTextSpan = document.getElementById("FootnoteText");
           if (NeedsFootnote)
           {
                FootnoteTagSpanStyle.display = "inline-block";
                FootnoteRowStyle.display = "inline-block";
                FootnoteTextSpan.innerHTML = Footnote;        
           }
           else
           {
                FootnoteTagSpanStyle.display = "none";
                FootnoteRowStyle.display = "none";
                FootnoteTextSpan.innerHTML = "";
           }
           var MyRowData;
           var RowStyle;
           var tr; // tableRow 
           var td; // table data
           var IsAltRow = false;
           var Tbody = document.getElementById("IndexData");
           // This is where the data table gets drawn
           for (var TickerNum = 0; TickerNum < PublicationValues.length; TickerNum++)
           {
               MyRowData = PublicationValues[TickerNum];
               tr = Tbody.insertRow(Tbody.rows.length);
               td=tr.insertCell(tr.cells.length);
               td.innerHTML = MyRowData.MSA;
               td=tr.insertCell(tr.cells.length);
               td.innerHTML = MyRowData.MSACode
               td.align = "center";
               td=tr.insertCell(tr.cells.length);
               td.innerHTML = MyRowData.OneDay
               if (MyRowData.OneDay != "N/A") {td.innerHTML = "$" + td.innerHTML}   
               td.align = "right";
               td=tr.insertCell(tr.cells.length);
               td.innerHTML = "$" + MyRowData.SevenDay
               td.align = "right";
               td=tr.insertCell(tr.cells.length);
               td.innerHTML = "$" + MyRowData.TwentyEightDay
               td.align = "right";
               tr.style.fontFamily = DataArgs.RowFontFamily; // can change font "Verdana"
               tr.style.fontSize = DataArgs.RowFontSize; // can change font size "10pt"
               if (IsAltRow) {
                    tr.style.backgroundColor = DataArgs.AltRowBackgroundColor; // can change background color "#c5d9f1"
               }
               IsAltRow = !IsAltRow;
           }
        }        

