(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>' + votd.text);
    document.write(' (<a href="' + votd.permalink +'">' + votd.reference + '</a>)');
    document.write(' <a href="' + votd.audiolink + '" title="Listen to chapter"><img alt="listen to chapter" src="http://www.biblegateway.com/resources/audio/images/sound.gif" border=0/></a>');
    document.write(' <a href="' + votd.copyrightlink + '">' + votd.copyright + '</a>');
    document.write('<br/><br/>Powered by <a href="http://www.biblegateway.com/">BibleGateway.com</a>');
    document.write('</div>');
};

window.BG = BG;


})();
