function url2imgcat(url) { return url + '/image-categorie.jpg'; }

jq(document).ready(function() {

  // Prefetch all image-categorie.jpg referenced by the menu item tag
  var url;
  jq('#layout_menu a').each(function() {
    url = url2imgcat(jq(this)[0].href);
    new Image().src = url;
  });
  

  // Change the photo when the mouse is over a menu item
  jq('#layout_menu li').mouseover( function() {
    // get the href corresponding to the LI's A element
    var href = jq(this).children()[0].href;
    // get the photo TD
    var td = jq('#layout_content_photo')
    // load the new image
    td.css('background', "url('" + url2imgcat(href) + "') no-repeat");
  });

});
