﻿//products-grid
document.observe("dom:loaded", function() {
 $$('.products-grid').each(function(u){
 // the product-name equil height
  var max = 0;
  u.select('[class="price-box"]').each(function(c){ 
   //if(c.getHeight() > max) max=c.getHeight(); 
   max = (c.getHeight() > max ) ? c.getHeight() : max;   
  });
//  console.log(max);
  u.select('[class="price-box"]').each(function(c){
   c.setStyle({'height':max+'px'});
  });
  
  // the product-name equil height
  var max = 0;
  u.select('[class="product-name"]').each(function(c){ 
   //if(c.getHeight() > max) max=c.getHeight(); 
   max = (c.getHeight() > max ) ? c.getHeight() : max;   
  });
//  console.log(max);
  u.select('[class="product-name"]').each(function(c){
   c.setStyle({'height':max+'px'});
  });
  
  // the content-grid equil height
  var max = 0;
  u.select('[class="content-grid"]').each(function(c){ 
  // if(c.getHeight() > max) max=c.getHeight();
   max = (c.getHeight() > max ) ? c.getHeight() : max;
  });
//  console.log(max);
  u.select('[class="content-grid"]').each(function(c){
   c.setStyle({'height':max+'px'});
  });
  
 });
 });

