function adjustStyle() {
    width = parseInt($(this).width());
    if (width < 1440) {
        $("#size-stylesheet").attr("href", "stylesheets/small-screens.css");
    } else{
        $("#size-stylesheet").attr("href", "stylesheets/large-screens.css");
    }
};
var t = false;

function tellWidth(){ /*for the sake of testing*/
    alert($(this).width());
};

$(function() {
    adjustStyle(); //first time when the page loads
    
    $(window).resize(function() {
        if(t != false)
            clearTimeout(t);
    
        t = setTimeout(adjustStyle,1000); // timeout of 1 sec
    });
});
