<!--

// --- Global variable stuff here
       var theItemCount;
       var theCurrentStory;
       var theCurrentLength;
       var theStorynotizie;

       var theCharacterTimeout;
       var theStoryTimeout;
       var theBrowserVersion;
       var theWidgetOne;
       var theWidgetTwo;
       var theSpaceFiller;
       var theLeadString;
       var theStoryState;
var theBrowserAgent;
var isIE;

// --- Check for old browser and force applet
theBrowserAgent = navigator.userAgent.toLowerCase();
theBrowserVersion = parseInt(navigator.appVersion);
isIE =  ((theBrowserAgent.indexOf("msie") != -1) && (theBrowserAgent.indexOf("opera") == -1));

if (theBrowserVersion < 4 || ! isIE)
{
//location.href = "/ticker/ticker_applet.rhs.htm";
}

// --- Only run for V4 browsers (check browser again here - some old browsers won't do this inline)
function startNews()
{
theBrowserAgent = navigator.userAgent.toLowerCase();
theBrowserVersion = parseInt(navigator.appVersion);
isIE =  ((theBrowserAgent.indexOf("msie") != -1) && (theBrowserAgent.indexOf("opera") == -1));
if (theBrowserVersion < 4 || ! isIE)
          {
           //  location.href = "/ticker/ticker_applet.rhs.htm";
             return;
          }

// ------ Check and fixup incoming data block
          if(!document.body.children.incoming.children.properties)
          {
             document.all.incoming.innerHTML = "<DIV ID=\"properties\"><DIV ID=\"itemcount\">1</DIV></DIV><DIV ID=\"stories\"><DIV ID=\"1\"><DIV ID=\"notizie\"><DIV ID=\"UrlLink\"></DIV></DIV></DIV>";
          }

// ------ Set up initial values
          theCharacterTimeout =   50;
          theStoryTimeout     = 5000;
          theWidgetOne        =  "_";
          theWidgetTwo        =  "-";

// ------ Set up initial values
          theStoryState       = 1;
          theItemCount        = document.body.children.incoming.children.properties.children.itemcount.innerText;
          theCurrentStory     = -1;
          theCurrentLength    = 0;
          theLeadString       = "<div class=\"news\">LE CLASSIFICHE:</div>";
          theSpaceFiller      = "";
// ------ Begin the ticker       
          runTheTicker();
       }

// --- The basic rotate function
       function runTheTicker()
       {
          if(theStoryState == 1)
          {
             setupNextStory();
          }

          if(theCurrentLength != theStorynotizie.length)
          {
             drawStory();
          }
          else
          {
             closeOutStory();
          }
       }

// --- Index to next story
       function setupNextStory()
       {
          theStoryState = 0;
          theCurrentStory++;
          theCurrentStory = theCurrentStory % theItemCount;
          theStorynotizie = document.body.children.incoming.children.stories.children[theCurrentStory].children.notizie.innerText;
          theCurrentLength = 0;
       }

// --- Draw a teletype line
       function drawStory()
       {
          var myWidget;
          if((theCurrentLength % 2) == 1)
          {
             myWidget = theWidgetOne;
          }
          else
          {
             myWidget = theWidgetTwo;
          }
          document.all.hottext.innerHTML = theLeadString + theStorynotizie.substring(0,theCurrentLength) + myWidget + theSpaceFiller;
          theCurrentLength++;
          setTimeout("runTheTicker()", theCharacterTimeout);
       }

// --- Finalise the item
       function closeOutStory()
       {
          document.all.hottext.innerHTML = theLeadString + theStorynotizie + theSpaceFiller;
          theStoryState = 1;
          setTimeout("runTheTicker()", theStoryTimeout);
       }
   
       
//-->