function badBrowser(){
	if($.browser.msie && parseInt($.browser.version) <= 6){ return true;}
	
	return false;
}

function getBadBrowser(c_name)
{
	if (document.cookie.length>0)
	{
	c_start=document.cookie.indexOf(c_name + "=");
	if (c_start!=-1)
		{ 
		c_start=c_start + c_name.length+1; 
		c_end=document.cookie.indexOf(";",c_start);
		if (c_end==-1) c_end=document.cookie.length;
		return unescape(document.cookie.substring(c_start,c_end));
		} 
	}
	return "";
}	

function setBadBrowser(c_name,value,expiredays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value) + ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

if(badBrowser() && getBadBrowser('browserWarning') != 'seen' ){
	$(function(){
		$("<div id='browserWarning'><p>You are currently running an outdated version of Internet Explorer. It is recommended that you upgrade your web browser immediately.  Not only will our website not look very good on older versions of Internet Explorer, neither will thousands of other websites across the Internet.</p>  <p>Even more importantly, outdated versions of Internet Explorer are simply not safe.  These old versions are full of security holes and bugs that have been fixed in new versions.  These problems make it far more likely that your computer will be infected with a virus while surfing the web, making it possible for criminals to steal your information, credit card data, e-mail passwords, and much more.</p> <p>For your saftey, we recommend that you download the latest version of Internet Explorer from the <a href='http://windowsupdate.microsoft.com'>Windows Update</a> site or switch to another web browser, such as <a href='http://getfirefox.com'>FireFox</a>, <a href='http://www.opera.com/download/'>Opera</a>, <a href='http://www.apple.com/safari/'>Safari</a> or <a href='http://www.google.com/chrome'>Chrome</a>.  If you would like to continue and view our website now, click close to hide this informational message.  Once you close this warning, it will not reappear unless your browser's cookies are cleared.</p>&nbsp;&nbsp;&nbsp;[<a href='#' id='warningClose'>close</a>] </div> ")
			.css({
				backgroundColor: '#fcfdde',
				'margin': '10% 10% 0 10%',
				'border': '1px black solid',
				'width': '80%',
				'border-top': 'solid 1px #000',
				'border-bottom': 'solid 1px #000',
				'text-align': 'center',
				'position': 'absolute',
				'z-index': '50',
				padding:'5px 5px 5px 5px'
			})
			.prependTo("body");
		
		$('#warningClose').click(function(){
			setBadBrowser('browserWarning','seen');
			$('#browserWarning').slideUp('slow');
			return false;
		});
	});	
}

