/**
 * @author iPrior
 */
var Bisermania = {
    start: function(){
        if (!$('div_bisermania')) {
            var div_bisermania = new Element('div', {
                'style': 'display:none; background-color:white; width:100%; height:100%; position:fixed; z-index:8; top:0px; left:0px;',
                'id': 'div_bisermania'
            });
            document.body.appendChild(div_bisermania);
        }
        Effect.BlindDown('div_bisermania');
		setTimeout('Bisermania.step1()',1000);
    },
    step1: function(){
		var myWidth = 0, myHeight = 0;
        if (typeof(window.innerWidth) == 'number') {
            //Non-IE
            myWidth = window.innerWidth;
            myHeight = window.innerHeight;
        }
        else 
            if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
                //IE 6+ in 'standards compliant mode'
                myWidth = document.documentElement.clientWidth;
                myHeight = document.documentElement.clientHeight;
            }
            else 
                if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
                    //IE 4 compatible
                    myWidth = document.body.clientWidth;
                    myHeight = document.body.clientHeight;
                }
		var top = (myHeight-600)/2;
		var left = (myWidth-800)/2;
		if(top<0) top=0;
		if(left<0) left=0;
        var bisermania_cnt_div = new Element('div', {
            'style': 'text-align:center; background-color:white; width:800px; height:600px; position:fixed; z-index:9; top:'+top+'px; left:'+left+'px;',
			'id':'bisermania_cnt_div'
        }).update('<p><b>iPrior</b> script production & <b>Solevolito</b> design studio</p><p><span style="color:red;">REPRESENT</span></p>');
		document.body.appendChild(bisermania_cnt_div);
		new Effect.Opacity('div_bisermania', { from: 1.0, to: 0.7, duration: 0.5 });
		setTimeout('Bisermania.step2()',1000);
    },
	step2:function() {
		$('bisermania_cnt_div').fade();
		setTimeout('Bisermania.step3()',1000);
	},
	step3:function() {
		$('bisermania_cnt_div').update('<span style="color:red">our little secret</span><br /><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/jjY105QI2io&hl=ru_RU&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/jjY105QI2io&hl=ru_RU&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br /><br /><div onclick="Bisermania.close()" style="cursor:pointer;">закрыть</div>');
		Effect.BlindDown('bisermania_cnt_div');
	},
	close:function() {
		$('bisermania_cnt_div').fade();
		setTimeout('$(\'bisermania_cnt_div\').remove();');
		$('div_bisermania').fade();
		setTimeout('$(\'div_bisermania\').remove();');
	}
}
