
function redirectIfBadBrowser(){
		window.location = "BadBrowser.html"
}



//determine which browser is being used, if non-compliant, then redirect
function getBrowser(){
	//get browser version
	var version = parseInt(navigator.appVersion);
	//redirect if IE5 for Mac as instructed by assignment
	if(((navigator.userAgent.indexOf("MSIE 5.") != -1) && (navigator.userAgent.indexOf("Mac") != -1) && (navigator.userAgent.indexOf("Opera") == -1))){
		redirectIfBadBrowser();
		return "bad";
	}
	//redirect if Netscape 4 as instructed by assignment
	else if(((version<5) && (navigator.appName == "Netscape") && (navigator.userAgent.indexOf("Gecko") == -1))){
		redirectIfBadBrowser();
		return "bad";
	}
	//checks to see if IE complient
	else if (document.all){
		return "IE";
 	}
	
	//checks to see if Mozilla complient
	else if (document.getElementById){
		return "Mozilla";

	}

 	//code not browser complient and user is redirected
	else	{
		redirectIfBadBrowser();
		return "bad";
	}
	//alert( "IE:" + isIE +  "\nSafari:" + isSafari + "\nNS:" + isNS);
}



var browserType = getBrowser();

window.onunload = GUnload;