var data = [
	{
		x:3,y:1,direct:'ver',
		question:'Recibir',
		text:'dar'
	},		
	{
		x:5,y:1,direct:'ver',
		question:'Oscuro',
		text:'claro'
	},
	{
		x:1,y:3,direct:'hor',
		question:'Abrir',
		text:'cerrar'
	},
	{
		x:4,y:5,direct:'hor',
		question:'Venta',
		text:'compra'
	}
];
	
$(function(){
	$('#debugmode').on({
		'click':function(ev){
			var debug = $(this).prop('checked');
			//console.log(debug);
			if(debug == true){
				$(".divover").css("display","block");
				$(".questions").css("pointer-events","none");
			}
			else{
				$(".divover").css("display","none");
				$(".questions").css("pointer-events","auto");
			}
			$('#crossword').crossWord({
				debug:debug,
				data:data,
				questions:'#questions',
				success:function(){
					//alert('success');
					$("#msg_correcto").fadeIn("slow");
					setTimeout('$("#msg_correcto").fadeOut("slow");', 3000);
					$("#audio")[0].play();		
				}
			});
		}
	}).trigger('click');
});

$(".bt_solucion").click(function(){
	$('#debugmode').trigger('click');
});

$(".bt_ayuda").click(function(){
	$("#msg_ayuda").toggle();
	//setTimeout('$("#msg_ayuda").hide("slow");', 6000);
});

$("#msg_ayuda").click(function(){
	$(this).fadeOut();
});

