Now we shall talk of many things

..no longer talks of many things.

1/22/2005

countdown to freedom

Here's the code for the countdown I have going up there. It's based on something I lazily grabbed from the Javascript Source years ago. Enjoy, tweak it, pass it on, whatever.

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Alan Palmer -->
<!-- Web Site: http://www.jsr.communitech.net -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!--Edited by John Shanks on Jan 22, 2005-->
<!--http://liberalartsstudent.blogspot.com-->

<!-- Begin
var date = new Date("January 30, 2005");
var description = "Iraqi Elections";
var now = new Date();
var diff = date.getTime() - now.getTime();
var days = Math.floor(diff / (1000 * 60 * 60 * 24));
document.write("<center><h3>")
if (days > 1) {
document.write(days+1 + " days until " + description);
}
else if (days == 1) {
document.write("Only two days until " + description);
}
else if (days == 0) {
document.write("Tomorrow are the " + description);
}
else if (days == -1){
document.write("Today Iraq votes" + "!");
}
else {
document.write("Iraq has voted. May the next hundred years have a free Iraq");
}
document.write("</h3></center>");
// End -->
</script>

0 Comments:

'); preview.document.close();} function PostComment(frm){if (frm.Comment.value=="" || (confirmBeforePost && confirm(confirmText)==false))return; if(frm.rememberMe.checked){ setCookie('author',frm.author.value); setCookie('email',frm.email.value); setCookie('url',frm.url.value); setCookie('remember','true');}else{ setCookie('remember','false');} frm.postBody.value = frm.Comment.value; frm.postBody.value+="&"+"#1"+"60;\n\n"+ getAuthorInfo(frm); frm.submit();} function toggleRemember(frm){if(frm.rememberMe.checked) setCookie('remember','true');else setCookie('remember','false');} function getCookie(name){var rexp = new RegExp(name + "=([^;]+)");var val=rexp.exec(document.cookie); return (val!=null)?unescape(val[1]):"";} function setCookie(name, value){document.cookie=name+ "="+escape(value)+";expires="+expiry.toGMTString();} document.write('
'+ formCaption+'
');if(!document.all) document.write("
");
:
:
:

BloggerHacks

<< Home