<!-- insert commas into numbers -->
function addseps(x) {
//make x a new variable
var x=x;
//make x a string
x+="";
//or x=String(x);
//iLen is the number of digits before any decimal point
// for 45.123, iLen is 2
//iLen is the length of the number, if no decimals
iLen=x.length;
pos=x.indexOf(".");
if (pos>-1) //there are decimals
{
iLen=pos;
}
//add the decimal point
temp="";
//add the decimal part to begin
// with 45.123, we add the .123
temp=x.substring(iLen,x.length);
//iLen-1 is the rightmost non-decimal digit (5 in 98745.123)
for (var i=iLen-1;i>=0;i--)
//we add a separator when the expression (iLen-i-1)%3==0 is true...
//except when i is (iLen-1), or the first digit
//eg (98745.12). i is iLen-1, and the digit pos is next the decimal, 
//it is 5. From here, we decrement i...iLen-2, iLen-3, iLen-4 ... when i is a multiple of
//3, (i=iLen-iLen+4-1). This point is just before the number 7
if ((iLen-i-1)%3==0&&i!=iLen-1)
temp=x.charAt(i)+","+temp;
else
temp=x.charAt(i)+temp;
return temp;
}//end of addseps(x)

<!-- highlight today -->
			function hilite(holiday,cal_month,cal_date,cal_year)
			{	var today = new Date();
				var now_year = today.getYear();
				var now_month = today.getMonth();
				var now_date = today.getDate();

				if (holiday==1)
				{ if (((now_year - 2000) == (cal_year) || (now_year - 100) == (cal_year)) && (now_month == (cal_month - 1)) && (now_date == cal_date))
				document.write("<td class='h_now'><a id='n0w'> </a>");
				else document.write("<td class='h_day'>");
				}

				else if (((now_year - 2000) == (cal_year) || (now_year - 100) == (cal_year)) && (now_month == (cal_month - 1)) && (now_date == cal_date))
				document.write("<td class='now'><a id='n0w'> </a>");
				else document.write("<td class='day'>");
			}
<!-- /highlight today -->
		
