var Switcher = Class.create();
Switcher.prototype = {
    initialize:function(url,linksNode,resultsNode) {
        this.url = url;
        this.resultsNode = resultsNode;
        this.ids = [];
        
        $A($(linksNode).getElementsByTagName('div')).each((function(n){
            $(n).observe('click',this.fetch.bind(this,n.id));
            this.ids.push(n.id);
        }).bind(this));
        this.fetch(window.location.href.slice(window.location.href.indexOf('?')+1));
    },
    fetch:function(what){
        if(this.ids.include(what))
            new Ajax.Updater(this.resultsNode,this.url+what);
    }
};