<PROPERTY NAME="textoffset1"/>
<PROPERTY NAME="textoffset2"/>
<PROPERTY NAME="speed"/>
<PROPERTY NAME="letters1"/>
<PROPERTY NAME="letters2"/>
<PROPERTY NAME="pause"/>
<ATTACH EVENT="ondocumentready" HANDLER="waveIt"/>

<script language="jscript" src="inc/z_HighlightTopic/z_timer.js"></script>
<script language="jscript">
var basecolor=element.style.color;
var basebkcolor=element.style.backgroundColor;
var baseoffset=element.style.pixelTop;
var n=0;
var _timer=new Timer(speed);
var message;
var direct=1;

function waveIt() {
	var waveStr;
	
	message = element.innerText;
	waveStr="";
	for (m=0;m<message.length;m++)
		waveStr=waveStr + "<span id='wavelight"+m+"' style='position:relative;top:" + baseoffset + ";color:" + basecolor + ";background-color:" + basebkcolor + ";'>" + message.charAt(m) + "</span>";
	element.innerHTML=waveStr;
	_timer.ontimer = function () {wave();};
	_timer.start();
}

function crossref(number) {
	var crossobj=element.children[number];
	return crossobj;
}

function wave() {
	if(direct>0) {
		if (n<=message.length-1) crossref(n).style.pixelTop=textoffset1;
		if (n>parseInt(letters1)-1) if(n-parseInt(letters1)<=message.length-1) crossref(n-parseInt(letters1)).style.pixelTop=textoffset2;
		if (n>(parseInt(letters1)+parseInt(letters2))-1) if(n-parseInt(letters1)-parseInt(letters2)<=message.length-1) crossref(n-parseInt(letters1)-parseInt(letters2)).style.pixelTop=baseoffset;
		if (n<message.length-1+parseInt(letters1)+parseInt(letters2))
			n++;
		else {
			direct=-1;
			n=message.length-1;
		}
	} else {
		if (n>=0) crossref(n).style.pixelTop=textoffset1;
		if (n<message.length-parseInt(letters1)) if(n+parseInt(letters1)>=0) crossref(n+parseInt(letters1)).style.pixelTop=textoffset2;
		if (n<message.length-(parseInt(letters1)+parseInt(letters2))) if(n+parseInt(letters1)+parseInt(letters2)>=0) crossref(n+parseInt(letters1)+parseInt(letters2)).style.pixelTop=baseoffset;
		if (n>-parseInt(letters1)-parseInt(letters2))
			n--;
		else {
			n=0;
			direct=1;
			_timer.stop();
			_timer = new Timer(pause);
			_timer.ontimer = function () {_timer.stop();_timer = new Timer(speed);_timer.ontimer = function () {wave();};_timer.start();}
		}
	}
	_timer.start();
}
</script>
