I've tested this typewriter script in the past, it worked great, and I want to use it on one of my sites - but I can't find a working example or any instructions, and I haven't been able to track it down online.

Can anyone figure out how it works by simply looking at the script?

var i_xph=0,x_xph,t_xph;
function typeWriter(){
var intv,args= typeWriter.arguments;
if(i_xph<1){ var obj = args[0];speed = args[1];
t_xph = document.getElementById(obj).childNodes[0];
x_xph= t_xph.nodeValue;t_xph.nodeValue = '';
} if(i_xph<x_xph.length){
t_xph.nodeValue += x_xph.charAt(i_xph);
intv = setTimeout("typeWriter()",speed);
i_xph = 0;}}}

I did find a body tag set up for it:

<body class="body<?=$data_details['IDParent']?>" id="body<?php echo "$mycode" ?>" onload="P7_swapClass(0,'none','showIt','hideIt','div');typeWriter('quote',100)">

I want to animate the database value "QEdN," inside <div class="quote">, as in the code below. If there's nothing in the database, an image will be displayed. Hopefully, the image won't be given the typewriter treatment!

<div class="quote" id="q<?php echo "$mycode" ?>">
if ($data[0]['QEdN'])
echo $data[0]['QEdN'];

* * * * * * * * * *

The entire script:

<div class="quotewrap" id="qwrap<?php echo "$mycode" ?>">
<div class="quote" id="q<?php echo "$mycode" ?>">
if ($data[0]['QEdN'])
echo $data[0]['QEdN'];
include ($_SERVER['DOCUMENT_ROOT']."/a1/inc/suggest/quote.php");
// Or replace the line above with this: echo "Submit one!";
<div class="sig" id="sig<?php echo "$mycode" ?>">
if ($data[0]['QEdN'])
echo $data[0]['SigEdN'];
/* else
echo "Submit one!"; */
</div><!-- EndQuoteWrap -->

P.S. I've been looking for similar scripts onilne, but most suffer from one of two problems. Some display a text box; I just want the text to flow across the screen, or inside an element of my own choosing. Second, many apparently require you to post the JavaScript whereever you want the function to happen, with the text inside the function.

I want just one JavaScript Typewriter file that I can link to from all my pages, and I want to be able to trigger the function anywhere via a simple mechanism.