// JavaScript source code

//Namespace
this.wideload = this.wideload || {};

(function(){

    var Configuration = function () { }

    var p = Configuration.prototype;

//BlinkInterval, how many milliseconds it takes from blink to blink
//BlinkTime: How many milliseconds it takes to reach blink peak.
    p.projectorStartUpSequence = {stayBlack: 250, stayOn:6590, blinks:[140,950,2250, 3700,4470, 47600, 5200, 9000, 14000], blinkTime:14,targetColor:new THREE.Color(0xFFFFFF) };
	var random = wideload.Random;
    p.parts =  [
		/** FINAL **/
		 { startTime: 0, runningTime: 1, effect:"red",  color:new THREE.Color(0xffffff), start: [0,0], width: 12, height: 10 , split: false },
		 { startTime: 6891, runningTime: 1, effect: "Synchronized", screens: [[3,5],[4,5],[5,5]] , split: true },
		 { startTime: 6891, runningTime: 1, effect: "Catastrophic", screens: [[2,4],[3,4],[4,4]] , split: true },
		 { startTime: 14047, runningTime: 34300-14047, effect: "Noise", screens: [[4,4]] , split: false },
		 { startTime: 14047, runningTime: 34300-14047, effect: "Noise", screens: [[5,5]] , split: true },
		 
		 { startTime: 6891, runningTime: 5000, effect: "RandomEffect", screens:[[9,4]] , split: false },//,
		 { startTime: 100, runningTime: 5000, effect: "Fireballs", screens:[[9,5]] , split: false },//,
		 { startTime: 6550, runningTime: 7000, effect: "Noise", start: [0,0], width: 12, height: 10 , split: false },//,
		 { startTime: 6550, runningTime: 16585-6550, effect: "Xor", screens:[[6,4]] , split: false },//,
		 
		 
		 { startTime: 12258, runningTime:26680-12200, effect: "RandomEffect", screens:[[4,5]] , split: false },//,
		 
	//	 { startTime: 12258, runningTime: 10000, effect: "red", color: new THREE.Color(0xFF0000), start:[1,6], width:12, height:1, skipWidth: 3, split: false },//,
/*		 { startTime: 12358, runningTime: 10000, effect: "red", color: new THREE.Color(0xFF0000), start:[2,6], width:12, height:1, skipWidth: 3, split: false },//,
		 { startTime: 12458, runningTime: 10000, effect: "red", color: new THREE.Color(0xFF0000), start:[3,6], width:12, height:1, skipWidth: 3, split: false },//,
		 { startTime: 12558, runningTime: 10000, effect: "red", color: new THREE.Color(0xFF0000), start:[4,6], width:12, height:1, skipWidth: 3, split: false },//,
		 { startTime: 12658, runningTime: 10000, effect: "red", color: new THREE.Color(0xFF0000), start:[5,6], width:12, height:1, skipWidth: 3, split: false },//,
		 { startTime: 12758, runningTime: 10000, effect: "red", color: new THREE.Color(0xFF0000), start:[6,6], width:12, height:1, skipWidth: 3, split: false },//,
		 { startTime: 12858, runningTime: 10000, effect: "red", color: new THREE.Color(0xFF0000), start:[7,6], width:12, height:1, skipWidth: 3, split: false },//,
		 { startTime: 12958, runningTime: 10000, effect: "red", color: new THREE.Color(0xFF0000), start:[8,6], width:12, height:1, skipWidth: 3, split: false },//,
	*/	 
		 /*{ startTime: 12258, runningTime: 10000000, effect: "RandomEffect", screens:[[4,4]] , split: false },//,
		 { startTime: 12258, runningTime: 10000000, effect: "RandomEffect", screens:[[4,4]] , split: false },//,
		 { startTime: 12258, runningTime: 10000000, effect: "RandomEffect", screens:[[4,4]] , split: false },//,
		 { startTime: 12258, runningTime: 10000000, effect: "RandomEffect", screens:[[4,4]] , split: false },//,
		 { startTime: 12258, runningTime: 10000000, effect: "RandomEffect", screens:[[4,4]] , split: false },//,
		 { startTime: 12258, runningTime: 10000000, effect: "RandomEffect", screens:[[4,4]] , split: false },//,
		 */
		 
		 
		 { startTime: 12258, runningTime: 1, effect: "Monitor", screens: [[3,5],[2,5],[1,5]] , split: true },
		 
		 { startTime: 12258, runningTime: 1, effect: "Overload", screens: [[3,4],[2,4],[1,4]] , split: true },
		 { startTime: 12258, runningTime: 1, effect: "Bywideload", screens: [[5,2],[4,2],[3,2]] , split: true },
		 
		 { startTime: 28029, runningTime: 30438-28029, effect: "Fireballs", start: [0,0], width: 12, height: 1 , split: true },//,
		 { startTime: 30438, runningTime: 31313-30438, effect: "Fireballs", start: [0,0], width: 12, height: 2 , split: true },//,
		 { startTime: 31313, runningTime: 48603-31313, effect: "Fireballs", start: [0,0], width: 12, height: 5 , split: true },//,
		 { startTime: 29759, runningTime: 48603-29759, effect: "Fireballs", start: [0,5], width: 12, height: 5 , split: true },//,
		 { startTime: 45700, runningTime: 50400-45700, effect: "Julia", screens:[[2,5]] , split: true },//,
	
		 { startTime: 50400, runningTime: 60400-50400, effect: "LightGradient", start: [0,0], width: 12, height: 10 , split: true },//,
		 { startTime: 50400, runningTime: 69000-50400, effect: "Julia", screens:[[2,5]] , split: false },//,
		 { startTime: 60400, runningTime: 93000-60400, effect: "LightGradient", start: [0,0], width: 12, height: 10 , split: true },//,
		 
		 { startTime: 60400, runningTime: 88500-60400, effect: "Greets", screens: [[2,3],[3,3],[4,3],[3,4],[4,4],[5,4],[4,5],[5,5], [6,5]] , split: true },
	
		 //Tästä eteenpäin parttej. StartTime @87000.
	
		{ startTime: 89000, runningTime: 121000-89000, effect: "Starfall", start:[0,0],width:12,height:10 , split: true, zoomBall:true },
		
	//	+wideload.Random.next()%1000
		
		// Amigas ballzors
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[10,8]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[10,6]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[10,4]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[10,2]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[8,8]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[8,6]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[8,4]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[8,2]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[6,8]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[6,6]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[6,4]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[6,2]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[4,8]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[4,6]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[4,4]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[4,2]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[2,8]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[2,6]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[2,4]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[2,2]], split: false },

		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[11,7]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[11,5]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[11,3]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[11,1]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[7,7]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[7,5]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[7,3]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[7,1]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[5,7]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[5,5]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[5,3]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[5,1]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[3,7]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[3,5]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[3,3]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[3,1]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[1,7]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[1,5]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[1,3]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[1,1]], split: false },

		
