(function() {

/* Keep everything in BG variable
    augment existing variable if it exists.
*/
if ( !window.BG || typeof window.BG !== 'object') {
    window.BG = {};
}
var BG = window.BG;

BG.votdWriteCallback = function(json) {
    var votd = json.votd;
    document.write('<div style="color: rgb(0, 0, 0);">' + votd.text);
    document.write(' ~ '  + votd.reference + '. <br /><a href="' + votd.permalink +'"  title="Show this Reference" target="_blank">Show this Reference' + '</a>&nbsp;&nbsp;-or-&nbsp;&nbsp;');
    document.write('<a href="' + votd.audiolink + '" title="Listen to this Chapter" target="_blank">Hear it <img style="border:none;" alt="Listen to this Chapter" src="/images/sound.gif" border=0/></a>');
    document.write(' <br /><a href="' + votd.copyrightlink + '">' + votd.copyright + '</a>');
    document.write('</div>');
};

window.BG = BG;

})();

