var nXPos          =-210;
var nYPos          = 110;
var nWidth         = 90;
var nHeight        = 35;

var nFontSizeMin   = 3;
var nFontSizeMax   = 20;

var strText        = 'Triton Group ';

var fAlpha         = 0.0;

function GetLogoItem(nItem)
{
   return document.getElementById("Logo_" + nItem.toString(16));
}

function InitLogo()
{
   var nLen = strText.length;

   for(var i = 0; i < nLen; i++)
   {
      document.write('<div id="Logo_' + i.toString(16) +
                     '" style="visibility: hidden;">' +
                     strText.charAt(i) + '</div>');

      var oDiv = GetLogoItem(i);

      if(oDiv)
      {
         oDiv.style.position       = "absolute";
         oDiv.style.top            = 0;
         oDiv.style.left           = 0;
         oDiv.style.width          = 640;
         oDiv.style.height         = 14;
         oDiv.style.textAlign      = "center";
         oDiv.style.verticalAlign  = "middle";
         oDiv.style.fontFamily     = "Georgia";
         oDiv.style.fontSize       = "20px";
         oDiv.style.fontWeight     = "bold";
         oDiv.style.color          = "black";
         oDiv.style.cursor         = "default";
      }
   }

   window.setInterval('OnTimer()',15);
}

function OnTimer()
{
   var nLen    = strText.length;
   var dfAlpha = 360 / nLen;

   for(var i = 0; i < nLen; i++)
   {
      var oDiv = GetLogoItem(i);

      if(oDiv)
      {
         var nTop = nYPos + nHeight * Math.sin(fAlpha -
                    i * dfAlpha * Math.PI / 180);

         oDiv.style.top  = nTop;
         oDiv.style.left = nXPos + nWidth * Math.cos(fAlpha -
                           i * dfAlpha * Math.PI / 180);

         oDiv.style.fontSize = ((nTop - nYPos + nHeight) /
                                (2 * nHeight)) * (nFontSizeMax -
                                 nFontSizeMin) + nFontSizeMin;

         oDiv.style.visibility = "visible";
      }
   }

   fAlpha += 0.02;
}
