function viewPDF (event) {
var link = encodeURI(event.target.href);
var ifrm= document.createElement('iframe');
var width = 800;
var left = 100;
ifrm.src = link;
/// для примера
ifrm.src = 'http://mozilla.github.io/pdf.js/web/viewer.html?file=http%3A%2F%2Fasync5.org%2Fmoz%2Fpdfjs.pdf';
ifrm.setAttribute('style', 'z-index: 9999;width: '+width+'px; height: 500px; position: fixed; top: 100px; left: '+left+'px;');
var close = document.createElement('button');
close.setAttribute('type', 'button');
close.innerHTML = 'Закрыть';
close.onclick = function() {
document.body.removeChild(ifrm);
document.body.removeChild(close);
}
close.setAttribute('style', 'z-index: 9999;position: fixed; top: 100px; left: '+ (left+width+20) +'px;');
document.body.appendChild(ifrm);
document.body.appendChild(close);
}
var bpm = 132;
// Intro
var intro = beeplay({bpm: bpm})
.play(null, 2)
.play('D#5', 1/4).play('E5', 1/4).play('F#5', 1/2)
.play('B5', 1/2).play('D#5', 1/4).play('E5', 1/4)
.play('F#5', 1/4).play('B5', 1/4).play('C#6', 1/4).play('D#6', 1/4)
.play('C#6', 1/4).play('A#5', 1/4).play('B5', 1/2)
.play('F#5', 1/2).play('D#5', 1/4).play('E5', 1/4)
.play('F#5', 1/2).play('B5', 1/2)
.play('C#6', 1/4).play('A#5', 1/4).play('B5', 1/4).play('C#6', 1/4)
.play('E6', 1/4).play('D#6', 1/4).play('E6', 1/4).play('C#6', 1/4);
function multiply(){
document.getElementsByClassName('window')[0].innerhtml = '';
var a=document.forma1.t1.value*2;
alert("Ширина окна слишком велика");
var s=(a-5)/19;
var b=a+30;
if((a+30)>580)
{
alert("Ширина окна слишком велика");
return(0);
}
s = Math.ceil(s);
document.getElementsByClassName('window')[0].style.width = s*19;
var i=0;
for(i=0;i<s;i++)
{
var newdiv = document.createElement('div');
newdiv.className = 'lamel' ;
document.getElementsByClassName('window')[0].appendChild(newdiv);
}
document.forma1.res.value=s;
}
document.addEventListener('readystatechange', function(){
var btn = document.getElementsByName('button');
btn.addEventListener('click', multiply);
});