function badBrowser(){
	if($.browser.msie && parseInt($.browser.version) <= 6){ return true;}
	//if($.browser.mozilla){ return true;} //Remove this line so you will not get the warning in Firefox.
	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'><div id='ie6-wrap'><h1>Alert</h1><p>It appears that you are using an outdated web browser Internet Explorer 6. While you may still visit this website we enourage you to upgrade your web broswer so you can enjoy all the rich features this website offers as well as other websites. Click on the <strong>Upgrade you Internet Explorer</strong> button below or <strong>Close this Box</strong>.</p><div><a href='http://www.microsoft.com/windows/downloads/ie/getitnow.mspx'><img src='ie6/btn-upgrade.png' width='197' height='39' alt='Upgrade Your Internet Explorer' /></a><a href='#' id='warningClose'><img src='ie6/btn-close.png' width='107' height='39' alt='Close This Box' style='margin-left:15px;' /></a></div></div></div>")
			.css({
				backgroundColor: '#fff',
				'width': '100%',
				'border-top': 'solid 1px #000',
				'border-bottom': 'solid 1px #000',
				'text-align': 'center',
				padding:'5px 0px 5px 0px'
			})
			.prependTo("body");
		
		$('#warningClose').click(function(){
			setBadBrowser('browserWarning','seen');
			$('#browserWarning').slideUp('slow');
			return false;
		});
	});	
}

