document.observe('dom:loaded', function()
{
	if (Prototype.Browser.IE)
	{
		var version = 1;
		
		if (navigator.appVersion.indexOf('MSIE') != -1) {
			version = parseFloat(navigator.appVersion.split('MSIE')[1]);
		}
		
		if (version < 7) {
			drawIEBar();
		}
	}
});

function drawIEBar(inOptions)
{
	options = {
		link: 'http://www.microsoft.com/windows/Internet-explorer/default.aspx',
		text: "This site might require the following browser update: 'Internet Explorer 8' from 'Microsoft Corporation'. Click here to install..."
	};
	
	if (inOptions)
	{
		if (inOptions.link) {
			options.link = inOptions.link;
		}
		
		if (inOptions.text) {
			options.text = inOptions.text;
		}
	}
	
	if (Prototype.Browser.IE)
	{
		var warning = new Element('a', {
			href: options.link,
			target: '_blank'
		})
		.setStyle({
			display: 'block',
			position: 'absolute',
			top: 0,
			left: 0,
			zIndex: 1000,
			width: '100%',
			height: '21px',
			lineHeight: '22px',
			background: '#ffffe1',
			padding: '0 5px 0 5px',
			borderBottom: '1px solid #000',
			color: '#000',
			fontWeight: 'normal',
			fontSize: '11px',
			fontFamily: 'arial',
			textDecoration: 'none',
			cursor: 'default'
		})
		.observe('mouseover', function(event)
		{
			warning.setStyle({
				background: '#316ac5',
				color: '#fff'
			});
		})
		.observe('mouseout', function(event)
		{
			warning.setStyle({
				background: '#ffffe1',
				color: '#000'
			});
		});
		
		warning.appendChild(new Element('img', {src: '/labeled/images/IEshield.gif'})
			.setStyle({float: 'left', marginTop: '3px', marginRight: '5px'}));
		
		warning.appendChild(new Element('span')
			.update(options.text).setStyle({display: 'block', float: 'left'}));
		
		var body = $$('body')[0];
		
		body.setStyle({marginTop: '40px'}).appendChild(warning);
	}
}

