//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=2;
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="Ben. Vexamos máis."; messageTime=""; messageError=""; messageErrorG=""; messageAttempts="Terceiro fallo. Espera a que se recargue a actividade."; 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="MDRyZWxldm9lc3BhMDI"; 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=[["101","26","0","0"],["89","30","0","0"],["95","47","0","0"],["112","51","0","0"],["117","26","0","0"],["64","83","1","1"],["81","81","1","1"],["83","100","1","1"],["62","100","1","1"],["106","235","2","2"],["122","230","2","2"],["124","243","2","2"],["107","250","2","2"],["183","271","3","3"],["161","270","3","3"],["160","289","3","3"],["183","288","3","3"],["310","33","4","4"],["281","38","4","4"],["281","59","4","4"],["314","57","4","4"],["453","67","5","5"],["437","66","5","5"],["438","74","5","5"],["453","84","5","5"],["459","74","5","5"]];
var backSrc="04relevoespa02_resources/media/Peninsula_Iberica_-_Iberian_Peninsula.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(101,26),new Point(89,30),new Point(95,47),new Point(112,51),new Point(117,26)],[new Point(64,83),new Point(81,81),new Point(83,100),new Point(62,100)],[new Point(106,235),new Point(122,230),new Point(124,243),new Point(107,250)],[new Point(183,271),new Point(161,270),new Point(160,289),new Point(183,288)],[new Point(310,33),new Point(281,38),new Point(281,59),new Point(314,57)],[new Point(453,67),new Point(437,66),new Point(438,74),new Point(453,84),new Point(459,74)]];
var game=[];indexGame=0;
var area=["0","1","2","3","4","5"];
var areaSolved=["N","N","N","N","N","N"];
var areaWord=["Estaca de Bares","Desembocadura do Miño","Desembocadura do Guadiana","Estreito de Xibraltar","Desembocadura do Bidasoa","Fronteira España - Francia"];
var areaHelp=["Estaca de Bares","Desembocadura do Miño","Desembocadura do Guadiana","Estreito de Xibraltar","Desembocadura do Bidasoa","Fronteira, no Mediterráneo, entre Francia e España."];
var areaWrong=["Este deberías de buscalo por Galicia.","Este está en Galicia, ao outro lado xa é Portugal.","Este atópase na costa sur da península, fai fronteira con Portugal","Non. Entre España e África.","Este río desemboca no Cantábrico.","Fíxate ben!"];
var initMessageError="";
var wordPointX=["101","64","106","177","297","453"];
var wordPointY=["26","83","235","271","37","67"];
var areaColor=["#F0F0F0","#F0F0F0","#F0F0F0","#F0F0F0","#F0F0F0","#F0F0F0"];
var pathMedia="04relevoespa02_resources/media/"
var auMP3=["","","","","",""];
var auOGG=["","","","","",""];
colorText="#2B2B2B";colorButton="#858B00";colorBack="#FFFFFF";colorSele="#F8F5D7";goURLNext=true;goURLRepeat=true;tiAval=true;
fMenssage="Verdana, Geneva, sans-serif";fActi="Verdana, Geneva, sans-serif";fEnun="Verdana, Geneva, sans-serif";
