// To alleviate the programatical obsctacle of case-sensitive naming conventions
// this first variable forces the value returned in lowercase format

var browserType = navigator.userAgent.toLowerCase();
var browser,version,total,thestring;

// The following are a list of browsers that are detected using "navigator.userAgent"
// variable Netscape is detected using the document object model at the end of the 
// "else if" statements assuming the browser has failed to return true, it is a fairly 
// safe assumption to equate the users browser as a Netscape application by way
// of default.

// Author: Leigh A. Laguisma
			
// WARNING! When adding future browsers append the code to the top of the list
																							
	//	Linux System browser																						
	if (checkIt('konqueror')) browser = "Konqueror";
	// Windows, Mac, Linux, FreeBSD, Solaris & QNX compatible browser
	else if (checkIt('opera')) browser = "Opera";
	// Mac System browser
	else if (checkIt('safari')) browser = "Safari";
	// Mac System browser
	else if (checkIt('omniweb')) browser = "OmniWeb";
	// Interactive TV-based browser
	else if (checkIt('webtv')) browser = "WebTV";
	// Mac System browser
	else if (checkIt('icab')) browser = "iCab";
	// Windows or Mac System browser
	else if (checkIt('msie')) browser = "Internet Explorer";
	// Windows, Mac & Linux compatible browser
	else if (checkIt('firefox')) browser = "Firefox";
	// Windows System browser
	else if (checkIt('communicator')){
			browser = "Netscape4";
			version = browserType.charAt(8);
	}

if (!version) version = browserType.charAt(place + thestring.length);

function checkIt(string){
place = browserType.indexOf(string) + 1;
thestring = string;
return place;
}

// Using the above we can now determine the value of the variable "browser" and 
// use it to output the appropriate cascading stylesheet

// "window.alert" which is commented out, has been left in place for debugging purposes
																							
if (browser == "Opera"){
// opera 6+
document.write('<link rel="STYLESHEET" type="text/css" href="http://www.lexisnexis.co.uk/control/opera-styling.css">');
//window.alert("I am Opera 6+");
}
else if (browser == "Internet Explorer"){
// IE
document.write('<link rel="STYLESHEET" type="text/css" href="http://www.lexisnexis.co.uk/control/ie-styling.css">');
//window.alert("I am IE");
}
else if (browser == "Firefox"){
// firefox
document.write('<link rel="STYLESHEET" type="text/css" href="http://www.lexisnexis.co.uk/control/firefox-styling.css">');
//window.alert("I am Firefox");
}
else if(browser == "Netscape4" || version < 5){
// netscape 4.x
document.write('<link rel="STYLESHEET" type="text/css" href="http://www.lexisnexis.co.uk/control/netscape4x-styling.css">');
//window.alert("I am Netscape 4.x");
}
//else if(version > 5 || browser == "Netscape6+"){
else if (document.getElementById){
// netscape 6+
document.write('<link rel="STYLESHEET" type="text/css" href="http://www.lexisnexis.co.uk/control/netscape7x-styling.css">');
//window.alert("I am Netscape 6+");
}