function importJS(source, id, onload) { if (!document.getElementById(id)) { var JS = document.createElement("SCRIPT"); JS.type = "text/javascript"; JS.src = source; JS.id = id; if (undefined != onload) JS.onload = onload; document.getElementsByTagName("head")[0].appendChild(JS); } } /* function addUTF8Encoding() { var metaTag=document.createElement('meta'); metaTag.setAttribute('http-equiv', "Content-Type"); metaTag.content = "text/html; charset=utf-8"; document.getElementsByTagName('head')[0].appendChild(metaTag); } */ //addUTF8Encoding(); if(!window.jQuery) { importJS('https://i.bngprm.com/im_html/jquery-1.4.4.min.js', 'bcimtooljquery', function() {importJS('https://i.bngprm.com/im_html/jquery.cookie.min.js', 'bcimtoolcookie');}); } else { importJS('https://i.bngprm.com/im_html/jquery.cookie.min.js', 'bcimtoolcookie'); } function imSlideIn() { var el = jQuery('#im_tool'); if (el.css('bottom') === '0px') { return; } el.css('bottom', -el.height()); el.animate({bottom: 0}, 800); } function imSlideOut(callback) { var el = jQuery('#im_tool'); el.animate({ bottom: - el.height() }, 800, function() { if (typeof callback === 'function') { callback(); } }); } function imClose() { jQuery('#im_tool').remove(); if (undefined == jQuery.bcimtool_close_hours) { jQuery.bcimtool_close_hours = 12; } if (jQuery.bcimtool_close_hours > 0) { var date = new Date(); date.setTime(date.getTime() + (jQuery.bcimtool_close_hours * 60 * 60 * 1000)); jQuery.cookie('bcimtool', 1, {path:'/', expires:date}); } } if ( document.addEventListener ) { DOMContentLoaded = function() { document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); imTool(); }; } else if ( document.attachEvent ) { DOMContentLoaded = function() { // Make sure body exists, at least, in case IE gets a little overzealous if ( document.readyState === "complete" ) { document.detachEvent( "onreadystatechange", DOMContentLoaded ); imTool(); } }; } // Catch cases where $(document).ready() is called after the // browser event has already occurred. if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout(imTool, 1); } // Mozilla, Opera and webkit nightlies currently support this event if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); // A fallback to window.onload, that will always work //window.addEventListener( "load", imTool, false ); // If IE event model is used } else if ( document.attachEvent ) { // ensure firing before onload, // maybe late but safe also for iframes document.attachEvent("onreadystatechange", DOMContentLoaded); // A fallback to window.onload, that will always work window.attachEvent( "onload", imTool ); } function imTool() { if(window.jQuery && window.jQuery.cookie) { var bcimtool = jQuery.cookie('bcimtool'); if (!bcimtool){ jQuery('body').append(['', '', '
', '
', '', '
'].join('')); } } else { setTimeout(imTool, 500); } }