// JavaScript Document
// This script alerts users of older browsers that the min-width property may not function
// correctly and that the site may not display properly.  It also alerts IE users about
// needing to refresh their browser window to get the embedded GoogleCalendar to display
// properly.

// Define variables to be tested
var browser=navigator.appName
var version=navigator.appVersion
var btype=navigator.userAgent

// This function alerts users whose browsers don't support the min-width property.
// IE7 does support it, so for users with IE6 or below it tells them to upgrade.
// Netscape just doesn't support it.  However, many browsers that do support it,
// such as Camino and Safari, identify themselves as Netscape in navigator.appName.
// Therefore, if the browser identifies itself as Netscape, we also check navigator.userAgent
// to see if it identifies itself as Gecko, which Camino, Safari etc. will.  Only if it does NOT
// is the alert displayed.  This should catch only users of Netscape Navigator.
function oldBrowser() {
	if((browser=="Microsoft Internet Explorer") && (version<7)) {
		alert("You are using an outdated browser. Some content in this site may not display correctly." + '\n' + "To best view this site, please upgrade to the newest version of your browser.")
	} else if((browser=="Netscape") && (btype.indexOf("Gecko") == -1)) {
		alert("Netscape does not support some design elements used in this site." + '\n' + "To better view this site, please use a different browser.")
	}
}

// This function alerts users IE about the refresh issue with the embedded GoogleCalendars
function alertIE(){
	if(browser=="Microsoft Internet Explorer") {
		alert("You are using Internet Explorer.  There are known" + '\n' + "issues with using Internet Explorer to display an embedded" + '\n' + "GoogleCalendar. If the calendar does not display correctly," + '\n' + "refresh your browser. You may have to refresh" + '\n' + "multiple times before the page displays correctly.")
	}
}