function nextmonth() {
  var j,mthresult,nextmo,yrresult,newurl,intyr;
  mtharray=new Array("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec");
  curmth=location.href;
  mthresult = curmth.substring(41,44);
  mthresult=mthresult.toLowerCase();
  for (j=0; j < 12; j+=1) {
    if (mthresult==mtharray[j]) nextmo=mtharray[j+1];
  }
  yrresult = curmth.substring(44,46);
  if (mthresult=="dec") {
    intyr = parseInt(yrresult,10) + 1;
    yrresult = String(intyr);
    if (yrresult.length==1) yrresult=("0" + yrresult);
    if (yrresult=="100") yrresult="00";
    nextmo="jan";
  }
  newurl="http://www.cpsc.gov/cpscpub/prerel/prerel" + nextmo + yrresult + ".html";
  var d=new Date();
  if (mthresult==mtharray[d.getMonth()]) {
    var gfy=(String(d.getFullYear()));
    if (curmth.substring(44,46)==gfy.substring(2,4)) {
      newurl="http://www.cpsc.gov/cpscpub/prerel/prerel.html";
    }
  }
  return newurl;
}


function prevmonth() {
  var j,mthresult,prevmo,yrresult,newurl,intyr;
  mtharray=new Array;
  mtharray[1] = "jan";
  mtharray[2] = "feb";
  mtharray[3] = "mar";
  mtharray[4] = "apr";
  mtharray[5] = "may";
  mtharray[6] = "jun";
  mtharray[7] = "jul";
  mtharray[8] = "aug";
  mtharray[9] = "sep";
  mtharray[10] = "oct";
  mtharray[11] = "nov";
  mtharray[12] = "dec";
  curmth=location.href;
  mthresult = curmth.substring(41,44);
  mthresult=mthresult.toLowerCase();
  for (j=0; j < 13; j+=1) {
    if (mthresult==mtharray[j]) prevmo=mtharray[j-1];
  }
  yrresult = curmth.substring(44,46);
  if (mthresult=="jan") {
    if (yrresult=="00") yrresult="100";
    intyr = parseInt(yrresult,10) - 1;
    yrresult = String(intyr);
    if (yrresult.length==1) yrresult=("0" + yrresult);
    prevmo="dec";
  }
  newurl="http://www.cpsc.gov/cpscpub/prerel/prerel" + prevmo + yrresult + ".html";
  return newurl;
}

