/* Polite ie warning  v1.1
* http://politeIeWarning.blogspot.com/
* Copyright 2010, nathaNJamal
* Dual licensed under the MIT or GPL Version 2 licenses.*/
(function ($) {
    $.fn.politeWarning = function (ver, msg) {
        if (!ver) ver = 7; //default warns on ie 7 and lower
        if (!msg) msg = 'Your browser is outdated. &nbsp; Consider upgrading... &nbsp;&nbsp;(<a href="http://www.google.com/chrome/intl/en/landing_chrome.html?hl=en">How?</a>)'; //default message

        //banner html
        var banner = '<div id="ieWarning"><span id="ieWarningTxt">' + msg + '</span> <div id="closeWarning">X</div></div>';

        if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { //test for MSIE x.x;
            var ieversion = new Number(RegExp.$1); // capture x.x portion and store as a number
            if (ieversion <= ver) {
                $('body').append(banner);
                $("#ieWarning").width($(window).width());
                setTimeout('$("#ieWarning").animate({"top":"0px"},1000);', 1500);
				setTimeout('$("#ieWarning").animate({ "top": "-31px" }, 500);', 10000);
            }
        }

        //close btn
        $('#closeWarning').click(function () {
            $("#ieWarning").animate({ "top": "-31px" }, 500);
        });

    };
})(jQuery);   
	
