var Winter2011 = {
	
	init: function() {
		this.product1 = new ScrollingProduct($("product1"), 1500, 5100);
		this.product2 = new ScrollingProduct($("product2"), 5500, 8900);
		this.product3 = new ScrollingProduct($("product3"), 9300, 14500);
		this.collage1 = new ScrollingCollage($("collage1"), 0, 0, 2100);
		this.collage2 = new ScrollingCollage($("collage2"), 791, 3000, 6300);
		this.collage3 = new ScrollingCollage($("collage3"), 1165, 6200, 10300);
		this.collage4 = new ScrollingCollage($("collage4"), 1520, 12200, 14500);

		this.badge1 = new ScrollingBadge($("badge1"), -15, 0, 1800);
		this.badge2 = new ScrollingBadge($("badge2"), 575, 500, 5100);
		this.badge3 = new ScrollingBadge($("badge3"), 600, 2700, 8900);
		this.badge4 = new ScrollingBadge($("badge4"), 750, 6200, 14000);

		this.content1 = new ScrollingContent($("content1"), 530, 500, 4400);
		this.content2 = new ScrollingContent($("content2"), 675, 2400, 8600);
		this.content3 = new ScrollingContent($("content3"), 750, 6200, 14000);

		this.badge1.skipEasing = true;
		this.badge1.hidden = false;
		this.hasInit = true;
		
		var collectionCta = $("collectionCta");
		console.log("collectionCta: "+collectionCta);
		
		$("collectionCta").addEvent("click", this.scrollToWall.bind(this));
	},
	
	update: function(top) {
		if (!this.hasInit) return;
		this.product1.update(top);
		this.product2.update(top);
		this.product3.update(top);
		
		this.collage1.update(top);
		this.collage2.update(top);
		this.collage3.update(top);
		this.collage4.update(top);

		this.badge1.update(top);
		this.badge2.update(top);
		this.badge3.update(top);
		this.badge4.update(top);

		this.content1.update(top);
		this.content2.update(top);
		this.content3.update(top);
	},
	
	scrollToWall: function() {
		_gaq.push(['_trackEvent', 'Winter2011', 'Scroll to wall']);
		jQuery('html,body').animate({scrollTop: jQuery("#wall").offset().top}, 2000, "swing");
	},
	
	video1Setup: function(video) {
		this.collage1.addVideo(video, $("videoCanvas1"), 424, 270, 0, 2000);
		this.collage1.playVideo();
		video.setStyle("display", "none");
	},
	
	video2Setup: function(video) {
		this.collage2.addVideo(video, $("videoCanvas2"), 294, 166, 1400, 5700);
		video.setStyle("display", "none");
	},
	
	video3Setup: function(video) {
		this.collage3.addVideo(video, $("videoCanvas3"), 282, 188, 5000, 9500);
		video.setStyle("display", "none");
	},
	
	video4Setup: function(video) {
		this.collage4.addVideo(video, $("videoCanvas4"), 310, 150, 8000, 14500);
		video.setStyle("display", "none");
	}
}
