SAMISDAT.JavaScript = {
    onload: function(){
        $('empty').style.background = 'none';
        $('empty').setStyle({
            width: '1930px',
            height: '1940px',
            top: '-1930px',
            left: -SAMISDAT.ViewPort.width + 'px',
            marginLeft: '0px'
        
        });
        ['ich', 'html', 'server', 'script'].each(function(elem){
            $(elem).setStyle({
                display: 'none',
                marginLeft: '0px'
            
            });
        });
        this.step1();
    },
    step1: function(){
        new Effect.Parallel([new Effect.Move('empty', {
            x: 63,
            y: -5,
            mode: 'absolute',
            sync: true
        }), new Effect.Scale('empty', 10, {
            sync: true
        })], {
            delay: 0.3,
            duration: 1.3,
                queue: {
                position: 'end',
                scope: 'ajax'
            },
        
            afterFinish: this.step2.bind(this)
        });
        
    },
    step2: function(){
        $('empty').style.width = '193px';
        $('empty').style.height = '194px';
        Effect.Appear('ich', {
            duration: 1,
            afterUpdate: function(){
                $('ich').style.display = 'block'
            },  queue: {
                position: 'end',
                scope: 'ajax'
            },
            afterFinish: this.step3.bind(this)
        })
    },
    step3: function(){
        bubble('html', 134, 70, {
            duration: 0.5
        });
        bubble('server', 207, 45, {
            delay: 0.1,
            duration: 0.5
        });
        bubble('script', 93, 0, {
            delay: 0.2,
            duration: 0.6
        });
        
        
    }
};

function bubble(id, y, x){
    $(id).setStyle({
        left: x + 'px',
        top: y + 'px'
    });
    new Effect.Scale(id, 100, Object.extend({
        beforeStart: function(effect){
            $(effect.element).style.display = 'block';
            $(effect.element).setOpacity(0);
        },
        afterUpdate: function(effect){
            $(effect.element).setOpacity(effect.position);
        },
        scaleFrom: 0,
        scaleFromCenter: true
    
    }, arguments[3] ||
    {}));
}


