// JavaScript Document

/*
Count down until any date script-
By JavaScript Kit (www.javascriptkit.com)
Over 200+ free scripts here!
*/

var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")

//enter the count down date using the format year/month/day
function countdown(yr,m,d){
var current="Colin's Due Date has come and gone!"

var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy
var futurestring=montharray[m-1]+" "+d+", "+yr
var difference=(Math.round((Date.parse(futurestring)-Date.parse(todaystring))/(24*60*60*1000))*1)
if (difference==0)
document.write(current)
else if (difference>0)
document.write("Allison is due in "+difference+" days!")
}


/*
Count up from any date script-
By JavaScript Kit (www.javascriptkit.com)
Over 200+ free scripts here!


//enter the count up date using the format year/month/day
function countup(yr,m,d){
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy
var paststring=montharray[m-1]+" "+d+", "+yr
var difference=(Math.round((Date.parse(todaystring)-Date.parse(paststring))/(7*24*60*60*1000)-.5)*1)
difference+=" weeks"
document.write("Allison is "+difference+" pregnant!")
}
*/

function countup(yr,m,d){
conception = new Date(yr,m-1,d); // 4th Sep 2008 
today = new Date(); 

elapsedMsecs = today-conception; 

oneWeekMsecs = 7*24*60*60*1000; 

weeks = Math.floor(elapsedMsecs/oneWeekMsecs); 
//document.write("Allison is "+weeks+" weeks pregnant!");
document.write("Colin is "+weeks+" weeks old!");
}
