/**************************************************************
Lite version, tests only for main types and browsers out there, 
this will cover you in almost all normal situations out there.

script by Tapio Markula and Harald Hope
source: http://tech.ratmachines.com/downloads/browser_detection.txt
For more in depth discussion of css and browser issues go to:
http://www.nic.fi/~tapio1/Teaching/DynamicMenusb.php#detections
http://www.nic.fi/~tapio1/Teaching/FAQ.php3
The cover page is at:
http://www.nic.fi/~tapio1/Teaching/index1.php3
***************************************************************/
var d, dom, ie, ie4, ie5x, moz, mac, win, lin, old, ie5mac, ie5xwin, op;
d = document;
n = navigator;
na = n.appVersion;
nua = n.userAgent;
win = ( na.indexOf( 'Win' ) != -1 );
mac = ( na.indexOf( 'Mac' ) != -1 );
lin = ( na.indexOf( 'Linux' ) != -1 );
if ( !d.layers ){
	dom = ( d.getElementById );
	op = ( nua.indexOf( 'Opera' ) != -1 );
	moz = ( nua.indexOf( 'Gecko' ) != -1 );
	ie = ( d.all && !op );
	ie4 = ( ie && !dom );
	/*
	ie5x tests only for functionality. ( dom||ie5x ) would be default settings. 
	Opera will register true in this test if set to identify as IE 5
	*/
	ie5x = ( d.all && dom );
	ie5mac = ( mac && ie5x );
	ie5xwin = ( win && ie5x );
}
/********************************************************
here is a sample use of the browser detector, it would load a browser specific stylesheet
for certain unsupported or improperly supported mac ie 5 css styles. The depth variable
is used so that the javascript library file can be used from anywhere in the website, you simply
insert the depth of the file like this, 
...
 <head>
 <title>Browser information Page</title>
 <meta http-equiv = "Content-Type" content = "text/html; charset = iso-8859-1" />
 <link rel = "stylesheet" type = "text/css" href = "css/main.css" />
 <script type = "text/javascript" src = "../js/browser_detection.js"> </script>
 <script type = "text/javascript">browser_css( '../' ); </script>
 </head>
in the head of the web page after the js file is loaded.
Or if you are always referring your site to the root, you wouldn't need that
 and could delete the depth variable and just use the absolute path to the root.
********************************************************/

function browser_css( depth ) {
	if ( ie ) {
		d.write('<link rel = "stylesheet" type = "text\/css" href = "' + depth + 'ie.css" \/\>');
	}
}
