//Copyright 2007, Howling Dynamo, Inc. or its suppliers. All Rights Reserved. http://www.hdyn.com/wr/common/contact.php?addr=pr
var g_shapes=null;
function doShapes(){
g_shapes.init(8);
}
function Shapes(_1,_2,_3){
this.clock=new GPTimer();
this.nodeSet=null;
this.holder=_1;
this.shapes=[];
this.waitMillis=17;
this.size=100;
this.maxSize=100;
this.f=1.013;
this.wiggleRatio=3.5;
this.iFirstShape=_2;
this.nShapes=_3;
this.init=function(_4){
this.shapes=[];
this.size=_4;
this.holder.style.display="block";
this.holder.innerHTML="";
while(this.size<=this.maxSize){
this.newShape();
}
this.shapes.reverse();
this.nodeSet=this.holder.getElementsByTagName("img");
document.body.onclick=clrShapes;
this.clock.doAfter(doNext,400);
};
this.setWait=function(_5){
this.waitMillis=_5;
};
this.newShape=function(){
var _6=randImg(this.iFirstShape,this.nShapes);
var s=_6.style;
this.size=this.size*this.f;
var w=Math.ceil(this.size+randPM(this.size*0.8));
var h=Math.ceil(this.size+randPM(this.size*0.8));
s.position="absolute";
s.width=w+"px";
s.height=h+"px";
var wr=this.wiggleRatio*this.size;
s.left=this.holder.offsetWidth/2+(randPM(wr)-w/2)+"px";
s.top=this.holder.offsetHeight/2+(randPM(wr)-w/2)+"px";
this.shapes.push(_6);
};
}
function rand(lt){
return Math.floor(Math.random()*0.999*lt);
}
function randPM(lt){
var m=Math.random()>0.5?0.99999:-0.99999;
return Math.floor(Math.random()*m*lt);
}
function randImg(_e,n){
return g_L3Arr[_e+rand(n)].cloneNode(false);
}
function clrShapes(){
g_shapes.nodeSet=null;
g_shapes.shapes=[];
var h=g_shapes.holder;
h.style.display="none";
h.innerHTML="";
document.body.onclick=null;
}
function doNext(){
with(g_shapes){
if(shapes.length>0){
holder.appendChild(shapes.pop());
clock.doAfter(doNext,waitMillis);
}else{
if(nodeSet!=null){
var _11=nodeSet[rand(nodeSet.length*0.8)];
if(_11==null){
clrShapes();
}else{
holder.removeChild(_11);
clock.doAfter(doNext,waitMillis);
}
}
}
}
}

