/*!
 * init.js
 * v3.0
 */

if (top!=self) {
	if (typeof(location.replace)!='undefined') {
		top.location.replace(self.location.href)
	} else { 
		top.location.href=self.location.href;
	}
}

$('input[placeholder], textarea[placeholder]').placeholder();


$('body').blackout('init');


var frame1 = $('#frame-1');
var frame2 = $('#frame-2');
var frame3 = $('#frame-3');
var frame4 = $('#frame-4');
var frame5 = $('#frame-5');
var frame6 = $('#frame-6');
var frame7 = $('#frame-7');
var frame8 = $('#frame-8');
var frame9 = $('#frame-9');
var emblema1 = $('#emblema1');
var emblema2 = $('#emblema2');
var sclon = $('#sclon');
var musik = $('#musik');
var flag = $('#flag');
var likes = $('#likes');
var store = $('#store');


$('html, body').addClass('background'+Math.round(random(1,3)));

if($('.flash-block').length)
{
	$(window).resize(resizeFlash);
	resizeFlash();
}

function resizeFlash(){
	if($.browser.webkit) return false;
	var winHeight = $(window).height();
	if(winHeight < 920)
	{
		$('.flash').css('overflow','hidden');
		var g = 133;
		$('.container .bg').css({bottom:-g});
		$('.flash-block').css({bottom:86-g})
	} else {
		$('.flash').css('overflow','auto');
		$('.container .bg').css({bottom:0});
		$('.flash-block').css({bottom:86})
	}
}

