$(document).ready(function() {
    setWrapcontentHeight();
    setBottomlineWidth();
});
$(window).resize(function() {
    setDelfautHeight();
    setWrapcontentHeight();
    setBottomlineWidth();
});


function setWrapcontentHeight() {
    if ($.browser.safari) {
        var extraHeight =60;
    }else{
        var extraHeight =0;
    }

    var totalHeight = $(document).height();
    var bottomlineHeight = $("#bottom-line").height();

    $('#wrapper').css('height', totalHeight - bottomlineHeight + extraHeight);
    
    setMainHeight();
}

function setBottomlineWidth() {
    $("#bottom-line").css('width', 'auto');
    
    var totalHeight = $(document).width();

    $("#bottom-line").css('width', totalHeight);
}

function setMainHeight() {

    var totalHeight = $("#wrapper").height();
    var headHeight = $("#head").height();
    var footerHeight = $("#footer").height();

    $('#main').css('height', totalHeight - 77 - 35 - 10);
}

function setDelfautHeight() {
    $('#main').css('height', "auto");
    $('#wrap-content').css('height', "auto");
}