Widget:Ad Campaign

             

 // Cleanup functions for the document ready method if ( document.addEventListener ) { DOMContentLoaded = function { document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); onReady; }; } 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 ); onReady; } }; }

if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout( onReady, 1 ); }

// Mozilla, Opera and webkit 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", onReady, 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", onReady ); }

function onReady { var cpid = 4; var jsonvar = eval('jsondata' + cpid);

var crmCurrency = jsonvar.currencySymbol; document.getElementById('crm_cpid_'+cpid+'_title').innerHTML = jsonvar.title; if ( jsonvar.money_target > 0 ) { document.getElementById('crm_cpid_'+cpid+'_amt_hi').innerHTML = jsonvar.money_target_display; document.getElementById('crm_cpid_'+cpid+'_amt_low').innerHTML = crmCurrency+jsonvar.money_low; } document.getElementById('crm_cpid_'+cpid+'_amt_raised').innerHTML = jsonvar.money_raised; document.getElementById('crm_cpid_'+cpid+'_comments').innerHTML = jsonvar.about; document.getElementById('crm_cpid_'+cpid+'_donors').innerHTML = jsonvar.num_donors; document.getElementById('crm_cpid_'+cpid+'_btn_txt').innerHTML = jsonvar.button_title; document.getElementById('crm_cpid_'+cpid+'_campaign').innerHTML = jsonvar.campaign_start; if ( jsonvar.money_raised_percentage ) { var moneyRaised = jsonvar.money_raised_percentage; var percentWidth = moneyRaised.split('%'); if ( percentWidth[0] > 100 ) { moneyRaised = '100%'; } document.getElementById('crm_cpid_'+cpid+'_amt_fill').style.width = moneyRaised; document.getElementById('crm_cpid_'+cpid+'_percentage').innerHTML = jsonvar.money_raised_percentage; }

if ( !jsonvar.is_active ) { document.getElementById('crm_cpid_'+cpid+'_button').innerHTML = jsonvar.home_url; document.getElementById('crm_cpid_'+cpid+'_button').style.color = 'red'; } }

<script type="text/javascript" src="https://krcla.ourpowerbase.net/sites/all/modules/civicrm//extern/widget.php?cpageId=4&widgetId=3&format=3">