function autoHeightAndWidth(obj,h,w){
	$(obj).each( function(){
    if($(this).height() > h && h > 0){
      $(this).height(h);
    }
    if($(this).width() > w && w > 0){
      $(this).width(w);
    }
  });
}
$(document).ready(function(){

    $('#bm_ba .prd_list').appendTo('#bm_ba');

    equalHeights('.prd_list h3');
    equalHeights('#prd_list li');

$('#ltabs a').click(function(){    
    equalHeights('.prd_list h3');
    equalHeights('#prd_list li');
});
    var i = 0;
    $('.prd_list').each(function(){
        $(this).addClass('id-'+i);
        i++;
    });
    autoHeightAndWidth('.prd_list img',145,145);
    autoHeightAndWidth('.img_class img',145,145);
    
   //my carousel fix
	if (!$('#mycarousel').has("li")) {
		$('#mycarousel').remove();
		$('div[class^="jcarousel"]').remove();
	}
	if (!($('#mycarousel li').html())){
		$('#mycarousel').remove();
		$('div[class^="jcarousel"]').remove();
		$('.product-info').css({'padding-top':'15px'});
	}
	if ( ($('#mycarousel').has("li")) || ($('#mycarousel li').html()) ){
		jQuery('#mycarousel').jcarousel({
	        vertical: false,
	        scroll: 1
		});
	}
    
    if((document.getElementById('mycarousel') != null) && (document.getElementById('mycarousel').childNodes.length <= 7)){
        $('.jcarousel-next-disabled-vertical').remove();
        $('.jcarousel-prev-disabled-vertical').remove();
    }
});