// no encoding and decoding
function cookie(name,value) {
   if(value!=null) {
      document.cookie = (name+"="+value)
      return
   } 
   var c = document.cookie.split(';')
   for(var i=0;i<c.length;i++)
   {
      var cv=c[i].split( '=' )
      if($.trim(cv[0])==name)
         return cv.length>1 ? $.trim(cv[1]) : ''
   }
   return null
}
