var IE = true;	var NS = false;	var browser = ""; var MAC = false;	var bVersion = ""; var MOZ = false; var IEVersion = "";
function checkBrowser(){
	bVersion = navigator.appVersion;
	if(bVersion.indexOf("Mac") != -1){
		MAC = true;
	}

	if(navigator.appName.indexOf("Netscape") != -1){
		NS = true;
		IE = false;
		
		if(navigator.userAgent.indexOf("\/7") != -1){
			bVersion = "7";
		}
		
		browser = "NS" + bVersion;
		if(navigator.userAgent.indexOf("Fire") != -1){
			MOZ = true;
		}
		if(browser.indexOf("Safari") != -1){
			browser = "Safari";
			MAC = true;
		}
	}else{
		if(navigator.userAgent.indexOf("Opera") != -1){
			OPERA = true;
		}
		IE = true;
		indMSIE = bVersion.indexOf("MSIE");
		if(bVersion.indexOf("MSIE 6") != -1){
			bVersion = "6";
		}else{
			IEVersion = bVersion.substring(indMSIE+5,indMSIE+8);
			posColon = IEVersion.indexOf(";");
			bVersion = IEVersion.substring(0,posColon);
		}
		browser = "IE" + bVersion;
	}
	
	if(parseInt(bVersion) < 5){
		showBrowerDownload();
	}
}
checkBrowser();

function showBrowerDownload(){
	bName = "Internet Explorer 6";
	bID = "IE";
	bPath = "http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/EN-US/ie6setup.exe";

	if(NS){
		bName = "Netscape 7";
		bID = "NS";
		bPath = "http://ftp.netscape.com/pub/netscape7/english/7.1/windows/win32/NSSetup.exe";
	}
	
	if(OPERA){
		bName = "Opera";
		bID = "Opera";
		bPath = "http://www.opera.com/download";
	}
	
	if(MOZ){
		bName = "Firefox";
		bID = "Firefox";
		bPath = "http://www.mozila.org/products/firefox";
	}

	w = "300px";	h = "300px";
	lft = (screen.width-300)/2;
	tp = (screen.height-300)/2;

	bWin = window.open('','bWin','width='+w+',height='+h+',top='+tp+',left='+lft+',status=no,resizable=no,toolbar=no,location=no,scrollbars=no,directories=no');

	bStyle = '<link rel="stylesheet" href="'+imagePath+'stylesheets/qbebrowserpop.css" type="text/css">';
	bTitle = "<p class=\"sectiontitle\">Browser Update Required</p>";
	bMessage = "<p>QBE uses the latest in internet browsing technology to provide you with the best service possible. We have detected that you are using an older browser that does not support some of the features in our site. We recommend the following browser update.</p><br>";
	bMessage += "<a id=\"browser"+bID+"\" class=\"ctext11\" href=\""+bPath+"\">"+bName+"</a>";
	bWin.focus();
	bWin.document.open();
	bWin.document.write('<html><head>'+bStyle+'</head><body>'+bTitle+bMessage+'</body></html>');
	bWin.document.close();
}
