if(document.all){
	blinker('BlinkMessage');
}
var content = document.getElementById("CONTENT").innerHTML;
//content = content.replace(/<BR>|<BR>/ig, "<BR>prompt# ./ ");
var cchar = '';
var skipWords = 3;
var cword = 1;

document.getElementById("CONTENT").innerHTML = '';
document.getElementById('CONTENT').style.visibility = 'visible';
document.getElementById("CONTENT").innerHTML = content.substring(0, 1);
if(content.substring(0, 1) == '<'){
	cchar = '<';
}

typeWriter(0);
//alert('removing message');

function typeWriter(pos){
	var newcontent = document.getElementById("CONTENT").innerHTML;
//	alert(newcontent);
	if(pos < content.length){
		if(newcontent.length > 1000){
			document.getElementById("CONTENT").innerHTML = content;
			setTimeout("typeWriter("+(content.length)+")", 5);
		}else{
			++pos;
			if(pos < content.length && cchar == '<'){
				while(pos < content.length && (content.substring(pos, (pos+1)) != '>')){
					++pos;
				}
				if(content.substring(pos, (pos+1)) == '>'){
					cchar = '>';
				}else if(content.substring(pos, (pos+1)) == '<'){
					cchar = '<';
				}else{
					cchar = '';
				}
				++pos;
				if(content.substring(pos, (pos+1)) == '>'){
					cchar = '>';
				}else if(content.substring(pos, (pos+1)) == '<'){
					cchar = '<';
				}else{
					cchar = '';
				}
			}
			if(cchar == ''){
				while(pos < content.length && (content.substring(pos, (pos+1)) != ' ' || content.substring(pos, (pos+1)) == '<')){
					++pos;
				}
				if(content.substring(pos, (pos+1)) == '>'){
					cchar = '>';
				}else if(content.substring(pos, (pos+1)) == '<'){
					cchar = '<';
				}else{
					cchar = '';
				}
			}
			if(content.substring(pos, (pos+1)) == '>'){
				++pos;
			}
			if(content.substring(pos, (pos+1)) == '<'){
				cchar = '<';
			}else{
				cchar = '';
			}
			if(skipWords != cword && pos < content.length){
				++cword;
	//			alert(cword);
				typeWriter(pos);
			}else{
				cword = 1;
				document.getElementById("CONTENT").innerHTML = (content.substring(0, pos))+"<BLINK>_</BLINK>";
				setTimeout("typeWriter("+pos+")", 1);
			}
		}
	}else{
		document.getElementById("CONTENT").innerHTML = (content.substring(0, pos));
		document.getElementById("MESSAGE").style.display = 'none';
		if(document.all){
			blinker('Blink');
		}
	}
}
