//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=2; attempts=0; attemptsMax=1;
var score=0; scoreMax=2; 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="Moi ben. Pasemos á seguinte."; messageTime=""; messageError="Ese non é o río que se pide."; messageErrorG="Ese non é o río que se pide."; messageAttempts="Inténtao 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="MDJkaXRnYWw"; 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=[["207","227","0","0"],["198","238","0","0"],["214","250","0","0"],["234","248","0","0"],["249","241","0","0"],["259","240","0","0"],["266","250","0","0"],["282","251","0","0"],["308","249","0","0"],["327","243","0","0"],["315","229","0","0"],["302","236","0","0"],["276","239","0","0"],["265","223","0","0"],["241","228","0","0"],["228","235","0","0"],["211","230","0","0"],["269","103","1","1"],["248","90","1","1"],["223","103","1","1"],["212","128","1","1"],["219","142","1","1"],["224","151","1","1"],["210","173","1","1"],["201","187","1","1"],["198","209","1","1"],["198","224","1","1"],["183","233","1","1"],["165","240","1","1"],["151","245","1","1"],["140","255","1","1"],["135","273","1","1"],["131","283","1","1"],["142","292","1","1"],["147","272","1","1"],["154","263","1","1"],["175","260","1","1"],["190","254","1","1"],["199","239","1","1"],["207","219","1","1"],["210","200","1","1"],["227","181","1","1"],["235","160","1","1"],["241","139","1","1"],["226","125","1","1"],["237","115","1","1"],["246","115","1","1"],["251","105","1","1"]];
var backSrc="02ditgal_resources/media/galiFisico2.jpg";
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(207,227),new Point(198,238),new Point(214,250),new Point(234,248),new Point(249,241),new Point(259,240),new Point(266,250),new Point(282,251),new Point(308,249),new Point(327,243),new Point(315,229),new Point(302,236),new Point(276,239),new Point(265,223),new Point(241,228),new Point(228,235),new Point(211,230)],[new Point(269,103),new Point(248,90),new Point(223,103),new Point(212,128),new Point(219,142),new Point(224,151),new Point(210,173),new Point(201,187),new Point(198,209),new Point(198,224),new Point(183,233),new Point(165,240),new Point(151,245),new Point(140,255),new Point(135,273),new Point(131,283),new Point(142,292),new Point(147,272),new Point(154,263),new Point(175,260),new Point(190,254),new Point(199,239),new Point(207,219),new Point(210,200),new Point(227,181),new Point(235,160),new Point(241,139),new Point(226,125),new Point(237,115),new Point(246,115),new Point(251,105)]];
var game=[];indexGame=0;
var area=["0","1"];
var areaSolved=["N","N"];
var areaWord=["Río Sil","Río Miño"];
var areaHelp=["Río Sil","Río Miño"];
var areaWrong=["",""];
var initMessageError="Ese non é o río que se pide.";
var wordPointX=["240","220"];
var wordPointY=["250","210"];
var areaColor=["#FF8000","#FF8000"];
var pathMedia="02ditgal_resources/media/"
var auMP3=["",""];
var auOGG=["",""];
colorText="#2B2B2B";colorButton="#D5D200";colorBack="#FFFFFF";colorSele="#D94C00";goURLNext=true;goURLRepeat=true;tiAval=true;
fMenssage="Verdana, Geneva, sans-serif";fActi="Verdana, Geneva, sans-serif";fEnun="Verdana, Geneva, sans-serif";
