 //Author: James Dalgarno
 //DOC: March 2008
 //DLM: 23rd January 2009
 //This function will try to identify the browser. The best way to use this script is to check for IE vs other browsers
 //Text function exists if this is required to return something like a message for the user. This doesnt yet test of
 //other browsers such as Google Chrome, however chrome or other browsers tend to use the rendering engines from one of
 //the tested for browsers so UK (u)n(k)nown should never really arise.
 function checkbrowser(requested)
 {
	var BrowserWarning = "";
	var BrowserLink = "";
	var navinfo = navigator.userAgent;	
	
	if(requested == "txt")
	{	
		if(navinfo.search(/MSIE 6/i) != -1){
		BrowserWarning = 
		"<h5>Your browser is Internet Explorer Ver 6(+)</h5>";
		}
		
		if(navinfo.search(/MSIE 7/i) != -1){
    	BrowserWarning = "<h5>Your browser is Internet Explorer Ver 7(+)</h5>"
		}
		if(navinfo.search(/Opera/i) != -1){
		BrowserWarning = 
		"<h5>Your browser is Opera 9(+)</h5>";
		}
		if(navinfo.search(/Navigator/i) != -1){
		BrowserWarning = 
		"<h5>Your browser is Netscape Navigator 9(+)</h5>";
		}
		else if(navinfo.search(/Firefox/i) != -1){
    	BrowserWarning = "<h5>Your browser is Firefox Ver 2(+)</h5>";
		document.getElementById('SiteWarning').style.display='none';
		}
	
		if(BrowserWarning == ""){
		BrowserWarning = 
		"<h5>Your browser is unknown</h5>";
		} 
		return(BrowserWarning);
	}
	
	if(requested == "link"){
		BrowserLink = "";
		if(navinfo.search(/MSIE 6/i) != -1) BrowserLink = "Mozilla Firefox Website";
		if(navinfo.search(/MSIE 7/i) != -1) BrowserLink = "Mozilla Firefox Website";
		if(navinfo.search(/Opera/i) != -1) BrowserLink = "";
		if(navinfo.search(/Navigator/i) != -1) BrowserLink = "";
		else if(navinfo.search(/Firefox/i) != -1) BrowserLink = "";
		if(BrowserWarning == "null") BrowserLink = "Mozilla Firefox Website";
		return(BrowserLink);	
	}
	if(requested == "var" || requested == ""){
		if(navinfo.search(/MSIE 6/i) != -1) IDBrowser = "IE";
		if(navinfo.search(/MSIE 7/i) != -1) IDBrowser = "IE";
		if(navinfo.search(/Opera/i) != -1) IDBrowser = "OP";
		if(navinfo.search(/Navigator/i) != -1) IDBrowser = "NN";
		else if(navinfo.search(/Firefox/i) != -1) IDBrowser = "FF";
		if(BrowserWarning == "null") IDBrowser = "UK";
		return(IDBrowser);	
	}	
	
 }
