	var tmpX = 0;
	var tmpY = 0;
	mapHpx = 1100;	//px	- width of map on page
	mapVpx = 530;	//px	- height of map on page
	mapWu = 0;		//left edge of map (in units)
	mapEu = 110;		//right edge of map (in units)
	mapNu = 53;		//top edge of map (in units)
	mapSu = 0;		//bottom edge of map (in units)
	var mapUnitBaseline = 205;
	mapXoffsetU = 2;
	mapYoffsetU = 0;
	mapGraphic = "background"
	
	//map 1 items
	numWks = 45;
	week = new Array(numWks);
	//mapType = new Array(numWks);
	week[1] = new Array('03/09/29',197.5,197,197.5,"");
	week[2] = new Array('03/10/05',199,197,198,"");
	week[3] = new Array('03/10/12',195,197,197.5,"");
	week[4] = new Array('03/10/19',198,195,194,"");
	week[5] = new Array('03/10/26',"Misplaced the data for this week.");
	week[6] = new Array('03/11/02',197.5,197,194,"Ran out of medication this week.");
	week[7] = new Array('03/11/09',193.5,191.5,192,190.5,"Wow. Look what happens when I go back to my meds.");
	week[8] = new Array('03/11/16',190.0,189.5,189.5,"");
	week[9] = new Array('03/11/23',189.0,190,188.5,"");
	week[10] = new Array('03/11/30',188,188,188.5,187.5,"");
	week[11] = new Array('03/12/07',185.5,185.5,185.5,185.5,"This week I didn't get any exercise at all. Strange that my weight would drop more than any other week.");
	week[12] = new Array('03/12/14',185.0,185.5,184.5,"");
	week[13] = new Array('03/12/21',184.5,184,185,185.5,"So, now you can really see what happens wehen I stop exercising. Or is it the influx of Christmas baking?");
	week[14] = new Array('03/12/28',184.5,185.5,"Christmas. 'nuff said.");
	week[15] = new Array('04/01/04',185.5,187,"Yikes - I've drifted into the yellow. Time to return to pounding the pavement.");
	week[16] = new Array('04/01/11',185.5,184.5,186, 185.5,"More pounding.");
	week[17] = new Array('04/01/18',184,181.5,183,182.5,"That's better. Back on track.");
	week[18] = new Array('04/01/25',181,181.5,181.5,"Getting closer now.");
	week[19] = new Array('04/02/01',180,179,182,183,"Oh my God, I actually did it! And 6 weeks ahead of schedule! Of course, it's not 'fixed' yet.");
	week[20] = new Array('04/02/08',179,178,177.5,"Now, it's 'fixed' in the data! Three consecutive readings, all well below threshold! Oh my God. I'm just disappearing.");
	week[21] = new Array('04/02/15',174,177.5,"This is what getting sick and then not eating can do.");
	week[22] = new Array('04/02/22',175,176,175.5,"");
	week[23] = new Array('04/02/29',176,175,177.5,"");
	week[24] = new Array('04/03/06',175.5,"");	
	week[25] = new Array('04/03/13',175.5,"");
	week[26] = new Array('04/03/20',175.5,"My weight seems to have stabilized.");
	week[27] = new Array('04/03/27',175,"This is good. I've stopped rigorous attention to losing weight, and haven't begun to climb.");
	week[28] = new Array('04/04/04',175.5,"I wonder how my vacation will be for my weight.");
	week[29] = new Array('04/04/11',179,177,"Not so good I guess.");
	week[30] = new Array('04/04/18',177,"");
	week[31] = new Array('04/04/25',176,"");
	week[32] = new Array('04/05/02',177,"");
	week[33] = new Array('04/05/09',174,"I have switched to a different anxiety medication .");
	week[34] = new Array('04/05/16',174,173,"Um. And now I have gone off new medication. See my blog at davesbrain.ca if in any doubt about this.");
	week[35] = new Array('04/05/23',172.5,"");
	week[36] = new Array('04/05/30',175,174,173,"");
	week[37] = new Array('04/06/06',174,173,172.5,"");
	week[38] = new Array('04/06/13',178.5,176.5,175.5,"Weeee! Fun with medications. On heavy dose of prednisone this week. That 187.5 is the high. Took water pill. Dropped 3lbs overnight.");
	week[39] = new Array('04/06/22',170.5,170.5,172.0,"This is almost too good to be true. Twice I've hit 170.5. One more pound and I cross into a whole new zone.");
	week[40] = new Array('04/06/29',173.5,172.5,171.5,"These numbers are approximate asI'm a little late in recording them.");
	week[41] = new Array('04/07/01',169.5,"And there you have it. Please scroll to bottom of page for visual proof.");
	week[42] = new Array('04/07/10',173.5,173,"");
	week[43] = new Array('04/07/17',174,174,173,"");
	week[44] = new Array('04/07/24',171,"");
	week[45] = new Array('04/08/01',170,"I always see this a s good sign, going for a while without diet/exercise diligence, then checking up, and seeing that it hasn't begun to creep back up again.");

	//interpolate some values and store
	//average the data, record the number of valid data points
	for (wkNm=1; wkNm<=numWks; wkNm++){//for each weekly entry
		sum = 0;
		nmDataPts = 0;
		for (rawDataPtNum=1; rawDataPtNum<=week[wkNm].length-2; rawDataPtNum++){
			sum += week[wkNm][rawDataPtNum];
			nmDataPts += 1;
		}
		avg = roundto(sum/nmDataPts,2);
		//add both the *combined* (averaged) value and the number of *valid* data points into the array
		junk = week[wkNm].unshift(nmDataPts)
		junk = week[wkNm].unshift(avg)
		//thus: week[wkNm](avg, nmDataPoints, date, d1, <d2, <d3>)
	}
	
 	//map functions
	
	function setMaps(){

			// calculate physical xy position on graphical map,
			// using GPS coordinates entered in coords.js file.
			// This code requires input in the format:
							
			//initiate values

			mapWddeg=Math.abs(mapWu-mapEu)//deg - width of map (in units)
			mapHtdeg=Math.abs(mapNu-mapSu)//deg - height of map (in units)
	
			for (wkNm=1; wkNm<=numWks; wkNm++){//for each weekly entry

				//only bother plotting if there are valid points (wkNm.e. sum > 0)
				if (week[wkNm][0] > 0){
					
					tmpX = Math.round(wkNm);//convert it to a number
					//calc and plot ---- EACH --- datum
					
					for (arrayVal=3; arrayVal<=week[wkNm].length-2; arrayVal++){
						tmpY = week[wkNm][arrayVal];
						rawDataPtNum = arrayVal - 2;
						//convert degrees/decimal into pixels
						coordHrz = (tmpX + mapXoffsetU) * mapHpx/mapWddeg * 2 - 3;
						coordVrt = (mapUnitBaseline - tmpY + mapYoffsetU) * mapVpx/mapHtdeg-1;
						//move icon
						div = "targ" + wkNm + "Datum" + rawDataPtNum
						//alert(coordHrz + " [" + rawDataPtNum + "] " + + coordVrt)
						moveDivTo(div, coordHrz, coordVrt);
					}
					
					//calc and plot --- AVERAGE --- of three weights

					//convert degrees/decimal into pixels
					coordHrz = (tmpX + mapXoffsetU) * mapHpx/mapWddeg * 2 - 5;
					coordVrt = (mapUnitBaseline - week[wkNm][0] + mapYoffsetU) * mapVpx/mapHtdeg;
					//move icon
					moveDivTo('targAvg' + wkNm, coordHrz, coordVrt)
				}
			}
	}


function moveDivTo(divID, x, y){
	if (document.all) {
		divStyleObj(divID).posLeft = x ;
		divStyleObj(divID).posTop = y ;		
	} else {
		divStyleObj(divID).left = x ;
		divStyleObj(divID).top = y ;
	}
}

function divObj(divID){
	if (document.all){
		return document.all[divID] ;
	}else{
		return document.layers[divID] ;
	}
}
	
function divStyleObj(divID){
	if (document.all){
		return document.all[divID].style ;
	}else{
		return document.layers[divID] ;
	}
}

function roundto(inValue,inDecimals){
	return Math.round((inValue)*Math.pow(10,inDecimals))/Math.pow(10,inDecimals);
}

//
	

