/*
taking out history would be good. maybe should cookie with the URL's.
*/
var safetyLinks = [
['/dallas/safety/bicycle_maintenance.asp','Bicycle Maintenance','Keep your bike in tune.'],
['/dallas/safety/etiquette.asp','Cycling Etiquette','More than just being polite—it\'s riding safely.'],
['/dallas/safety/helpful_tips.asp','Helpful Tips','Doh! How to deal with unforeseen circumstances.'],
['/dallas/safety/hydration.asp','Hydration','Hydration is more than just water.'],
['/dallas/safety/know_the_lingo.asp','Know the Lingo','Why is everyone yelling "Car Back?"'],
['/dallas/safety/lab_video.asp','Safety Video','Seeing is believing.'],
['/dallas/safety/managing_obstacles.asp','Managing Obstacles','Cars, dogs and pedestrian what to do?'],
['/dallas/safety/road_rules.asp','Road Rules','Stay on the right side of the lines and the law!'],
['/dallas/safety/wet_weather.asp','Wet Weather','We ride safely rain or shine.']
];
function randomSafetyMenu()
{
	var adCount = 3;
	var htmlAccumulator = "";
	for(var i=0; i<adCount;)
	{
		var idToUse = Math.round([safetyLinks.length - 1]*Math.random());
		if(document.referrer.indexOf(safetyLinks[idToUse][0]) < 0)
		{
			if(document.URL.indexOf(safetyLinks[idToUse][0]) < 0)
			{
				htmlAccumulator += '<td><a href="' + safetyLinks[idToUse][0] + '">' + safetyLinks[idToUse][1] + '</a><br />' + safetyLinks[idToUse][2] + '</td>';
				safetyLinks.splice(idToUse,1)
				i++;
			}
		}
	}
	return '<h2>Learn More:</h2><table><tr>' + htmlAccumulator + '</tr></table>';
}
function makeAdSection(contentArray)
{
	return '<td><a href="' + contentArray[0] + '">' + contentArray[1] + '</a><br />' + contentArray[2] + '</td>';
}
document.write(randomSafetyMenu());