/*		
		{ startTime: 118300, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[8,6]], split: false },
		{ startTime: 118600, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[8,4]], split: false },
		{ startTime: 118600, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[8,8]], split: false },
		{ startTime: 118900, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[11,5]], split: false },
		{ startTime: 118900, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[9,5]], split: false },

		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[6,6]], split: false },
		{ startTime: 118300, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[6,4]], split: false },
		{ startTime: 118300, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[12,6]], split: false },
		{ startTime: 118300, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[8,6]], split: false },
		{ startTime: 118600, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[8,4]], split: false },
		{ startTime: 118600, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[8,8]], split: false },
		{ startTime: 118900, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[11,5]], split: false },
		{ startTime: 118900, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),screens:[[9,5]], split: false },
*/
		
		// red fillers
		{ startTime: 119000, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),start:[0,0], width:12, height:10, skipWidth: 1, skipHeight:1, split: false },
		{ startTime: 119000, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xff0000),start:[1,1], width:11, height:9, skipWidth: 1, skipHeight:1, split: false },
		
		
		// Unt white powerz
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[0,1]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[0,3]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[0,5]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[0,7]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[0,9]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[1,0]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[1,2]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[1,4]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[1,6]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[1,8]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[3,0]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[3,2]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[3,4]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[3,6]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[3,8]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[5,0]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[5,2]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[5,4]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[5,6]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[5,8]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[7,0]], split: false },

		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[7,2]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[7,4]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[7,6]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[7,8]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[9,0]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[9,2]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[9,4]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[9,6]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[9,8]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[11,0]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[11,2]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[11,4]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[11,6]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[11,8]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[2,1]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[2,3]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[2,5]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[2,7]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[2,9]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[4,1]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[4,3]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[4,5]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[4,7]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[4,9]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[6,1]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[6,3]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[6,5]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[6,7]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[6,9]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[8,1]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[8,3]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[8,5]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[8,7]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[8,9]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[10,1]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[10,3]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[10,5]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[10,7]], split: false },
		{ startTime: 118000+(wideload.Random.next()%1000), runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[10,9]], split: false },
		/*
		{ startTime: 118200, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[11,6]], split: false },
		{ startTime: 118200, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[10,5]], split: false },
		{ startTime: 118400, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[9,6]], split: false },
		{ startTime: 118400, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[11,4]], split: false },
		{ startTime: 118700, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[9,4]], split: false },
		{ startTime: 118700, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[7,4]], split: false },
		{ startTime: 118700, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[5,4]], split: false },
		{ startTime: 118800, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[5,6]], split: false },
		{ startTime: 118800, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[7,6]], split: false },
		{ startTime: 118800, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[3,6]], split: false },
		{ startTime: 118800, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[4,5]], split: false },
		{ startTime: 118800, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[8,5]], split: false },
		{ startTime: 118800, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[10,3]], split: false },
		*/
		// and white fillers
		{ startTime: 119000, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),start:[0,1], width:12, height:9, skipWidth: 1, skipHeight:1, split: false },
		{ startTime: 119000, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),start:[1,0], width:11, height:10, skipWidth: 1, skipHeight:1, split: false },
		
		//{ startTime: 105000, runningTime: 125000-89000, effect: "Ballsea", start:[0,0],width:6,height:10 , split: true, zoomBall:true },
	
	
