//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("txtImaPronomes1.htm","_self");});
$("#embBut1").click(function() {
embedUp('<iframe width="560" height="315" src="https://www.youtube.com/embed/I_wFkJBjbfE?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>',"Connosco, convosco",600,400);
});
$("#embBut2").click(function() {
embedUp('<iframe width="560" height="315" src="https://www.youtube.com/embed/AwrsDXbgdNo?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>',"A colocación do pronome átono I",600,400);
});
$("#embBut3").click(function() {
embedUp('<iframe width="560" height="315" src="https://www.youtube.com/embed/yaZ-FtJl86E?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>',"A colocación do pronome átono II",600,400);
});
});
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();}
