//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
$(document).ready(function(){
document.addEventListener("touchstart", touchHandler, true);document.addEventListener("touchmove", touchHandler, true);document.addEventListener("touchend", touchHandler, true);document.addEventListener("touchcancel", touchHandler, true);
$("svg").each(function () { $(this)[0].setAttribute("preserveAspectRatio","xMinYMin meet") });
 $("svg").each(function () { $(this)[0].setAttribute("viewBox","0 0 383 164")});
$("svg").each(function () { $(this)[0].setAttribute("width", "950px") });
$("svg").each(function () { $(this)[0].setAttribute("height", "408px") });
$("#b_hidrosfera").on("touchstart mouseover", function(e) {$("#b_hidrosfera").addClassSVG("c_Resalte");}).on("touchend mouseout", function(e) {$("#b_hidrosfera").removeClassSVG("c_Resalte");});
$("#b_atmosfera").on("touchstart mouseover", function(e) {$("#b_atmosfera").addClassSVG("c_Resalte");}).on("touchend mouseout", function(e) {$("#b_atmosfera").removeClassSVG("c_Resalte");});
$("#b_xeosfera").on("touchstart mouseover", function(e) {$("#b_xeosfera").addClassSVG("c_Resalte");}).on("touchend mouseout", function(e) {$("#b_xeosfera").removeClassSVG("c_Resalte");});
$("#b_rotacion").on("touchstart mouseover", function(e) {$("#b_rotacion").addClassSVG("c_Resalte");}).on("touchend mouseout", function(e) {$("#b_rotacion").removeClassSVG("c_Resalte");});
$("#b_translacion").on("touchstart mouseover", function(e) {$("#b_translacion").addClassSVG("c_Resalte");}).on("touchend mouseout", function(e) {$("#b_translacion").removeClassSVG("c_Resalte");});
$("#b_globo").on("touchstart mouseover", function(e) {$("#b_globo").addClassSVG("c_Resalte");}).on("touchend mouseout", function(e) {$("#b_globo").removeClassSVG("c_Resalte");});
$("#b_mapa").on("touchstart mouseover", function(e) {$("#b_mapa").addClassSVG("c_Resalte");}).on("touchend mouseout", function(e) {$("#b_mapa").removeClassSVG("c_Resalte");});
$("#b_lineas").on("touchstart mouseover", function(e) {$("#b_lineas").addClassSVG("c_Resalte");}).on("touchend mouseout", function(e) {$("#b_lineas").removeClassSVG("c_Resalte");});
$("#b_sistema").on("touchstart mouseover", function(e) {$("#b_sistema").addClassSVG("c_Resalte");}).on("touchend mouseout", function(e) {$("#b_sistema").removeClassSVG("c_Resalte");});
$("#l_hidrosfera").on("touchstart mouseover", function(e) {$("#b_hidrosfera").addClassSVG("c_Resalte");}).on("touchend mouseout", function(e) {$("#b_hidrosfera").removeClassSVG("c_Resalte");});
$("#l_atmosfera").on("touchstart mouseover", function(e) {$("#b_atmosfera").addClassSVG("c_Resalte");}).on("touchend mouseout", function(e) {$("#b_atmosfera").removeClassSVG("c_Resalte");});
$("#l_xeosfera").on("touchstart mouseover", function(e) {$("#b_xeosfera").addClassSVG("c_Resalte");}).on("touchend mouseout", function(e) {$("#b_xeosfera").removeClassSVG("c_Resalte");});
$("#l_rotacion").on("touchstart mouseover", function(e) {$("#b_rotacion").addClassSVG("c_Resalte");}).on("touchend mouseout", function(e) {$("#b_rotacion").removeClassSVG("c_Resalte");});
$("#l_translacion").on("touchstart mouseover", function(e) {$("#b_translacion").addClassSVG("c_Resalte");}).on("touchend mouseout", function(e) {$("#b_translacion").removeClassSVG("c_Resalte");});
$("#l_globo").on("touchstart mouseover", function(e) {$("#b_globo").addClassSVG("c_Resalte");}).on("touchend mouseout", function(e) {$("#b_globo").removeClassSVG("c_Resalte");});
$("#l_mapa").on("touchstart mouseover", function(e) {$("#b_mapa").addClassSVG("c_Resalte");}).on("touchend mouseout", function(e) {$("#b_mapa").removeClassSVG("c_Resalte");});
$("#l_lineas").on("touchstart mouseover", function(e) {$("#b_lineas").addClassSVG("c_Resalte");}).on("touchend mouseout", function(e) {$("#b_lineas").removeClassSVG("c_Resalte");});
$("#l_fases").on("touchstart mouseover", function(e) {$("#l_fases").addClassSVG("c_Resalte");}).on("touchend mouseout", function(e) {$("#l_fases").removeClassSVG("c_Resalte");});
$("#l_mareas").on("touchstart mouseover", function(e) {$("#l_mareas").addClassSVG("c_Resalte");}).on("touchend mouseout", function(e) {$("#l_mareas").removeClassSVG("c_Resalte");});
$("#l_sistema").on("touchstart mouseover", function(e) {$("#b_sistema").addClassSVG("c_Resalte");}).on("touchend mouseout", function(e) {$("#b_sistema").removeClassSVG("c_Resalte");});
$("#l_atmosfera").on("touchstart click", function(e) {window.open('esquemaTerra_resources/media/LanzaAtmosferaatmosfera.png','ww','width=374,height=705');});
$("#b_atmosfera").on("touchstart click", function(e) {window.open('esquemaTerra_resources/media/LanzaAtmosferaatmosfera.png','ww','width=374,height=705');});
$("#b_hidrosfera").on("touchstart click", function(e) {window.open('esquemaTerra_resources/media/LanzaHidrosferacicloAuga.png','ww','width=681,height=505');});
$("#l_hidrosfera").on("touchstart click", function(e) {window.open('esquemaTerra_resources/media/LanzaHidrosferacicloAuga.png','ww','width=681,height=505');});
$("#l_xeosfera").on("touchstart click", function(e) {window.open('esquemaTerra_resources/media/LanzaXeosferaterraInterno.png','ww','width=655,height=655');});
$("#b_xeosfera").on("touchstart click", function(e) {window.open('esquemaTerra_resources/media/LanzaXeosferaterraInterno.png','ww','width=655,height=655');});
$("#b_rotacion").on("touchstart click", function(e) {window.open('esquemaTerra_resources/media/LanzaRotacionrotacion.png','ww','width=543,height=655');});
$("#l_rotacion").on("touchstart click", function(e) {window.open('esquemaTerra_resources/media/LanzaRotacionrotacion.png','ww','width=543,height=655');});
$("#l_translacion").on("touchstart click", function(e) {window.open('esquemaTerra_resources/media/LanzaTranslaciontraslacion.png','ww','width=1453,height=705');});
$("#b_translacion").on("touchstart click", function(e) {window.open('esquemaTerra_resources/media/LanzaTranslaciontraslacion.png','ww','width=1453,height=705');});
$("#b_globo").on("touchstart click", function(e) {window.open('esquemaTerra_resources/media/LanzaGloboglobo.png','ww','width=557,height=705');});
$("#l_globo").on("touchstart click", function(e) {window.open('esquemaTerra_resources/media/LanzaGloboglobo.png','ww','width=557,height=705');});
$("#l_mapa").on("touchstart click", function(e) {window.open('esquemaTerra_resources/media/LanzaMapaafrica-1804896_1920.jpg','ww','width=1005,height=567');});
$("#b_mapa").on("touchstart click", function(e) {window.open('esquemaTerra_resources/media/LanzaMapaafrica-1804896_1920.jpg','ww','width=1005,height=567');});
$("#b_lineas").on("touchstart click", function(e) {window.open('esquemaTerra_resources/media/LanzaLineasparaleloMeridiano.png','ww','width=806,height=688');});
$("#l_lineas").on("touchstart click", function(e) {window.open('esquemaTerra_resources/media/LanzaLineasparaleloMeridiano.png','ww','width=806,height=688');});
$("#l_sistema").on("touchstart click", function(e) {window.open('esquemaTerra_resources/media/LanzaSistemasistemaSolar.png','ww','width=963,height=605');});
$("#b_sistema").on("touchstart click", function(e) {window.open('esquemaTerra_resources/media/LanzaSistemasistemaSolar.png','ww','width=963,height=605');});
$("#l_fases").on("touchstart click", function(e) {window.open('esquemaTerra_resources/media/LanzaFasesfasesLunares.png','ww','width=923,height=605');});
$("#l_mareas").on("touchstart click", function(e) {window.open('esquemaTerra_resources/media/LanzaEclipseseclipses.png','ww','width=1005,height=223');});
});
function randomSort(){
}
function isCorrect(){
}
function goTime(){clearInterval(timeInterval);showMessage("Time");}
function showSol(oldTypeGame){ 
}
function imaUp(ima){$("body").css("overflow","hidden");$("#ardoraActCanvas").attr({"width": $(window).width(),"height": $(window).height()});document.getElementById("ardoraActCanvas").style.zIndex=15;document.getElementById("ardoraActCanvas").style["visibility"]="visible";
document.getElementById("ardoraActCanvas").style["position"] = "fixed";document.getElementById("ardoraActCanvas").style["left"]=0;document.getElementById("ardoraActCanvas").style["top"]=0;
var alpha=0;var delta=0.03;var canvas=document.getElementById("ardoraActCanvas");var context=canvas.getContext("2d");context.beginPath();context.fillStyle="rgba(0, 0, 0, 0.25)";context.fillRect(0, 0, context.canvas.width, context.canvas.height);context.fill();var imageObj=new Image();
imageObj.onload = function() {var xCenterIma=($("#ardoraActCanvas").width()-imageObj.width) / 2;var yCenterIma=($("#ardoraActCanvas").height()-imageObj.height) / 2;context.beginPath();context.shadowColor ="rgba(0, 0, 0, 0.25)";context.shadowBlur = 10;
context.shadowOffsetX=10;context.shadowOffsetY=10;context.fill();context.beginPath();context.strokeStyle="rgba(0,0,0,1)";context.fillStyle ="rgba(255,255,255,1)";context.fillRect(xCenterIma-5,yCenterIma-5,imageObj.width+10,imageObj.height+10);
context.fill();context.rect(xCenterIma-5,yCenterIma-5,imageObj.width+10,imageObj.height+10);context.stroke();context.fill();context.shadowBlur=0;context.shadowOffsetX=0;context.shadowOffsetY = 0;loop();
function loop(){alpha+=delta;if (alpha<=1){context.clearRect(xCenterIma,yCenterIma,imageObj.width,imageObj.height);context.globalAlpha=alpha;context.drawImage(imageObj,xCenterIma,yCenterIma);requestAnimationFrame(loop);}}};
imageObj.src =ima;$("#ardoraActCanvas").css("cursor", "pointer");$("#ardoraActCanvas").click(function() {document.getElementById("ardoraActCanvas").style.zIndex=0;document.getElementById("ardoraActCanvas").style["visibility"]="hidden";canvas.width=canvas.width;$("body").css("overflow","visible");$("#ardoraActCanvas").attr({"width":2,"height":2});});}
window.requestAnimationFrame=(function(){return  window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame    || function( callback ){window.setTimeout(callback, 10000 / 60);};})();
function paintBack(){}
function svgFWords(input) {var output = ""; var chr1, chr2, chr3 = ""; var enc1, enc2, enc3, enc4 = "";var i = 0;
var btest = /[^A-Za-z0-9\+\/\=]/g; if (btest.exec(input)) { alert("Invalid characters");} input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
do { enc1 = wordsStr.indexOf(input.charAt(i++)); enc2 = wordsStr.indexOf(input.charAt(i++)); enc3 = wordsStr.indexOf(input.charAt(i++)); enc4 = wordsStr.indexOf(input.charAt(i++)); chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);chr3 = ((enc3 & 3) << 6) | enc4;
output = output + String.fromCharCode(chr1);if (enc3 != 64) {output = output + String.fromCharCode(chr2);} if (enc4 != 64) {output = output + String.fromCharCode(chr3);}
chr1 = chr2 = chr3 = ""; enc1 = enc2 = enc3 = enc4 = "";} while (i < input.length);return unescape(output);}
Array.prototype.in_array=function(){ for(var j in this){ if(this[j]==arguments[0]){return true;}}return false;}
$.fn.removeClassSVG = function(className){$(this).attr("class", function(index, existingClassNames) {var re = new RegExp(className, "g");return existingClassNames.replace(re, "");}); return this;};
$.fn.addClassSVG = function(className) {$(this).attr("class", function(index, existingClassNames) {if (existingClassNames==null) {return className;}else{return existingClassNames + " " + className;};});return this;};
function touchHandler(event) {var touch = event.changedTouches[0];var simulatedEvent = document.createEvent("MouseEvent");simulatedEvent.initMouseEvent({touchstart: "mousedown",touchmove: "mousemove",touchend: "mouseup"}[event.type], true, true, window, 1,
touch.screenX, touch.screenY,touch.clientX, touch.clientY, false,false, false, false, 0, null);touch.target.dispatchEvent(simulatedEvent);event.preventDefault();};
