//    Copyright (C) 1995   Zhong Yang  zyang01@fiu.edu
//
//    This program is free software; you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation; either version 2 of the License, or
//    any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program; if not, write to the Free Software
//    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                


function delcookie (cookiename) {
  document.cookie = cookiename+"=bb; expires=Saturday, 16-Sep-90 23:59:59 GMT; path=/"+"";
}

function clear() {
    mycookies=new Array(20);
    var i=0;
    var startpoint=0;
    var whole_len=document.cookie.length;
      while(whole_len!=startpoint && i< 20)
   {
     if ((temlen=document.cookie.indexOf(";",0))!=-1)
     {
        mycookies[i]=document.cookie.substring(0,temlen);
	if((mycookies[i].substring(0,4)=="oops")||(mycookies[i].substring(0,5)==" oops"))
	{
          clen = mycookies[i].length;
          nlen= mycookies[i].indexOf("=",startpoint);
          cname= mycookies[i].substring(startpoint,nlen);
	  delcookie(cname);
          i++;
          startpoint=temlen+1
        }
     }
     else if (startpoint != whole_len)
     {
        mycookies[i]=document.cookie.substring(0,whole_len);
	if((mycookies[i].substring(0,4)=="oops")||(mycookies[i].substring(0,5)==" oops"))
	{
          clen = mycookies[i].length;
          nlen= mycookies[i].indexOf("=",startpoint);
          cname= mycookies[i].substring(startpoint,nlen);
	  delcookie(cname);
	}
        startpoint=whole_len;
     }

   }

}

