var i = 0;
var TextNumber = 0;
var TextInput = new Object();
var HelpText="";
var Text = "";
var Speed=300
var WaitSpace=" "
TextInput[0] = "Klikni me!"; // ovdje se piše tekst koji se pojavljuje na dugmetu
TextInput[1] = ":| :) :] :> :D :X";
TotalTextInput =1;
for (var addWait = 0; addWait <= TotalTextInput; addWait++) {
TextInput[addWait]+=WaitSpace;
}
var TimerId
var TimerSet=false;
function startBanner (form) {
if (!TimerSet){
TimerSet=true;
banner();
}
}
function banner() {
Text=rollMessage();
TimerId = setTimeout("banner()", Speed);
document.form2.banner.value=Text;
}
function rollMessage () {
Wait_yn=false;
i++;
var CheckSpace = HelpText.substring(i-1, i);
CheckSpace = "" + CheckSpace;
if (CheckSpace == " ") {
i++;
}
if (i >= HelpText.length+1) {
i=0;
if (TextNumber < TotalTextInput) {
TextNumber++;
}
else {
TextNumber = 0;
}
initBanner();
}
Text = HelpText.substring(0, i);
return (Text);
}
function initBanner() {
Text = TextInput[TextNumber];
HelpText = Text;
startBanner ();
}