$(function() {
	initAnimParams();
});

var n;

function initAnimParams() {
	
	n = {
		sectWidth: 1920,
		
		sects: {
			'home': {
				//  Replaces headings['home'] and blips['home'][1]
				'index': 1,
				'blipWidth': 130
				
			},
			
			'portfolio': {
				'index': 2,
				'blipWidth': 180
			},
			
			'about': {
				'index': 3,
				'blipWidth': 180
			},
			
			'services': {
				'index': 4,
				'blipWidth': 140
			},
			
			'contact': {
				'index': 5,
				'blipWidth': 170
			},
			
			// Thor humbly requests this.
			'subcontact': {
				'index': 6
			}
		},
		
		'anim': {
			// Nav and blip timeout 
			timeout: 200,
			
			shift: false,
			
			shiftCoeff: 5,
			prettyCoeff: 0.7,
			
			'logo': {
				'on': {
					'easing': 'easeOutExpo',
					'time': function() { return n.anim.shift ? 70 * n.anim.shiftCoeff : 700; }
				},
				
				'off': {
					'easing': 'easeOutExpo',
					'time': function() { return n.anim.shift ? 700 * n.anim.shiftCoeff : 700; }
				}
			},

			'nav': {
				'on': {
					'easing': 'easeOutExpo',
					'time': function() { return n.anim.shift ? 700 * n.anim.shiftCoeff : 700; }
				},
				
				'off': {
					'easing': 'easeOutExpo',
					'time': function() { return n.anim.shift ? 700 * n.anim.shiftCoeff : 700; }
				},
				
				'gradient': {
					'easing': 'easeOutExpo',
					'time': function() { return n.anim.shift ? 600 * n.anim.shiftCoeff : 600; }
				},
				
				'blip': {
					'easing': 'easeOutExpo',
					'time': function() { return n.anim.shift ? 900 * n.anim.shiftCoeff : 900; }
				}
			},
			
			'thor': {
				'size': {
					'easing': 'easeOutExpo',
					'time': function() { return n.anim.shift ? 450 * n.anim.shiftCoeff : 450; }
				},
				
				'position': {
					'easing': 'easeInOutCubic',
					'time': function() { return n.anim.shift ? 500 * n.anim.shiftCoeff : 800; }
				},
				
				// Individual per-element settings.
				// [Speed coefficient, Delay before subtitle sizing, Delay before title sizing]
				'settings': {
					'1': [0.9, 00, 0],
					'2': [0.9, 100, 0],
					'3': [1.2, 200, 0],
					'4': [1.6, 250, 0],
					
					'-1': [1.1, 0, 100], 
					'-2': [1.3, 0, 0], 
					'-3': [1.6, 0, 0], 
					'-4': [2, 0, 0]
				}
				
			},
			
			'line': {
				'easing': 'easeOutExpo',
				'time': function() { return n.anim.shift ? 1500 * n.anim.shiftCoeff : 1500; }
			},
			
			// i = intro (boolean)
			'aaa': {
				'introCoeff': 0.9,
				'coeff': $('body').height() / 977,
				
				// Shutter opening
				so: {
					'easing': function(i) { return i ? 'easeInOutCubic' :'easeInOutCubic' },
					'time': function(i) { return (i ? 1000 : 2000) * (i ? n.anim.aaa.introCoeff : n.anim.aaa.coeff) * (n.anim.shift ? n.anim.shiftCoeff : 1); }

				},
				
				// Shutter closing
				sc: {
					'easing': function(i) { return i ? 'easeInOutCubic' :'easeInOutCubic' },
					'time': function(i) { return (i ? 1000 : 2000) * (i ? n.anim.aaa.introCoeff : n.anim.aaa.coeff) * (n.anim.shift ? n.anim.shiftCoeff : 1); }
				},
				
				// Curtain opening 
				co: {
					'introTime': 500,
					'introEasing': 'easeInOutCubic',

					'easing': function(i) { return i ? 'easeInOutCubic' :'easeInOutCubic' },
					'time': function(i) { return (i ? 500 : 1000) * (i ? n.anim.aaa.introCoeff : n.anim.aaa.coeff) * (n.anim.shift ? n.anim.shiftCoeff : 1); }
				},

				// Curtain closing
				cc: {
					'easing': function(i) { return i ? 'easeInOutCubic' :'easeInOutCubic' },
					'time': function(i) { return (i ? 1500 : 2500) * (i ? n.anim.aaa.introCoeff : n.anim.aaa.coeff) * (n.anim.shift ? n.anim.shiftCoeff : 1); }
				},
			},
			
			'content': {
				'old': {
					'easing': 'easeOutExpo',
					'time': function() { return n.anim.shift ? 500 * n.anim.shiftCoeff : 00; }
				},
				
				'new': {
					'easing': 'easeOutExpo',
					'time': function() { return n.anim.shift ? 500 * n.anim.shiftCoeff : 0; }
				}
			}
		}

		
	}
}