// IMPORTANT!
// This script and set of style definitions has been updated.
// Please use the following script instead
// http://www.lanl.gov/styles/verd-detect.js


var path = "http://www.lanl.gov/source/styles/v1.0/";


// Convert the Browser value to lower case
var agt = navigator.userAgent.toLowerCase(); 


// Browser variables
var is_major    =  parseInt(navigator.appVersion); 
var is_minor    =  parseFloat(navigator.appVersion);
var is_nav      = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1));
var is_nav2     = (is_nav && (is_major == 2));
var is_nav3     = (is_nav && (is_major == 3));
var is_nav4     = (is_nav && (is_major == 4));
var is_nav4up   = (is_nav && (is_major >= 4));
var is_navonly  = (is_nav && ((agt.indexOf(";nav") != -1) || (agt.indexOf("; nav") != -1)) );
var is_nav5     = (is_nav && (is_major == 5));
var is_nav5up   = (is_nav && (is_major >= 5));
var is_ie       = (agt.indexOf("msie") != -1);
var is_ie3      = (is_ie && (is_major < 4));
var is_ie4      = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.")==-1) );
var is_ie4up    = (is_ie  && (is_major >= 4));
var is_ie5      = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.")!=-1) );
var is_ie5up    = (is_ie  && !is_ie3 && !is_ie4);


// Platform variables
var is_win	= (agt.indexOf("win")!=-1);
var is_mac 	= (agt.indexOf("mac")!=-1);
var is_sun 	= (agt.indexOf("sunos")!=-1);
var is_sun4  	= (agt.indexOf("sunos 4")!=-1);
var is_sun5  	= (agt.indexOf("sunos 5")!=-1);
var is_suni86	= (is_sun && (agt.indexOf("i86")!=-1));
var is_irix  	= (agt.indexOf("irix") !=-1);    // SGI
var is_irix5 	= (agt.indexOf("irix 5") !=-1);
var is_irix6 	= ((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6") !=-1));
var is_hpux  	= (agt.indexOf("hp-ux")!=-1);
var is_hpux9 	= (is_hpux && (agt.indexOf("09.")!=-1));
var is_hpux10	= (is_hpux && (agt.indexOf("10.")!=-1));
var is_aix   	= (agt.indexOf("aix") !=-1);      // IBM
var is_aix1  	= (agt.indexOf("aix 1") !=-1);    
var is_aix2  	= (agt.indexOf("aix 2") !=-1);    
var is_aix3  	= (agt.indexOf("aix 3") !=-1);    
var is_aix4  	= (agt.indexOf("aix 4") !=-1);    
var is_linux 	= (agt.indexOf("inux")!=-1);
var is_sco   	= (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
var is_unixware = (agt.indexOf("unix_system_v")!=-1); 
var is_mpras    = (agt.indexOf("ncr")!=-1); 
var is_reliant  = (agt.indexOf("reliantunix")!=-1);
var is_dec   	= ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) || (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) || (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1)); 
var is_sinix 	= (agt.indexOf("sinix")!=-1);
var is_freebsd 	= (agt.indexOf("freebsd")!=-1);
var is_bsd 	= (agt.indexOf("bsd")!=-1);
var is_unix  	= ((agt.indexOf("x11")!=-1) || is_sun || is_irix || is_hpux || is_sco || is_unixware || is_mpras || is_reliant || is_dec || is_sinix || is_aix || is_linux || is_bsd || is_freebsd);


// Macintosh detects
if (is_mac && is_ie5up) {
	document.write('<link rel="stylesheet" href="' + path + 'verd-mac-ie5.css" type="text/css">');
	}
else if (is_mac && is_ie4up) 
	{
	document.write('<link rel="stylesheet" href="' + path + 'verd-mac-ie4.css" type="text/css">');
	}
else if (is_mac && is_nav5up) 
	{
	document.write('<link rel="stylesheet" href="' + path + 'verd-mac-ns6.css" type="text/css">');
	}
else if (is_mac && is_nav4up) 
	{
	document.write('<link rel="stylesheet" href="' + path + 'verd-mac-ns4.css" type="text/css">');
	}
else if (is_mac) 
	{
	document.write('<link rel="stylesheet" href="' + path + 'verd-mac-ns4.css" type="text/css">');
	}
	

// Windows detects
else if (is_win && is_ie5up) 
	{
	document.write('<link rel="stylesheet" href="' + path + 'verd-win-ie.css" type="text/css">');
	}
else if (is_win && is_ie4up) 
	{
	document.write('<link rel="stylesheet" href="' + path + 'verd-win-ie.css" type="text/css">');
	}
else if (is_win && is_nav5up) 
	{
	document.write('<link rel="stylesheet" href="' + path + 'verd-win-ns6.css" type="text/css">');
	}
else if (is_win && is_nav4up) 
	{
	document.write('<link rel="stylesheet" href="' + path + 'verd-win-ns4.css" type="text/css">');
	}
else if (is_win) 
	{
	document.write('<link rel="stylesheet" href="' + path + 'verd-win-ie.css" type="text/css">');
	}


// UNIX & Linux Detects
else if (is_unix && is_ie5up) 
	{
	document.write('<link rel="stylesheet" href="' + path + 'verd-unix-ie.css" type="text/css">');
	}
else if (is_unix && is_ie4up) 
	{
	document.write('<link rel="stylesheet" href="' + path + 'verd-unix-ie.css" type="text/css">');
	}
else if (is_unix && is_nav5up) 
	{
	document.write('<link rel="stylesheet" href="' + path + 'verd-unix-ns.css" type="text/css">');
	}
else if (is_unix && is_nav4up) 
	{
	document.write('<link rel="stylesheet" href="' + path + 'verd-unix-ns.css" type="text/css">');
	}
else if (is_unix) 
	{
	document.write('<link rel="stylesheet" href="' + path + 'verd-unix-ns.css" type="text/css">');
	}


// Default
else {
	document.write('<link rel="stylesheet" href="' + path + 'verd-default.css" type="text/css">');
	}
