function Program(menu, block, max) {
	
	this.menu = menu;
	this.block = block;
	this.max = max;
}

Program.prototype.setSelected = function(id) {

  for (var i = 0; i<=this.max; i++) {
	  
    var menu = document.getElementById(this.menu+i);
	
	if (menu) {
      menu.className='inactive';
    }
  }
  
  var menu = document.getElementById(this.menu+id);
  menu.className='active';   
}

Program.prototype.hideAll = function hideAll() {

  for (var i = 0; i<=this.max; i++) {
	
	var block=document.getElementById(this.block+i);

	if (block) {
      block.style.display='none'; 
    }
  }
}

Program.prototype.show = function show(id) {

  var block = document.getElementById(this.block+id);
  var menu = document.getElementById(this.menu+id);

  this.hideAll();
  
  if (block) { 
    block.style.display='block';
  }
  
  if (menu) {  
    this.setSelected(id);
  }
}