/* Functions used in every page for text size/colour switching
 *
 * 18-Sep-2008 [Mike Ford] Add host parameter to pass name of server containing stylesheets, for
 *                         use when referencing from a foreign server; if not supplied, defaults
 *                         to current server.
 * 31-Jul-2007 [Mike Ford] Edit generated hrefs for move to new server.
 * 16-Aug-2005 [Mike Ford] Extract into separate file. 
 */

function emit_custom_css_links()
{
  // if browserConfig object has not been defined, just return
  if (!browserConfig) return;
  
  if (arguments.length<1) {
    host = location.hostname;
  }
  else {
    host = arguments[0];
  }
  
  // Stash in settings object for later use by dynamic switcher if invoked
  browserConfig.css_host = host;

  // initialize with defaults
  var size = 'standard';
  var colour = '1';

  // if required features detected, substitute cookie values (if any)
  if (browserConfig._cookies) {
    if (lssSettings.size) size = lssSettings.size;
    if (lssSettings.colour) colour = lssSettings.colour;
  }

  // and output stylesheet links)
  document.writeln('<link rel="stylesheet" href="http://'+host+'/sys.css/text-size-'+size+'.css" type="text/css" id="css-text-size" />');
  document.writeln('<link rel="stylesheet" href="http://'+host+'/sys.css/text-colour-'+colour+'.css" type="text/css" id="css-text-colour" />');
  }
