//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=4; attempts=0; attemptsMax=1;
var score=0; scoreMax=4; 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="Buen comienzo. Sigue así."; messageTime=""; messageError="Fíjate. Ahí no está el dígito pedido."; messageErrorG="Fíjate. Ahí no está el dígito pedido."; messageAttempts="Segundo fallo. 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="MDFhY3RNaWxsb24"; 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=[["441","195","0","0"],["415","196","0","0"],["415","267","0","0"],["469","267","0","0"],["469","195","0","0"],["166","196","1","1"],["193","197","1","1"],["192","267","1","1"],["141","270","1","1"],["139","200","1","1"],["315","272","2","2"],["344","271","2","2"],["349","198","2","2"],["292","201","2","2"],["288","269","2","2"],["102","271","3","3"],["130","269","3","3"],["131","199","3","3"],["77","199","3","3"],["69","269","3","3"]];
var backSrc="01actMillon_resources/media/act01.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(441,195),new Point(415,196),new Point(415,267),new Point(469,267),new Point(469,195)],[new Point(166,196),new Point(193,197),new Point(192,267),new Point(141,270),new Point(139,200)],[new Point(315,272),new Point(344,271),new Point(349,198),new Point(292,201),new Point(288,269)],[new Point(102,271),new Point(130,269),new Point(131,199),new Point(77,199),new Point(69,269)]];
var game=[];indexGame=0;
var area=["0","1","2","3"];
var areaSolved=["N","N","N","N"];
var areaWord=["Unidades","D. de millar","Centenas","C. de millar"];
var areaHelp=["Haz clic en el dígito de las <b>unidades</b>","Indica la cifra de las <b>decenas de millar</b>","Presiona sobre el dígito de las <b>centenas</b>","¿ Qué dígito corresponde con las <b>centenas de millar</b>?"];
var areaWrong=["","","",""];
var initMessageError="Fíjate. Ahí no está el dígito pedido.";
var wordPointX=["441","166","315","102"];
var wordPointY=["195","196","272","271"];
var areaColor=["#FF8000","#D5D200","#FF8000","#D5D200"];
var pathMedia="01actMillon_resources/media/"
var auMP3=["","","",""];
var auOGG=["","","",""];
var colorWord="#000000";
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";
