text = "Baby.Caelyn.pictures.now.online!!!";
word = text.split('.');
ix = -1;		//letter count
jx = 0;			//which word in array is to be spelled
start = 0;		//variable to hold cycles of the blink
scount = 0;		//variable to hold cycles of the mispell

function checkIt() 
{
	with(document.all.anima) 
	{
		if(innerText.charAt(innerText.length-1) == "_") 
		{
			innerText = innerText.substring(0, innerText.length - 1);
			return true;
		}
		else 
		{
			innerText = innerText + "_";
			return false;
		}
	}
}

function blinkfor(count, timing) 
{
	with(document.all.anima) 
	{
		if(start < count) 
		{
			if(checkIt()) 
			{
				start++;
			}
			mistake = 'blinkfor('+count+','+timing+')';
			setTimeout('eval(mistake)', timing);
		}
		else 
		{
			start = 0;
			ix++;
			call_It();
		}
	}
}

function mispell(offset,correction) 
{
	with(document.all.anima) 
	{
		if(scount < offset) 
		{
			if(!checkIt()) 
			{
				innerText = innerText.substring(0, innerText.length-2) + "_";
				scount++;
			}
			mistake = 'mispell(' + offset + ', "' + correction + '")';
			setTimeout("eval(mistake)", 250);
		}
		else 
		{
			if(correction == '' && scount == offset ) 
			{
				ix = ix - offset;
				scount++;
			}
			if(offset > 0) 
			{
				if(checkIt()) 
				{
					innerText += correction.charAt(correction.length - offset) + "_";
					offset--;
				}
				mistake = 'mispell(' + offset + ',"' + correction + '")';
				setTimeout("eval(mistake)", 250);
			}
			else 
			{
				scount = 0;
				jx++;
				innerText = innerText.substring(0, innerText.length - 1);
				call_It();
			}
		}
	}
}

function spellit(string) 
{
	with(document.all.anima) 
	{
		if(ix <= string.length) 
		{
			if(string.charAt(ix) == '/') 
			{
				NumErrs = string.charAt(ix + 1);
				NewLets = string.substring(ix + 2, ix + NumErrs);
				mispell(NumErrs,NewLets);
			}
			else if(ix <= string.length - 1) 
			{
				ix++;
				innerText = string.substring(0,ix) + "_";
				mistake = 'spellit("' + string + '")';
				setTimeout("eval(mistake)", 250);
			}
			else 
			{
				innerText = string.substring(0, ix);
				jx++;
				call_It();
			}
		}
	}
}

function call_It() 
{
	with(document.all) 
	{
		if(ix == -1)
		{
			blinkfor(4, 300);
		}
		else if(jx <= word.length - 1) 
		{
			spellit(anima.innerText + " " + word[jx]);
		} 
		else 
		{
			ix = -1;		//letter count
			jx = 0;			//which word in array is to be spelled
			start = 0;		//variable to hold cycles of the blink
			scount = 0;		//variable to hold cycles of the mispell
			anima.innerText = "";
			blinkfor(0,300);
		}
	}
}

