

function JSONscriptRequest(fullUrl) {
    this.fullUrl = fullUrl;
    this.noCacheIE = '&noCacheIE=' + (new Date()).getTime();
    this.headLoc = document.getElementsByTagName("head").item(0);
    this.scriptId = 'JscriptId' + JSONscriptRequest.scriptCounter++;
}

JSONscriptRequest.scriptCounter = 1;

JSONscriptRequest.prototype.buildScriptTag = function () {
    this.scriptObj = document.createElement("script");
    this.scriptObj.setAttribute("type", "text/javascript");
    this.scriptObj.setAttribute("charset", "utf-8");
    this.scriptObj.setAttribute("src", this.fullUrl + this.noCacheIE);
    this.scriptObj.setAttribute("id", this.scriptId);
}


JSONscriptRequest.prototype.removeScriptTag = function () {
    this.headLoc.removeChild(this.scriptObj);
}


JSONscriptRequest.prototype.addScriptTag = function () {
    this.headLoc.appendChild(this.scriptObj);
}


function loadWidgetChain()
{
    get_fpw();
}


function get_fpw()
{
    var req="http://partnercache.daylife.com/npr_fluportal/widget?title=Public Media H1N1 News&limit=5&show_excerpts=0&callback=display_widget&output=json";
    bObj = new JSONscriptRequest(req);
    bObj.buildScriptTag();
    bObj.addScriptTag();
}

function display_widget(data)
{
    if (document.getElementById(window.fpw_target))
    {
        document.getElementById(window.fpw_target).innerHTML=data.html;
    }
}



loadWidgetChain();
