Javascript: dont refresh if timer > 0

Hey. This is my problem. I have a timer on my site till te page redirects. What I want to do is have it so that you can’t refresh unless the timer has reached zero. I put the code for the timer below too if that does anything.

<script language=“JavaScript” type=“text/javascript”>
var Counter = “15”;
var AFTER_URL = “<?php echo $rnd_site;?>”;
var TIME=1*1000;
var TIMER = null;
var boolRole = null;
parent.ok=0;

function stop()
{
if(TIMER)
{
clearInterval(TIMER);
TIMER=null;
boolRole = false;
}
}
function pause()
{
if(boolRole == true){
boolRole = false;
}else{
boolRole = true;
};
click();
};
function start()
{
stop();
boolRole = true;
TIMER=setInterval(“click()”,TIME);
}
function click()
{
if(boolRole)
{
if ((document.getElementById(‘timer’).innerHTML="Seconds remaining: "+Counter–)<0)
{
stop();
}
if (!Counter)
{
parent.display.location.href=AFTER_URL;
document.location=“earn_top.php”;
}
}
};
function initThis()
{
start();
boolRole = true;
}
</script>

thanks for any help,
-Naaman