// This line depends on jQuery, and tells the browser to kick off this stuff once
// everything's fully loaded
$(document).ready(function () {
    // These two lines make set a Date variable with the current date and time
    var currentDate = new Date();
    var currentHour = currentDate.getHours();
 
    // Here we're creating a new <link /> to insert in the <head></head>
    var newCSS = document.createElement('link');
    newCSS.type = 'text/css';
    newCSS.rel = 'stylesheet';
 
    // This is where you can determine when to use which stylesheet.
    // If the current hour is before 8am or 8pm (or later), use "style_night.css"
    if (currentHour < 8 || currentHour >= 20) {
        newCSS.href = 'style_night.css';
    }
    // Otherwise, use "style.css"
    else {
        newCSS.href = 'style.css';
    }
    // This line actually does the deed, and attaches the selected stylesheet
    $("head").append(newCSS);

});
