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.bongacash.com/im_html/jquery-1.4.4.min.js', 'bcimtooljquery', function() {importJS('https://i.bongacash.com/im_html/jquery.cookie.min.js', 'bcimtoolcookie');}); } else { importJS('https://i.bongacash.com/im_html/jquery.cookie.min.js', 'bcimtoolcookie'); } function imTool() { if(window.jQuery && window.jQuery.cookie) { var bcimtool = jQuery.cookie('bcimtool'); if (!bcimtool){ jQuery('body').append(['', '
', '
', '', '
'].join('')); } } else { setTimeout(imTool, 500); } } function imSlideIn() { var el = jQuery('#im_tool'); var bottom = -el.height(); el.css('bottom', bottom); jQuery('#im_tool').animate({bottom: 0}, 800); } function imSlideOut() { jQuery('#im_tool').animate({bottom: - jQuery('#im_tool').height()}, 800, function(){ jQuery(this).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 ); }