var toptickercontent=new Array();
toptickercontent[0]='<a style="color: #fff; text-decoration: none;" href="if_under_investigation.asp">IF UNDER INVESTIGATION: If law enforcement has contacted you regarding a criminal charge, getting a defense attorney now may prevent criminal charges from being filed.</a>';
toptickercontent[1]='<a style="color: #fff; text-decoration: none;" href="if_arrested.asp">IF ARRESTED: Avoid the common mistakes that can lead to more serious consequences.</a>';
toptickercontent[2]='<a style="color: #fff; text-decoration: none;" href="sex_offense_consequences.asp">CONSEQUENCES OF SEX CRIMES: Be sure you understand the consequences of a sex crime conviction before considering a plea bargain.</a>';
var pause = false; // Boolean to trigger pause on mouseover event
var t1a,t2a,t3a; // Timer ID variables.
var icnt = 0; // Outside loop counter
var currentChar=1; //Inside loop counter and pointer into characters of the lines.

function typer(){
clearTimeout(t1a); //clear all timing
clearTimeout(t2a); //clear all timing
clearTimeout(t3a); //clear all timing

// The next code checks for mouseover pause and completes the line instantly if true.
if(pause && currentChar==1){return;}
else if (pause){currentChar=toptickercontent[icnt].length-1;}

// The next code fast fills html tags by rapidly moving to the closing >.
if(toptickercontent[icnt].charAt(currentChar-1)=='<'){
	while (toptickercontent[icnt].charAt(currentChar-1)!='>'){
		currentChar++;
		if (currentChar>toptickercontent[icnt].length){
		toptickercontent[icnt]=toptickercontent[icnt]+'>'; // correct for missing > overflow condition
		currentChar--;
		}
	}
}
// The next code types the textual part of the line and indexes to the next line
      document.getElementById('toptick1').innerHTML=toptickercontent[icnt].substr(0, currentChar);
      currentChar++
      if (currentChar>toptickercontent[icnt].length)  // Are we at the last character in the line?
      {
        icnt++;
        if (icnt==toptickercontent.length){  // Are we at the last line in the array?
        icnt=0;
        }
        currentChar=1;
        t1a=setTimeout("typer()", 4900);  // This is the pause between lines in ms   
      }
      else
      {
     pause=false; 
     t2a=setTimeout("typer()", 20);  // This is the pause between typed characters in ms
      }
}
//
  // This runs it!
