var data = [
	{
		x:11,y:1,direct:'ver',
		question:'Recibir',
		text:'destemplada'
	},		
	{
		x:5,y:7,direct:'ver',
		question:'Oscuro',
		text:'cuerda'
	},
	{
		x:9,y:8,direct:'ver',
		question:'Abrir',
		text:'vasos'
	},
	{
		x:4,y:9,direct:'hor',
		question:'Venta',
		text:'templada'
	},
	{
		x:1,y:11,direct:'hor',
		question:'Venta',
		text:'sonido'
	}
];
	
$(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();
});