var scene = new scrollScene();
scene.frame = [
	function(){
		this.animate('opacity',{
			node : frame1,
			timeStart : 1.8382352941176472,
			timeEnd : 3.9215686274509802,
			valueStart : 1,
			valueEnd : 0
		});
		this.animate('marginLeft',{
			node : frame1,
			timeStart : 0,
			timeEnd : 3.1862745098039214,
			valueStart : 0,
			valueEnd : 155,
			log : true
		});
	},
	function(){
		var start = 2.083333333333333;
		var end = 3.063725490196078;
				
		this.animate('opacity',{
			node : frame2,
			timeStart : start,
			timeEnd : end,
			valueStart : 0,
			valueEnd : 1
		}).animate('opacity',{
			node : frame2,
			timeAfter : end,
			timeStart : 16.05392156862745,
			timeEnd : 17.27941176470588,
			valueStart : 1,
			valueEnd : 0
		});
		
		this.animate('marginLeft',{
			node : frame2,
			timeStart : start,
			timeEnd : end,
			valueStart : 0,
			valueEnd : 100
		});
		this.animate('marginBottom',{
			node : frame2,
			timeStart : start,
			timeEnd : end,
			valueStart : 0,
			valueEnd : 110
		});
		this.animate('backgroundPosition',{
			node : frame2,
			timeStart : start,
			timeEnd : 33.455882352941174,
			valueStart : 0,
			valueEnd : -1000
		});
		this.animate('zIndex',{
			node : frame2,
			timeStart : 5.147058823529411,
			timeEnd : 5.147058823529411,
			valueStart : 2,
			valueEnd : 110
		});
	},
	function(){
		this.animate('opacity',{
			node : frame3,
			timeStart : 8.088235294117647,
			timeEnd : 10.906862745098039,
			valueStart : 0,
			valueEnd : 1
		});
	},
	function(){
		this.animate('opacity',{
			node : frame4,
			timeStart : 16.666666666666664,
			timeEnd : 17.892156862745097,
			valueStart : 0,
			valueEnd : 1
		});
		this.animate('opacity',{
			node : frame4,
			timeAfter : 17.892156862745097,
			timeStart : 24.387254901960784,
			timeEnd : 26.10294117647059,
			valueStart : 1,
			valueEnd : 0
		});
		this.animate('opacity',{
			node : frame3,
			timeAfter : 17.892156862745097,
			timeStart : 24.387254901960784,
			timeEnd : 26.10294117647059,
			valueStart : 1,
			valueEnd : 0
		});
		this.animate('backgroundPosition',{
			node : frame4,
			timeStart : 16.666666666666664,
			timeEnd : 26.10294117647059,
			valueStart : 0,
			valueEnd : -300
		});
		
		this.animate('opacity',{
			node : frame5,
			timeStart : 26.225490196078432,
			timeEnd : 27.818627450980394,
			valueStart : 0,
			valueEnd : 1
		});
		
		this.animate('marginLeft',{
			node : frame5,
			timeStart : 26.225490196078432,
			timeEnd : 28.431372549019606,
			valueStart : 0,
			valueEnd : -195
		})
		
		this.animate('marginLeft',{
			node : frame5,
			timeAfter : 28.431372549019606,
			timeStart : 28.431372549019606,
			timeEnd : 30.88235294117647,
			valueStart : -195,
			valueEnd : 0
		});
		
		this.animate('zIndex',{
			node : frame5,
			timeAfter : 30.392156862745097,
			timeStart : 31.392156862745097,
			timeEnd : 31.392156862745097,
			valueStart : 110,
			valueEnd : 2
		});
		
		this.animate('backgroundPosition',{
			node : frame5,
			timeAfter : 28.431372549019606,
			timeStart : 28.431372549019606,
			timeEnd : 34.068627450980394,
			valueStart : 0,
			valueEnd : -375
		});
		
		this.animate('backgroundPosition',{
			node : frame5,
			timeAfter : 34.068627450980394,
			timeStart : 34.068627450980394,
			timeEnd : 44.068627450980394,
			valueStart : -375,
			valueEnd : -850
		});
	
		this.animate('opacity',{
			node : frame3,
			timeAfter : 37.00980392156863,
			timeStart : 37.00980392156863,
			timeEnd : 39.46078431372549,
			valueStart : 0,
			valueEnd : 1
		});
		
		this.animate('opacity',{
			node : frame3,
			timeAfter : 43.01470588235294,
			timeStart : 43.01470588235294,
			timeEnd : 45.09803921568628,
			valueStart : 1,
			valueEnd : 0
		});
		
		this.animate('opacity',{
			node : frame5,
			timeAfter : 43.01470588235294,
			timeStart : 43.01470588235294,
			timeEnd : 45.09803921568628,
			valueStart : 1,
			valueEnd : 0
		});
		
		this.animate('opacity',{
			node : emblema1,
			timeStart : 45.09803921568628,
			timeEnd : 45.09803921568628,
			valueStart : 1,
			valueEnd : 0
		});
		
		this.animate('opacity',{
			node : emblema2,
			timeStart : 45.09803921568628,
			timeEnd : 45.09803921568628,
			valueStart : 0,
			valueEnd : 1
		});

	},
	function(){
		this.animate('opacity',{
			node : frame6,
			timeStart : 45.09803921568628,
			timeEnd : 46.09803921568628,
			valueStart : 0,
			valueEnd : 1
		});
		
		this.animate('opacity',{
			node : frame3,
			timeAfter : 47.67156862745098,
			timeStart : 47.67156862745098,
			timeEnd : 50.03921568627451,
			valueStart : 0,
			valueEnd : 1
		});
		
		this.animate('zIndex',{
			node : frame3,
			timeAfter : 49.50980392156863,
			timeStart : 49.50980392156863,
			timeEnd : 49.50980392156863,
			valueStart : 110,
			valueEnd : 2
		});
		this.animate('zIndex',{
			node : frame6,
			timeAfter : 49.50980392156863,
			timeStart : 49.50980392156863,
			timeEnd : 49.50980392156863,
			valueStart : 110,
			valueEnd : 2
		});
		this.animate('zIndex',{
			node : frame7,
			timeAfter : 49.50980392156863,
			timeStart : 49.50980392156863,
			timeEnd : 49.50980392156863,
			valueStart : 105,
			valueEnd : 1
		});


		this.animate('opacity',{
			node : frame7,
			timeStart : 49.63235294117647,
			timeEnd : 51.10294117647059,
			valueStart : 0,
			valueEnd : 1
		});
		
		this.animate('rotate',{
			node : frame7,
			timeStart : 50.122549019607845,
			timeEnd : 58.57843137254902,
			valueStart : 0,
			valueEnd : -360
		});
		
		this.animate('opacity',{
			node : frame3,
			timeAfter : 56.98529411764706,
			timeStart : 56.98529411764706,
			timeEnd : 58.08823529411765,
			valueStart : 1,
			valueEnd : 0
		});
		this.animate('opacity',{
			node : frame7,
			timeAfter : 56.98529411764706,
			timeStart : 56.98529411764706,
			timeEnd : 58.08823529411765,
			valueStart : 1,
			valueEnd : 0
		});
		this.animate('opacity',{
			node : frame6,
			timeAfter : 56.98529411764706,
			timeStart : 56.98529411764706,
			timeEnd : 58.08823529411765,
			valueStart : 1,
			valueEnd : 0
		});
		
	},
	function(){
		this.animate('opacity',{
			node : sclon,
			timeStart : 55.75980392156863,
			timeEnd : 58.08823529411765,
			valueStart : 0,
			valueEnd : 1
		});
		
		this.animate('opacity',{
			node : frame5,
			timeAfter : 57.84313725490197,
			timeStart : 57.84313725490197,
			timeEnd : 60.5392156862745,
			valueStart : 0,
			valueEnd : 1
		});
		
		this.animate('opacity',{
			node : frame5,
			timeAfter : 71.56862745098039,
			timeStart : 71.56862745098039,
			timeEnd : 73.65196078431373,
			valueStart : 1,
			valueEnd : 0
		});
		
		this.animate('opacity',{
			node : frame8,
			timeStart : 62.745098039215684,
			timeEnd : 64.95098039215686,
			valueStart : 0,
			valueEnd : 1
		});
		this.animate('opacity',{
			node : frame8,
			timeAfter : 71.56862745098039,
			timeStart : 71.56862745098039,
			timeEnd : 73.65196078431373,
			valueStart : 1,
			valueEnd : 0
		});
		this.animate('backgroundPosition',{
			node : frame5,
			timeAfter : 57.84313725490197,
			timeStart : 57.84313725490197,
			timeEnd : 72.79411764705883,
			valueStart : -1031,
			valueEnd : -1310
		});
		
	},
	function(){
		this.animate('opacity',{
			node : frame9,
			timeStart : 73.2843137254902,
			timeEnd : 74.1421568627451,
			valueStart : 0,
			valueEnd : 1
		});
		this.animate('backgroundPosition',{
			node : frame9,
			timeStart : 73.2843137254902,
			timeEnd : 86.15196078431373,
			valueStart : 0,
			valueEnd : -400
		});
		this.animate('opacity',{
			node : frame9,
			timeAfter : 85.29411764705883,
			timeStart : 85.29411764705883,
			timeEnd : 86.02941176470588,
			valueStart : 1,
			valueEnd : 0
		});
		this.animate('opacity',{
			node : musik,
			timeStart : 74.87745098039215,
			timeEnd : 76.83823529411765,
			valueStart : 0,
			valueEnd : 1
		});
		this.animate('opacity',{
			node : musik,
			timeAfter : 85.29411764705883,
			timeStart : 85.29411764705883,
			timeEnd : 86.02941176470588,
			valueStart : 1,
			valueEnd : 0
		});
	},
	function(){
		this.animate('opacity',{
			node : flag,
			timeStart : 86.02941176470588,
			timeEnd : 86.64302600472813,
			valueStart : 0,
			valueEnd : 1
		});
		this.animate('left',{
			node : flag,
			timeStart : 86.02941176470588,
			timeEnd : 91.0614657210402,
			valueStart : 490,
			valueEnd : 0
		});
		this.animate('width',{
			node : flag,
			timeStart : 86.02941176470588,
			timeEnd : 91.0614657210402,
			valueStart : 0,
			valueEnd : 494
		});
		this.animate('backgroundPosition',{
			node : flag,
			timeAfter : 91.0614657210402,
			timeStart : 91.0614657210402,
			timeEnd : 91.0614657210402,
			valueStart : 0,
			valueEnd : 0
		});
		this.animate('width',{
			node : flag,
			timeAfter : 92.43498817966903,
			timeStart : 92.43498817966903,
			timeEnd : 96.45390070921985,
			valueStart : 494,
			valueEnd : 0
		});
	},
	function(){
		this.animate('opacity',{
			node : likes,
			timeStart : 94.2080378250591,
			timeEnd : 96.45390070921985,
			valueStart : 0,
			valueEnd : 1
		});
		this.animate('opacity',{
			node : store,
			timeStart : 91.725768321513,
			timeEnd : 96.45390070921985,
			valueStart : 0,
			valueEnd : 1
		});
	}
]
