Function setcookie (name, value) {var days = 365; // This cookie will be saved for 30 days var exp = new date (); // new date ("December 31,999 8"); exp. settime (exp. gettime () + days * 24x60*60*1000); document. cookie = Name + "=" + escape (value) + "; Path =/; expires =" + exp. togmtstring ();} function getcookie (name) {var arr = document. cookie. match (New Regexp ("(^ |)" + name + "= ([^;] *) (; | $)"); If (Arr! = NULL) return Unescape (ARR [2]); return NULL;} function delcookie (name) {var exp = new date (); exp. settime (exp. gettime ()-1); var cval = getcookie (name); If (cval! = NULL) document. cookie = Name + "=" + cval + "; Path =/; expires =" + exp. togmtstring ();} function setpostbgpic (getdefaultbg) {var getvalue = getcookie ("mfl_templetpostbg "); if (getvalue = "null" | getvalue = NULL | getvalue = "") {document. body. background = getdefaultbg;} else {document. body. background = getvalue ;}}
Setcookie, getcookie, delcookie, setpostbgpic