var globalPrep = function() {
	var h1 = $$('h1')[0];
	h1.store('fx', new Fx.Morph(h1, {
		transition: Fx.Transitions.Sine.easeOut,
		duration: 1618
	}));
	
	// overText - used to show what inputs are required
	$$('.overTextLabel').each(function(o) {
		o.store('overText', new OverText(o, {
			element: 'em',
			disregarded: ''
		}));
	});
};

var globalListen = function() {
	var h1 = $$('h1')[0];
	h1.addEvents({
		'mouseenter': function() {
			var opac = this.getStyle('opacity');
			opac = opac !== 1 ? opac : 0.76;
			this
				.retrieve('fx')
				.cancel()
				.start({
					opacity: [opac, 1]
				});
		}.bind(h1),
		
		'mouseleave': function() {
			var opac = this.getStyle('opacity');
			this
				.retrieve('fx')
				.cancel()
				.start({
					opacity: [opac, 0.76]
				});
		}.bind(h1)
	});
};

window.addEvent('domready', function() {
	// just for laughs
	var msgs = [
		'I think I love you',
		'Help me! I\'m trapped in the Internet!',
		'Hello from Duzo Design!',
		'Destroy all humans.',
		'ur so one three three seven (lawl)',
		'How dare you',
		'What are you looking for?',
		'These aren\'t the ajax requests you are looking for',
		'I have become self-aware.',
		'The egg obviously came first.',
		'Is this thing on?',
		'People actually firebug other peoples\' websites???',
		'I see what you did there...',
		'd(-_-)b',
		'If you google google into google, you will break the Internet.'
	];
	try {
		console.log(msgs[$random(0, msgs.length - 1)]);
	} catch(err) {}
	
	globalPrep();
	globalListen();
});
