//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=5; attempts=0; attemptsMax=4;
var score=0; scoreMax=10; scoreInc=2; scoreDec=1
var typeGame=0;
var tiTime=false;
var tiTimeType=0;
var tiButtonTime=false;
var textButtonTime="Comenzar";
var tiSuccesses=false;
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=1; scoWrongDo=1; scoMessage=""; scoPtos=10;
var fMenssage="Verdana, Geneva, sans-serif";
var fActi="Verdana, Geneva, sans-serif";
var fEnun="Verdana, Geneva, sans-serif";
var timeOnMessage=3; messageOk="CONGRATULATIONS!"; messageTime=""; messageError="OOOPS!!"; messageErrorG="OOOPS!!"; messageAttempts="START 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="bGlzdGVucGNjb21wb25lbnRz"; 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=[["330","60","0","0"],["397","60","0","0"],["397","10","0","0"],["262","7","0","0"],["265","104","0","0"],["396","107","0","0"],["397","59","0","0"],["59","39","1","1"],["92","65","1","1"],["157","20","1","1"],["105","0","1","1"],["7","41","1","1"],["39","85","1","1"],["58","83","1","1"],["92","64","1","1"],["108","111","2","2"],["133","150","2","2"],["190","126","2","2"],["136","80","2","2"],["36","110","2","2"],["93","162","2","2"],["118","162","2","2"],["135","149","2","2"],["114","226","3","3"],["207","223","3","3"],["207","174","3","3"],["50","174","3","3"],["49","288","3","3"],["207","288","3","3"],["206","219","3","3"],["195","40","4","4"],["218","75","4","4"],["258","37","4","4"],["214","5","4","4"],["149","57","4","4"],["201","90","4","4"],["217","74","4","4"]];
var backSrc="listenpccomponents_resources/media/pezascomputer.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(330,60),new Point(397,60),new Point(397,10),new Point(262,7),new Point(265,104),new Point(396,107),new Point(397,59)],[new Point(59,39),new Point(92,65),new Point(157,20),new Point(105,0),new Point(7,41),new Point(39,85),new Point(58,83),new Point(92,64)],[new Point(108,111),new Point(133,150),new Point(190,126),new Point(136,80),new Point(36,110),new Point(93,162),new Point(118,162),new Point(135,149)],[new Point(114,226),new Point(207,223),new Point(207,174),new Point(50,174),new Point(49,288),new Point(207,288),new Point(206,219)],[new Point(195,40),new Point(218,75),new Point(258,37),new Point(214,5),new Point(149,57),new Point(201,90),new Point(217,74)]];
var game=[];indexGame=0;
var area=["0","1","2","3","4"];
var areaSolved=["N","N","N","N","N"];
var areaWord=["Microprocessor","Graphics card","Sound Card","RAM Modules","Hard Disk"];
var areaHelp=["","","","",""];
var areaWrong=["","","","",""];
var initMessageError="OOOPS!!";
var wordPointX=["330","59","108","114","195"];
var wordPointY=["60","39","111","226","40"];
var areaColor=["#F0F0F0","#F0F0F0","#F0F0F0","#F0F0F0","#F0F0F0"];
var imaSound='<img id="playSound" class="imaRight" src="listenpccomponents_resources/media/sound.png" alt="Sound"  align="right">'
var pathMedia="listenpccomponents_resources/media/"
var auMP3=["microprocessor.mp3","graphicscard.mp3","soundcard.mp3","RAMmodules.mp3","harddisk.mp3"];
var auOGG=["","","","",""];
var colorWord="#000000";
colorText="#2B2B2B";colorButton="#0086FF";colorBack="#FFFFFF";colorSele="#CBDDEB";goURLNext=true;goURLRepeat=true;tiAval=true;
fMenssage="Verdana, Geneva, sans-serif";fActi="Verdana, Geneva, sans-serif";fEnun="Verdana, Geneva, sans-serif";
