
var detectNoIe8_html = '';
detectNoIe8_html += '<div id="detectNoIe8">';
detectNoIe8_html += '	<div id="overlay"></div>';
detectNoIe8_html += '	<a href="http://go.microsoft.com/?linkid=9668684"><img width="720" height="294" border="0" usemap="#banner_map" src="http://go.microsoft.com/?linkid=9668683" alt="Завантажити безкоштовно Internet Explorer 8" /></a>';
detectNoIe8_html += '	<map id="banner_map" name="banner_map">';
detectNoIe8_html += '		<area href="http://go.microsoft.com/?linkid=9668685" alt="для Windows XP" title="для Windows XP" shape="rect" coords="431,149,670,193" />';
detectNoIe8_html += '		<area href="http://go.microsoft.com/?linkid=9668686" alt="для Windows Vista" title="для Windows Vista" shape="rect" coords="431,209,670,253" />';
detectNoIe8_html += '		<area href="http://go.microsoft.com/?linkid=9668684" alt="Завантажити безкоштовно Internet Explorer 8" title="Завантажити безкоштовно Internet Explorer 8" shape="rect" coords="0,0,720,294" />';
detectNoIe8_html += '	</map>';
detectNoIe8_html += '	<div id="detectNoIe8_close" onclick="hideIE8();" title="Закрити">Закрити</div>';
detectNoIe8_html += '</div>';

function SetCookie(name, value, days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
		var expires = "; expires=" + date.toGMTString();
	}
	else
	{
		var expires = "";
	}
	document.cookie = name + "=" + value + expires + "; path=/";
}

function GetCookie(name)
{
	var ca = document.cookie.split(';');
	var nameEQ = name + "=";
	for (var i=0; i < ca.length; i++)
	{
		var c = ca[i];
		while (c.charAt(0) == ' ') c = c.substring(1, c.length);	//delete spaces
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
	}
	return null;
}

function DelCookie(name)
{
	SetCookie(name, "", -1);
}

function hideIE8() 
{
	SetCookie('detectNoIe8', 'shown', 1);
	$('#detectNoIe8').remove();
}

function showIE8()
{
	var isie, ieversion;
	if (isie = /MSIE (\d+\.\d+);/.test(navigator.userAgent))
	{
		ieversion = new Number(RegExp.$1);
	}

	if (!isie || ieversion < 8)
	{
		if (navigator.cookieEnabled == true)
		{
			var ie6cookie = GetCookie('detectNoIe8');
			if (ie6cookie != "shown")
			{
				/*document.getElementById('overlay').style.display = 'block';*/
				/*document.getElementById('detectNoIe8').style.display = 'block';*/
				$('body').prepend(detectNoIe8_html);
				$('#detectNoIe8').css({left: (document.body.clientWidth - 750) / 2});
			}
		}
	}
}

$(showIE8);
