var jmDotCom = {
	lastBuild:'2009-06-01',
	navEfects: {
		initNav: function(){
			var headerStrings = ['Professional Design + Custom CMS Development','A Little About Me','What I\'ve Been Up Too','Thoughts on Design and Development','Get In Touch With Us'];
			var currentTagLine = $('tagline').get('text');
			var myFx = new Fx.Tween('tagline',{link:'cancel', duration:'short'});
			// loop thru nav elements
			$$('#header li a').each(function(el, idx) {
				el.addEvents({
					'mouseover': function() {
						if (currentTagLine!=headerStrings[idx]) {
							myFx.start('opacity',0).chain(function() {
								$('tagline').set('text', headerStrings[idx]);
								this.start('opacity', 1);
							});
							this.tween('background-color', ['#fff','#eee']);
						}
					},
					'mouseout': function() {
						if (currentTagLine!=headerStrings[idx]) {
							myFx.start('opacity',0).chain(function() {
								$('tagline').set('text', currentTagLine);
								this.start('opacity', 1);
							});
							this.tween('background-color', ['#eee','#fff']);
						}
					},
					'click': function() {
						this.removeEvents('mouseout');
						$('tagline').set('text', 'Loading...');
					} 
				});
			});
		}
	},
	recentWork: {
		initList: function(){
			$$('.details').setStyle('opacity', 0);
			$$('#latest-work li').each(function(el){
				var hiddenDiv = el.getElement('div'); 
				var tw = new Fx.Tween(hiddenDiv,{link:'cancel',duration:'short'});

				el.addEvents({
					'mouseover': function() {
						hiddenDiv.removeClass('hide');
						tw.start('opacity', 1);
					},
					'mouseout': function() {
						tw.start('opacity', 0).chain(function(){hiddenDiv.addClass('hide')});
					}
				});
			});
		}
	}
};

window.addEvent('domready', jmDotCom.navEfects.initNav);
window.addEvent('domready', jmDotCom.recentWork.initList);
window.addEvent('domready',function() {  new SmoothScroll({ duration:1300 }, window); });