function settimes(){
alert("You have 20 minutes time !")
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
etime=hours*3600+mins*60+secs;
etime+=1200; //这里就是你所要的时间,如果20分钟:(1200 = 20 分* 60 秒/分)
checktime();
}
function checktime(){
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
ctime=hours*3600+mins*60+secs
if(ctime>=etime){
expired();
}
else
display();
}
function expired(){
alert("Time expired");
location.href="http://www.cnbruce.com/red/"; //Put here the next page
}
// Done hiding -->
</Script>
<BODY onLoad="settimes()">
<Center><H2>Look in the status bar. In 20 mins you will be forced to change page</H2>
</Center>
</BODY>
</HTML>