 function detectBrowserClass(modern){	
	var nBrowser = navigator.appName;
	var nVersion = navigator.appVersion;
	var nAgent = navigator.userAgent;
	
	this.version;
	this.browser;
	this.os;
	
	this.modern = (typeof modern == 'object') == true ? modern:0;	
	
	if(nVersion.indexOf('Windows') !=-1){
		this.os = 'win';
	}else{
		this.os = (nVersion.indexOf('Macintosh') !=-1) == true ? 'mac':'other';
	}
	
	if (nAgent.indexOf('Opera') !=-1){
		var strIndex = nAgent.indexOf('Opera');
		this.version = nAgent.substring((strIndex + 6), (strIndex + 9));
		this.browser = 'opera';
	}
	else if (nAgent.indexOf('Firefox') !=-1){
		var strIndex = nAgent.indexOf('Firefox');
		this.version = nAgent.substring((strIndex + 8), (strIndex + 11));
		this.browser = 'firefox';
		
	}
	else if(nAgent.indexOf('MSIE') !=-1){
		var strIndex = nAgent.indexOf('MSIE');
		this.version = nAgent.substring((strIndex + 5), (strIndex + 8));
		this.browser = 'ie';
	}
	else if (nAgent.indexOf('Safari') !=-1){
		if (nAgent.indexOf('Version') !=-1){
			var strIndex = nAgent.indexOf('Version')
			this.version = nAgent.substring((strIndex + 8), (strIndex + 11))
		}else{
			this.version = 2;
		}
		this.browser = 'safari';
	}
	else if (nAgent.indexOf('Netscape') !=-1){
		var strIndex = nAgent.indexOf('Netscape');
		this.version = nAgent.substring((strIndex + 9), (strIndex + 12));
		this.browser = 'netscape';
	}else{
		this.browser = nBrowser.toLowerCase();
		this.version = null;
	}	
	
	this.whichBrowser = function (){ return this.browser; }
	this.whichVersion = function (){ return this.version; }
	this.whichOS = function (){	return this.os; }
	
	this.getInfo = function (){
		var info = "Browser name: " + nBrowser + "<br />" +
				   "Browser version: "+ nVersion + "<br />" +
				   "User Agent: " + nAgent;
		return info;
	}
	
	this.modernBrowser = function (){				
		var isModern = false;
		if(typeof(this.modern[this.browser])=='number' || this.version === null){
			isModern = ( this.modern[this.browser] <= this.version || this.version === null ) == true ? true :0;				
		}		
		return isModern;
	}
}
 

// Instantiate browser detect
var detectBrowser = new detectBrowserClass({ 
	'opera': 9,
	'safari': 2,
	'firefox': 1.5,
	'ie': 6
});


 

// Support legacy browsers
if(detectBrowser.modernBrowser() == true){
	var ie_browser="";
	
	if(detectBrowser.whichBrowser() == 'ie'){
		ie_browser='@import "/cm/newui/blog/css/nasa/ie_footer_blog_xsl.css";';
	}
	
	 var css = '<style title="css" type="text/css">' + "\n" +
			  '@import "/cm/newui/blog/css/nasa/reset.css";' + "\n" +
			  '@import "/cm/newui/blog/css/nasa/typography.css";' + "\n" +
			  '@import "/cm/newui/blog/css/nasa/blog.css";' + "\n" +
			  ie_browser+"\n"+
			  '</style>';
	/* Support legacy browsers*/

	 if(detectBrowser.whichBrowser()=='firefox'){
	      css= css + '<link href="http://www.nasa.gov/css/207947main_etouch_firefox.css" rel="stylesheet" type="text/css" />';
         }
        	 
	 document.write(css); 
}else{
	 var legacyMsg = '<center><div class="site_errors">' + "\n" +
					'<div class="floatType_site_error_top"></div>' + "\n" +
					'<div class="floatType_site_error">' + "\n" +
					'<table cellpadding="8"> <tr> <td bgcolor="#000000">' +
					'<font color="#ffffff"><h2><img src="/cm/newui/blog/images/nasa/site_error.gif" />There\'s a problem with your browser.</h2></font>' + "\n" +
					'<font color="#ffffff"><p>You are using an unsupported web browser. To get the best experience possible, please download a compatible browser.  </p></font>' + "\n" +
					'</td> </tr> </table>' +
					'</div>' + "\n" +
					'<div class="floatType_site_error_bottom"></div>' + "\n" +
					'</div></center>' + "\n";

	document.write(legacyMsg);
	}
	
