var htmlstr = "", flag=true, imgflag=true, keyd=1, speed=5, wait=3000, temp=0, height=160, amount=32;
var messages=new Array(), startPanel=0, n_panel=0, i=0, j=0, count=1;

function startText() {
  for (i=0; i<messages.length; i++) insertText(i);
  if(messages.length<2) {
	flag=false;
	temp=0;
  }
  window.setTimeout("scroll()",wait);
 //)
}
function scroll() {
  if (keyd && flag) {
	for (i=0;i<messages.length;i++) {
	  temp++;
	  tmp = document.getElementById('scroll_area'+i).style;
	  tmp.top = parseInt(tmp.top)-speed;
	  if (parseInt(tmp.top) <= height*(-1)) {
		tmp.top = height*(messages.length-1);
	  }
	  if (temp>(amount-1)*messages.length) {
		flag=false;
		temp=0;
		window.setTimeout("flag=true;temp=0;imgflag=true;",wait);
	  }
	}
  }
  window.setTimeout("scroll()",1);
}
function insertText(i) {
  htmlstr='<div style="left: 1px; width: 720px;  position: absolute;  top: '+(height*i)+'px" id="scroll_area'+i+'" >\n';
  htmlstr+=messages[i]+'\n'+'</div>\n';
  document.write(htmlstr);
}