// JavaScript Document
/* BEGIN BROWSER HANDLING, DON'T TOUCH */
isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && !document.getElementById) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;
function getObj(elementName){
  if(isNS4){ return document.layers[elementName]; }
  else if (isIE4 || isIE5){ return document.all(elementName); }
  else if (isNS6){ return document.getElementById(elementName); }
}
function Show(id){ if(getObj(id)){ getObj(id).style.display = 'block'; } }
function Hide(id){ if(getObj(id)){ getObj(id).style.display = 'none'; } }
/* END BROWSER HANDLING */

/*
we'll need to remeber which item we display so that
we can hide it later on, when we want to display a different item
*/
var previous_competitor; // this var will hold the id of the competitor
var previous_product; // this var will hold the id of the product 
var previous_system; // this var will hold the id of the type of system
var previous_clop; // this var will hold the id of the close or open system

// this function will display a list of system according to their product
function ShowProduct(competitor){
  this_competitor = "selProduct_" + competitor;
  if(previous_competitor){ Hide(previous_competitor); }
  if(previous_product){ Hide(previous_product); }
  Show(this_competitor);
  previous_competitor = this_competitor;
}

// this function will display a list of system according to their product
function ShowSystem(product){
  this_product = "selSystem_" + product;
  if(previous_product){ Hide(previous_product); }
  if(previous_system){ Hide(previous_system); }
  Show(this_product);
  previous_product = this_product;
}

// this function will display a list of close or open system according to their system
function ShowClop(system){
  this_system = "selClop_" + system;
  if(previous_system){ Hide(previous_system); }
  if(previous_clop){ Hide(previous_clop); }
  Show(this_system);
  previous_system = this_system;
}
// this function will display the description according to the chosen close or open
function ShowDesc(clop){
  this_clop = "divDesc_" + clop;
  if(previous_clop){ Hide(previous_clop); }
  Show(this_clop);
  previous_clop = this_clop;
}
