//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() {
$("#goLeftBut").click(function() {window.open("MovementosTerra3.htm","_self");});
$("#goRightBut").click(function() {window.open("MovementosTerra5.htm","_self");});
var bWords = document.getElementsByTagName("b");if (bWords.length){for (x=0;x<bWords.length;x++){bWords[x].className="hideB";}}$("#boldBut").click(function() {hideBold();});
$("#embBut1").click(function() {
embedUp('<object width="420" height="315"><param name="movie" value="http://www.youtube.com/v/al61PZi9cO4?hl=gl_ES&amp;version=3&amp;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/al61PZi9cO4?hl=gl_ES&amp;version=3&amp;rel=0" type="application/x-shockwave-flash" width="420" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>',"Vídeo",450,350);
});
$("#urlBut2").click(function(){window.open("http://www.fourmilab.ch/cgi-bin/uncgi/Earth/action?opt=-p&img=learth.evif","_blank");});
$("#urlBut3").click(function(){window.open("https://www.google.es/maps/@-13.5430952,-83.7105037,23027353m/data=!3m1!1e3","_blank");});
$("#urlBut4").click(function(){window.open("http://science.sbcc.edu/physics/flash/LengthofDay.swf","_blank");});
$("#urlBut5").click(function(){window.open("http://eol.jsc.nasa.gov/HDEV/","_blank");});
});
function hideBold(){var bWords=document.getElementsByTagName("b");if (bWords.length){if ((bWords[0].className=="") || (bWords[0].className=="showB")){
for (x=0;x<bWords.length;x++){bWords[x].className="hideB";}}else{for (x=0;x<bWords.length;x++){bWords[x].className="showB";}}}}
function embedUp(embedURL,title,videoW,videoH){$("body").css("overflow","hidden");videoW=videoW+20;videoH=videoH+40;$("#ardoraActCanvas").attr({"width": $(window).width(),"height": $(window).height()});
document.getElementById("ardoraActCanvas").style.zIndex = 5;document.getElementById("ardoraActCanvas").style["visibility"] = "visible";var canvas = document.getElementById("ardoraActCanvas");var context = canvas.getContext("2d");
context.beginPath();context.fillStyle="rgba(0, 0, 0, 0.2)";context.fillRect(0,0,context.canvas.width, context.canvas.height);context.fill();var xCenterIma = ($("#ardoraActCanvas").width() - videoW) / 2;
var yCenterIma = ($("#ardoraActCanvas").height() - videoH) / 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,videoW+10,videoH+10);
context.fill();context.rect(xCenterIma-5,yCenterIma-5, videoW + 10, videoH + 10);context.stroke();context.fill();context.shadowBlur=0;context.shadowOffsetX=0;context.shadowOffsetY=0;
var element= document.createElement("div");element.setAttribute("id","embedDIV");var codeAud="<p>"+title+"</p><br>"+embedURL;$(element).html(codeAud);$(element).css("position","absolute");$(element).css("left",xCenterIma+10+"px");
$(element).css("top",yCenterIma+10+"px");$(element).css("z-index",999);document.getElementById("ardoraBody").appendChild(element);$("#ardoraActCanvas").css("cursor", "pointer");
$("#ardoraActCanvas").click(function () {$("#embedDIV").remove();document.getElementById("ardoraActCanvas").style.zIndex = 0;document.getElementById("ardoraActCanvas").style["visibility"] = "hidden";canvas.width = canvas.width;
$("#ardoraActCanvas").attr({"width":2,"height":2});$("body").css("overflow","visible");});}
function imaUp(ima){$("body").css("overflow","hidden");$("#ardoraActCanvas").attr({"width": $(window).width(),"height": $(window).height()});document.getElementById("ardoraActCanvas").style.zIndex=5;document.getElementById("ardoraActCanvas").style["visibility"]="visible";
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 playIt(sound){var file=document.getElementById(sound);file.load();file.play();}
