window.addEvent('domready', function(){
	//Create the main body accordian for site sections...
	var accordion = new Accordion('h3.atStart', 'div.atStart', {
		opacity: false,
		onActive: function(toggler, element){
			toggler.setStyle('color', '#66FF66');
		},
		
		onBackground: function(toggler, element){
			toggler.setStyle('color', '#777');
		}
	}, $('accordion'));
	
	//Multibox Setup...
	var box = {};
	window.addEvent('domready', function(){
		box = new MultiBox('mb', {descClassName: 'multiBoxDesc'});
	});
	
	//Side Scrolling
	//Paintings...
	$('painting_scroll_value').value = '-1';
	var paintings = $$('#painting_inner .painting');
	
	var scroll = new Fx.Scroll('painting_bin', {
		wait: false,
		duration: 1200,
		offset: { 'x' : 0, 'y' : 0 },
		transition: Fx.Transitions.Quad.easeInOut
	});
	
	scroll.toElement('y2008');
	
	$('to2008').addEvent('click', function(e) {
		new Event(e).stop();
		scroll.toElement('y2008');
		$('painting_scroll_value').value = '-1';
	});
	
	$('to2007').addEvent('click', function(e) {
		new Event(e).stop();
		scroll.toElement('y2007');
		$('painting_scroll_value').value = '0';
	});
	
	$('to2006').addEvent('click', function(e) {
		new Event(e).stop();
		scroll.toElement('y2006');
		$('painting_scroll_value').value = '5';
	});
	
	$('next_painting').addEvent('click', function(e) {
		new Event(e).stop();
		var n = parseInt($('painting_scroll_value').value) + 1;
		if (n<paintings.length)
		{
			scroll.toElement(paintings[n].getProperty('id'));
			$('painting_scroll_value').value = n;	
		}
	});
	
	$('prev_painting').addEvent('click', function(e) {
		new Event(e).stop();
		var p = parseInt($('painting_scroll_value').value) - 1;
		if (p>-1)
		{
			scroll.toElement(paintings[p].getProperty('id'));
			$('painting_scroll_value').value = p;	
		}
	});
	
	//Side Scrolling
	//Client Work...
	$('client_scroll_value').value = '0';
	var clients = $$('#client_inner .client');

	var clientscroll = new Fx.Scroll('client_bin', {
		wait: false,
		duration: 1200,
		offset: { 'x' : 0, 'y' : 0 },
		transition: Fx.Transitions.Quad.easeInOut
	});

	clientscroll.toElement('clientwork1');
	
	$('next_client').addEvent('click', function(e) {
		new Event(e).stop();
		var n = parseInt($('client_scroll_value').value) + 1;
		if (n<clients.length)
		{
			clientscroll.toElement(clients[n].getProperty('id'));
			$('client_scroll_value').value = n;	
		}
	});
	
	$('prev_client').addEvent('click', function(e) {
		new Event(e).stop();
		var p = parseInt($('client_scroll_value').value) - 1;
		if (p>-1)
		{
			clientscroll.toElement(clients[p].getProperty('id'));
			$('client_scroll_value').value = p;
		}
	});
});
