MyIndo.prototype.getID = function(name)
{
    var ids = $$('.' + name).reject(function(el){ return !el.id || el.id.indexOf(name + '_') !== 0 }).map(function(el){ return el.id.substring(name.length + 1, el.id.length) });
    return ids;
}
MyIndo.prototype.updateHits = function(name,data)
{
    try {
	    data.each(function(s) {
	        $(name + '_' + s.id).update(s.hits);
	    });
    } catch(e) {
    }
}
document.observe("dom:loaded", function(){
    //var ids = $$('.articlehits').reject(function(el){ return !el.id || el.id.indexOf('articlehits_') !== 0 }).map(function(el){ return el.id.substring(12, el.id.length) });
    ids = myindo.getID('articlehits');
    var data = [
        {id: 8,hits:10},
        {id: 9,hits:20}
    ];
    myindo.updateHits('articlehits',data);
});
