Date.prototype.getDOY = function() {
var onejan = new Date(this.getFullYear(),0,1);
return Math.ceil((this - onejan) / 86400000);
} 

var today = new Date();
var DOY = today.getDOY(); // DOY is day of year 1-365 or 366 in leap year

DOY = (parseInt(DOY%365));  // 365 is number of tips currently specified in the tiptext array - you can have as many as you want up to 366

