code :
<SCRIPT>

function MyCookie(){
  this.setCookie=function (name ,value,expireTime){
   if(!expireTime) expireTime=new Date();
   document.cookie=name+"="+value+";"+"expire="+expireTime.toGMTString();
  };
  this.getCookie=function (name){
   alert(document.cookie);
   var cookies=document.cookie.split("; ");
   for (var i=0;i<cookies.length;i++){
    var s=cookies[i].split("=");
    if(s[0]==name ) return s[1];
   }
  };
 }
 
 var cookieTest =new MyCookie();
 
 cookieTest.setCookie("a","11");
 alert(cookieTest.getCookie("a"));
 
 cookieTest.setCookie("b","22");
 alert(cookieTest.getCookie("b"));
 
 cookieTest.setCookie("c","33");
 alert(cookieTest.getCookie("c"));

</SCRIPT>



------君临天下,舍我其谁------