﻿
var IEWarn = new Class({
'site': 'sitename',
'initialize': function() {
var warning = "<h1>Seu navegador atual é o Internet Explorer 6.</h1><h4>Este modelo é compatível com IE6, no entanto a sua experiência será reforçada com um navegador mais recente.</h4><p>Ao continuar a executar o Internet Explorer 6 que está aberta a todas e quaisquer vulnerabilidades de segurança descobertos desde essa data.Em outubro de 2006, a Microsoft lançou a versão 7 do Internet Explorer que, além de proporcionar maior segurança na navegação,que permite que o navegador Internet Explorer a fim de identificar como \"navegadores modernos\".A Microsoft lançou o Internet Explorer 7 como uma atualização de alta prioridade, e agora está disponível para download gratuito, sem quaisquer requisitos de certificação. A partir de 12 de fev. De 2008 a Microsoft está a forçar atualizações para o Internet Explorer 6, a fim de mover as pessoas muito melhor para a versão 7 e segura. Por favor, garantir que você não dificultar este processo. É para seu próprio bem!</p> <a class=\"external\"  href=\"http://www.microsoft.com/downloads/details.aspx?FamilyId=9AE91EBE-3385-447C-8A30-081805B2F90B\">Download Internet Explorer 7!</a>";

this.box = new Element('div', {'id': 'iewarn'}).inject(document.body, 'top');
var div = new Element('div').inject(this.box).setHTML(warning);

var click = this.toggle.bind(this);
var button = new Element('a', {'id': 'iewarn_close'}).addEvents({
'mouseover': function() {
this.addClass('cHover');
},
'mouseout': function() {
this.removeClass('cHover');
},
'click': function() {
click();
}
}).inject(div, 'top');

this.height = $('iewarn').getSize().size.y;

this.fx = new Fx.Styles(this.box, {duration: 1000}).set({'margin-top': $('iewarn').getStyle('margin-top').toInt()});
this.open = false;

var cookie = Cookie.get('IEWarn'), height = this.height;
//cookie = 'open'; // added for debug to not use the cookie value
if (!cookie || cookie == "open") this.show();
else this.fx.set({'margin-top': -height});


return ;
},

'show': function() {
this.fx.start({
'margin-top': 0
});
this.open = true;
Cookie.set('IEWarn', 'open', {duration: 7});
},
'close': function() {
var margin = this.height;
this.fx.start({
'margin-top': -margin
});
this.open = false;
Cookie.set('IEWarn', 'close', {duration: 7});
},
'status': function() {
return this.open;
},
'toggle': function() {
if (this.open) this.close();
else this.show();
}
});

window.addEvent('domready', function() {
if (window.ie6) { (function() {var iewarn = new IEWarn();}).delay(2000); }
});