/*** Writes url address. ***/
		var provider;
		var provider_text;
		var provider_url;
		var provider_name;
		var facility;
		var facility_text;
		var facility_url;
		var facility_name;
	function add_url(position,provider,facility)
	{
		if (provider == "3J&#39;s")
			{
				provider_text = '<img src="images/bus/3js.png"><br><center>3J&#39;s</center>';
				provider_url = 'www.3jstrackdays.&#99;&#111;&#109;/';
				provider_name = '3J&#39;s';
			}
		else if (provider == "AFM")
			{
				provider_text = '<b>A</b>merican <b>F</b>ederation of <b>M</b>otorcyclists';
				provider_url = 'www.afmracing.&#111;&#114;&#103;/';
				provider_name = 'AFM';
			}
		else if (provider == "AMA")
			{
				provider_text = '<img src="images/ca/ama.png"><br><b>A</b>merican <b>M</b>otorcyclist <b>A</b>ssociation SuperBike Championship';
				provider_url = 'www.amasuperbike.&#99;&#111;&#109;/';
				provider_name = 'AMA';
			}
		else if (provider == "banquet")
			{
				provider_text = 'google map to DoubleTree<br>Berkeley, CA 94710';
				provider_url = 'www.google.com/maps?f=l&hl=en&q=Doubletree+Hotel+%26+Executive+Meeting+Center+Berkeley+Marina&near=Berkeley,+CA&ie=UTF8&z=13&ll=37.871601,-122.283497&spn=0.098649,0.131321&om=1&iwloc=A';
				provider_name = 'Awards Banquet';
			}
		else if (provider == "Cascade-nrs")
			{
				provider_text = '<img src="images/bus/cascadetracktime.png"><br>Cascade Tracktime<br>Oregon Motorcycle Road Race Association<br>(OMRRA) New Racer School';
				provider_url = 'cascadetracktime.&#99;&#111;&#109;/';
				provider_name = 'Cascade<font color=#0000ff size=-5>&#8209;NRS</font>';
			}
		else if (provider == "Cascade")
			{
				provider_text = '<img src="images/bus/cascadetracktime.png"><br>Cascade Tracktime';
				provider_url = 'cascadetracktime.&#99;&#111;&#109;/';
				provider_name = 'Cascade';
			}
		else if (provider == "Class")
			{
				provider_text = '<img src="images/bus/class.png"><br>Reg Pridmore&#39;s ClassRides';
				provider_url = 'www.classrides.&#99;&#111;&#109;/';
				provider_name = 'Class';
			}
		else if (provider == "CSS")
			{
				provider_text = '<img src="images/bus/css.png"><br><b>C</b>alifornia <b>S</b>uperbike <b>S</b>chool';
				provider_url = 'www.superbikeschool.&#99;&#111;&#109;/';
				provider_name = 'CSS';
			}
		else if ((provider == "DIITT") || (provider == "Dial It In TrackTime"))
			{
				provider_text = '<img src="images/bus/dit.png"><br>Dial It In Track Time';
				provider_url = 'www.dialitintracktime.&#99;&#111;&#109;/';
				provider_name = 'Dial It In TrackTime';
			}
		else if (provider == "EMA")
			{
				provider_text = '<img src="images/ca/ema.png"><br><b>E</b>uropean <b>M</b>otorcycle <b>A</b>ccessories';
				provider_url = 'www.ema-usa.&#99;&#111;&#109;/';
				provider_name = 'EMA';
			}
		else if (provider == "FastFreddie")
			{
				provider_text = 'Fast Freddie<br>Freddie Spencer Riding School';
				provider_url = 'www.fastfreddie.&#99;&#111;&#109;/';
				provider_name = 'FastFreddie';
			}
		else if (provider == "Fastrack")
			{
				provider_text = '<img src="images/ca/fastrack.png"><br>Fastrack Riders';
				provider_url = 'www.fastrackriders.&#99;&#111;&#109;/';
				provider_name = 'Fastrack';
			}
		else if (provider == "Femmoto")
			{
				provider_text = '<img src="images/ca/femmoto.png"><br>Femmoto<br>Sportbike Track Time for Grrls!';
				provider_url = 'www.femmoto.&#99;&#111;&#109;/';
				provider_name = 'Femmoto';
			}
		else if (provider == "Hyperclub")
			{
				provider_text = '<img src="images/ca/hyperclub.png"><br>Hyperclub';
				provider_url = 'www.hypercycle.&#99;&#111;&#109;/';
				provider_name = 'Hyperclub';
			}
		else if (provider == "Keigwins")
			{
				provider_text = '<img src="images/bus/katt.png"><br>Keigwins at the Track<br><b>600 Production sponsor</b><br>offers <b>AFM N</b>ew <b>R</b>acer&#146;s <b>S</b>chools';
				provider_url = 'www.keigwin.&#99;&#111;&#109;/';
				provider_name = 'Keigwins';
			}
		else if (provider == "Kneeriders")
			{
				provider_text = 'Kneeriders';
				provider_url = 'www.kneeriders.&#99;&#111;&#109;/store/trackdays.html';
				provider_name = 'Kneeriders';
			}
		else if (provider == "LetsRide")
			{
				provider_text = 'Lets Ride Trackdays';
				provider_url = 'www.letsridetrackdays.&#99;&#111;&#109;/';
				provider_name = 'LetsRide';
			}
		else if (provider == "AFM_meeting")
			{
				provider_text = '<b>AFM Meeting</b> @<br>Ricky&#39;s Sports Bar in San Leandro<br>(link to map)<br>Board Meeting: <b>7:00 pm</b><br>Chapter Meeting: <b>8:00 pm</b>';
				provider_url = 'maps.google.com/maps?near=15028+Hesperian+Blvd,+San+Leandro,+CA+94578&geocode=&q=%22Ricky&#39;s+Sports+Theater+%26+Grill%22&f=l&hl=en&sll=37.704285,-122.129997&sspn=0.025329,0.038924&ie=UTF8&z=17&iwloc=A&om=1';
				provider_name = 'AFM Meeting';
			}
		else if (provider == "MotoGP")
			{
				provider_text = '<img src="images/ca/motopg.png"><br>Motorcycle Grand Prix World Championship';
				provider_url = 'www.motogp.&#99;&#111;&#109;/en/motogp/index.htm';
				provider_name = 'MotoGP';
			}
		else if (provider == "NRS")
			{
				provider_text = 'link to:<br>AFM site New Racers / Race School page';
				provider_url = 'http://www.afmracing.org/content/view/51/70/';
				provider_name = '&#8209;NRS';
			}
		else if ((provider == "open test") && (facility == "Thunderhill"))
			{
				provider_text = 'Bikes Must Pass AFM Tech';
				provider_url = 'www.thunderhill.&#99;&#111;&#109;/';
				provider_name = 'open test';
			}
		else if (provider == "PSSR")
			{
				provider_text = '<b>P</b>acific <b>S</b>uper <b>S</b>port <b>R</b>iders';
				provider_url = 'www.pssrtrack.&#99;&#111;&#109;/';
				provider_name = 'PSSR';
			}
		else if (provider == "PTT")
			{
				provider_text = '<img src="images/bus/ptt.png"><br><b>P</b>acific <b>T</b>rack <b>T</b>ime<br><b>600 Superbike sponsor</b><br>offers <b>AFM N</b>ew <b>R</b>acer&#146;s <b>S</b>chools';
				provider_url = 'www.pacifictracktime.&#99;&#111;&#109;/';
				provider_name = 'PTT';
			}
		else if ((provider == "RedShift") || (provider == "redshift"))
			{
				provider_text = '<img src="images/bus/redshift.png"><br><b>R</b>ed<b>S</b>hift<br>(formerly dp safety school)';
				provider_url = 'www.rideredshift.&#99;&#111;&#109;/';
				provider_name = 'RedShift';
			}
		else if (provider == "Sierra Sportbike Association")
			{
				provider_text = 'Sierra Sportbike Association';
				provider_url = 'www.sportbikeusa.&#99;&#111;&#109;/';
				provider_name = 'Sierra Sportbike Association';
			}
		else if (provider == "Sierra Traction")
			{
				provider_text = 'Sierra Traction';
				provider_url = 'www.sierratraction.&#99;&#111;&#109;/';
				provider_name = 'Sierra Traction';
			}
		else if (provider == "SoCal")
			{
				provider_text = '<b>S</b>o<b>C</b>al Trackdays';
				provider_url = 'www.socaltrackdays.&#99;&#111;&#109;/';
				provider_name = 'SoCal';
			}
		else if (provider == "sportbiketracktime")
			{
				provider_text = '<b>S</b>port<b>B</b>ike<b>T</b>rack<b>T</b>ime';
				provider_url = 'www.sportbiketracktime.&#99;&#111;&#109;/';
				provider_name = 'SportBikeTrackTime';
			}
		else if (provider == "STAR")
			{
				provider_text = '<img src="images/bus/star.png"><br><b>STAR</b> Motorcycle School';
				provider_url = 'www.starmotorcycle.&#99;&#111;&#109;/';
				provider_name = 'STAR';
			}
		else if (provider == "Ti2TT")
			{
				provider_text = '<img src="images/bus/takeit2thetrack.png"><br>Take It 2 the Track';
				provider_url = 'Ti2TT.&#99;&#111;&#109;/';
				provider_name = 'Ti2TT';
			}
		else if ((provider == "Track&nbsp;Club") || (provider == "Track Club") || (provider == "TrackClub"))
			{
				provider_text = '<img src="images/bus/trackclub.png"><br>The Track Club / Club Desmo<br><b>Open Production sponsor</b>';
				provider_url = 'www.thetrackclub.&#99;&#111;&#109;/';
				provider_name = 'TrackClub ';
			}
		else if (provider == "TrackCrafters")
			{
				provider_text = '<img src="images/ca/trackcrafters.png"><br><b>T</b>rack<b>C</b>rafters<br>featuring Doug Chandler Racing School';
				provider_url = 'www.trackcrafters.&#99;&#111;&#109;/';
				provider_name = 'TrackCrafters';
			}
		else if (provider == "TrackDaz")
			{
				provider_text = '<img src="images/bus/trackdaz.png"><br><b>T</b>rack<b>D</b>az';
				provider_url = 'www.TrackDaz.&#99;&#111;&#109;/';
				provider_name = 'TrackDaz';
			}
		else if (provider == "TrackXperience")
			{
				provider_text = '<img src="images/bus/trackxperience.png"><br><b>T</b>rack<b>X</b>perience';
				provider_url = 'www.trackxperience.&#99;&#111;&#109;/';
				provider_name = 'TrackXperience';
			}
		else if ((provider == "Wera_fin") || (provider == "Wera_nat"))
			{
				provider_text = '<img src="images/ca/wera.png"><br>WERA Nationals';
				provider_url = 'www.wera.&#99;&#111;&#109;/pages/yearlyschedule.htm#west';
				provider_name = 'WERA';
			}
		else if ((provider == "WERA") || (provider == "Wera"))
			{
				provider_text = '<img src="images/ca/wera.png"><br>WERA West';
				provider_url = 'www.wera.&#99;&#111;&#109;/pages/yearlyschedule.htm#west';
				provider_name = 'WERA';
			}
		else if (provider == "WSMC")
			{
				provider_text = 'Willow Springs Motorcycle Club';
				provider_url = 'www.willowspringsraceway.com/clubs/wsmc/home.htm';
				provider_name = 'WSMC';
			}
		else if ((provider == "Z<sup>2</sup>") || (provider == "Z2") || (provider == "Zoom Zoom") || (provider == "ZoomZoom"))
			{
				provider_text = '<img src="images/bus/z2.png"><br>Zoom Zoom Track Days<br>offers <b>AFM N</b>ew <b>R</b>acer&#146;s <b>S</b>chools';
				provider_url = 'www.zoomzoomtrackdays.&#99;&#111;&#109;/';
				provider_name = 'Z<sup>2</sup>';
			}
		else if ((provider == "Z<sup>2</sup> Race") || (provider == "Z2 Race"))
			{
				provider_text = '<img src="images/bus/z2.png"><br><b>Z<sup>2</sup> R</b>ace <b>W</b>eekend';
				provider_url = 'zoomzoomtrackdays.com/ti/zoomzoom/showcontent?content=race';
				provider_name = 'Z<sup>2</sup> Race';
			}
		else if (provider == "")
			{
				provider_name = '';
			}
		else 
			{
				provider_text = provider;
				provider_url = '';
				provider_name = provider;
			}
		
		if ((facility == "AutoClub") || (facility == "CA Speedway"))
			{
				facility_text = '<img src="images/bus/cal_speedway.png"><br>Auto Club Speedway<br>&nbsp;&nbsp;(California Speedway)<br>9300 Cherry Avenue<br>Fontana, CA&nbsp;&nbsp;92335<br>gps: 118.466° 33.9786°';
				facility_url = 'http://www.autoclubspeedway.&#99;&#111;&#109;';
				facility_name = 'AutoClub';
			}
		else if (facility == "Arroyo Seco")
			{
				facility_text = 'Arroyo Seco Motorsports Raceway<br>20030 HWY 549 SE<br>Deming, NM&nbsp;&nbsp;88030<br>gps: 107.717° 32.2725°';
				facility_url = 'www.arroyosecoraceway.&#99;&#111;&#109;/mcracing.html';
				facility_name = 'Arroyo Seco';
			}
		else if (facility == "Autobahn")
			{
				facility_text = 'Autobahn Country Club<br>3795 South Patterson Rd.<br>Joliet, IL&nbsp;&nbsp;60436<br>gps: 88.1182° 41.4508°';
				facility_url = 'www.autobahncountryclub.&#110;&#101;&#116;/';
				facility_name = 'Autobahn';
			}
		else if (facility == "Barber")
			{
				facility_text = 'Barber Motorsports Park<br>6040 Barber Motorsports Parkway<br>Leeds, Alabama&nbsp;&nbsp;35094<br>gps: 86.6198° 33.5325°';
				facility_url = 'www.barbermotorsports.&#99;&#111;&#109;/';
				facility_name = 'Barber';
			}
		else if (facility == "BeaveRun")
			{
				facility_text = 'BeaveRun Motorsports Complex<br>201 Penndale Road<br>Wampum, PA&nbsp;&nbsp;16157<br>gps: 80.3363° 40.8453°';
				facility_url = 'www.beaverun.&#99;&#111;&#109;/';
				facility_name = 'BeaveRun';
			}
		else if (facility == "Blackhawk")
			{
				facility_text = 'Blackhawk Farms Raceway<br>15538 Prairie Rd<br>South Beloit, IL&nbsp;&nbsp;61080<br>gps: 89.0989° 42.4849°';
				facility_url = 'www.blackhawkfarms.&#99;&#111;&#109;/';
				facility_name = 'Blackhawk';
			}
		else if (facility == "Brainerd")
			{
				facility_text = 'Brainerd International Raceway<br>5523 Birchdale Road<br>Brainerd, MN&nbsp;&nbsp;56401<br>gps: 94.2851° 46.4144°';
				facility_url = 'www.brainerdracewayandresort.&#99;&#111;&#109;/';
				facility_name = 'Brainerd';
			}
		else if (facility == "Buttonwillow")
			{
				facility_text = '<img src="images/bus/buttonwillow.png"><br>Buttonwillow Raceway Park<br>Buttonwillow, CA<br>gps: 119.546° 35.4993°';
				facility_url = 'www.Buttonwillowraceway.&#99;&#111;&#109;/';
				facility_name = 'Buttonwillow';
			}
		else if (facility == "Carolina")
			{
				facility_text = 'Carolina Motorsports<br>3662 Kershaw Hwy<br>Kershaw, S.C.&nbsp;&nbsp;29067<br>gps: 80.6001° 34.4919°';
				facility_url = 'www.carolinamotorsportspark.&#99;&#111;&#109;/';
				facility_name = 'Carolina';
			}
		else if (facility == "Chuckwalla")
			{
				facility_text = 'Chuckwalla Valley Raceway<br>Desert Center, CA  92239<br>gps: 115.399876° 33.714987°'
				facility_url = 'Chuckwallavalleyraceway.net';
				facility_name = 'Chuckwalla';
			}
		else if (facility == "Daytona")
			{
				facility_text = 'Daytona International Speedway<br>gps: 81.0678° 29.1845°';
				facility_url = 'daytonainternationalspeedway.&#99;&#111;&#109;/';
				facility_name = 'Daytona';
			}
		else if (facility == "Firebird")
			{
				facility_text = 'Firebird Raceway<br>20000 S Maricopa Rd<br>Chandler, AZ&nbsp;&nbsp;85226<br>gps: 111.963° 33.2898°';
				facility_url = 'www.firebirdraceway.&#99;&#111;&#109;/';
				facility_name = 'Firebird';
			}
		else if (facility == "Gateway")
			{
				facility_text = 'Gateway International Raceway<br>700 Raceway Blvd.<br>Madison, IL&nbsp;&nbsp;62060<br>gps: 90.1332° 38.6503°';
				facility_url = 'www.gatewayraceway.&#99;&#111;&#109;/';
				facility_name = 'Gateway';
			}
		else if (facility == "Gingerman")
			{
				facility_text = 'Gingerman Raceway<br>61414 Phoenix Road<br>South Haven, MI&nbsp;&nbsp;49090<br>gps: 86.1434° 42.4043°';
				facility_url = 'www.gingermanraceway.&#99;&#111;&#109;/';
				facility_name = 'Gingerman';
			}
		else if (facility == "Grattan")
			{
				facility_text = 'Grattan Raceway<br>7201 Lessiter Road<br>Belding, MI&nbsp;&nbsp;48809<br>gps: 85.3774° 43.0941°';
				facility_url = 'www.grattanraceway.&#99;&#111;&#109;/';
				facility_name = 'Grattan';
			}
		else if (facility == "Hallett")
			{
				facility_text = 'Hallett Motor Racing Circuit<br>59901 E. 55 Road<br>Jennings, OK&nbsp;&nbsp;74038<br>gps: 96.5928° 36.2212°';
				facility_url = 'www.hallettracing.net/';
				facility_name = 'Hallett';
			}
		else if (facility == "Hastings")
			{
				facility_text = 'Motorsports Park Hastings<br>Hastings, NE&nbsp;&nbsp;68902-1341';
				facility_url = 'www.racemph.&#99;&#111;&#109;/';
				facility_name = 'Hastings';
			}
		else if (facility == "Heartland")
			{
				facility_text = 'Heartland Park Topeka<br>7530 S Topeka Blvd<br>Topeka, Kansas&nbsp;&nbsp;66619<br>gps: 95.7016° 38.9389°';
				facility_url = 'www.hpt.&#99;&#111;&#109;/';
				facility_name = 'Heartland';
			}
		else if (facility == "Homestead")
			{
				facility_text = 'Homestead-Miami Speedway<br>One Speedway Boulevard<br>Homestead, Florida&nbsp;&nbsp;33035<br>gps: 80.4118° 25.4551°';
				facility_url = 'www.homesteadmiamispeedway.&#99;&#111;&#109;/';
				facility_name = 'Homestead';
			}
		else if ((facility == "Infineon") || (facility == "Sears Point") || (facility == "SPIR"))
			{
				facility_text = '<img src="images/ca/infineon.png"><br>Infineon Raceway<br><small>formerly </small>Sears Point International Raceway<br>Sonoma, CA<br>gps: 122.457° 38.1705°';
				facility_url = 'www.infineonraceway.&#99;&#111;&#109;/';
				facility_name = 'Infineon';
			}
		else if (facility == "Jennings GP")
			{
				facility_text = 'Jennings GP Motorsports Park<br>4960 NW CR152<br>Jennings, FL&nbsp;&nbsp;32053<br>gps: 83.1662° 30.5756°';
				facility_url = 'www.jenningsgp.&#99;&#111;&#109;/';
				facility_name = 'Jennings GP';
			}
		else if (facility == "Las Vegas")
			{
				facility_text = '<img src="images/bus/lvms.png"><br>Las Vegas Motor Speedway<br>7000 Las Vegas Blvd. N.<br>Las Vegas, NV&nbsp;&nbsp;89115<br>gps: 115.001377 36.271642';
				facility_url = 'www.lvms.&#99;&#111;&#109;/';
				facility_name = 'Las Vegas';
			}
		else if (facility == "Loudon")
			{
				facility_text = 'Loudon &#8260; New Hampshire International Speedway<br>1122 Route 106 N<br>Loudon, NH<br>gps: 71.4646° 43.3632°';
				facility_url = 'www.nhis.&#99;&#111;&#109;/';
				facility_name = 'Loudon';
			}
		else if ((facility == "Laguna Seca") || (facility == "Laguna"))
			{
				facility_text = '<img src="images/bus/laguna.png"><br>Mazda Raceway Laguna Seca<br>Monterey, CA<br>gps: 121.837° 36.5836°';
				facility_url = 'www.laguna-seca.&#99;&#111;&#109;/';
				facility_name = 'Laguna Seca';
			}
		else if ((facility == "Mid&#45;Ohio") || (facility == "Mid-Ohio"))
			{
				facility_text = 'Mid&#45;Ohio<br>7721 Steam Corners Road<br>Lexington, OH&nbsp;&nbsp;44904<br>gps: 82.6361° 40.6894°';
				facility_url = 'www.midohio.&#99;&#111;&#109;/';
				facility_name = 'Mid&#45;Ohio';
			}
		else if (facility == "Miller")
			{
				facility_text = 'Miller Motorsports Park<br>2901 N. Sheep Lane<br>Tooele, UT<br>gps: 112.37° 40.5811°';
				facility_url = 'www.millermotorsportspark.&#99;&#111;&#109;/';
				facility_name = 'Miller';
			}
		else if (facility == "Moroso")
			{
				facility_text = 'Moroso Motorsports Park<br>17047 Beeline Hwy.<br>Jupiter, FL<br>gps: 80.3036° 26.911°';
				facility_url = 'www.morosomotorsportspark.&#99;&#111;&#109;/';
				facility_name = 'Moroso';
			}
		else if (facility == "Cresson")
			{
				facility_text = 'MotorSports Ranch-Cresson<br>Cresson, Texas&nbsp;&nbsp;76035<br>gps: 97.6179° 32.5237°';
				facility_url = 'www.motorsportranch.&#99;&#111;&#109;/';
				facility_name = 'Cresson';
			}
		else if (facility == "MSR")
			{
				facility_text = 'Mercedes Benz of Sugarland Road Course<br>Houston, TX<br>gps: 95.4202° 29.2781°';
				facility_url = 'www.msrhouston.&#99;&#111;&#109;/';
				facility_name = 'MSR';
			}
		else if (facility == "Nelson Ledges")
			{
				facility_text = 'Nelson Ledges<br>10342 State Route 305<br>Garrettsville, OH&nbsp;&nbsp;44231<br>gps: 81.104° 41.2884°';
				facility_url = 'www.nelsonledges.&#99;&#111;&#109;/';
				facility_name = 'Nelson Ledges';
			}
		else if (facility == "Oak Hill")
			{
				facility_text = 'Oak Hill Raceway<br>FM 1716<br>Henderson, TX&nbsp;&nbsp;75652<br>gps: 94.7024° 32.2577°';
				facility_url = 'www.oakhillraceway.&#110;&#101;&#116;/';
				facility_name = 'Oak Hill';
			}
		else if (facility == "Oregon")
			{
				facility_text = 'Oregon Raceway Park<br>Grass Valley, OR&nbsp;&nbsp;97029<br>gps: 120.744997°  45.364100°';
				facility_url = 'www.oregonraceway.&#110;&#101;&#116;/';
				facility_name = 'Oregon';
			}
		else if (facility == "Pacific Raceways")
			{
				facility_text = 'Pacific Raceways<br>31001 144th Ave Se<br>Kent, Washington&nbsp;&nbsp;98042<br>gps: 122.15° 47.3234°';
				facility_url = 'www.pacificraceways.&#99;&#111;&#109;/';
				facility_name = 'Pacific Raceways';
			}
		else if (facility == "Pocono")
			{
				facility_text = 'Pocono International Raceway<br>Long Pond Rd<br>Long Pond, PA&nbsp;&nbsp;18334<br>gps: 75.5088° 41.0562°';
				facility_url = 'www.poconoraceway.&#99;&#111;&#109;/';
				facility_name = 'Pocono';
			}
		else if (facility == "PIR")
			{
				facility_text = '<b>P</b>ortland <b>I</b>nternational <b>R</b>aceway<br>West Delta Park - 1940 North Victory Boulevard<br>Portland, Oregon&nbsp;&nbsp;97217<br>gps: 122.696° 45.5957°';
				facility_url = 'www.portlandraceway.&#99;&#111;&#109;/';
				facility_name = 'PIR';
			}
		else if (facility == "Pueblo")
			{
				facility_text = 'Pueblo Motorsports Park<br>3733 N Pueblo Blvd<br>Pueblo, CO&nbsp;&nbsp;81008<br>gps: 104.664° 38.3111°';
				facility_url = 'www.pueblomotorsportspark.&#99;&#111;&#109;/';
				facility_name = 'Pueblo';
			}
		else if (facility == "Putnam")
			{
				facility_text = 'Putnam Park Road Course<br>5251 S. County Road 550 East<br>Mount Meridian, IN&nbsp;&nbsp;46135<br>gps: 86.7438° 39.5831°';
				facility_url = 'www.putnampark.&#99;&#111;&#109;/';
				facility_name = 'Putnam';
			}
		else if (facility == "Reno Fernley")
			{
				facility_text = '<img src="images/bus/renofernly.png"><br>Reno Fernley Raceway<br>1965 Hwy 95A<br>Fernley, NV&nbsp;&nbsp;89408<br>gps: 119.244° 39.5399°';
				facility_url = 'www.reno-fernleyraceway.&#99;&#111;&#109;/';
				facility_name = 'Reno Fernley';
			}
		else if (facility == "Road America")
			{
				facility_text = 'Road America Raceway<br>N7390 Hwy. 67<br>Elkhart Lake, WI&nbsp;&nbsp;53020<br>gps: 87.989° 43.7947°';
				facility_url = 'www.roadamerica.&#99;&#111;&#109;/';
				facility_name = 'Road America';
			}
		else if (facility == "Road Atlanta")
			{
				facility_text = 'Road Atlanta<br>5300 Winder Highway<br>Braselton, Georgia&nbsp;&nbsp;30517<br>gps: 83.815° 34.1467°';
				facility_url = 'www.roadatlanta.&#99;&#111;&#109;/';
				facility_name = 'Road Atlanta';
			}
		else if (facility == "Roebling Road")
			{
				facility_text = 'Roebling Road<br>1135 Roebling Road<br>Bloomingdale, GA&nbsp;&nbsp;31302<br>gps: 81.3224° 32.1695°';
				facility_url = 'www.roeblingroad.&#99;&#111;&#109;/';
				facility_name = 'Roebling Road';
			}
		else if ((facility == "Spring Mountain") || (facility == "Pahrump"))
			{
				facility_text = 'Spring Mountain Motorsports Park<br>3601 S Hwy 160<br>Pahrump, Nevada<br>gps: 115.906° 36.1713°';
				facility_url = 'www.springmountainmotorsports.&#99;&#111;&#109;/';
				facility_name = 'Spring Mountain';
			}
		else if (facility == "Summit Point")
			{
				facility_text = 'Summit Point Raceway<br>Summit Point, WV&nbsp;&nbsp;25446<br>gps: 77.9729° 39.2408°';
				facility_url = 'www.summitpoint-raceway.&#99;&#111;&#109;/';
				facility_name = 'Summit Point';
			}
		else if (facility == "Talladega")
			{
				facility_text = 'Talladega Gran Prix Raceway<br>46 Pilgrim Lane<br>Munford, AL&nbsp;&nbsp;36268<br>gps: 85.999° 33.5061°';
				facility_url = 'www.tgprace.&#99;&#111;&#109;/';
				facility_name = 'Talladega';
			}
		else if (facility == "Texas World")
			{
				facility_text = 'Texas World Speedway<br>17529 Hwy 6 South<br>College Station, TX&nbsp;&nbsp;77845<br>gps: 96.2286° 30.5327°';
				facility_url = 'www.texasworldspeedway.&#99;&#111;&#109;/';
				facility_name = 'Texas World';
			}
		else if (facility == "Thunderbolt")
			{
				facility_text = 'Thunderbolt Raceway<br>(New Jersey Motorsports Park)<br>Millville, NJ<br>gps: 75.059° 39.3547°';
				facility_url = 'www.njmotorsportspark.&#99;&#111;&#109;/';
				facility_name = 'Thunderbolt';
			}
		else if (facility == "Thunderhill")
			{
				facility_text = '<img src="images/bus/thunderhill.png"><br>Thunderhill Raceway Park<br>Willows, CA<br>gps: 122.332° 39.5385°';
				facility_url = 'www.thunderhill.&#99;&#111;&#109;/';
				facility_name = 'Thunderhill';
				facility_img = 'url(images/bus/th.png)';
			}
		else if (facility == "VIR")
			{
				facility_text = '<b>VIR</b>ginia International Raceway<br>1245 Pine Tree Road<br>Alton, Virginia&nbsp;&nbsp;24520<br>gps: 79.1915° 36.5514°';
				facility_url = 'www.virclub.&#99;&#111;&#109;/';
				facility_name = 'VIR';
			}
		else if ((facility == "Streets<small> of </small>Willow") || (facility == "Streets of Willow"))
			{
				facility_text = '<img src="images/ca/willowspringsraceway.png"><br>Streets<small> of </small>Willow<br>Willow Springs Internation Raceway<br>Rosamond, CA<br>gps: 118.265° 34.8714°';
				facility_url = 'www.willowspringsraceway.&#99;&#111;&#109;/';
				facility_name = 'Streets<small> of </small>Willow';
			}
		else if ((facility == "WSIR") || (facility == "Willow Springs"))
			{
				facility_text = '<img src="images/ca/willowspringsraceway.png"><br><b>W</b>illow <b>S</b>prings <b>I</b>nternation <b>R</b>aceway<br>Rosamond, CA<br>gps: 118.265° 34.8714°';
				facility_url = 'www.willowspringsraceway.&#99;&#111;&#109;/';
				facility_name = 'WSIR';
			}
		else if (facility == "")
			{
				facility_name = '';
			}
		else 
			{
				facility_text = facility;
				facility_url = '';
				facility_name = facility;
			}

		if (position == "l")
				pos = 'white-space: nowrap; left: -20px; ';
		else if (position == "r")
				pos = 'white-space: nowrap; left: -100px; ';
		else if (position == "m")
				pos = 'left: 10px; top: -30px; width: 260px; ';
		else if (position == "f")
				pos = 'left: 20px; top: -12px; width: 160px; white-space: nowrap; ';
		else if (position == "p")
				pos = 'white-space: nowrap; left: 20px; top: -2px; ';
		
		if ((facility_name == "") && (provider == "NRS"))
		document.write('<a class="nrs" " href="http://' + provider_url + '" target="blank">' + provider_name + '<span style="border: 6px double red; ' + pos + ' ">' + provider_text + '</span></a>');
		else if (facility_name == "")
		document.write('<a class="link_3" " href="http://' + provider_url + '" target="blank">' + provider_name + '<span style="border: 6px double blue; ' + pos + ' ">' + provider_text + '</span></a>');
		else if (provider_name == "")
		document.write('<a class="link_2" " href="http://' + facility_url + '" target="blank">' + facility_name + '<span style="white-space: nowrap; border: 6px double green; ' + pos + ' ">' + facility_text + '</span></a>');
		else if ((provider_name == "")&&(facility_name == ""))
		document.write("");
		else
		document.write('<a class="link_3" " href="http://' + provider_url + '" target="blank">' + provider_name + '<span style="border: 6px double blue; ' + pos + ' ">' + provider_text + '</span></a> &#64; <a class="link_2" " href="http://' + facility_url + '" target="blank">' + facility_name + '<span style="white-space: nowrap; border: 6px double green; ' + pos + ' ">' + facility_text + '</span></a>');
	}
	
