$(document).ready(function() {
	
	//add Class=Last to last child of LIs
	$("li:last-child").addClass('last');
		
	
	//-------------------------------------------------------------------
	//----------- STUPID BROWSER DETECTION (IE6) ------------ (I HATE IE)
	
	//detect the sucker
	function badBrowser(){
		if($.browser.msie && parseInt($.browser.version) <= 6) {
			return true;
		} else {
			//if($.browser.mozilla || $.browser.safari){ return true;} //test Firefox or Safari
			return false;
		}
	}
	
	//plant cookie
	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());
	}
	
	//get cookie
	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 "";
	}
	
	//handle the sucker
	if(badBrowser() && getBadBrowser('browserWarning')!='seen' ){
		$("<div id='browserWarning'><h1>Warning!</h1><p>The web browser that you are currently using can not support many enhanced features in this website.<br />Please switch to <a href='http://getfirefox.com'>FireFox</a>, <a href='http://www.apple.com/safari/'>Safari</a> or <a href='http://www.microsoft.com/windows/downloads/ie/getitnow.mspx'>Internet Explorer 8</a>. Thanks!</p><a id='warningClose' href='#'>close</a></div>").prependTo("body");
	}
				
	$('div#browserWarning a#warningClose').click(function(){
		setBadBrowser('browserWarning','seen');
		$('#browserWarning').remove();
		$("div#warningBg").remove();
		return false;			 
	});
	
	
});