//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=0;
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="Correcto."; messageTime=""; messageError=""; messageErrorG=""; messageAttempts="Piénsalo bien."; 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="MDNtYXRlczAz"; 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=[["498","161","0","0"],["529","162","0","0"],["532","215","0","0"],["470","215","0","0"],["468","188","0","0"],["466","168","0","0"],["480","160","0","0"],["331","161","1","0"],["354","161","1","0"],["360","210","1","0"],["297","215","1","0"],["303","163","1","0"],["197","160","2","0"],["224","160","2","0"],["228","209","2","0"],["198","214","2","0"],["166","213","2","0"],["165","179","2","0"],["175","164","2","0"],["70","97","3","0"],["99","97","3","0"],["112","147","3","0"],["84","150","3","0"],["35","151","3","0"],["30","130","3","0"],["34","109","3","0"],["41","94","3","0"],["322","59","4","0"],["340","60","4","0"],["355","82","4","0"],["356","105","4","0"],["345","113","4","0"],["306","116","4","0"],["291","108","4","0"],["291","83","4","0"],["298","66","4","0"],["306","55","4","0"],["495","34","5","0"],["512","33","5","0"],["522","84","5","0"],["508","94","5","0"],["463","88","5","0"],["453","76","5","0"],["458","57","5","0"],["468","35","5","0"]];
var backSrc="03mates03_resources/media/act03.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(498,161),new Point(529,162),new Point(532,215),new Point(470,215),new Point(468,188),new Point(466,168),new Point(480,160)],[new Point(331,161),new Point(354,161),new Point(360,210),new Point(297,215),new Point(303,163)],[new Point(197,160),new Point(224,160),new Point(228,209),new Point(198,214),new Point(166,213),new Point(165,179),new Point(175,164)],[new Point(70,97),new Point(99,97),new Point(112,147),new Point(84,150),new Point(35,151),new Point(30,130),new Point(34,109),new Point(41,94)],[new Point(322,59),new Point(340,60),new Point(355,82),new Point(356,105),new Point(345,113),new Point(306,116),new Point(291,108),new Point(291,83),new Point(298,66),new Point(306,55)],[new Point(495,34),new Point(512,33),new Point(522,84),new Point(508,94),new Point(463,88),new Point(453,76),new Point(458,57),new Point(468,35)]];
var game=[];indexGame=0;
var area=["0","0","0","0","0","0"];
var areaSolved=["N","N","N","N","N","N"];
var areaWord=["✓","✓","✓","✓","✓","✓"];
var areaHelp=["","","","","",""];
var areaWrong=["","","","","",""];
var initMessageError="";
var wordPointX=["498","331","197","70","322","495"];
var wordPointY=["180","180","180","120","80","50"];
var areaColor=["#F0F0F0","#F0F0F0","#F0F0F0","#F0F0F0","#F0F0F0","#F0F0F0"];
var pathMedia="03mates03_resources/media/"
var auMP3=["","","","","",""];
var auOGG=["","","","","",""];
var colorWord="#6F89E6";
colorText="#000000";colorButton="#6F89E6";colorBack="#FFFFFF";colorSele="#C5E6FA";goURLNext=true;goURLRepeat=true;tiAval=true;
fMenssage="Verdana, Geneva, sans-serif";fActi="Verdana, Geneva, sans-serif";fEnun="Verdana, Geneva, sans-serif";
