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%56))+1;  // 5 is number of tips currently specified in the TOD array - you can have as many as you want up to 366

var TOD = new Array(366);
TOD[1] = "Lock your door, even when you intend to return home shortly or even if you are just going down the hall. It takes a thief ten seconds or less to enter an open room and steal your property";
  TOD[2] = "Lock or secure doors and windows when you are alone or asleep";
  TOD[3] = "Keep emergency numbers by your phone";
  TOD[4] = "Do not leave messages on your door indicating that you are away and when you will return";
  TOD[5] = "Do not let strangers enter your home";
  TOD[6] = "Do not prop open outer doors";
  TOD[7] = "If someone asks to use your phone for an emergency call, offer to telephone for them instead of allowing them access";
  TOD[8] = "Do not put your address on your key ring";
  TOD[9] = "Know your neighbors";
  TOD[10] = "Do not leave keys in hiding places. Thieves will find them. Carry your keys or make sure that anyone who truly needs them has their own copy";
  TOD[11] = "Call 911 to report suspicious persons or activity in or around your neighborhood";
  TOD[12] = "Open a savings or checking account instead of keeping money in your room";
  TOD[13] = "Keep automatic teller machine cards in a safe place, keep your PIN number secret. When possible, only use ATMs during the day";
  TOD[14] = "Instead of carrying large sums of cash use a charge card. Some charge cards insure property purchased with those cards against loss, theft or damage";
  TOD[15] = "If you find yourself in immediate danger, call 911; try to stay calm and get away at the first opportunity";
  TOD[16] = "Avoid walking alone at night unless absolutely necessary";
  TOD[17] = "Keep to well lit commonly traveled routes";
  TOD[18] = "Avoid shortcuts and dark, isolated areas";
  TOD[19] = "Walk purposefully, know where you are going, and project a no-nonsense image";
  TOD[20] = "Avoid potentially dangerous situations and encounters";
  TOD[21] = "If you feel threatened, cross the street, locate an emergency phone, or enter a store or place of business even if you have just left it";
  TOD[22] = "Have your door keys ready; carry them in your pockets, not buried in a purse";
  TOD[23] = "Always lock your car. (one in five stolen cars was left with keys in the ignition.)";
  TOD[24] = "Lock bikes to immovable objects or bike racks with hardened alloy locks and chains or U-shaped lock";
  TOD[25] = "Do not leave tempting valuables or property visible inside the car. Lock these items in the trunk";
  TOD[26] = "Lock mopeds as you would bikes";
  TOD[27] = "Look into your car before getting in. Lock doors and roll up windows once inside for protection";
  TOD[28] = "Never pick up hitchhikers";
  TOD[29] = "Carry change for emergency calls. 911 is a free call";
  TOD[30] = "Drive to a police or fire station or open place of business if you feel you are being followed";
  TOD[31] = "Do not stop to help occupants of stopped or disabled vehicles. Continue driving to the nearest phone and call for assistance for them";
  TOD[32] = "Alarm systems need to have an audible horn or bell to be effective";
  TOD[33] = "Raise the hood, and then lock yourself into your car if it breaks down. If someone stops and offers you help, remain in your car and ask them to phone for help. Do not worry about seeming rude";
  TOD[34] = "Travel with a friend or in a group";
  TOD[35] = "Be alert and aware of your surroundings";
  TOD[36] = "Avoid dark, vacant or deserted areas; use well-lit, well-traveled routes";
  TOD[37] = "Dress in clothes and shoes which will not hamper movement";
  TOD[38] = "Move away from any potential threat if possible";
  TOD[39] = "Sensing a threat, join any group of people nearby; cross the street and increase your pace";
  TOD[40] = "If a threatening situation is imminent, and people are close by to help, yell, scream or make a commotion in any way you can to get their attention";
  TOD[41] = "If threatened, go to an open business";
  TOD[42] = "Call 911 from a safe location";
  TOD[43] = "If on-street parking is not allowed in your mobile home park, make management enforce that rule!  Burglars can easily blend in with those residents and visitors using the street for parking";
  TOD[44] = "Never leave keys under doormats, flowerpots, mailboxes or other \"secret\" hiding places -- burglars know where to look for hidden keys";
  TOD[45] = "Trim your shrubbery around your home to reduce cover for burglars";
  TOD[46] = "Change locks immediately if your keys are lost or stolen";
  TOD[47] = "An alarm system is excellent for home security. It provides peace of mind to homeowners, especially while on vacation";
  TOD[48] = "Outside doors should be metal or solid hardwood and at least 1 3/4 inches thick. Frames must be made of equally strong material and each door must fit its frame securely";
  TOD[49] = "Never leave notes on your door such as \"Gone shopping\"";
  TOD[50] = "Secure all tools, including ladders, so they cannot be used to gain entry into your home or that of a neighbor";
  TOD[51] = "Install perimeter lighting. Make sure a burglar cannot approach and entrance in darkness. Inexpensive lights are available which detect motion";
  TOD[52] = "Notice strange people in your neighborhood, and make sure they know it!  Burglars often park their cars and case the area, noting which houses are unoccupied and how they might enter unnoticed";
  TOD[53] = "If a party is too loud/too late call and report it. You have the right to enjoy a quiet environment";
  TOD[54] = "Burglars like:<br />Unoccupied homes, easy access, lots of cover, and a good escape route";
  TOD[55] = "Rose bushes and other thorny plants can be a deterrent to unauthorized entry through a window";
  TOD[56] = "Install peepholes in all outside doors";

// and so on up to TOD[366] (to allow for leap year)

var weekDays = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
var months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
var dd = today.getDate();
var dy = today.getDay();
var mm = today.getMonth();
var yy = today.getFullYear();

var daySuffix = 'th';
if(dd != 11 && dd != 12 && dd != 13) {ddx = dd % 10}
else {ddx = dd}
if (ddx == 1) { daySuffix = 'st' }
if (ddx == 2) { daySuffix = 'nd' }
if (ddx == 3) { daySuffix = 'rd' }

var tipOfDay = "<center>" + "<strong>" +"Crime Buster Tip of the Day for " + weekDays[dy] + " " + dd  + daySuffix + " " + months[mm] + " " + yy + ": &nbsp&nbsp  " + "<br>" + "</strong>" + "</center>" + TOD[DOY]
document.write(tipOfDay);