2026-10-24 06:46:44 -05:00
/* BeFree OpenCart Theme — GPLv3 — generated with Grok (xAI). See README.md. */
( function () {
function read ( id ) {
var el = document . getElementById ( id );
return el ? Number ( el . value ) : 0 ;
}
function paint () {
var annual = document . getElementById ( 'pn-annual' );
if ( ! annual ) return ;
var trucks = read ( 'pn-trucks' ) || 12 ;
var gallons = read ( 'pn-gallons' ) || 8 ;
var services = read ( 'pn-services' ) || 4 ;
var total = trucks * gallons * services ;
annual . textContent = total . toLocaleString ();
var advice = document . getElementById ( 'pn-advice' );
if ( ! advice ) return ;
var pack = total > 800 ? 'a bulk tote' : ( total > 200 ? 'a drum' : 'case quantity' );
advice . textContent = 'About ' + total . toLocaleString () + ' units a year. Start the quote at ' + pack + ', then confirm the real pack size on the product label.' ;
}
document . addEventListener ( 'input' , function ( event ) {
if ( event . target && event . target . closest && event . target . closest ( '#pn-advisor' )) paint ();
});
if ( document . readyState === 'loading' ) {
document . addEventListener ( 'DOMContentLoaded' , paint );
} else {
paint ();
}
})();
2026-11-12 08:45:25 +00:00
/* Optional obfuscated address: <a class="bf-em" data-e="reversed user|domain">. No address is shipped. */
( function () {
function decodeAddresses () {
document . querySelectorAll ( 'a.bf-em[data-e]' ). forEach ( function ( anchor ) {
var raw = anchor . getAttribute ( 'data-e' ) || '' ;
var email = raw . split ( '' ). reverse (). join ( '' ). replace ( '|' , '@' );
if ( /^[^\s@]+@[^\s@]+\.[^\s@]+$/ . test ( email )) {
anchor . setAttribute ( 'href' , 'mailto:' + email );
}
});
}
if ( document . readyState === 'loading' ) {
document . addEventListener ( 'DOMContentLoaded' , decodeAddresses );
} else {
decodeAddresses ();
}
})();