<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>refresh script</title>
</head>
<body>
<script language="JavaScript" type="text/javascript">
var secs
var timerID = null
var timerRunning = false
var delay = 1000
function InitializeTimer()
{
// Set the length of the timer, in seconds
secs = 10
StopTheClock()
StartTheTimer()
}
function StopTheClock()
{
if(timerRunning)
clearTimeout(timerID)
timerRunning = false
}
function StartTheTimer()
{
if (secs==0)
{
StopTheClock()
// Here's where you put something useful that's
// supposed to happen after the allotted time.
// For example, you could display a message:
//alert("You have just wasted 10 seconds of your life.")
window.location.reload();
}
else
{
self.status = secs
secs = secs - 1
timerRunning = true
timerID = self.setTimeout("StartTheTimer()", delay)
}
}
//Refresh page script- By Brett Taylor ([email protected])
//Modified by Dynamic Drive for NS4, NS6+
//Visit http://www.dynamicdrive.com for this script
//configure refresh interval (in seconds)
var countDownInterval=2;
//configure width of displayed text, in px (applicable only in NS4)
var c_reloadwidth=200
</script>
<!--
<ilayer id="c_reload" width=&{c_reloadwidth}; ><layer id="c_reload2" width=&{c_reloadwidth}; left=0 top=0></layer></ilayer>
-->
<script language="JavaScript" type="text/javascript">
var cycle=0;
var countDownTime=countDownInterval+1;
function countDuration(len)
{
}
function countDown()
{
countDownTime--;
if (countDownTime <=0)
{
countDownTime=countDownInterval;
clearTimeout(counter)
if (cycle >0)
{
//window.location.href=window.location.pathname+'?r=1#bottom';
//} else {
window.location=window.location.pathname+'?r=1#bottom';
InitializeTimer();
//window.location.reload()
}
return
}
if (document.all) //if IE 4+
document.all.countDownText.innerText = countDownTime+" ";
else if (document.getElementById) //else if NS6+
document.getElementById("countDownText").innerHTML=countDownTime+" "
else if (document.layers){ //CHANGE TEXT BELOW TO YOUR OWN
document.c_reload.document.c_reload2.document.write('Next <a href="javascript:window.location.reload()">refresh</a> in <b id="countDownText">'+countDownTime+' </b> seconds')
document.c_reload.document.c_reload2.document.close()
}
counter=setTimeout("countDown()", 2); //set to zero so page never returns to top
}
function startit()
{
if (document.all||document.getElementById) //CHANGE TEXT BELOW TO YOUR OWN
document.write('Next <a href="javascript:window.location.reload()">refresh</a> in <b id="countDownText">'+countDownTime+' </b> seconds');
countDown();
cycle++;
}
if (document.all||document.getElementById)
startit()
else
window.onload=startit
</script>
<div style="height:2000px;">
top
</div>
<br />
<a name="bottom" id="bottom"></a>
bottom
<br />
<script language="JavaScript" type="text/javascript">
<!--
// date to see something change
document.write( (new Date).toLocaleString() );
//-->
</script>
</body>
</html>