// find out the version number of IE, or 0 if some other browser
// minor variant of code at http://stackoverflow.com/questions/19999388/jquery-check-if-user-is-using-ie
function detectIE()
    {
    var ua = window.navigator.userAgent;
    var msie = ua.indexOf('MSIE ');
    var trident = ua.indexOf('Trident/');

    if (msie > 0)
        {
        // IE 10 or older => return version number
        return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
        }

    if (trident > 0)
        {
        // IE 11 (or newer) => return version number
        var rv = ua.indexOf('rv:');
        return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);
        }

    // other browser
    return 0;
}