﻿$(document).ready(function() {

    //se houverem artigos na página
    if ($('.articleItem').length > 0) {
        //se pelo menos um artigo tem imagens
        if ($('.articleItem > .photo > img').length > 0) {
            //altero o aspecto de todos eles
            var photoWidth = $('.articleItem').children('.photo').children('img').width();
            var photoHeight = $('.articleItem').children('.photo').children('img').height();
            $('.articleItem').each(function() {
                $(this).css('overflow', 'auto');
                $(this).children('.photo').css('width', photoWidth + 'px');
                $(this).children('.photo').css('height', photoHeight + 'px');
                $(this).children('.photo').css('float', 'left');
                $(this).children('.photo').css('margin-right', '10px');


                if ($(this).children('.photo').children().length == 0) {
                    $(this).children('.photo').css('height', '60px');
                }
            });

        }
    }


});
