function Switcher(links, panels, initiallink, initialpanel, selected, unselected) {
  this.links=links;
  this.panels=panels;
  this.currentlink=initiallink;
  this.currentpanel=initialpanel;
  this.selected=selected;
  this.unselected=unselected;
}

Switcher.prototype.switchTo=function(link, panel) {
  var oldpanel=Elem.getById(this.currentpanel);
  var newpanel=Elem.getById(panel);
  oldpanel.setVisible(false);
  newpanel.setVisible(true);
  
  var oldlink=Elem.getById(this.currentlink);
  var newlink=Elem.getById(link);
  oldlink.ensureClassIncludes(this.unselected, true);
  oldlink.ensureClassIncludes(this.selected, false);
  newlink.ensureClassIncludes(this.selected, true);
  newlink.ensureClassIncludes(this.unselected, false);

  this.currentlink=link;
  this.currentpanel=panel;
}
