  function loadFoto(foto1, foto2, foto3, foto4){

    var divFon = document.createElement("div");
    divFon.className = 'fon';
    divFon.id = 'fon';
    divFon.style.width = document.body.scrollWidth + 'px';
    divFon.style.height = document.body.scrollHeight + 'px';
    document.getElementById( "bFoto" ).appendChild( divFon );

    var div = document.createElement("div");
    div.className = 'foto';
    div.id = 'foto';
    document.getElementById( "bFoto" ).appendChild( div );

    var big = document.createElement("div");
    big.id = 'big';
    var img = document.createElement("img");
    img.src = foto1;
    big.appendChild(img);
    big.style.padding = 10 + 'px';
    div.appendChild(big);

    var img = document.createElement("img");
    img.src = foto1;
    div.appendChild(img);
    img.className = 'preview1';
    img.onclick = makeBig;

    var img = document.createElement("img");
    img.src = foto2;
    div.appendChild(img);
    img.className = 'preview1';
    img.onclick = makeBig;

    var img = document.createElement("img");
    img.src = foto3;
    div.appendChild(img);
    img.className = 'preview1';
    img.onclick = makeBig;

    var img = document.createElement("img");
    img.src = foto4;
    div.appendChild(img);
    img.className = 'preview1';
    img.onclick = makeBig;

    var br = document.createElement( "br" );
    div.appendChild(br);

    var input = document.createElement( "input" );
    input.type = 'submit';
    input.name = 'escape';
    input.onclick = escape;
    input.value = 'Вийти із перегляду фото';
    div.appendChild(input);
  }
  function escape(){
    document.getElementById("bFoto").removeChild(document.getElementById("fon"));
    document.getElementById("bFoto").removeChild(document.getElementById("foto"));
  }
  function makeBig(){
    document.getElementById('big').innerHTML = "<img src = " + this.src + ">";
  }