function ieVersion() {
  var rv = -1;
  if (navigator.appName == 'Microsoft Internet Explorer') {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}
var version = ieVersion();

if ((navigator.appName=="Microsoft Internet Explorer") && (version < 7) && readCookie('end6Off') != '1') {
	makeWindow(); 
}


function closeLayer(theobject,makeCook) {
	var makeCook = makeCook;
	document.getElementById(theobject).style.display="none";
	if (makeCook > '0') {
		createCookie('end6Off',1,14400);
	}
}


function createCookie(name,value,minutes) {
	var minutes = minutes;
	if (minutes) {
		var date = new Date();
		date.setTime(date.getTime()+(minutes*60*1000));
		var expires = "; expires="+date.toGMTString();
	} else {
		var expires = "";
	}
	document.cookie = name+"="+value+expires+"; path=/";
}


function readCookie(the_name) {
	var nameEQ = the_name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
		

function makeWindow() {
	texto = 'Você está usando um navegador desatualizado e descontinuado! Isso é perigoso! Além disso, o site não será exibido corretamente.';
	
	bit = '<div id="aviso" style="position: fixed; top: 0px; right: 0px; left: 0px; background: #FFFFE1; height: 30px; border-bottom: 1px solid #A0A0A0;">';
	bit += '<div style="margin-top: 7px; font-family: Verdana, Geneva, sans-serif; font-size: 12px;">';
	bit += '<img src="../img/error.png" width="16" height="16" align="absmiddle" style="margin-right: 5px; margin-left: 8px;" />';
	bit += '<b>Atenção:</b> '+texto;
	bit += '&nbsp;<a href="" target="_blank" style="color: #03C; font-size: 11px; text-decoration: underline; font-weight: normal;">Saiba mais!</a>';
	bit += '</div>';
	bit += '</div>';
	
	document.write(bit);
	
}