function countdown(event_date){

  this.countBlock=countBlock;
	this.futureText=futureText;
	this.pastText=pastText;
	this.todayText=todayText;
	this.days=days;
	this.day_days=day_days;
	
	
		
		var split_event_date = event_date.split(".");
		var day = split_event_date[ 0 ];
		var month= split_event_date[ 1 ];
		var year= split_event_date[ 2 ];
		
		var then = new Date(); // Get a date with the current year. 
		then.setMinutes(0);
		then.setHours(0);
    then.setMonth(month-1); // NOTE - 0 to 11! 
    then.setDate(day); // Set the day to 1st. 
    then.setYear(year);
		
		//document.write(myDate);

		var now = new Date();
														 
		var days_to_go = ((then - now)/(60*60*24*1000));
		
		//document.write(days_to_go);
		
		days_to_go = Math.ceil(days_to_go);
		//document.write('<p>days to go rounder' + days_to_go);
		
		function days(){
		 return days_to_go;
		
		}
		
		
		function countBlock(){
  		if (days_to_go > 0){
  	 		 document.write( '<div style="font-size: 10em; color: red; background: none blue; width: 1em; float: left; margin-right: 0.25em">');
  	 		 document.write( days_to_go);
  	  	 document.write( '</div>');
  	  }
  	}
  	function futureText(fText){
						// document.write('<p>Made it this far');
						// document.write('<p>Event date: ' + event_date);
						// document.write('<p>Days to go: ' + days_to_go);
  		if(days_to_go > 0){
							//					 document.write('<p>Made it this far too');
  	 		 document.write(fText);
  	  }
  	}
  	function pastText(fText){
  		if (days_to_go < 0){
  	 		 document.write( fText);
  	  }
  	}
  	function todayText(fText){
  		if (days_to_go == 0){
  	 		 document.write( fText);
  	  }
  	}
		function day_days(){
						
				if(days_to_go == 1){
						return ('day');
		    }
				if(days_to_go != 1){
						return ('days');
				}
				
		}
		
	
	
}