var data = [
	{
		x:1,y:1,direct:'hor',
		question:'1',
		text:'fase'
	},		
	{
		x:3,y:1,direct:'ver',
		question:'2',
		text:'satelite'
	},
	{
		x:9,y:2,direct:'ver',
		question:'3',
		text:'traslacion'
	},
	{
		x:2,y:3,direct:'hor',
		question:'4',
		text:'atmosfera'
	},
	{
		x:11,y:4,direct:'ver',
		question:'5',
		text:'rotacion'
	},
	{
		x:1,y:5,direct:'hor',
		question:'6',
		text:'relieve'
	},
	{
		x:5,y:7,direct:'ver',
		question:'7',
		text:'marea'
	},
	{
		x:7,y:8,direct:'ver',
		question:'8',
		text:'tierra'
	},
	{
		x:4,y:9,direct:'hor',
		question:'9',
		text:'artificial'
	},
	{
		x:4,y:13,direct:'hor',
		question:'10',
		text:'luna'
	}
];
	
$(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();
});

