<%function gotourl(gotourls,thetimes,isback)
if not(isnumeric(thetimes)) then
response.write ("请设定好等待的时间")
response.end
end if
if gotourls="" and isback=0 then
response.write "请指定要跳转的URL"
response.end
end if
%>
<script language=javascript>
var closetime=0;
var theurl="<%=gotourls%>";
var urls="<%=gotourls%>";
var showurl="<%=gotourls%>";
var endtime=<%=thetimes%>;
var isback=<%=isback%>;
if(isback==1){theurl="javascript:history.back(1)";}
if(theurl=="javascript:history.back(1)"){showurl="前一页";}
setTimeout("gotourl(theurl)",1);
function gotourl(urls)
{
if(closetime!=endtime)
{
document.title=endtime-closetime+"秒后自动跳转到"+showurl
document.all.listtime.innerHTML=endtime-closetime+"秒后自动跳转到<a onclick=clearTimeout(Timeout);window.status=''; href="+theurl+">"+showurl+"</a>"
window.status=endtime-closetime + "秒后自动跳转到"+showurl
Timeout=setTimeout("gotourl(theurl)",1000);
} 
else
{
window.status="";
document.location.href=theurl
}
closetime=closetime+1
}
</script>
<span id=listtime class=listtime></span>
<%end function%>
<%function closewin(endtime)%>
<span id=listtime class=listtime></span>
<script language=javascript>
var endtime=<%=endtime%>;
closes();
function closes()
{
endtime=endtime-1;
if(endtime==0)
{
window.close();
}
document.title=endtime+"秒后自动关闭本页";
document.all.listtime.innerHTML=endtime+"秒后自动关闭本页";
window.status=endtime+"秒后自动关闭本页";
setTimeout("closes()",1000);
}
</script>
<%end function%>
<!--
调用示例
gotourl "url",5,0     5秒后跳转到URL
closewin 5            5秒后关闭本窗口
-->
