var ak_current_sound = 'none';

function akStopAll() {
	soundManager.stopAll();
	for (var i = 0; i < document.images.length; i++) {
		if (document.images[i].id == 'ak_sound_icon') {
			document.images[i].src = window.ak_sound_stop_icon;
		}
	}
	window.ak_current_sound = 'none';
}

function akPlay(name, file) {
	if (name == window.ak_current_sound) {
		akStopAll();
	}
	else {
		akStopAll();
		soundManager.play(name, file);
		window.ak_current_sound = name;
		document.images[name].src = window.ak_sound_play_icon;
	}
}
