function feedmanagerClass() {
    var domain=location.host.toString();

    this.keys = new Object();
    this.keys["editorsblogZrail_fd"]="http://" + domain + "/w/blogs/editorsblog/rss.xml";
    this.keys["editorsblogYrail_fd"]="http://" + domain + "/w/blogs/editorsblog/rss.xml";
    this.keys["wwdnews_fd"]="http://www.wwd.com/rss/2/news/topstory";


    this.action = new Object();
    this.action["editorsblogZrail_fd"] = populateEditorsblogZrail;
    this.action["editorsblogYrail_fd"] = populateEditorsblogYrail;
    this.action["wwdnews_fd"] = populateWwd;
    this.numItems = 3;
    this.idList = new Array();

}

var feedmanager=new feedmanagerClass();



function assignFeeds() {
    var count = 0;
    var bodyClass = document.getElementsByTagName('body')[0].className;
    var scriptTarget;
    bodyClass = bodyClass.split(" ");
    for (var i=0; i<bodyClass.length; i++) {
      if (bodyClass[i] == "home") {
        this.numItems = 3;
        break;
      }
    }

    // get rss feeds div ids
    for (fId in this.action) {

        if (document.getElementById(fId) != null) {
                this.idList[count] = fId;
                scriptTarget = document.getElementById(this.idList[count]);
                count++;
        }



    }


    // Write out the script tags
    if (scriptTarget != null && scriptTarget != undefined) {
      scriptNode = document.createElement('script');
      scriptNode.setAttribute('language','javascript');
      scriptNode.setAttribute('src','/js/loadFeeds.js');
      scriptTarget.appendChild(scriptNode);

    }




} /* end assignFeeds */

feedmanagerClass.prototype.assign=assignFeeds;