/*** Protects email address. ***/
		var prefix = '&#109;&#97;' + 'i&#108;' + '&#116;&#111;:';
		var path = ' hr' + 'ef' + '="';
		var name;
		var domain;
		var top;
	function no_spm(name,domain,top)
	{
		if (top == "net")
			top = "&#110;&#101;&#116;";
		if (top == "com")
			top = "&#99;&#111;&#109;";
		document.write('<a class="link"' + path + prefix + name + '&#64;' + domain + '&#46;' + top + '\">');
		document.write(name + ' a&#116; ' + domain + ' &#46; ' + top + '</a>');
	}

/*** Formats a number as phone number. ***/
function format_phone(ph)
	{
		var str=ph;
		
		document.write("&#40;");
		document.write(str.substr(0,3));
		document.write("&#41;");
		document.write(str.substr(3,3));
		document.write("&#8209;");
		document.write(str.substr(6,4));
	}

/*** Formats a number as currency. ***/
function addCurrency( strValue ) 
{
	 var objRegExp = /-?[0-9]+\.[0-9]{2}$/;
	 
	 if( objRegExp.test(strValue)) 
	 {
		 objRegExp.compile('^-');
		 strValue = addCommas(strValue);
		 if (objRegExp.test(strValue))
		 {
			 strValue = '(' + strValue.replace(objRegExp,'') + ')';
		 }
		 return '$' + strValue;
	 }
	 else
	 return strValue;
}

