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'>Did you know that your version of Internet Explorer is out of date? Some features of our design may not display or work as intended. We recommend that you upgrade to a newer version or other web browser. A list of the most popular web browsers can be found at the follwing sites <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.microsoft.com/windows/downloads/ie/getitnow.mspx'>Internet Explorer </a>. Thanks!&nbsp;&nbsp;&nbsp;[<a href='#' id='warningClose'>close this message</a>] </div> ")
			.css({
				backgroundColor: '#f6f830', 'font-color': '#000000',

	'font-weight': 'normal', 'font-size': '14px', 'font-family': 'Comic Sans MS',
				'width': '100%',
				'border-left': 'solid 1px #000',
	'border-right': 'solid 1px #000',
				'border-bottom': 'solid 1px #000',
 'border-top': 'solid 1px #000',
					'text-align': 'left',
				padding:'5px 5px 5px 5px'
			})
			.prependTo("body");
		
		$('#warningClose').click(function(){
			setBadBrowser('browserWarning','seen');
			$('#browserWarning').slideUp('slow');
			return false;
		});
	});	
}



