/* 
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/ClientSide/javascript.js to edit this template
 */

const numSteps = 20.0;

let boxElement;
//let prevRatio = 1.0;
//let observer;
// Set things up
window.addEventListener(
  "load",
  (event) => {
    boxElement = document.querySelector("#bread-crumbs");
    if (boxElement!==null){
        const rect = boxElement.getBoundingClientRect();
        const vizibil= (rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth));
        /*console.log("vizibil:"+vizibil);*/
        if (!vizibil)
        {
            boxElement.scrollIntoView({behavior:"smooth", block:"nearest"});
            //const scry=window.scrollY;
            const scry=document.documentElement.scrollTop;
            //alert(scry);
            //console.log("scry:"+scry.toString());
            boxElement.scrollBy({top: 1000, behavior:"smooth"});
            const scry2=document.documentElement.scrollTop;
            //console.log("scry:"+scry2.toString());
        }
        
    }
  },
  false,
);

