var num_products=7;

// Show/hide procuct group by number:
function ShowProduct(_num){
 try{
  o=eval('product_'+_num);
  ChangeDisplay(o);
 }catch(e){}
}

// Show product by parse URL of page "/pages/products/#xxxxx"
function ShowProductByLocation(){
 str_location=new String(window.location);
 a_matches=str_location.match(/\#[a-zA-Z_\-]*(\d*)$/);
// alert(a_matches);
 ShowProduct(a_matches[1]);
}

// Show/hide all products:
is_show=1;
function ShowAllProducts(){
 try{
  for(i=1;i<=num_products;i++){
   o=eval(id='product_'+i);
   SetDisplay(o,is_show);
  }
 }catch(e){
  alert('Exception on object with ID:'+id)
 }
 is_show=(is_show==1)?0:1;
}

/* Go to corresponding product:
*Need global variable: a_menu_items
*/
function GoToProducts(_id){
// alert('GoToProducts('+_id);
 window.location='/pages/products/#product_capt_'+_id;
}

//alert('products.js syntax correct!');
