function adjustStyle(width, height) {
    width = parseInt(width);
    height = parseInt(height);
    
    // check the height:
    if (height < 650) {
        $("#size-stylesheet").attr("href", "css/smallheight.css");
    } else if (height >= 650) {
        $("#size-stylesheet").attr("href", "css/bigheight.css");
    }
    
    // check the width:
    else if (width < 970) {
        $("#size-stylesheet").attr("href", "css/smallwidth.css");
    } else if (width >= 970) {
        $("#size-stylesheet").attr("href", "css/bigwidth.css");
    } 
}

$(function() {
    adjustStyle($(this).width(), $(this).height());
    $(window).resize(function() {
        adjustStyle($(this).width(), $(this).height());
    });
});