/*
   ie6update.js
   Copyright (c) 2009 joonis new media
   Author: Thimo Kraemer <thimo.kraemer@joonis.de>
   Translations based on http://ie6.forteller.net
*/
(function() {
var appVer = navigator.appVersion.match(/MSIE (\d\.\d)/);
if (!appVer) return;
appVer = appVer[1];
var winVer = navigator.appVersion.match(/NT (\d\.\d)/);
winVer = winVer ? winVer[1] : 0;
var script = document.scripts[document.scripts.length - 1].src;
var path = script.slice(0, script.lastIndexOf('/') + 1);

document.write('<style type="text/css"> '
	+ '#ie6msgbox { '
	+ ' font-family: Tahoma,Verdana,Arial,Helvetica,Sans-serif,Sans; '
	+ ' font-size: 8pt; '
	+ ' font-weight: normal; '
	+ ' line-height: normal; '
	+ ' text-align: left; '
	+ ' color: #000; '
	+ ' width: auto; '
	+ ' margin: 0; '
	+ ' padding: 4px 4px 4px 25px; '
	+ ' border: none; '
	+ ' border-bottom: 2px solid #666; '
	+ ' background: #ffffe1 url(' + path + 'info.gif) 4px 4px no-repeat; '
	+ ' margin-bottom: 2.5em; '
	+ '} '
	+ '#ie6msgbox b { '
	+ ' color: #900; '
	+ '} '
	+ '#ie6msgbox a, '
	+ '#ie6msgbox a:link, '
	+ '#ie6msgbox a:visited, '
	+ '#ie6msgbox a:hover, '
	+ '#ie6msgbox a:active { '
	+ ' color: #009; '
	+ ' font-weight: bold; '
	+ ' text-decoration: none; '
	+ ' border: none; '
	+ ' background-color: transparent; '
	+ '} '
	+ '#ie6msgbox a:hover { '
	+ ' text-decoration: underline; '
	+ '} '
	+ '</style> ');

function showMsgBox() {
	var lang = navigator.browserLanguage.substr(0, 2);
	var body = document.body;
	var div = document.createElement('div');
	div.id = 'ie6msgbox';
	div.innerHTML = ''
		+ '<b>You are using an outdated version of Internet Explorer!</b><br />To get the best possible experience using websites, please upgrade your web browser to a newer version. For further details contact your system administrator or simply install one of the following free programs:<br />';

	div.innerHTML += ''
		+ '<a href="http://www.google.com/chrome" target="_blank">Google Chrome</a> | '
		+ '<a href="http://www.mozilla.com/firefox" target="_blank">Mozilla Firefox</a> | '
		+ '<a href="http://www.apple.com' + ((lang == 'en') ? '' : '/'+lang) + '/safari/download" target="_blank">Safari</a> | '
		+ '<a href="http://' + ((lang == 'de') ? lang : 'www') + '.opera.com/download" target="_blank">Opera</a>';

	var appId;
	if (appVer < 8) {
		appId = {
			'5.1': '341C2AD5-8C3D-4347-8C03-08CDECD8852B',
			'5.2': '351B4886-E538-43BF-94B9-CD0CEA34DCDC',
			'6.0': '79154FB4-C610-4A1E-811D-DFE0F1DD84D1'};
		if (appId[winVer] || (winVer <= 0 && (navigator.platform == "Win32" || navigator.platform == "Windows")))
			div.innerHTML += ' | <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID='
							 + appId[winVer] + '&DisplayLang=' + lang + '" target="_blank">Internet Explorer 8</a>';
	}
	div.style.marginBottom = body.style.marginTop;
	body.style.marginTop = '0';
	body.style.marginLeft = 'auto';
	body.style.marginRight = 'auto';
	body.style.paddingTop = '0';
	body.style.paddingLeft = '0';
	body.style.paddingRight = '0';
	
	body.insertBefore(div, body.firstChild);
}

if (appVer <= 7) window.attachEvent('onload', showMsgBox);

})();