//	{ startTime: 122000, runningTime: 1, effect: "red",forceColor:new THREE.Color(0xffffff),screens:[[4,6],[5,6],[1,3],[2,3],[0,3],[11,3],[10,3], [9,3],[2,4],[3,4],[1,4],[0,4],[3,5],[4,5], [1,5],[2,5]], split: false },
		// { startTime: 123500, runningTime: 10000, color:new THREE.Color(0xffffff), effect: "Noise", start:[0,0],width:12,height:10,split:false, zoomBall:false },

		{ startTime: 119500, runningTime: 1, effect: "Eclipser", screens: [[4,6],[5,6]] , split: true },
	   { startTime: 119500, runningTime: 1, effect: "Music", screens: [[2,6],[3,6]] , split: true },
	   
	   { startTime: 119500, runningTime: 1, effect: "Exca", screens: [[1,3],[2,3]] , split: true },
	   { startTime: 119500, runningTime: 20000, effect: "Julia", screens: [[0,3]] , split: false },
	   { startTime: 119500, runningTime: 20000, effect: "Xor", screens: [[11,3]] , split: false },
	   { startTime: 119500, runningTime: 20000, effect: "Greets", screens: [[10,3]] , split: false },

	   { startTime: 119500, runningTime: 1, effect: "Poro", screens: [[2,4],[3,4]] , split: true },
	   { startTime: 119500, runningTime: 20000, effect: "Starfall", screens: [[1,4]] , split: false },
	   { startTime: 119500, runningTime: 20000, effect: "Fireballs", screens: [[0,4]] , split: false },
	   //{ startTime: 123500, runningTime: 10000000, effect: "Teddy", screens: [[11,4]] , split: false },
	   
	   { startTime: 119500, runningTime: 1, effect: "Rimina", screens: [[3,5],[4,5]] , split: true },
	   { startTime: 119500, runningTime: 20000, effect: "LightGradient", screens: [[2,5]] , split: false },
	   { startTime: 119500, runningTime: 20000, effect: "RandomEffect", screens: [[1,5]] , split: false }//,
	
	//   { startTime: 145000, runningTime: 10000, color:new THREE.Color(0xffffff), effect: "Noise", start:[0,0],width:12,height:10,split:false, zoomBall:false },

	
      /*      { startTime: 0, runningTime: 15000, effect: "Julia", screens: [[5, 7], [7, 3], [9, 3], [6, 4]], split: false },
            { startTime: 0, runningTime: 15000, effect: "Teddy", screens: [[6, 7], [7, 4], [10, 3], [5, 4]], split: false },
            
            
        ];
      */
       //     { startTime: 0, runningTime: 10000000, effect: "Teddy", screens: [[2,3],[3,3],[3,4],[4,4],[4,5],[5,5]] , split: true },
      // { startTime: 6550, runningTime: 10000000, effect: "Noise", start: [0,0], width: 12, height: 10 , split: false }//,
	   //{ startTime: 0, runningTime: 10000000, effect: "Greets", screens: [[2,3],[3,3],[4,3],[3,4],[4,4],[5,4],[4,5],[5,5], [6,5]] , split: true },

	 /* GREETS  
      // { startTime: 0, runningTime: 10000000, effect:"red",  color:new THREE.Color(0xffffff), start: [0,0], width: 12, height: 10 , split: false },
	  { startTime: 0, runningTime: 10000000, effect: "Starfall", start: [0,0], width: 12, height: 10 , split: true },
	/*
	   { startTime: 0, runningTime: 10000000, effect: "Synchronized", screens: [[4,6],[5,6],[6,6]] , split: true },
	   { startTime: 0, runningTime: 10000000, effect: "Catastrophic", screens: [[4,5],[5,5],[6,5]] , split: true },
	   { startTime: 0, runningTime: 10000000, effect: "Monitor", screens: [[4,4],[5,4],[6,4]] , split: true },
	   { startTime: 0, runningTime: 10000000, effect: "Overload", screens: [[4,3],[5,3],[6,3]] , split: true }*/
