window.addEvent('domready', function() {

	var bodyScroller = new Fx.Scroll($(document.body));
	
	$$('#doc #portfolio-content .description a.go-to-top-link').each(function(item, index){
		
		item.addEvent('click', function(e){
			var e = new Event(e);
			e.stop();
			e.target.blur();
			bodyScroller.toTop();
		});
	});
	
	$$('#portfolio-title a').each(function(item, index){
		item.set('morph', {duration:200})
		item.addEvent('mouseenter', function(e){
			var event = new Event(e);
			if (!event.target.hasClass('current')) {
				item.morph('.hover-link');
			}
		});
		item.addEvent('mouseleave', function(e){
			var event = new Event(e);
			if (!event.target.hasClass('current')) {
				item.morph('.default-link');
			}
		});
	});
	
	$$('#doc .project-panel a').each(function(item, index){

		item.set('morph', {duration:250})
		item.addEvent('mouseenter', function(e){
			item.morph({'background-color':'#79A1AB', 'color':'#ffffff'});
		});
		item.addEvent('mouseleave', function(e){
			item.morph({'background-color':'#000', 'color':'#ffffff'});
		});
	});
	
});
