// ZenCart Manipulation by Tim Ridgway, www.madeglobal.com, jquery

jQuery.noConflict();

jQuery(document).ready(function($){
  // adjust the width setting depending on the size of the underlying category image
  $(".categoryListBoxContents").each(function(){
      var imagewidth = $(this).find("img").attr("width");
       
      if ( imagewidth > 250) {
        $(this).css( {width: "544px"} );
      } else {
        $(this).css( {"width":"250px", "margin-left":"10px", "margin-right":"10px" } );      
      }
   });
   
   $("#categoryImgListing").each(function(){
     var imagewidth = $(this).find("img").attr("width");
          
     if ( imagewidth > 250) {
        $(this).css( {width: "544px"} );
      } else {
        $(this).css( {width: "250px"} );      
      }   });
  
  //prepend two span tags for category imagtes
  $(".categoryListBoxContents").prepend('<span class="overlay_left"></span><span class="overlay_right"');
  $("#categoryImgListing").prepend('<span class="overlay_left"></span><span class="overlay_right"');
  
  $('.categoryListBox').each(function(idx,el){
    el.style.marginTop='';
  });

});




