jQuery(document).ready(function($){    
    function equalizeBoxesH(id){
        var numbox = $('\'' + id + ' .smallText').length;
        var numleftbox = $('\'' + id + ' .leftPbox').length;
        var numrightbox = $('\'' + id + ' .rightPbox').length;
        var numrows = 0;
     
        if(numleftbox > numrightbox){
            numrows = numrightbox;            
        }else{
            numrows = numleftbox;
        }
        for(var numctr = 0; numctr < numrows; numctr++){
            var numleftH = eval( '$(\'' + id + ' .leftPbox:eq(' + numctr + ')\').height();' );
            var numrightH = eval( '$(\'' + id + ' .rightPbox:eq(' + numctr + ')\').height();' );

            if(numleftH > numrightH){
                eval( '$(\'' + id + ' .rightPbox:eq(' + numctr + ')\').height(' + numleftH + ');' );                             
            }else if(numrightH > numleftH){
                eval( '$(\'' + id + ' .leftPbox:eq(' + numctr + ')\').height(' + numrightH + ');' );                                         
            }
        } 
           
        if(numbox % 2 == 1){
            eval( '$(\'' + id + ' .smallText:eq(' + (numbox-2) + ')\').addClass(\'bottomLine\');' );
            eval( '$(\'' + id + ' .smallText:eq(' + (numbox-3) + ')\').addClass(\'bottomLine\');' );
            eval( '$(\'' + id + ' .smallText:eq(' + (numbox-1) + ')\').removeClass(\'topLine\');' );
        }
    }
    equalizeBoxesH('#specialsListing');
    equalizeBoxesH('#specialsDefault');
    equalizeBoxesH('#featuredProducts');
    equalizeBoxesH('#whatsNew');
    equalizeBoxesH('#newProductsDefault');
});
