function openModalWindow(i) {
$('#js-note').html(NOTES[i]);
$('#js-notes').fadeIn();
}
$(function () {
for (var i = 0; i < NOTES.length; i++) {
var selector = '#modal-open' + (i + 1);
(function (n) {
$(selector).click(function () {
openModalWindow(n);
});
})(i);
}
$('.modal .modal-bg,.modal .modal-close').click(function () {
$('#js-notes').fadeOut();
});
});