| var times = Math.ceil (Math.random () *100); var settime = 10000; SetInterval ("Setintval ()", settime+times); function Setintval () {
var cookieval = GetCookie ("Ifopen"); // if (Cookieval = = Undefined | | cookieval = = ' undefined ') { Setcookie ("Ifopen", ' yes '); alert (times+settime);
} Else { alert (cookieval); } } function Closeit () { var tmp = GetCookie ("Ifopen"); if (tmp!= undefined && tmp!= ' undefined ') { Setcookie ("Ifopen", ' undefined '); } } function Setcookie (name,value) { var days = 10;//300; var exp = new Date (); Exp.settime (Exp.gettime () + days*1000); Document.cookie = name + "=" + Escape (value) + "expires=" + exp.togmtstring () + ";p ath=/"; } function GetCookie (name) { var arr = Document.cookie.match (New RegExp ("(^|)" +name+ "= ([^;] *)(;|$)")); if (arr!= null) { Return unescape (arr[2]); return null; } } /* Turn off calling method <script language= "javascript" src= "1.js" ></script> <body> <a href= "javascript:;" onclick= "Closeit ();" > Key Operations </a> </body> */ |