function enterForum(user) {
	writeCookie("panForaUser-AdminDemo",user,"","/AdminDemo");
	// AdminWin = window.open("/AdminDemo/cgi-bin/Forum.cgi?fid=AdminDemo", "AdminWin");
}

function enterAdmin(user) {
	writeCookie("panForaUser-AdminDemo",user,"","/AdminDemo");
	// AdminWin = window.open("/AdminDemo/cgi-bin/_AFAdminMenu.cgi?fid=AdminDemo", "AdminWin");
}

function writeCookie(Name,Value,Days,Path) {
   var newCookie = "";

   newCookie = Name + "=" + escape(Value);

   // Cookie Date init
   if (Days != 0 && Days != "") {
	   var tim = new Date();
	   tim.setTime(tim.getTime() + (24 * 60 * 60 * 1000 * Days ));
	   expDate = tim.toGMTString();
   
	   newCookie += '; EXPIRES=' + expDate;
   }

   if ((Path) && Path != "") {
	   newCookie += '; PATH=' + Path;
   } else {
	   var path = document.location.pathname;
	   Path = "";
	   newAr = path.split("/");
	   for (var i=0; i < newAr.length - 1; i++) {
		   Path = Path + newAr[i] + "/";
	   }
   
	   newCookie += '; PATH=' + Path;
   }

   if (newCookie != "") {
	   document.cookie = newCookie;
   }
}
