//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 incre=0; timerMove=0;$(document).ready(function () {$("body").css({backgroundColor: "#FFFFFF"});
initZoom();});
function initZoom() {$("#zoomer img").css({top:0,left:0});var maskWidth=$("#zoomer").width();var maskHeight=$("#zoomer").height();var imgPos=$("#zoomer img").offset();var imgWidth = $("#zoomer img").width();
var imgHeight=$("#zoomer img").height();var x1=(imgPos.left+maskWidth)-imgWidth;var y1=(imgPos.top+maskHeight)-imgHeight;var x2 = imgPos.left;var y2 = imgPos.top;
var regionPos=$("#zoomer img").offset();var thumbPos=$("#zoomer img").parent().offset();var areaPos={top: (regionPos.top - thumbPos.top) * (-1),left: (regionPos.left-thumbPos.left)*(-1)}
$("#zoomer img").draggable({containment: [x1, y1, x2, y2],drag: function () {$("#zoomer img").css({cursor: "move"});},stop: function(){$("#zoomer img").css({cursor: "default"});}});
}
function audioUp(audioURLmp3,audioURLogg,title,audioW,audioH) {$("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.2)";context.fillRect(0, 0, context.canvas.width, context.canvas.height);context.fill();
var xCenterIma = ($("#ardoraActCanvas").width() - audioW) / 2;var yCenterIma = ($("#ardoraActCanvas").height() - audioH) / 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, audioW + 10, audioH + 10);context.fill();context.rect(xCenterIma - 5, yCenterIma - 5, audioW + 10, audioH + 10);context.stroke();context.fill();
context.shadowBlur=0;context.shadowOffsetX=0;context.shadowOffsetY=0;var element= document.createElement("div");element.setAttribute("id","audioPlayer");
var codeAud="<p style='width:"+(audioW-10).toString()+"px;'>"+title+"</p><br><audio controls>";if (audioURLogg.length){codeAud=codeAud+"<source src='"+audioURLogg+"' type='audio/ogg'/>";}
if (audioURLmp3.length){codeAdu=codeAud+"<source src='"+audioURLmp3+"' type='audio/mpeg'/>";}codeAud=codeAud+"</audio>";$(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("ardoraMain").appendChild(element);
$("#ardoraActCanvas").css("cursor","pointer");$("#ardoraActCanvas").click(function () {$("#audioPlayer").remove();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});});}
function playIt(sound) {var file = document.getElementById(sound);file.load();file.play();}
window.requestAnimationFrame=(function(){return  window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame    || function( callback ){window.setTimeout(callback, 10000 / 60);};})();
