function RelContent(id, slots) {
    this.slots   = slots;
    this.items   = [];
    this.tiles   = [];
    this.pointer = 0;

    if(document && isMethodType(typeof document.getElementById)) {
        var e, c;
        
        if((e = document.getElementById(id))) {
            var scroller;

            if((c = getChildren(e))) {
                for(var i = 0; i < c.length; i++) {
                    if(c[i].className.indexOf('scroller') > -1) {
                        scroller = c[i];
                        
                        if(scroller.style) {
                            scroller.style.overflow = 'hidden';
                            
                            if((s = e.currentStyle)) {
                                scroller.style.width  = s.width;
                                scroller.style.height = s.height;
                            }
                            else if((s = e.computedStyle)) {
                                scroller.style.width  = s.width;
                                scroller.style.height = s.height;
                            }
                            else {
                                scroller.style.width  = 'inherit';
                                scroller.style.height = 'inherit';
                            }
                        }
                        
                        break;
                    }
                }

                if(scroller && (c = getChildren(scroller))) {
                    for(var i = 0; i < c.length; i++) {
                        this.items[i] = c[i].innerHTML;
                        
                        if(i < slots) {
                            this.tiles[i] = c[i];
                        }
                    }
                }
            }
        }
    }
}

RelContent.prototype.scroll = function(d) {
    this.pointer += d;

    for(var i = this.pointer, n = 0; i < this.pointer + this.slots; i++, n++) {
        this.tiles[n].innerHTML = this.get(i);
    }
}

RelContent.prototype.get = function(pos) {
    if(pos < 0) {
        while(pos < 0) {
            pos = this.items.length + pos;
        }
    }
    
    else if(pos >= this.items.length) {
        pos %= this.items.length;
    }
    
    return this.items[pos];
}
