$(document).ready(function() {
    // Odd Rows:
    $('.productsCategory div.item:nth-child(6n+1)')
        .addClass('prodCata1')
        .next().addClass('prodCata2')
        .next().addClass('prodCata3');
    
    // Even Rows:
    $('.productsCategory div.item:nth-child(6n+4)')
        .addClass('prodCatb1')
        .next().addClass('prodCatb2')
        .next().addClass('prodCatb3');
    
    // Last Item:
    $('.productsCategory div.item:last')
        .removeClass('prodCata1')
        .removeClass('prodCata2')
        .addClass('prodCata3');
    
    // Find top 3 and add border to top:
    $('.productsCategory div.item')
        .slice(0,3)
        .css('border-top','solid 1px #ccc');
    
    // Format the Price. If blank, hide it.
    $('div.productsCategory div.item span.productPrice span').each(function() {
        var priceText = $(this).text();
        var price = parseFloat(priceText);
        $(this).text('$' + price.toFixed(2));
    });
    
    $('.productListPrice').each(function() {
        if ($(this).find('span').html() == '$00.00') {
            $(this).hide();
        }
    });
    
    $('#Menu li.item').find("a:contains('Home')").removeClass('current');
    
    // Hide the first Breadcrumb element:
    if ($('div.breadCrumbs').size() >1) {
      $('div.breadCrumbs:first').hide();
    }
    
    // Sub-Category Centering:
    var totalWidth = 0;
    $('#subCategories div.item').each(function() {
        totalWidth += parseInt($(this).width() + 10);
    });
    
    $('#subCategories').width(totalWidth);
    
});