var openit=[ {title : '美女大PK', url :'http://my.kunlun.com/space.php?do=home',thumb :'uploadfile/kunlun/uploadfile/200910/20091030113905434.jpg', adddate : '10-30'} ,{title : '三国', url :'http://in.sg.kunlun.com/template/txjh0922/?u=550&u2=sg',thumb :'uploadfile/kunlun/uploadfile/200909/20090927043904621.jpg', adddate : '09-27'} ];function readCookie(cookieName) { var theCookie=""+document.cookie; var ind=theCookie.indexOf(cookieName); if (ind==-1 || cookieName=="") return ""; var ind1=theCookie.indexOf(';',ind); if (ind1==-1) ind1=theCookie.length; return unescape(theCookie.substring(ind+cookieName.length+1,ind1)); } function writeCookie(cookieName,cookieValue,nDays) { var today = new Date(); var expire = new Date(); if (nDays==null || nDays==0) nDays=1; expire.setTime(today.getTime() + 3600000*nDays); document.cookie = cookieName+"="+escape(cookieValue) + ";domain=tuitui8.com;expires="+expire.toGMTString(); } var i=0; var np=readCookie('next_open'); if(np==null){ np=0; }else { if(np>= (openit.length-1)) { np=0; }else { np++; } } i = np; writeCookie('next_open',np,480); var np=readCookie('next_open_time'); var tm=new Date().getTime(); if(np==null || np < tm){ writeCookie('next_open_time',tm+3600000*4,24*30); window.open (openit[i].url, "newwindow", ""); }