var current_slide = 0;
var slide_texts = [
	"Software developers, click through the slide-show to see how you can participate in our network.", 
	"With a few lines of code you can easily integrate our plug-in into your installer and link it to our network.", 
	"Later on, a user downloads your OpenCandy enabled installer and begins installing your app.", 
	"Of the apps you've chosen to recommend, our plugin requests the app we think your user will like the most.", 
	"We send back the recommendation and display it as an offer screen in the install process.", 
	"Hopefully, your user likes the recommendation and chooses to install it.", 
	"If so, the app is automatically downloaded and the user can install it at their convenience.", 
	"Your users get more applications that they love.", 
	"You get to spread software you love, and even increase your distribution by allowing others to recommend you."
	];
var disabled_left = true;
var disabled_right = false;
function toggle_slide(previous) {
	if ((previous && !current_slide) || ( !previous && current_slide == 8 )) {
		return;
	}
	$('what-slide' + current_slide).style.display = 'none';
	current_slide += previous ? -1 : 1;
	$('what-slide' + current_slide).style.display = 'block';
	$('what-slide-text').innerHTML = slide_texts[current_slide];
	//$('what-arrow-left').style.visibility = current_slide == 1 ? 'hidden' : 'visible';
	
	if (current_slide == 0) {
		remove_class($('what-arrow-left'), ' left-enabled');
		add_class($('what-arrow-left'), 'left-disabled');
		disabled_left = true;
	}
	else if (disabled_left == true) {
		remove_class($('what-arrow-left'), 'left-disabled');
		add_class($('what-arrow-left'), 'left-enabled');
		disabled_left = false;
	}
	if (current_slide == 8 ) {
		add_class($('what-arrow-right'), 'right-disabled');
		remove_class($('what-arrow-right'), 'right-enabled');
		disabled_right = true;
	}
	else if (disabled_right == true) {
		remove_class($('what-arrow-right'), 'right-disabled');
		add_class($('what-arrow-right'), 'right-enabled');
		disabled_right = false;
	}
	//$('what-arrow-right').style.visibility = current_slide == 11 ? 'hidden' : 'visible';
	$('what-dots').style.backgroundPosition = (-240 + 24 * (current_slide - 1)) + 'px 0px';
}