window.addEvent('domready',function(){
	
	//artist mouse over "stuff"
	$ES('li','artists_thumbs').each(function(el){
		el.addEvents({
			'mouseenter' : function(){
				original_src = $$('.artist_pic')[0].src;
				$$('.artist_pic')[0].setProperty('src','/assets/images/artists/full/' + el.id + '.png');
			},
			'mouseleave' : function(){
				$$('.artist_pic')[0].setProperty('src',original_src);
			}
		});
	});
	
	//nav mouse over sprites
	$ES('li','nav_wrap').each(function(el){
		el.addEvent('mouseenter',function(){
			this.setStyle('background',"url('/assets/images/common/" + this.id +"_on.png') no-repeat");
		});
		el.addEvent('mouseleave',function(){
			this.setStyle('background',"url('/assets/images/common/" + this.id +".png') no-repeat");
		});
	});
	
	$$('.over').each(function(el){
		el.addEvent('mouseover',function(){
			this.setProperty('src',"/assets/images/buttons/" + this.id +"_on.png");
		});
		el.addEvent('mouseout',function(){
			this.setProperty('src',"/assets/images/buttons/" + this.id +".png");
		});
	});
	
	$('mailing_list_input').addEvent('focus',function(){
		$('mailing_list').setProperty('src',"/assets/images/buttons/mailing_list_on.png");
	});
	$('mailing_list_input').addEvent('blur',function(){
		$('mailing_list').setProperty('src',"/assets/images/buttons/mailing_list.png");
	});
	
	//mailing list
	$('submit').addEvents({
		'mouseenter': function(){this.style.cursor = "pointer"},
		'click': function(){
			$('mailing_list_form_form').send();
			MOOdalBox.open("http://calciumrecords.com/index.php/contact/mailing_list_thanks",
			"Correspondence Received",
			"200 200"
			);
		}
	});
	
	
	//SCAFFOLD!
	$('email_link').addEvent('click',function(e){
		new Event(e).stop();
		MOOdalBox.open("http://calciumrecords.com/index.php/contact/index",
		"Contact Milk and Two Recordings",
		"275 350"
		);
	});
	
	
	//Scrolling!
	
	var scroll = new Scroller('content', {area: 65, velocity: .6});

	// Mousemove
	$('content').addEvent('mouseover', scroll.start.bind(scroll));
	$('content').addEvent('mouseout', scroll.stop.bind(scroll));
	
});