function init() {
	$("[id^='txtbtn']").hide();
	$("[id^='txtsBtn']").hide();
	$("[id^='btn']").each(function( i, e ) {
		var $me  = $(this),
			meId = $me.attr("id");
		$me.click(function() {
			var subGroup = $("#txt" + meId).find("[id^='sBtn']");
			sg.sound("success-low");
			$("[id^='btn']").removeClass("selected");
			$(this).addClass("selected");
			$("[id^='txtbtn']").hide();
			$("#txt" + meId).fadeIn();				
			if ( subGroup.length ) {
				$(subGroup).each(function() {
					$(this).click(function() {
						var $me  = $(this),
							meId = $me.attr("id");
						sg.sound("success-low");
						$("[id^='sBtn']").removeClass("selected");
						$me.addClass("selected");
						$("[id^='txtsBtn']").hide();
						$("#txt" + meId).fadeIn();	
					});
				});
			}
		});		
	});
}
function validateTxt(form) {
	var elements     = $("." + form + " input:text");	
		rightAnswers = [];
	elements.each(function() {
		var $me          = $(this),
			answer       = $me.attr("data-answer"),
			userAnswer   = $me.val(),
			userEval     = userAnswer.replace(/\s/g,"");
		if ( userEval == answer ) {
			rightAnswers.push(userEval);
			$me.removeClass("wrong");
			$me.addClass("right");
		}else {
			$me.removeClass("right");
			$me.addClass("wrong");
		}		
	});
	if ( rightAnswers.length == elements.length ) {
		$("#ok").trigger('click');
		sg.sound("success");
	}else {
		$("#wrong").trigger('click');
		sg.sound("error");
	}	
}