//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 vW=900;var vH=400;var iW=900;var iH=400;var isFull=false;
function createBar(){var element = document.createElement("div");element.setAttribute("id", "ardNavBar");$(element).css("position","fixed");$(element).css("z-index", 998);
$(element).css("right",0);$(element).css("bottom",0);
document.getElementById("ardoraMain").appendChild(element);
$(element).html('<p id="startBut" title="Menú Despregable" class="butfont butLe">i</p>');
$("#startBut").on("touchstart click",function(e){if ($("#ardNB").length>0){$("#ardNB").animate({width:"0px"},500);$("#ardNB").promise().done(function(){$("#ardNB").remove();});$("#startBut").text("i");}else{
$("#startBut").text("E");var NB = document.createElement("div");NB.setAttribute("id", "ardNB");$(NB).css("position","fixed");$(NB).css("z-index", 998);
$(NB).css("right","40px");$(NB).css("bottom","0px");$(NB).css("width",0);$(NB).css("height",35);
var codeAud ='<p id="plusBut" title="Increase" class="butfont butLe">h</p><p id="zeroBut" title="" class="butfont butLe">Y</p><p id="minusBut" title="Reduce" class="butfont butLe">j</p><p id="infoBut" title="Information" class="butfont butLe">k</p><p id="fullBut" title="Full Screen" class="butfont butLe">H</p>'
$(NB).html(codeAud);document.getElementById("ardoraMain").appendChild(NB);$(NB).animate({width:"200px"},500);
$("#plusBut").on("touchstart click",function(v){vW=vW+150;vH=vH+66;$("svg").each(function () { $(this)[0].setAttribute("width",vW.toString()+"px") });$("svg").each(function () { $(this)[0].setAttribute("height",vH.toString()+"px") });});
$("#zeroBut").on("touchstart click",function(v){vW=iW;vH=iH;$("svg").each(function () { $(this)[0].setAttribute("width",vW.toString()+"px") });$("svg").each(function () { $(this)[0].setAttribute("height",vH.toString()+"px") });});
$("#minusBut").on("touchstart click",function(v){vW=vW-150;vH=vH-66;$("svg").each(function () { $(this)[0].setAttribute("width",vW.toString()+"px") });$("svg").each(function () { $(this)[0].setAttribute("height",vH.toString()+"px") });});
$("#fullBut").on("touchstart click",function(v){if (!isFull){var e = document.getElementById("ardoraMain");if (e.requestFullscreen) {e.requestFullscreen();} else if (e.mozRequestFullScreen) {e.mozRequestFullScreen();} else if (e.webkitRequestFullScreen) {e.webkitRequestFullScreen();}
document.addEventListener("fullscreenchange", function() {if (!document.fullscreen) {$("#imaFull").remove();}}, false);document.addEventListener("mozfullscreenchange", function() {if (!document.mozFullScreen) {$("#imaFull").remove();}}, false);
document.addEventListener("webkitfullscreenchange", function() {if (!document.webkitIsFullScreen) {$("#imafull").remove();;}}, false);isFull=true;}
else{var docElement, request;docElement = document;request = docElement.cancelFullScreen || docElement.webkitCancelFullScreen || docElement.mozCancelFullScreen || docElement.msCancelFullScreen || docElement.exitFullscreen; if (typeof request != "undefined" && request) {request.call(docElement);} isFull=false;}
});
$("#infoBut").on("touchstart click",function(v){if ($("#ardeInfo").length==0){var eInfo = document.createElement("div");eInfo.setAttribute("id", "ardeInfo");var codeAud = "<p>" + "CC-BY-NC-SA" + "</p>";
$(eInfo).html(codeAud);$(eInfo).css("z-index", 999);$(eInfo).css("margin",0);$(eInfo).css("position","fixed");document.getElementById("ardoraMain").appendChild(eInfo);eIH=$(eInfo).css("height");$(eInfo).css("height",0);eIW=($(document).width()-$(eInfo).width()) / 2;$("#ardeInfo").css("marginLeft", eIW.toString()+"px");
$(eInfo).css("top", "0px");$(eInfo).animate({height:eIH},500);setTimeout(function(){$("#ardeInfo").animate({height:"0px"},500);$("#ardeInfo").promise().done(function(){$("#ardeInfo").remove();})},5000);}});
}});}
