var UpStreamColour = "#87ab8f" ; var DownStreamColour = "#beb574" ; var UpDownStreamOverlapColour = "#d95963" ; var NegativeValueColour = "#7b7bc1" ; function DisableEnableTable( TableId, CheckStatus) { if(CheckStatus == true) { document.getElementById(TableId).bgColor = "lightgrey"; } else { document.getElementById(TableId).bgColor = ""; } } var offset = 1; var BandNumber = 1; var USBandNumber = 1; var DSBandNumber = 1; function InsertRow( Direction, StartVal , EndVal ) { var CreateNewRow = 1; var Number = 0; var UStd = ""; var DStd = ""; if( Direction == "UpStream") { if( BandNumber > USBandNumber) { Number = USBandNumber; } else { Number = BandNumber; USBandNumber++; } UStd = " " + " " + " " + " " + " " + " " + "" + "
Band " + Number +"
" ; DStd = " "; if( BandNumber > USBandNumber) { CreateNewRow = 0; document.getElementById("USBand" + Number).innerHTML = UStd ; USBandNumber++; } } else { if( BandNumber > DSBandNumber) { Number = DSBandNumber; } else { Number = BandNumber; DSBandNumber++; } DStd = " " + " " + " " + " " + " " + " " + "" + "
Band " + Number +"
" ; UStd = " "; if( BandNumber > DSBandNumber) { CreateNewRow = 0; document.getElementById("DSBand" + Number).innerHTML = DStd ; DSBandNumber++; } } if (CreateNewRow == 1) { var xx=document.getElementById('BandInfoTable'); var x=xx.insertRow(Number + offset); var y=x.insertCell(0); var z=x.insertCell(1); y.innerHTML="
234
" z.innerHTML="
234
" var td = " " ; y.id = "USBand" + Number; z.id = "DSBand" + Number; y.width = "50%"; z.width = "50%"; y.innerHTML = UStd ; z.innerHTML = DStd ; BandNumber++; } } function ShowRawValuesInTable(doc, Title, UpSize, UpValueList , DownSize, DownValueList , base ) { var MaxSize = 0; if( UpSize > DownSize) { MaxSize = UpSize; } else { MaxSize = DownSize; } var table = "" ; table += ""; table += " " ; table += " "; table += " "; table += "" ; table += " " ; table += "" ; table += "" ; table += "" ; var tr=""; doc.write(table); for (i = 0; i < MaxSize; i +=10 ) { tr = "" ; tr += "" ; tr += "" ; tr += "" ; tr += "" ; doc.write(tr); } doc.write("
UpStream " + Title + " DownStream " + Title + "
Tones
12345678910
12345678910
" + i + " " ; for (j = 0; j < 10; j++ ) { UpValue = parseInt(UpValueList[i+j], base); DownValue = parseInt(DownValueList[i+j], base); if( ( UpValue > 0) && ( ( DownValue > 0) || ( DownValue < 0) ) ) { tr += " " ; } else if( UpValue < 0) { tr += " " ; } else { tr += " " ; } } tr += "
" + UpValue + " " + UpValue + " " + UpValue + "
" ; for (j = 0; j < 10; j++ ) { UpValue = parseInt(UpValueList[i+j], base); DownValue = parseInt(DownValueList[i+j], base); if( ( DownValue > 0) && ( ( UpValue > 0) || ( UpValue < 0) ) ) { tr += " " ; } else if( DownValue < 0) { tr += " " ; } else { tr += " " ; } } tr += "
" + DownValue + " " + DownValue + " " + DownValue + "
"); } function doCompleteBarGraph( doc, yTitle, xTitle, yDiff, xDiff, yFactor, xFactor, yMaxSize, UpSize, UpValueList , DownSize, DownValueList , base ) { var xMaxSize = 0; if( UpSize > DownSize) { xMaxSize = UpSize ; } else { xMaxSize = DownSize; } xFactorSize = xMaxSize* xFactor ; yFactorSize = yMaxSize* yFactor ; doBarGraphTop(doc, yTitle, xFactorSize); doBarGraphTableStart(doc, yTitle, xFactorSize , yFactorSize); doLeftBar(doc, "black", yMaxSize, yDiff, yFactor); doAllBarsWrite(doc, yFactor, xFactor, yMaxSize, UpSize, UpValueList , DownSize, DownValueList , base ); doBarGraphTableEnd(doc ); doHorizantalBar(doc, "black", (xFactorSize+ xDiff),3 ); doAxisWrite(doc, xTitle, xDiff, xMaxSize, xFactor ); } function doBarGraphColorInfo(doc, color,Title) { var table = " "; table = " " ; table += " " ; table += " "; table += " " ; table += "
" + Title + "
" ; doc.write(table); } function doBGColorInfoStart(doc ) { var table = " "; table = " " ; table += " " ; table += " "; doc.write(table); } function doBGColorInfo(doc, color,Title,width) { var td = " "; td += " "; td += " "; doc.write(td); } function doBGColorInfoEnd(doc, color,Title) { var table = " "; table += " " ; table += "
" + Title + "
" ; doc.write(table); } function doBarGraphTableStart(doc, yTitle, xFactorSize , yFactorSize) { var table = " "; table = ""; doc.write(table); } function doBarGraphTableEnd(doc) { doc.write("
"); } function doBarGraphTop(doc, Title, Size) { var table = " "; var TmpSize = 0; TmpSize = Size +45; table = " " ; table += " " ; table += " "; table += " "; table += " " ; table += "
" + Title+ "
" ; doc.write(table); } function doLeftBar(doc, color, height, diff, mulfactor) { var td = " "; var difffactor = 0 ; var initheight = 0 ; var barheight = 0 ; var loop = 0 ; difffactor = (diff / mulfactor); ActualBarHeight = ( mulfactor * height); initheight = (diff/ 2); loop = ( height / diff ) * mulfactor ; barheight = ActualBarHeight + initheight; td = " " ; for (i=loop; i>=1; i--) { td += ""; } td += ""; td += "
" +(i* difffactor )+"-
"; td += ""; doc.write(td); td = ""; td +="
"; td += ""; doc.write(td); } function doAllBarsWrite(doc, yFactor, xFactor, yMaxSize, UpSize, UpValueList , DownSize, DownValueList , base ) { var UpValue = 0; var DownValue = 0; var xMaxSize = 0; var xFactorSize = 0; var yFactorSize = 0; if( UpSize > DownSize) { xMaxSize = UpSize ; } else { xMaxSize = DownSize; } xFactorSize = xMaxSize* xFactor ; yFactorSize = yMaxSize* yFactor ; var width = 1; if ( xFactor > 1) { width *= xFactor; } var Colour = " "; var Value = 0; for (i = 0; i < xMaxSize; i++) { if ( xFactor < 1) { if( ( i % (1/xFactor) ) != 0) { continue; } } if((UpSize > i) && (DownSize> i) ) { UpValue = parseInt(UpValueList[i], base); DownValue = parseInt(DownValueList[i], base); if( (UpValue < 0) || (DownValue < 0) ) { if(UpValue < DownValue) { Colour = NegativeValueColour; Value = UpValue * -1; } else { Colour = NegativeValueColour; Value = DownValue * -1 ; } } else if( (UpValue != 0) && (DownValue == 0) ) { Colour = UpStreamColour; Value = UpValue ; } else if( (UpValue == 0) && (DownValue != 0) ) { Colour = DownStreamColour; Value = DownValue ; } else if( UpValue > DownValue ) { Colour = UpDownStreamOverlapColour; Value = UpValue ; } else { Colour = UpDownStreamOverlapColour; Value = DownValue ; } } else if(UpSize > i) { UpValue = parseInt(UpValueList[i], base); if( UpValue < 0 ) { Colour = NegativeValueColour; Value = UpValue * -1; } else { Colour = UpStreamColour; Value = UpValue ; } } else { DownValue = parseInt(DownValueList[i], base); if( DownValue < 0 ) { Colour = NegativeValueColour; Value = DownValue * -1; } else { Colour = DownStreamColour ; Value = DownValue ; } } doBarGraphWrite(doc, Colour, ((Value *yFactor) % (yFactorSize +1)), width); } } function doBarGraphWrite(doc, color,height,width) { var td = " "; td += "
"; doc.write(td); } function doHorizantalBar(doc, color,width,height) { var table = " "; var TmpWidth; TmpWidth = width +45; table += "
"; doc.write(table); } function doAxisWrite(doc, xTitle, Gap, Size, xFactor ) { var td = " "; var table = " "; var i; var xFactorSize = Size * xFactor ; var TmpSize = xFactorSize +45 + Gap ; var FactorGap = Gap *(1/xFactor); var loop = Size / FactorGap ; var r_loop = Math.round( loop ) ; if(loop >= r_loop ) { loop = r_loop ; } else { loop = r_loop -1; } var RemainGap = ( (Size - (loop*FactorGap))* xFactor); var MiddlePosition = Math.round(loop/2); table += "" doc.write(table); doc.write(""); td = "" ; doc.write(td); for (i=0; i< loop ;i++) { td = "" ; doc.write(td); } if( (loop*FactorGap) < Size) { td = "" ; doc.write(td); } td = "" ; doc.write(td); doc.write(""); doc.write(""); td = "" ; doc.write(td); for (i=0; i< loop ;i++) { if( i == MiddlePosition ) { td = "" ; doc.write(td); } else { td = "" ; doc.write(td); } } if( (loop*FactorGap) < Size) { td = "" ; doc.write(td); } td = "" ; doc.write(td); doc.write(""); doc.write("
"; td += "
"; td += "
"; td += (i * FactorGap ) ; td += ""; td += " "; td += ""; td += Size ; td += "
"; td += "
"; td += "
"; td += xTitle ; td += ""; td += ""; td += ""; td += "
"); }