/*** Inserts commas into numeric string. ***/
function addCommas( strValue ) 
{
	 var objRegExp = new RegExp('(-?[0-9]+)([0-9]{3})'); 
	
	 //check for match to search criteria
	 while(objRegExp.test(strValue)) {
	 //replace original string with first group match, 
	 //a comma, then second group match
	 strValue = strValue.replace(objRegExp, '$1,$2');
	 }
 return strValue;
}
function updated () {
	var docdate = new Date(document.lastModified);

	var day = docdate.getDay();
		if (day == 0) var daystr = "Sunday";
		if (day == 1) var daystr = "Monday";
		if (day == 2) var daystr = "Tuesday";
		if (day == 3) var daystr = "Wednesday";
		if (day == 4) var daystr = "Thursday";
		if (day == 5) var daystr = "Friday";
		if (day == 6) var daystr = "Saturday";

	var month = docdate.getMonth();
		if (month == 0) var monthstr = "January";
		if (month == 1) var monthstr = "February";
		if (month == 2) var monthstr = "March";
		if (month == 3) var monthstr = "April";
		if (month == 4) var monthstr = "May";
		if (month == 5) var monthstr = "June";
		if (month == 6) var monthstr = "July";
		if (month == 7) var monthstr = "August";
		if (month == 8) var monthstr = "September";
		if (month == 9) var monthstr = "October";
		if (month == 10) var monthstr = "November";
		if (month == 11) var monthstr = "December";

	var year = docdate.getYear()
		if (year < 1000) {
			year = year + 1900;
		}

	var dn = "AM";

	var hours = docdate.getHours()
		if (hours > 12) {
			hours = hours - 12;
			dn = "PM";
		}

	var Minutes = docdate.getMinutes()

	document.write(
	"- "
	+ daystr + ", "
	+ docdate.getDate() + " "
	+ monthstr + " "
	+ year + " - "
	+ hours + ":"
	);
		if (Minutes < 10) {
			document.write("0");
		}

	document.write(
	+ Minutes + " " + dn
	);
}

