// skip product page 
$(document).ready(function(){
  $("#product_list a, div#mv a").click(function(event){
    target = event.target;
    while (target != null && target.nodeName != 'A')
      target = target.parentNode;
    if (target != null && (url = target.href) != null) {
      product_re = /([0-9]+)-[^?\/]*\.html$/;
      product = url.match(product_re);
      if (product != null) {
//        window.location = baseDir + "product-details.php?id_product=" + product[1];
//        event.preventDefault();
          // we just change the href of the <a href=""> node so that the target attribute works
          target.href = baseDir + "product-details.php?id_product=" + product[1];
      }
    }
  });
});

// vim:sts=2 sw=2 expandtab
