/*!
 * HIV/AIDS Locator Widget - Vertical Skin bootstrap
 *
 * Copyright 2010 ICF International
 */
(function() {
    var LOCATOR_URI = "http://locator.aids.gov",
        TARGET = /cdcwidget.js/;
    var theScripts = document.getElementsByTagName('script');
    for (var i = 0; i < theScripts.length; i++) {
        var oldWidget = theScripts[i];
        if (oldWidget.src.match(TARGET)) {
            var newWidget = document.createElement('script');
            newWidget.type = "text/javascript";
            newWidget.src = LOCATOR_URI + "/widget.js";
            try {
                newWidget.appendChild(document.createTextNode('{"skin":"actagainstaids"}'));
            } catch(e) {
                newWidget.text = '{"skin":"actagainstaids"}';
            }
            oldWidget.parentNode.insertBefore(newWidget, oldWidget);
            oldWidget.parentNode.removeChild(oldWidget);
            break;
        }
    }
})();