lgurlinf_bnr_1 = "/web/banner" + "inf?lg=1&f=fdmlib&bt=si&l=en&cn=&rf=&pl=1";
var bidinf_bnr_1 = false;
lgcurlinf_bnr_1 = lgurlinf_bnr_1 + "&a=click";
lgvpinf_bnr_1 = lgurlinf_bnr_1 + "&a=viewport";
var inf_bnr_1_sc=0;
function ifScrollTo(id)
{
if (document.getElementById(id) == null) {
return false;
}
hT = document.getElementById(id).getBoundingClientRect().top;
if (document.getElementById(id).offsetTop > hT) {
hT = document.getElementById(id).offsetTop;
}
hH = document.getElementById(id).offsetHeight;
wH = window.screen.height;
wS = window.scrollY;
//console.log(id + ' scrolling ' + wS + ' wH ' + wH + ' element ' + hH + ' at ' + hT);
if ( (wS > (hT+1.5*hH-wH)) && (wS < (hT+hH)) ) {
return true;
}
else return false;
}
function checkViewBegin(id)
{
if (window[id+'_sc'] == 2) {
return;
}
if (ifScrollTo(id)) {
if (window[id+'_sc'] == 0) {
//console.log('Begin view of '+id);
window[id+'_sc'] = 1;
setTimeout(function() { checkViewEnd(id); }, 1000);
}
} else {
if (window[id+'_sc'] == 1) {
//console.log('End view of '+id);
window[id+'_sc'] = 0;
}
}
}
function checkViewEnd(id)
{
if ( (window[id+'_sc']==1) && ifScrollTo(id) ) {
window[id+'_sc'] = 2;
console.log('Lgv '+id);
window['lgvp_'+id]();
}
}
document.addEventListener( "scroll", function() {
checkViewBegin('inf_bnr_1');
} );
function getid_inf_bnr_1(e) {
x = e.srcElement || e.target;
if (x.readyState == 4 && x.status == 200) {
var response = x.responseText;
bidinf_bnr_1 = response;
//console.log('R: '+response);
checkViewBegin('inf_bnr_1');
}
}
function go_inf_bnr_1(e) {
return true;
x = e.srcElement || e.target;
if (x.readyState == 4 && x.status == 200) {
//console.log('lg');
var win = window.open('https://software.informer.com/landing/', '_blank');
if (win) { win.focus(); }
}
}
function ec(e) {}
function httpGetAsync(theUrl, callback)
{
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = callback;
xmlHttp.open("GET", theUrl, true); // true for asynchronous
xmlHttp.send(null);
}
function lgcl_inf_bnr_1(event)
{
u = lgcurlinf_bnr_1 + '&bid=' + bidinf_bnr_1;
httpGetAsync(u, go_inf_bnr_1);
//event.preventDefault();
//return false;
}
function lgvp_inf_bnr_1()
{
u = lgvpinf_bnr_1 + '&bid=' + bidinf_bnr_1;
httpGetAsync(u, ec);
}
document.getElementById("inf_bnr_1").innerHTML = '\
\
\
';
httpGetAsync(lgurlinf_bnr_1, getid_inf_bnr_1);