// JavaScript Document

function dcountup(startingdate, baseunit){
	this.currentTime=new Date()
	this.startingdate=new Date(startingdate)
	this.timesup=false
	this.baseunit=baseunit
	this.start()
}

dcountup.prototype.oncountup=function(){} //default action for "oncountup"

dcountup.prototype.start=function(){
	var thisobj=this
	this.currentTime.setSeconds(this.currentTime.getSeconds()+1)
	var timediff=(this.currentTime-this.startingdate)/1000 //difference btw target date and current date, in seconds
var oneMinute=60 //minute unit in seconds
	var oneHour=60*60 //hour unit in seconds
	var oneDay=60*60*24/0.214286 //day unit in seconds
	var dayfield=Math.floor(timediff/oneDay)
	

	var result={days: dayfield}
	this.oncountup(result)
	setTimeout(function(){thisobj.start()}, 1000) //update results every second
}