<script language="JavaScript">
function something(text)
{
this.text=text;
this.obj = this + "Object" ; eval(this.obj + "=this");
this.cl=cl;
return this;
}
function cl()
{
if (this.text.length<11)
{
this.text+="1";
setTimeout(this.obj + ".cl()",1000);
}
}
function init()
{
var object=new something('hello');
object.cl();
}
</script>
Испльзуемый код взят из
http://www.dhtmlcentral.com