Date.prototype.getDayInYear = function() {
//	alert("Date.getDayInYear() --> this: " + this);
	var firstDayInYear = new Date(this);
	firstDayInYear.setMonth(0);
	firstDayInYear.setDate(0);
	var mls1 = Math.floor(Date.parse(this.toString()));
	var mls2 = Date.parse(firstDayInYear.toString());
	return ((mls1-mls2) / 86400000);
}

Date.prototype.getWeek = function() {	
	// ASSUMPTION: week starts at monday!, which is dayofweek 1 (and should be 0);
	/*	 
	 if year starts on monday: all ok --> -1
	 if year starts on other day:
	*/
	var firstDayInYear = new Date(this);
	firstDayInYear.setMonth(0);
	firstDayInYear.setDate(1);
	var firstDayInFirstWeek = firstDayInYear.getDay();
	
	var dayInYearWithWeekCorrection = this.getDayInYear() + firstDayInFirstWeek; //wat meer,namelijk 7-
	
	var week = 1 + Math.floor(dayInYearWithWeekCorrection / 7);
	
	week > 52 ? week = 1 : true;
	//alert("Date.getWeek() --> this: "+this + " first: " +firstDayInFirstWeek + " day:" + dayInYearWithWeekCorrection + " week:" + week);
	return week;
}

Date.prototype.getFullHours = function() {
  var result = this.getHours().toString();
  if (result.length == 1) {
    return '0' + result;
  } else {
    return result;  
  }  
}

Date.prototype.getFullMinutes = function() {
  var result = this.getMinutes().toString();
  if (result.length == 1) {
    return '0' + result;
  } else {
    return result;  
  }  
  
}

Date.prototype.getFullSeconds = function() {
  var result = this.getSeconds().toString();
  if (result.length == 1) {
    return '0' + result;
  } else {
    return result;  
  }    
}

Date.prototype.getFullDate = function() {
  var result = this.getDate().toString();
  if (result.length == 1) {
    return '0' + result;
  } else {
    return result;
  }
}

Date.prototype.getFullMonth = function() {
  var result = (this.getMonth()+1).toString();
  if (result.length == 1) {
    return '0' + result;
  } else {
    return result;
  }
}

