var scroll;
function start() {
	initSwish('MainMenu');

	// attach scroll links
	var slide = $$('.MI');
	slide.each(function(smi, i){
		smi.addEvent('click', function(event) {
			event = new Event(event).stop();
			ta = smi.href.split(/(#)/);
			scrollContent(ta[1]=="#"?ta[2]:ta[1]);
		});
	});
	var slide = $$('.SwishMenu .Main li ul li a');
	slide.each(function(smi, i){
		if (smi.href.test('#'))
			smi.addEvent('click', function(event) {
				event = new Event(event).stop();
				ta = smi.href.split(/(#)/);
				scrollContent(ta[1]=="#"?ta[2]:ta[1]);
			});
	});
	var slide = $$('#Code_Links ul li a');
	slide.each(function(smi, i){
		smi.addEvent('click', function(event) {
			event = new Event(event).stop();
			ta = smi.href.split(/(#)/);
			scrollContent(ta[1]=="#"?ta[2]:ta[1]);
		});
	});
	// move to welcome
	new Fx.Scroll('ContentViewPort', { wait: false, offset: {x: 0, y: 11}, duration: 0, transition: Fx.Transitions.Quad.easeInOut }).toElement('Welcome');
	scroll = new Fx.Scroll('ContentViewPort', { wait: false, offset: {x: 0, y: 11}, duration: 1100, transition: Fx.Transitions.Quad.easeInOut });
}

function scrollContent(target) {
	scroll.toElement(target);
}

window.addEvent('domready', start);
