//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="Start";
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="Wonderful"; messageTime=""; messageError="That's not the tool we are looking for."; messageErrorG="That's not the tool we are looking for."; messageAttempts="Wait until the activity is reloaded again"; 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="MDR2b2NhaW5n"; 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=[["41","46","0","0"],["55","111","0","0"],["59","216","0","0"],["53","248","0","0"],["27","252","0","0"],["19","220","0","0"],["24","90","0","0"],["134","49","1","1"],["138","107","1","1"],["128","140","1","1"],["119","173","1","1"],["92","183","1","1"],["97","132","1","1"],["109","82","1","1"],["366","59","2","2"],["374","69","2","2"],["373","116","2","2"],["370","134","2","2"],["359","117","2","2"],["358","87","2","2"],["356","63","2","2"],["351","173","3","3"],["377","239","3","3"],["346","253","3","3"],["319","246","3","3"],["317","215","3","3"],["330","179","3","3"],["334","138","3","3"],["341","107","3","3"],["354","117","3","3"],["73","270","4","4"],["133","270","4","4"],["147","286","4","4"],["124","301","4","4"],["67","305","4","4"],["29","307","4","4"],["25","279","4","4"],["40","265","4","4"],["157","221","5","5"],["249","217","5","5"],["264","230","5","5"],["236","251","5","5"],["143","265","5","5"],["117","261","5","5"],["81","259","5","5"],["79","240","5","5"],["88","219","5","5"],["121","216","5","5"]];
var backSrc="04vocaing_resources/media/posterTools1.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(41,46),new Point(55,111),new Point(59,216),new Point(53,248),new Point(27,252),new Point(19,220),new Point(24,90)],[new Point(134,49),new Point(138,107),new Point(128,140),new Point(119,173),new Point(92,183),new Point(97,132),new Point(109,82)],[new Point(366,59),new Point(374,69),new Point(373,116),new Point(370,134),new Point(359,117),new Point(358,87),new Point(356,63)],[new Point(351,173),new Point(377,239),new Point(346,253),new Point(319,246),new Point(317,215),new Point(330,179),new Point(334,138),new Point(341,107),new Point(354,117)],[new Point(73,270),new Point(133,270),new Point(147,286),new Point(124,301),new Point(67,305),new Point(29,307),new Point(25,279),new Point(40,265)],[new Point(157,221),new Point(249,217),new Point(264,230),new Point(236,251),new Point(143,265),new Point(117,261),new Point(81,259),new Point(79,240),new Point(88,219),new Point(121,216)]];
var game=[];indexGame=0;
var area=["0","1","2","3","4","5"];
var areaSolved=["N","N","N","N","N","N"];
var areaWord=["screwdriver","screw","nail","scissors","cutter","saw"];
var areaHelp=["","","","","",""];
var areaWrong=["","","","","",""];
var initMessageError="That's not the tool we are looking for.";
var wordPointX=["41","130","366","351","73","157"];
var wordPointY=["46","100","59","173","270","221"];
var areaColor=["#6F89E6","#6F89E6","#6F89E6","#6F89E6","#6F89E6","#6F89E6"];
var imaSound='<img id="playSound" class="imaRight" src="04vocaing_resources/media/sound.png" alt="Sound"  align="right">'
var pathMedia="04vocaing_resources/media/"
var auMP3=["screwdriver.mp3","screw.mp3","nail.mp3","scissors.mp3","cutter.mp3","saw.mp3"];
var auOGG=["screwdriver.ogg","screw.ogg","nail.ogg","scissors.ogg","cutter.ogg","saw.ogg"];
var colorWord="#000000";
colorText="#000000";colorButton="#6F89E6";colorBack="#FFFFFF";colorSele="#C5E6FA";goURLNext=true;goURLRepeat=true;tiAval=true;
fMenssage="Verdana, Geneva, sans-serif";fActi="Verdana, Geneva, sans-serif";fEnun="Verdana, Geneva, sans-serif";
