Multiple Resizing Columns

HTML

<div id="header"></div>
<span id="row">
<div id="col1" class="col"></div>
<div id="col2" class="col">
    <div class="feed-item">
        <img
            class="user-photo"
            src="http://1.gravatar.com/avatar/0cf940de36795741cdf8df64a222e356?size=48"
        />
        <div class="content">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
    </div>
    <div class="feed-item">
        <img
            class="user-photo"
            src="http://1.gravatar.com/avatar/0cf940de36795741cdf8df64a222e356?size=48"
        />
        <div class="content">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
        <img
            class="post-photo"
            src="http://az25936.vo.msecnd.net/rbi/c7/2bf7976e7f9aa8d417456718008609.jpg"
        />
            <div class="replyPost">
                <img
            class="user-reply-photo"
            src="http://1.gravatar.com/avatar/0cf940de36795741cdf8df64a222e356?size=48"
                />
                <div class="replyContent">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
                <img
            class="reply-photo"
                src="http://az25936.vo.msecnd.net/rbi/3c/c9ad28f79b4d171b5be69f0e4cddd1.jpg"
                />
                </div>
            </div>
        </div>
        
    </div>
    
    <div class="feed-item">
       ...

CSS

body { margin: 0px; padding: 0px; }
* { font-family: arial; font-size: 25px; }
#header { background: #FFA615; height: 50px; margin: 0px 0px 30px 0px; width: 100%; }
#row { display: block; background: #ccc; width: 991px; }
#col1 { width: 180px; margin: 0px 45px 0px 40px; }
#col2 { width: 436px; }
#col2 div.feed-item { clear: left; padding-bottom: 10px; }
#col2 div.content { margin-left: 54px; font-size: 13px; color: #444; background: #eee; }
#col2 div.replyContent { margin-left: 42px; font-size: 13px; color: #444; background: #eee; }
#col2 .user-photo { left: 0px; width: 48px; height: 48px; float: left; padding-bottom: 10px; }
#col2 .user-reply-photo { left: 0px; width: 36px; height: 36px; float: left;  padding: 0px 10px 10px 0px; }
#col2 .post-photo { width: 316px; padding-bottom:10px; }
#col2 .reply-photo { width: 274px; }
#col3 { width: 240px; margin: 0px 23px 0px 24px; }
.col { background: #444; color: #fff; float: left; }
#row, .col { height: 900px; }

JavaScript

$(function(){
    $(window).resize(function(){
        var current = $(this).width(),
            main = [922, 1152],
            col2 = [370, 540],
            col3 = [240, 300],
            dcol2 = $('#col2'),
            dcol3 = $('#col3'),
            dcol2content = dcol2.find('.content, .post-photo'),
            diff = current - main[0],
            diff_col2;
        if (current <= main[0]) {
            dcol2.css('width', col2[0]);
            dcol3.css('width', col3[0]);
            dcol2content .css('width', col2[0] - 54);
        } else if (current >= main[1]) {
            dcol2.css('width', col2[1]);
            dcol3.css('width', col3[1]);
            dcol2content .css('width', col2[1] - 54);
        } else {
            //this is where the "hard" maths happen
            diff_col2 = parseInt(diff * ((col2[1] - col2[0]) /
                ((col3[1] - col3[0]) + (col2[1] - col2[0]))), 10);
            dcol2.css('width', col2[0] + diff_col2);
            dcol3.css('width', col3[0] + diff - diff_col2);
            dcol2content .css('width', col2[0] + diff_col2 - 54);
        }
        $('#row, #header').css('width', 45+40+24+23+180+
                               dcol2.width() + dcol3.width());
        $('div:not("#col3, #col2, #col2 div")').each(function(){
             var div = $(this);
             div.html(div.width() + 'px');
        });
        
        //make the image resize with col3 
        $('#col3 img').css('width', dcol3.width());
    });
    $(window).resize();
});