//       { startTime: 0, runningTime: 10000000, effect:"red",  color:new THREE.Color(0xff0000), start: [0,0], width: 12, skipWidth:1, height: 10 , split: false },
 //       { startTime: 0, runningTime: 10000000, effect:"red",  color:new THREE.Color(0xffffff), start: [1,0], width: 12, skipWidth:1, height: 10 , split: false }
      //{ startTime: 0, runningTime: 10000000, effect: "Noise", start: [0,0], width: 12, height: 10 , split: false },
	   //{ startTime: 0, runningTime: 10000000, effect: "Greets", screens: [[2,3],[3,3],[4,3],[3,4],[4,4],[5,4],[4,5],[5,5], [6,5]] , split: true },

	   /*

	   
	//   { startTime: 0, runningTime: 10000000, effect: "Greets", screens: [[2,3],[3,3],[4,3],[3,4],[4,4],[5,4],[4,5],[5,5], [6,5]] , split: true },
	//   { startTime: 0, runningTime: 10000000, effect: "Greets", screens: [[2,3],[3,3],[4,3],[3,4],[4,4],[5,4],[4,5],[5,5], [6,5]] , split: true },
	//   { startTime: 0, runningTime: 10000000, effect: "Greets", screens: [[2,3],[3,3],[4,3],[3,4],[4,4],[5,4],[4,5],[5,5], [6,5]] , split: true }
        //    { startTime: 0, runningTime: 15000, effect: "Julia", screens: [[5, 7], [7, 3], [9, 3], [6, 4]], split: false },
         //   { startTime: 0, runningTime: 15000, effect: "Teddy", screens: [[6, 7], [7, 4], [10, 3], [5, 4]], split: false },
           //	 { startTime: 10000, runningTime: 25000, effect: "Julia", start: [0,0], width:12,height:10, split: false },
           	
		//	{ startTime: 35000, runningTime: 250000, effect: "Fireballs", start: [0,0], width:12,height:10, split: true },
           	// { startTime: 0, runningTime: 15000, effect: "Julia", start: [0,0], width:12,height:10, split: false},
           //	 { startTime: 800, runningTime: 15000, effect: "Julia", start: [0,2], width:4,height:4, split: true },
           	// { startTime: 800, runningTime: 15000, effect: "Teddy", start: [5,3], width:4,height:4, split: true },
           	 //{ startTime: 800, runningTime: 15000, effect: "LightGradient", screens: [[8, 7], [7, 6], [11, 4], [3, 4]], split: false },
           	 //{ startTime: 800, runningTime: 15000, effect: "RandomEffect", screens: [[7, 7], [7, 5], [11, 3], [4, 4]], split: false },
			 */           
    ];
	
	p.cameraDrive = [
		{startTime: 0, lookAt:[0,0,0], moveTo: [0,0,-140],startAt: [0,0,-180],startLookAt: [0,0,0]}, //Initial position.
		{startTime: 6590, lookAt: [0,0,0], moveTo: [0, 0,-270] },
		
		
		//GREET TIMING
		/*
		{startTime: 3000, lookAt: [198,0,980], moveTo: [57,69,244] },
		{startTime: 7000, lookAt: [717,0,696], moveTo: [-305,109,-71] },
		{startTime: 10000, endTime: 15000, lookAt: [147,50,696], moveTo: [-245,199,-201] },
		{startTime: 15000, endTime: 20000, lookAt: [-47,0,696], moveTo: [175,109,-261] },
		{startTime: 20000, endTime: 25000, lookAt: [47,300,696], moveTo: [-175,-209,-261] }*/
		
		
		//Alun partit. ÄLÄ KOSKE!!!!
		{startTime: 6600, lookAt: [0,0,0], moveTo: [0, 0,-270] },//,
		{startTime: 7000,  lookAt: [80,-18,424], moveTo: [11,-1,-213] },
		{startTime: 10000, lookAt: [1686,19,461], moveTo: [271,60,10] },
		{startTime: 14000, lookAt: [-1375,-245,893], moveTo: [195,0,195] },
		{startTime: 19000, lookAt: [571,-125,810], moveTo: [30,-37,286] },
		{startTime: 24000, lookAt: [100,980,168], moveTo: [-74,-118,134] },
		{startTime: 28000, lookAt: [100,980,168], moveTo: [-28,-68,114] },
		{startTime: 32000, lookAt: [-59,997,-43], moveTo: [0,0,94] },
		{startTime: 36000, lookAt: [-59,997,-43], moveTo: [0,150,94] },
		{startTime: 40000, lookAt: [0,-700,-43], moveTo: [-100,100,94] },
		{startTime: 44000, lookAt: [-789,-247,551], moveTo: [-174,-20,222] },
		{startTime: 48000, lookAt: [-585,-221,779], moveTo: [-202,23,181] },
		{startTime: 52000, lookAt: [-871,55,486], moveTo: [283,18,-105] },
		{startTime: 56000, endTime: 60000, lookAt: [565,-149,-811], moveTo: [180,45,-28] },
	
		//Greets
		{startTime: 60000, lookAt: [198,0,980], moveTo: [57,69,-144] },
		{startTime: 64000, lookAt: [717,0,696], moveTo: [-105,109,-71] },
		{startTime: 68000, lookAt: [147,50,696], moveTo: [-145,199,-201] },
		{startTime: 72000, lookAt: [-47,0,696], moveTo: [175,109,-261] },
		{startTime: 76000, lookAt: [47,300,696], moveTo: [-175,-209,-261] },
		{startTime: 80000, lookAt: [147,50,696], moveTo: [-145,199,-201] },
//		{startTime: 84000, lookAt: [-47,0,696], moveTo: [175,109,-261] },
//		{startTime: 88000, lookAt: [47,300,696], moveTo: [-175,-209,-261] },
		{startTime: 83500, endTime: 89000, lookAt: [413,74,907], moveTo: [-22,-9,-44] },
		
		//Tästä jatkuu
		//Starfall
		{startTime: 89000, lookAt: [400,-800,900], moveTo: [-32,-54,-24] },
		{startTime: 94000,lookAt: [36,-35,1200], moveTo: [-34,-34,-34] },
		{startTime: 98000, lookAt: [36,-15,200], moveTo: [-180,-4,-124] },
		{startTime: 102000, lookAt: [336,-15,-200], moveTo: [-20,-6,-154] },
		{startTime: 108000, lookAt: [336,-15,-200], moveTo: [-20,-6,-154] },
//
	//			{startTime: 94000, endTime: 101000, lookAt: [36,-35,1200], moveTo: [-34,-34,-34] },
	//	{startTime: 101000, endTime: 107000, lookAt: [36,-15,200], moveTo: [-180,-4,-124] },
	//	{startTime: 107000, endTime: 116000, lookAt: [336,-15,-200], moveTo: [-20,-6,-154] },

		
		// Siirtymä amigaan
		{startTime: 112000, lookAt: [449,-247,987], moveTo: [-5,-182,-325] },
		{startTime: 117000, lookAt: [-147,-138,958], moveTo: [-2,-64,-307] },
		{startTime: 120000, lookAt: [-604,-304,789], moveTo: [0,54,-289] },
		{startTime: 123000, lookAt: [-983,48,-172], moveTo: [-50,75,-300] },
		{startTime: 126000, lookAt: [-940,364,-296], moveTo: [-0,60,-130] },
		{startTime: 129000, lookAt: [-783,48,-172], moveTo: [280,60,-30] },
		{startTime: 132000,endTime:137000, lookAt: [-998,-248,23], moveTo: [2082,60,-10] }
		// Credit
		//{startTime: 117000, endTime: 119000, lookAt: [-300,-25,-500], moveTo: [170,-20,344] },
		
		/*{startTime: 60000, lookAt: [565,-149,-811], moveTo: [380,45,128] }
		{startTime: 56000, lookAt: [565,-149,-811], moveTo: [380,45,128] }
		{startTime: 56000, lookAt: [565,-149,-811], moveTo: [380,45,128] }
		*/
	//	{startTime: 40000, lookAt: [-100,-1,-10], moveTo: [100, 100,100] },
	//	{startTime: 44000, lookAt: [100,-1,-10], moveTo: [100, 0,100] },
	//	{startTime: 48000, lookAt: [100,-100,-10], moveTo: [100, 100,100] },
	//	{startTime: 52000, endTime: 60000, lookAt: [0,,0], moveTo: [0, 0,-15000] }
		
	];
	
	p.prepare = function()
	{
		var points = [new THREE.Vector3(this.cameraDrive[0].startAt[0],this.cameraDrive[0].startAt[1],this.cameraDrive[0].startAt[2])];
		var lookPoints = [new THREE.Vector3(this.cameraDrive[0].startLookAt[0],this.cameraDrive[0].startLookAt[1],this.cameraDrive[0].startLookAt[2])];
		var prev = null;
		this.maxTime = this.cameraDrive[this.cameraDrive.length-1].endTime;
		for(var i = 0; i < this.cameraDrive.length; i++)
		{
			var camo = this.cameraDrive[i];
			if(prev != null)
			{
				if(!camo.startAt) //Wrap the current start to previouses moveTo if it does not exist.
					camo.startAt = prev.moveTo;
				if(!camo.startLookAt)
					camo.startLookAt = prev.lookAt;
				
			}
			if(!camo.endTime)
					camo.endTime = i+1 > this.cameraDrive.length -1 ? null : this.cameraDrive[i+1].startTime;
			points.push ( new THREE.Vector3(camo.moveTo[0], camo.moveTo[1], camo.moveTo[2]));
			lookPoints.push(new THREE.Vector3(camo.lookAt[0], camo.lookAt[1], camo.lookAt[2]));
			camo.partial = (camo.endTime - camo.startTime) / this.maxTime;
			console.log("Partial " + camo.partial);
			prev = camo;
		}
		this.path = new THREE.SplineCurve3(points);
		this.lookPath = new THREE.SplineCurve3(lookPoints);
		for(var i = 0; i < this.parts.length; i++)
		{
			var conf = this.parts[i];
			if(conf.start)
			{
				var sx = conf.start[0];
				var sy = conf.start[1];
				var wx = conf.width;
				var wy = conf.height;
				console.log(sx, sy, wx, wy);
				var temp = [];

				for( var x = 0; x < wx; x++)
				{
					if(conf.skipWidth != undefined){
						x+= conf.skipWidth;
					}
					for(var y = 0; y < wy; y++)
					{
						if(conf.skipHeight != undefined){
							y+= conf.skipHeight;
							}
						temp.push([(sx+x)%12, (sy+y)%10]);
					}
				}
				conf.screens = temp;
			}
			console.log(conf.screens);
			//Todo - automatic width calc
			//Todo - automatic sorting
		}
	}
	
    //Expose
    wideload.Configuration = Configuration;
}());