function short_date () {
	var docdate = new Date(document.lastModified);

	var day = docdate.getDay();
		if (day == 0) var daystr = "Sun";
		if (day == 1) var daystr = "Mon";
		if (day == 2) var daystr = "Tue";
		if (day == 3) var daystr = "Wed";
		if (day == 4) var daystr = "Thu";
		if (day == 5) var daystr = "Fri";
		if (day == 6) var daystr = "Sat";

	var month = docdate.getMonth();
		if (month == 0) var monthstr = "Jan";
		if (month == 1) var monthstr = "Feb";
		if (month == 2) var monthstr = "Mar";
		if (month == 3) var monthstr = "Apr";
		if (month == 4) var monthstr = "May";
		if (month == 5) var monthstr = "Jun";
		if (month == 6) var monthstr = "Jul";
		if (month == 7) var monthstr = "Aug";
		if (month == 8) var monthstr = "Sep";
		if (month == 9) var monthstr = "Oct";
		if (month == 10) var monthstr = "Nov";
		if (month == 11) var monthstr = "Dec";

	var year = docdate.getYear()
		if (year < 1000) {
			year = year + 1900;
		}

		if (year > 2000) {
			year = year - 2000;
		}
	var date_ = docdate.getDate()

	document.write(
	daystr + ", "
	);
		if (date_ < 10) {
			document.write("0");
		}
	document.write(
	+ date_ + " "
	+ monthstr + ", 0"
	+ year
	);
}
			function past(e_year,e_month,e_date)
			{
					var passed=new Date()
					var year=passed.getYear()
					var month=passed.getMonth()
					var day=passed.getDate()
					
					if (year < 1000) year = year + 1900;
					
					if ((e_year < year) || ((e_year == year) && (e_month < month)) || ((e_year == year) && (e_month == month) && (e_date <= day)))
						document.write("<code>");
			}
	function sponsor(race_c)
	{
		if (race_c == "contingency")
			document.write('<a title="Contingency" class="sponsor" href="http://www.afmracing.org/sponsors.html?sponsors_contingencies" target="blank">$</a> ');
		else
			document.write('<a title="' + race_c + ' " class="sponsor" href="http://www.afmracing.org/sponsors.html?sponsors_classsponsors" target="blank">$</a> ');
	}
	
