//Latest News Script
//Sophisticated news ticker. Simple Typewriter style that allows links and text!

//<!-- arrays of text or links -->
var myTickerText = new Array();
var myTickerLinks = new Array();
//Editieren Sie hier die Texte und Links
myTickerText[0]  = "Ständige Präsentation mit wechselnden Objekten in der Galerie Bilderbücher, Buchhandlung Mayr, Schrannenplatz in Amberg"; 

myTickerText[1]  = "Besuchen Sie meine neue Rubrik  - Filztaschen - hier klicken";
myTickerLinks[1] ="http://www.atelier-monika-stich.de/index_filztaschen.html"

myTickerText[2] = "Viele neue Barhocker finden sie in der Rubrik Barhocker"
myTickerLinks[2] = "http://www.atelier-monika-stich.de/index_barhocker.html"

//need more. Just add them with the next number like below but without the slashes
//myTickerText[5] = "This is my News With Link 5";
//myTickerLinks[5] = "http://www.anotherlink.com";

var Inc = new Number(0);      // used to itterate through array
var theCharacterTimeout = 60; //pause tween chars
var theStoryTimeout = 3000;   //pause at end of line
var theEnumerator = 0;        //used to iterate through the individual strings


// --- Run the ticker

function start()
{
doTheTicker();
}



function doTheTicker()
{
if(Inc > (myTickerText.length - 1)){Inc=0;}

   if((theEnumerator % 2) == 1)
   {
      writeTicker("_",Inc);
   }
   else
   {
      writeTicker("*",Inc);
   }

   theEnumerator++;
	
   if(theEnumerator == myTickerText[(Inc)].length+1)
   {
      writeTicker("",Inc);
      theEnumerator = 0;
      Inc++;
      setTimeout('doTheTicker()', theStoryTimeout); 
          
   }
   else
   {
      setTimeout('doTheTicker((Inc))', theCharacterTimeout);
   }
}

function writeTicker(aWidget,vn)
{
   
   var hrefstr = new String();
   var endhrefstr = new String();
   
   hrefstr = "<a href='" + myTickerLinks[vn] + "'>";
   endhrefstr = "</a>";
   document.all.hottext.innerHTML = hrefstr + myTickerText[vn].substring(0,theEnumerator) + aWidget + endhrefstr;
}
