ns4 = document.layers; 
ie = document.all; 
ns6 = document.getElementById && !document.all;



/*function changeStyles (id,size) { 
if (ns4) { 
alert ("Sorry, but NS4 does not allow font changes."); 
return false; 
} 
else if (ie) { 
obj = document.all[id]; 
} 
else if (ns6) { 
obj = document.getElementById(id); 
} 
if (!obj) { 
alert("unrecognized ID"); 
return false; 
} 
trace = size+"%";
//alert(trace);
obj.style.fontSize = trace;

// set cookie (TJ 28/07/04)
document.cookie = "SiteTools_FontSize=" + size + ";Path=/";
// Path=/ needs to be there because of subdirectory issues -
// see http://members.ozemail.com.au/~dcrombie/cookie4.html

return true; 
} */

function setcookie( Name, Value, Expiry, Path, Domain ) {
  if(Expiry != null) {
    var datenow = new Date();
    datenow.setTime( datenow.getTime() + Math.round(86400000*Expiry) );
    Expiry = datenow.toGMTString();
  }
  Expiry = Expiry ? '; expires='+Expiry : '';
  Path = Path ?'; path='+Path:'';
  Domain = Domain ? '; domain='+Domain : '';
  document.cookie = Name + '=' + escape(Value) + Expiry + Path + Domain;
}

function readcookie(Name) {
  var cookies = document.cookie;
  if( cookies.indexOf( Name + '=' ) == -1) { return null; }
  var start = cookies.indexOf( Name + '=' ) + Name.length + 1;
  var finish = cookies.substring( start, cookies.length );
  finish = ( finish.indexOf( ';' ) === -1 ) ? cookies.length : start + finish.indexOf( ';' );
  return unescape( cookies.substring( start, finish ) );
}

function setActiveStyleSheet(pTitle) {
  var vLoop, vLink;
  for( vLoop=0; (vLink = document.getElementsByTagName( 'link' )[vLoop]); vLoop++ ) {
    if(vLink.getAttribute( 'rel' ).indexOf( 'style' ) != -1 && vLink.getAttribute( 'title' )) {
      vLink.disabled = true;
      if(vLink.getAttribute( 'title' ) == pTitle) { vLink.disabled = false; }
    }
  }
}

function selectStyle( vcookieName, vSelection ) {
  setcookie( vcookieName, vSelection, 90, '/' );
  setActiveStyleSheet( vSelection );
}

if( document.cookie.indexOf( 'style=' ) !== -1) {
  css = readcookie( 'style' );
  setActiveStyleSheet(css);
}
