function Comparati_Sizer(element_id, variable_name, tab_dom_id_3d, tab_dom_id_front, tab_dom_id_top, tab_dom_id_side){
    this.variable_name = variable_name;
    this.element_id = element_id;
    this.tab_dom_id_3d = tab_dom_id_3d;
    this.tab_dom_id_front = tab_dom_id_front;
    this.tab_dom_id_top = tab_dom_id_top;
    this.tab_dom_id_side = tab_dom_id_side;
    this.canvas_width = 430;
    this.current_pos = 0;
    this.target_pos = 0;
    this.velocity = 0;
    this.currently_updating = 0;

    this.magnitude = function(num){
          if(num < 0)
              return -1*num;
          else
              return num;
    }
    this.update = function(){
          this.velocity += 0.2*(this.target_pos - this.current_pos);
          this.current_pos += this.velocity;
          this.velocity *= 0.5;

          document.getElementById(element_id).style.left = this.current_pos+"px";

          if(this.magnitude(this.velocity) < 0.01){
              this.currently_updating = 0;
          }
          if(this.currently_updating == 1){
              setTimeout(this.variable_name + '.update()', 20);
          }
    }

    this.change_position = function(position){
          this.target_pos = position;
          if(this.currently_updating == 0){
              this.currently_updating = 1;
              this.update();
          }
    }
    this.activate_tab = function(tab) {
      document.getElementById(tab).className = "tab_on tab";
    }
    this.reset_tabs = function() {
      document.getElementById(tab_dom_id_3d).className = "tab_off tab";
      document.getElementById(tab_dom_id_front).className = "tab_off tab";
      document.getElementById(tab_dom_id_side).className = "tab_off tab";
      document.getElementById(tab_dom_id_top).className = "tab_off tab";
    }
    this.click_tab = function(tab) {
      this.reset_tabs();
      switch(tab){
          case '3d':
                this.activate_tab(tab_dom_id_3d);
                target_pos = -1*this.canvas_width*0;	
                break;
          case 'front':
                this.activate_tab(tab_dom_id_front);
                target_pos = -1*this.canvas_width*1;
                break;
          case 'side':
                this.activate_tab(tab_dom_id_side);
                target_pos = -1*this.canvas_width*2;	
                break;
          case 'top':
                this.activate_tab(tab_dom_id_top);
                target_pos = -1*this.canvas_width*3;	
                break;
          default:
                target_pos = 0;	
      }
      this.change_position(target_pos);
    }
}
