//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=8; attempts=0; attemptsMax=2;
var score=0; scoreMax=8; 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="Bo traballo."; messageTime=""; messageError="Ese non é o ser vivo que buscamos."; messageErrorG="Ese non é o ser vivo que buscamos."; 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="MDRlY29zMDM"; 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=[["246","312","0","0"],["301","307","0","0"],["362","314","0","0"],["366","337","0","0"],["366","352","0","0"],["242","351","0","0"],["168","312","1","0"],["170","295","1","0"],["212","317","1","0"],["208","342","1","0"],["164","334","1","0"],["129","333","1","0"],["130","293","1","0"],["145","287","1","0"],["25","317","2","0"],["84","317","2","0"],["53","245","2","0"],["23","240","2","0"],["3","280","2","0"],["6","309","2","0"],["292","265","3","3"],["323","258","3","3"],["336","218","3","3"],["319","189","3","3"],["300","191","3","3"],["278","219","3","3"],["261","253","3","3"],["167","265","4","3"],["205","262","4","3"],["219","237","4","3"],["192","218","4","3"],["158","217","4","3"],["140","236","4","3"],["124","261","4","3"],["49","206","5","5"],["86","193","5","5"],["81","176","5","5"],["61","165","5","5"],["37","164","5","5"],["29","195","5","5"],["275","139","6","6"],["311","116","6","6"],["313","56","6","6"],["263","49","6","6"],["245","66","6","6"],["237","99","6","6"],["233","135","6","6"],["254","145","6","6"],["97","77","7","6"],["95","3","7","6"],["174","29","7","6"],["177","51","7","6"],["151","116","7","6"],["139","145","7","6"],["79","125","7","6"]];
var backSrc="04ecos03_resources/media/redeAlimentaria.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(246,312),new Point(301,307),new Point(362,314),new Point(366,337),new Point(366,352),new Point(242,351)],[new Point(168,312),new Point(170,295),new Point(212,317),new Point(208,342),new Point(164,334),new Point(129,333),new Point(130,293),new Point(145,287)],[new Point(25,317),new Point(84,317),new Point(53,245),new Point(23,240),new Point(3,280),new Point(6,309)],[new Point(292,265),new Point(323,258),new Point(336,218),new Point(319,189),new Point(300,191),new Point(278,219),new Point(261,253)],[new Point(167,265),new Point(205,262),new Point(219,237),new Point(192,218),new Point(158,217),new Point(140,236),new Point(124,261)],[new Point(49,206),new Point(86,193),new Point(81,176),new Point(61,165),new Point(37,164),new Point(29,195)],[new Point(275,139),new Point(311,116),new Point(313,56),new Point(263,49),new Point(245,66),new Point(237,99),new Point(233,135),new Point(254,145)],[new Point(97,77),new Point(95,3),new Point(174,29),new Point(177,51),new Point(151,116),new Point(139,145),new Point(79,125)]];
var game=[];indexGame=0;
var area=["0","0","0","3","3","5","6","6"];
var areaSolved=["N","N","N","N","N","N","N","N"];
var areaWord=["✓","✓","✓","✓","✓","✓","✓","✓"];
var areaHelp=["Sinala os produtores","Sinala os produtores","Sinala os produtores","Fai clic nos consumidores primarios","Fai clic nos consumidores primarios","Indica os consumidores secundarios","Cales son os consumidores terciarios?","Cales son os consumidores terciarios?"];
var areaWrong=["","","","","","","",""];
var initMessageError="Ese non é o ser vivo que buscamos.";
var wordPointX=["270","168","25","292","167","49","275","97"];
var wordPointY=["340","312","317","265","265","206","139","77"];
var areaColor=["#FF8000","#FF8000","#FF8000","#F0F0F0","#F0F0F0","#F0F0F0","#F0F0F0","#F0F0F0"];
var pathMedia="04ecos03_resources/media/"
var auMP3=["","","","","","","",""];
var auOGG=["","","","","","","",""];
var colorWord="#FF8000";
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";
