function showform() {
    var elm = document.getElementById('bgenquiry');
    elm.style.display = "block";
}

function hideform() {
    var elm = document.getElementById('bgenquiry');
    elm.style.display = "none";
}

var sh = 0;
function showfm() {
    var elm = document.getElementById('panalbody');
    if (sh % 2 == 0) { elm.style.display = "block"; } else {elm.style.display = "none";  }
    sh++;
}

var shh = 0;
function showpanal() {
    var elm = document.getElementById('panalbody2');
    if (shh%2 == 0){ elm.style.display = "block";   }  else {  elm.style.display = "none";}
    shh++;
}
           
var shhh = 0;
function showlist() {
    var elm = document.getElementById('datalist');
    if (shhh % 2 == 0) {   elm.style.display = "block";   } else { elm.style.display = "none";}
    shhh++;
}


function Captcha() {
    var code=Math.floor(Math.random() * 8000) + 1000;
    document.getElementById("mainCaptcha").value = code;
}


function ValidCaptcha() {
var string1 = document.getElementById('mainCaptcha').value;
var string2 = document.getElementById('captchainp').value;
if (string1 == string2) {return true;} 

alert("Captcha Error");
return false;

}




document.addEventListener("DOMContentLoaded", function() {
       
    var lazyloadThrottleTimeout;
      
    function lazyload (){
        var lazyloadImages = document.querySelectorAll("iframe.lazy");
        if(lazyloadThrottleTimeout) {
            clearTimeout(lazyloadThrottleTimeout);
        }    
        
        lazyloadThrottleTimeout = setTimeout(function() {
            var scrollTop = window.pageYOffset;
            lazyloadImages.forEach(function(iframe) {
                if(iframe.offsetTop < (window.innerHeight + scrollTop)) {
                  iframe.src = iframe.dataset.src;
                  iframe.classList.remove('lazy');
                }
            });
            if(lazyloadImages.length == 0) { 
              document.removeEventListener("scroll", lazyload);
              window.removeEventListener("resize", lazyload);
              window.removeEventListener("orientationChange", lazyload);
            }
            console.log(lazyloadImages.length);
        }, 20);
    }
      
    document.addEventListener("scroll", lazyload);
    window.addEventListener("resize", lazyload);
    window.addEventListener("orientationChange", lazyload);
});
         