function setmode(mode)
{
  if (! document.getElementById) { return; }
  var temp = document.getElementById("modelinks");
  if(!temp) { return; }
  temp.style.display = 'block';
  if(mode==-1) {
    var theCookie=""+document.cookie;
    var ind=theCookie.indexOf('mode');
    if (ind==-1) {
      mode=1;
    } else {
      var ind1=theCookie.indexOf(';',ind);
      if (ind1==-1) ind1=theCookie.length;
      if(theCookie.substring(ind+5,ind1)=='online') mode=1; else mode=0;
    }
  }
  if(mode) {
    var temp = document.getElementById("onlinemodelink");
    temp.style.color = 'white';
    temp.style.backgroundColor = '#006000';
    var temp = document.getElementById("onlinemode");
    temp.style.display = 'block';
    var temp = document.getElementById("printmodelink");
    temp.style.color = '#338833';
    temp.style.backgroundColor = 'white';
    var temp = document.getElementById("printmode");
    temp.style.display = 'none';
    var thedate = new Date();
    thedate.setMonth(thedate.getMonth()+3);
    document.cookie = ("mode=online; domain=nzdwfc.tetrap.com; path=/archive/; expires=" + thedate.toString());
  } else {
    var temp = document.getElementById("onlinemodelink");
    temp.style.color = '#338833';
    temp.style.backgroundColor = 'white';
    var temp = document.getElementById("onlinemode");
    temp.style.display = 'none';
    var temp = document.getElementById("printmodelink");
    temp.style.color = 'white';
    temp.style.backgroundColor = '#006000';
    var temp = document.getElementById("printmode");
    temp.style.display = 'block';
    var thedate = new Date();
    thedate.setMonth(thedate.getMonth()+3);
    document.cookie = ("mode=print; domain=nzdwfc.tetrap.com; path=/archive/; expires=" + thedate.toString());
  }
  return false;
}

