//Creado con Ardora - www.webardora.net
//bajo licencia Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)
//para otros usos contacte con el autor
var timeAct=360; timeIni=360; timeBon=0;
var successes=0; successesMax=6; attempts=0; attemptsMax=1;
var score=0; scoreMax=6; scoreInc=1; scoreDec=1
var typeGame=0;
var tiTime=false;
var tiTimeType=0;
var tiButtonTime=true;
var textButtonTime="Comenzar";
var tiSuccesses=true;
var tiAttempts=true;
var tiScore=true;
var startTime;
var colorBack="#FFFDFD"; colorButton="#91962F"; colorText="#000000"; colorSele="#FF8000";
var goURLNext=false; goURLRepeat=false;tiAval=false;
var scoOk=0; scoWrong=0; scoOkDo=0; scoWrongDo=0; scoMessage=""; scoPtos=10;
var fMenssage="Verdana, Geneva, sans-serif";
var fActi="Verdana, Geneva, sans-serif";
var fEnun="Verdana, Geneva, sans-serif";
var timeOnMessage=5; messageOk="¡ Muy bien!"; messageTime=""; messageError="Esa no es la operación buscada."; messageErrorG="Esa no es la operación buscada."; messageAttempts="Lee con atención cada frase e inténtalo otra vez."; isShowMessage=false;
var urlOk=""; urlTime=""; urlError=""; urlAttempts="";
var goURLOk="_blank"; goURLTime="_blank"; goURLAttempts="_blank"; goURLError="_blank"; 
borderOk="#008000"; borderTime="#FF0000";borderError="#FF0000"; borderAttempts="#FF0000";
var wordsGame="MDRtYXQ"; wordsStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
function giveZindex(typeElement){var valueZindex=0; capas=document.getElementsByTagName(typeElement);
for (i=0;i<capas.length;i++){if (parseInt($(capas[i]).css("z-index"),10)>valueZindex){valueZindex=parseInt($(capas[i]).css("z-index"),10);}}return valueZindex;}
var points=[["144","17","0","0"],["264","18","0","0"],["266","69","0","0"],["19","69","0","0"],["17","16","0","0"],["402","15","1","1"],["527","15","1","1"],["526","71","1","1"],["282","70","1","1"],["282","16","1","1"],["17","86","2","2"],["265","84","2","2"],["264","140","2","2"],["20","142","2","2"],["403","86","3","3"],["526","84","3","3"],["529","137","3","3"],["282","139","3","3"],["283","86","3","3"],["155","161","4","4"],["265","159","4","4"],["265","212","4","4"],["15","216","4","4"],["19","161","4","4"],["401","159","5","5"],["525","158","5","5"],["525","217","5","5"],["279","212","5","5"],["281","157","5","5"],["333","159","5","5"]];
var backSrc="04mat_resources/media/actParen.png";
var Shape = function () {this.x=undefined;this.y=undefined;};
Shape.prototype={fill:function(context){context.save();context.fillStyle=this.fillStyle;this.createPath(context);context.fill();context.restore();},
stroke:function(context){context.save();this.createPath(context);context.stroke();context.restore();},
isPointInPath:function(context,x,y){this.createPath(context);return context.isPointInPath(x, y);},};
var Polygon=function(){this.points = [];this.numInd=0;};Polygon.prototype=new Shape();Polygon.prototype.addPoint=function(x,y){this.points.push(new Point(x,y));};
Polygon.prototype.createPath=function (context) {if (this.points.length === 0)return;context.beginPath();
context.moveTo(this.points[0].x,this.points[0].y);for (var i=0; i < this.points.length; ++i) {context.lineTo(this.points[i].x,this.points[i].y);}context.closePath();};
var Point=function(x,y){this.x=x;this.y=y;};var shapes=[];
var polygonPoints=[[new Point(144,17),new Point(264,18),new Point(266,69),new Point(19,69),new Point(17,16)],[new Point(402,15),new Point(527,15),new Point(526,71),new Point(282,70),new Point(282,16)],[new Point(17,86),new Point(265,84),new Point(264,140),new Point(20,142)],[new Point(403,86),new Point(526,84),new Point(529,137),new Point(282,139),new Point(283,86)],[new Point(155,161),new Point(265,159),new Point(265,212),new Point(15,216),new Point(19,161)],[new Point(401,159),new Point(525,158),new Point(525,217),new Point(279,212),new Point(281,157),new Point(333,159)]];
var game=[];indexGame=0;
var area=["0","1","2","3","4","5"];
var areaSolved=["N","N","N","N","N","N"];
var areaWord=["✓","✓","✓","✓","✓","✓"];
var areaHelp=["El triple del resultado de sumar dos y cinco","La suma del triple de cinco y dos","El doble de la suma de tres y cinco","Tres más el doble de cinco","El triple de la diferencia entre cinco y dos","Quitar dos a la suma de tres y cinco"];
var areaWrong=["","","","","",""];
var initMessageError="Esa no es la operación buscada.";
var wordPointX=["145","405","145","405","145","405"];
var wordPointY=["35","35","110","110","185","185"];
var areaColor=["#F0F0F0","#F0F0F0","#F0F0F0","#F0F0F0","#F0F0F0","#F0F0F0"];
var pathMedia="04mat_resources/media/"
var auMP3=["","","","","",""];
var auOGG=["","","","","",""];
var colorWord="#23982C";
colorText="#000000";colorButton="#FF8000";colorBack="#FFFFFF";colorSele="#EBD0AB";goURLNext=true;goURLRepeat=true;tiAval=true;
fMenssage="Verdana, Geneva, sans-serif";fActi="Verdana, Geneva, sans-serif";fEnun="Verdana, Geneva, sans-serif";
