//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=3; attempts=0; attemptsMax=1;
var score=0; scoreMax=3; 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="Vamos a intentalo outra 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="MDRlbmVyeGlhMDI"; 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=[["263","195","0","0"],["299","233","0","0"],["300","254","0","0"],["262","260","0","0"],["248","213","0","0"],["447","128","1","1"],["459","150","1","1"],["466","178","1","1"],["462","184","1","1"],["443","189","1","1"],["430","189","1","1"],["421","150","1","1"],["424","134","1","1"],["420","110","1","1"],["426","96","1","1"],["445","100","1","1"],["448","35","2","2"],["462","76","2","2"],["446","87","2","2"],["429","78","2","2"],["411","78","2","2"],["395","79","2","2"],["387","64","2","2"],["409","50","2","2"],["427","46","2","2"]];
var backSrc="04enerxia02_resources/media/bicicleta.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(263,195),new Point(299,233),new Point(300,254),new Point(262,260),new Point(248,213)],[new Point(447,128),new Point(459,150),new Point(466,178),new Point(462,184),new Point(443,189),new Point(430,189),new Point(421,150),new Point(424,134),new Point(420,110),new Point(426,96),new Point(445,100)],[new Point(448,35),new Point(462,76),new Point(446,87),new Point(429,78),new Point(411,78),new Point(395,79),new Point(387,64),new Point(409,50),new Point(427,46)]];
var game=[];indexGame=0;
var area=["0","1","2"];
var areaSolved=["N","N","N"];
var areaWord=["Pedal","Dínamo","Foco"];
var areaHelp=["Lugar onde a túa enerxía convírtese en mecánica.","Lugar onde a enerxía mecánica convértese en eléctrica","Lugar onde a enerxía eléctrica transfórmase en luminosa"];
var areaWrong=["Fíxate. Estase pedindo o lugar onde ti transmites a forza.","Non. Buscamos a dínamo.","Deberías de buscar o sitio da bici \"con luz\"."];
var initMessageError="";
var wordPointX=["263","447","448"];
var wordPointY=["195","128","35"];
var areaColor=["#D5D200","#D5D200","#D5D200"];
var pathMedia="04enerxia02_resources/media/"
var auMP3=["","",""];
var auOGG=["","",""];
var colorWord="#000000";
colorText="#000000";colorButton="#D5D200";colorBack="#FFFFFF";colorSele="#DC5A15";goURLNext=true;goURLRepeat=true;tiAval=true;
fMenssage="Verdana, Geneva, sans-serif";fActi="Verdana, Geneva, sans-serif";fEnun="Verdana, Geneva, sans-serif";
