if(window.addEventListener) {
	window.addEventListener('load', initHome, false); // W3C DOM
} else if(window.attachEvent) {
	window.attachEvent('onload', initHome);
}

function initHome() {
	// Add rollover effects to "more info" and "buy now" buttons
	//infoRollovers();

	// Create the accordion on the front page
	//createAccordion();
}


// -------------------------------------------------------------------------------------
// Add rollover effects to secondary buttons on the Front Page
// Mootools DOES NOT like dashes within class names!!! Found this out the (very) hard way.
// -------------------------------------------------------------------------------------
function infoRollovers() {

	// the "in depth" buttons on the front page
	$$('.indepth').addEvent('mouseover', function() {
		this.effect('opacity', {duration: 200, wait: true}).custom(1, .7);
	})
	.addEvent('mouseout', function() {
		this.effect('opacity', {duration: 750, fps: 30, wait: true}).custom(.7, 1);
	});
	
	// the "buy now" buttons on the front page
	$$('.buynow').addEvent('mouseover', function() {
		this.effect('opacity', {duration: 200, wait: true}).custom(1, .7);
	})
	.addEvent('mouseout', function() {
		this.effect('opacity', {duration: 750, wait: true}).custom(.7, 1);
	});
}

// -------------------------------------------------------------------------------------
// I've started a new career as an accordionist!
// -------------------------------------------------------------------------------------
function createAccordion() {
	myBox = $$('.dt');
	myBoxOpen = $$('.dd');
		
	var myEffect = new Fx.Accordion(myBox, myBoxOpen, {start: 'all-closed'}); 
	// start: 'all-closed' open-first, first-open, etc.
}
