AUI().ready('anim', function(A) {
var Height = A.DOM.winHeight();

var Width = A.DOM.winWidth();
var bg=A.Node.create('<div id="bg"></div>');
//bg.appendTo('body');
A.one('#cont').prepend(bg);
bg.setStyles({width:Width+'px'});
bg.setStyle('height',Height+'px');

bg.setX(0);
bg.setY(0);
var img=A.Node.create('<img src="bg.png"/>');
bg.append(img);
img.setStyles({width:Width+'px'});
img.setStyle('height',Height+'px');
img.setX(0);
img.setY(0);
A.one('.content').setStyle('opacity',0.8);
var Count=Math.floor((Width-300)/50);
for (var i=0;i<Count;i++){
var nod=A.Node.create('<div class="test">З<BR/>А<BR/>К<BR/>А<BR/>З<BR/>А<BR/>Т<BR/>Ь<BR/> <BR/>В<BR/>И<BR/>З<BR/>И<BR/>Т<BR/>К<BR/>И<BR/> <BR/>Н<BR/>А<BR/>З<BR/>Н<BR/>А<BR/>Ч<BR/>И<BR/>Т<BR/>Ь<BR/> <BR/>С<BR/>О<BR/>В<BR/>Е<BR/>Щ<BR/>А<BR/>Н<BR/>И<BR/>Е<BR/> <BR/>У<BR/>В<BR/>О<BR/>Л<BR/>И<BR/>Т<BR/>Ь<BR/> <BR/>З<BR/>А<BR/>Р<BR/>Е<BR/>З<BR/>Е<BR/>Р<BR/>В<BR/>И<BR/>Р<BR/>О<BR/>В<BR/>А<BR/>Т<BR/>Ь<BR/> <BR/>П<BR/>Е<BR/>Р<BR/>Е<BR/>Г<BR/>О<BR/>В<BR/>О<BR/>Р<BR/>Н<BR/>У<BR/>Ю<BR/> <BR/>Н<BR/>А<BR/>Й<BR/>Т<BR/>И <BR/>С<BR/>О<BR/>Т<BR/>Р<BR/>У<BR/>Д<BR/>Н<BR/>И<BR/>К<BR/>А<BR/> <BR/></div>');
var rgb = 'rgb('+(29+(Math.floor(Math.random()*120)))+','+(255-(Math.floor(Math.random()*150)))+','+(100+(Math.floor(Math.random()*100)))+')';
A.one('#cont').append(nod);
A.one('.test').setStyles({width:'10px'});
nod.setStyle('color',rgb);
nod.setX(300+(i*50));
nod.setY(Height);
A.one('#cont').setStyle('height',Height+'px');

var myAnim = new A.Anim({
        node: nod,
	from:{xy:[300+(i*50),Height]},
        to: {
            xy:[300+(i*50),-1000]
        },
duration: 10+(Math.random()*5),
on:{end:function() {
    nod.setY(Height);
this.run();
}}
});
myAnim.run();
 

}
});
