// Applies different CSS files according to browser in use and the branding area
// Runs at load time in header
// Requires preloading of  browser.js
// N.B. assumes ie5 css file is loaded  as the default
//
// The variable 'brand' must be set prior to calling this script to permit alternative
// colour schemes for different brand areas, e.g. undergraduate.

var browser=browsername() ;
var version=browserversion() ;
if (browser=="ns")
 {
 if (version=="4") 
  { 
  browser="ns4"
  }
 else
  {
  browser="other"
  }
 }
// alert (browser+version);

// keep browsers to a minimum; we'll add them as and when it becomes necessary. Defaults to
// ie and assumes version 5 or later (for which pages are written)
// Standard ie5 css loads by default -- load subsidiary ie5 style sheet as required for different branding areas.
if (browser=="ie" && brand!="corporate-red") 
 { 
// alert ("applying IE css") ;
 document.write ('<link rel="stylesheet" href="'+siteroot+'css/bs_ie5_'+brand+'.css" type="text/css">') ;
 }
 // If the browser is NS4, load NS4 specific style sheet as required for different branding areas.
if (browser=="ns4") 
 { 
// alert ("applying NS4 css") ;
 document.write ('<link rel="stylesheet" href="'+siteroot+'css/bs_ns4_'+brand+'.css" type="text/css">') ;
 }
// If neither of these, load 'standard' alternative browser style sheet as required for different branding areas.
if (browser=="other") 
 { 
// alert ("applying other css") ;
 document.write ('<link rel="stylesheet" href="'+siteroot+'css/bs_oth_'+brand+'.css" type="text/css">') ;
 }

