/** * If the web browser is IE6 or below, display a close-able little notice bar * on the top of the web page, to notify user to upgrade to a better browser. * * Usage: Simply include this file in the pages that you want the notice bar appear. * * Hesky Ji * Maikel Daloo * * public-beta-0.1 * 11/08/2008 */ var ua = navigator.userAgent.toLowerCase(); var client = { isStrict: document.compatMode == 'CSS1Compat', isOpera: ua.indexOf('opera') > -1, isIE: ua.indexOf('msie') > -1, isIE7: ua.indexOf('msie 7') > -1, isIE8: ua.indexOf('msie 8') > -1, isSafari: /webkit|khtml/.test(ua), isWindows: ua.indexOf('windows') != -1 || ua.indexOf('win32') != -1, isMac: ua.indexOf('macintosh') != -1 || ua.indexOf('mac os x') != -1, isLinux: ua.indexOf('linux') != -1 }; client.isBorderBox = client.isIE && !client.isStrict; client.isSafari3 = client.isSafari && !!(document.evaluate); client.isGecko = ua.indexOf('gecko') != -1 && !client.isSafari; /** * You're not sill using IE6 are you? * * @var Boolean * @private */ var ltIE7 = client.isIE && !client.isIE7 && !client.isIE8; if(ltIE7){ addLoadEvent(display_warning); } function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { func(); if (oldonload) { oldonload(); } } } } function display_warning(){ var oldHtml = document.body.innerHTML; var css_a = 'text-decoration: underline; color: black; font-weight:bold;'; var warningHtml = ""; warningHtml += ''; warningHtml += "
"; warningHtml += "
"; warningHtml += "[ close ]"; warningHtml += "
"; warningHtml += "
"; warningHtml += "Používate zastaralú verziu prehliadača Internet Explorer, stránka sa može nesprávne zobraziť alebo nemusí fungovať správne! Kliknite sem pre stiahnutie novšej verizie! Radšej však používajte Firefox alebo Google Chrome."; warningHtml += "
"; warningHtml += "
"; var spacerHTML = ""; spacerHTML += "
"; spacerHTML += "
"; var oldHTMLWrap = ""; oldHTMLWrap += "
"; oldHTMLWrap += spacerHTML; oldHTMLWrap += oldHtml; oldHTMLWrap += "
"; document.body.innerHTML = oldHTMLWrap + warningHtml; }