var DM={
	slideFx: '',
	fadeFx: '',
	currentLink: '',
	currentHash: window.location.hash.substring(1)
};
	
function slideContent(a,b){
	var e=new Event(b).stop();
	var c=a.getProperty('href').replace('#','');
		DM.currentLink=a;
		DM.currentHash=c;
	DM.slideFx.toElement(c);
}

function setCurrent(){
	//$$('#nav li').removeClass('current');
	//DM.currentLink.getParent().addClass('current');
	document.title="mattvolenec.com - "+DM.currentLink.getProperty('title');
}

function setup(){
	if($$('body')){
		DM.slideFx=new Fx.Scroll('slider-box',{wait:false,duration:600,transition:Fx.Transitions.Quad.easeInOut,onComplete:setCurrent});
		$$('nav a').addEvent('click',function(e){slideContent(this,e)});
		
		$$('img.thumb').each(function(img){
			var src = img.getProperty('src');
			var alt = img.getProperty('alt');
			var extension = src.substring(src.lastIndexOf('.'),src.length);
			img.addEvent('click', function() {
				$$('img.feature').setProperty('src', src.replace(extension,'L' + extension));
				$('replace').setText(alt);
			});
		});
	}
	if($$('document.images')){
		GenesisL=new Image();
		GenesisL='assets/GenesisL.jpg';
		GleasonL=new Image();
		GleasonL.src='assets/Gleason.jpg';
		BlueLeafL=new Image();
		BlueLeafL.src='assets/BlueLeafL.jpg';
		PearlL=new Image();
		PearlL.src='assets/PearlL.jpg';
		PhotoL=new Image();
		PhotoL.src='assets/PhotoL.jpg';
		FramptonL=new Image();
		FramptonL.src='assets/FramptonL.jpg';
		SYATPL=new Image();
		SYATPL.src='assets/SYATPL.jpg';
		FootyTubeL=new Image();
		FootyTubeL.src='assets/FootyTubeL.jpg';
		FontL=new Image();
		FontL.src='assets/FontL.png';
	}
}

window.addEvent('domready',function(){setup()});
