Thanks for the post Ian, but that wasn't quite what I wanted. Here's the
full code if anyone cares for it. It's a bit of a kludge, but it does what I
want. Just drop the code into a js file and call it like so:
<script language="JavaScript" type="text/JavaScript"
src="includes/countdown.js"></script>

------------------
var targetURL="index.cfm?logout"

//time in seconds
var countDownInterval=1800;
var message="Logout in";

var countDownTime=countDownInterval+1;

function countDown(){
        countDownTime--;
        if (countDownTime <=0){
                countDownTime=countDownInterval;
                clearTimeout(counter)
                window.location=targetURL
                return
        }
        if (document.all) //if IE 4+
                document.all.countDownText.innerText = 
secToMin(countDownTime)+" ";
        else if (document.getElementById) //else if NS6+
                
document.getElementById("countDownText").innerHTML=secToMin(countDownTime)
+" "
        else if (document.layers){ //TEXT FOR NS4.x
                document.c_redirect.document.c_redirect2.document.write(message 
+ ' <b
id="countDownText">'+secToMin(countDownTime)+' </b> seconds')
                document.c_redirect.document.c_redirect2.document.close()
        }
counter=setTimeout("countDown()", 1000);
}

function startit(){
        if (document.all||document.getElementById) { //TEXT FOR IE
                document.write(message + ' <b id="countDownText">' +
secToMin(countDownTime) +' </b> seconds');
                countDown();
        }
}

function secToMin (theseconds) {
        var theTime = new String();
        var minutes = Math.floor(countDownTime / 60)
        var seconds = countDownTime % 60

        theTime = minutes + " Minutes " + seconds;
        return theTime;
}

if (document.all||document.getElementById)
startit()
else
window.onload=startit
------------------



<!----------------//------
andy matthews
web developer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--------------//--------->


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219267
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to