	//maps
	var numMaps = 1;
	delimiter = " ";//str			- a string value that input data is separated with (<sp> or :)
	var mapWd = new Array(numMaps);
	var mapHt = new Array(numMaps);
	var trgWd = new Array(numMaps);
	var trgHt = new Array(numMaps);
	var mapW = new Array(numMaps);
	var mapE = new Array(numMaps);
	var mapN = new Array(numMaps);
	var mapS = new Array(numMaps);
	var mapItems = new Array(numMaps);
	var mapComment = new Array(numMaps);
	var mapCoords = new Array(numMaps);
	var mapType = new Array(numMaps);
	var mapGraphic = new Array(numMaps);
	var mComment = new Array(numMaps);

	//map 1	- map (downtown)
	mapWd[1] = 1272;//px			- width of map on page
	mapHt[1] = 612;//px			- height of map on page
	trgWd[1] = 14;//px			- icon width
	trgHt[1] = 14;//px			- icon height
	mapW[1] = 82.745;//deg	- left edge of map (in degrees)
	mapE[1] = 81.87;//deg	- right edge of map (in degrees)
	mapN[1] = 46.245;//deg	- top edge of map (in degrees)
	mapS[1] = 45.95;//deg	- bottom edge of map (in degrees)
	mapGraphic[1] = "North Channel"
 	mComment[1] = "North Channel"

	//map 1 items
	mapItems[1] = 14;
	mapComment[1] = new Array(mapItems[1]);
	mapCoords[1] = new Array(mapItems[1]);
	mapType[1] = new Array(mapItems[1]);

	mapCoords[1][1] 	= "N45.973 W81.928"
	mapComment[1][1] 	= "<strong>Sunday -</strong>  We arrive in Little Current at 6PM. We meet our skipper, Jamie, and our crewmates, Paul and Barbara. We familiarize ourselves with <a href='#gl_e1'>En Passant</a>. Our first meal together is in the local restaurant."
	mapType[1][1]		= "black"

	mapCoords[1][2] 	= "N46.003 W81.977"
	mapComment[1][2] 	= "<strong>Monday -</strong>  We wake to footfalls on the deck above us, lots of them, like a class of children playing on the deck. It turns out to be gulls feasting on the mayflies that litter the deck by the hundreds. The aroma of coffee followed by blueberry pancakes and bacon fills the cabin, as our skipper preapres our first meal. He has a list of rotating duties: cook, navigator, skipper. He goes over our itinerary - we'll sail for about 6 hours a day, anchoring each night, we'll rotate helm hourly or so, and we won't set foot on dry land until the last day of our adventure. We finish up breakfast and check the <a href='#gl_m1'>MAFOR</a> report on weather. Chance of <a href='#gl_s2'>squalls</a> are forecast for the afternoon, with winds reaching 40 knots. This is a normal part of sailing, and no cause for alarm. We set out at 11AM and head out into the North Channel and get a feel for the boat.<br><br>We hold off as long as we can, but eventually, each of us must use the head. This is a process where the first and last steps have you with your face in the bowl (to reach behind to open the through-hull fitting) and has 5 discrete intermediate steps that must be done in order and that aren't much more pleasant. Missing any of the steps results in yuckiness at best and a sunken boat at worst. But we survive."
	mapType[1][2]		= "red"

	mapCoords[1][3] 	= "N46.058 W82.292"
	mapComment[1][3] 	= "We have made good time on our first leg and have a few hours. We move into open water to practice some <a href='#gl_t1'>tacking</a>, <a href='#gl_g1'>gybing</a> and <a href='#gl_c1'>crew overboard</a> maneuvers. It is very, very hot. Even out on the lake with the wind, it is sweltering. We sweat profusely all day long. But we are working so hard we don't have time to care."
	mapType[1][3]		= "red"

	mapCoords[1][4] 	= "N46.078 W82.232"
	mapComment[1][4] 	= "<strong>The Storm -</strong>  Watching the horizon darken, we motor our way back to our first anchorage of the trip, but before we get there, we are overtaken by the storm. The sky goes black, then green. The incoming storm is preceded by a rolling cloud that looks like a rope stretched across the sky from horizon to horizon. I snap off a quick picture but struggle to get my camera back in the pocket of my rain suit as the skipper starts shouting orders. A white wall of rain spanning from cloud to ground races toward us across the lake, engulfing islands as it comes, and is upon us in minutes. The rain comes at us horizontally, so hard it stings.<br><br>We are in a very tough spot. We cannot make it to anchorage, only a quarter mile away, but we are now in shallow water with shoals around us to ground on, and we have a rocky shore<a href='#gl_l1'> to the lee</a> of us, upon which we will be smashed. The wind roars up to 70 knots (110 km/h) and the 3 metre waves pummel us, setting us rocking severely. <br><br>The skipper takes the <a href='#gl_h4'>helm</a> and sends the women below. He sends myself and Paul to the bow to let out the anchor. The anchor may or may not hold us - normally, it would have to be set - but the skipper needs the anchor to tell him which direction we are drifting, so he knows which way to power to keep us in deep water. We cannot see more than 50 yards in any direction, and we know there are rocky shores waiting for us in every direction.<br><br>Below, Barbara is on the radio, trying to raise the Coast Guard. Jinni is being pelted by food leaping out of the cupboards. She can hear the boat screeching and groaning, and at one point she hears a VERY loud crack from the direction of the mast. Through the companionway hatch, they can see our skipper at the helm. Behind him and <em>above</em> him, the dinghy (an eight foot rowboat) is <em>flying</em>. It is suspended in the air, spinning over and over like a giant propeller. Skipper figures it did seven full 360 degree flips in the air over the stern of the boat.<br><br> Paul climbs into the anchor locker at the bow, and I hang on to the cleat and toe rail just aft of him, while the wind and waves pitch us up and down metres at a time. We are heeling at about a 45 degree angle, we are being ripped by winds and shoved by waves pounding over the toerails and can barely hang on with each heave. We cannot get the anchor off. We realize it is tied off with a line but we cannot untie the knot. Paul pulls out his penknife and cuts the line, letting the anchor free. It whizzes out of the locker, and as we watch it go, I ask him (in a scream) if the <a href='#gl_b1'>bitter end</a> is tied off. We don't know, and it is going too fast for us to hold it.<br><br>It reaches the end and we finally see it <em>is</em> tied off - to a flimsy ring bolt no thicker than a pencil. We get the line around a cleat, but the 13 tonnes of the boat being pounded at 70 knots puts so much tension on the line that we cannot get a proper tie off.<br><br>And then, eerily, the waves suddenly subside. Not in a way that suggests the storm is easing, in a way that makes the boat under us feel ... stable was the sensation I felt - <em>alarmingly</em> stable - there's only one reason why a boat gets very stable, and that's if it suddenly takes on a lot of weight. Below, Jinni sees a wall of green water rising up to fill her entire view out the hatch. She waits for it to crash, but it does not. On the bow, I realize that I am no longer <em>lying</em> down at all, I am <em>standing</em>, upright on the toerail. The port toerail is straight up over my head and the starboard toerail is below my feet. The water rises above my knees. This is not from a wave flowing and ebbing, my feet are simply three feet under water. <img src='images/sketch2.gif' align='right'>We recount later, that Jinni is not in fact, looking at a giant wave of water <em>on</em> the lake, she is tilted full over, looking out the hatch directly <em>down</em> into the lake. En Passant is on its side, heeled at an 80 degree angle. Our skipper loses control as first the rudder, then the propeller (which is on the <em>keel</em>), is lifted clear out of the water. He sees the water rise over the toerail next to him, over the winches, and begin lapping at the edge of the cockpit.<br><br>This is it, we're capsizing.<br><br>Later, our skipper recounts that, if the water had risen two more inches, or even a small wave had chosen that time to break, it would pour into the cockpit, and then into the cabin. There, it would flood and then sink us.<br><br>My only thought up there on the bow is that Jinni is still in the cabin and will drown if I don't get back there.<br><br>And then - the big blow of wind, the big wave of water - doesn't come. The boat slowly beings to right itself. Paul and I race back to the cockpit and get below. The wind and waves pound us for ten more minutes but we've seen the worst of it. Another half hour and it's all over.<br><br> In calm waters under clearing skies, we go to pull our anchor out. It is jammed so securely into a crevasse that we try for <em>two hours</em> to free it. I'm thinking fate had other plans for us than to drown that day, and set our anchor with a Godly force. We try every trick in the book, short of cutting it loose, before it finally comes free. We motor around the corner, completing the last few hundred yards to anchor in the harbour of Crocker Island - in the shadow of a 60 foot pine tree snapped in half, its top thrown down the hill to the shore like a twig. We take stock.<br><br>Our damage assessment:<ul><li>a digital camera (mine) at the bottom of the lake</li><li>a ceiling panel dislodged from around the mast</li><li>a tin of cherry tomatoes, a tin of muffins</li></ul> Later, when we arrive back at Little Current, we will hear reports of one of the largest freak storms to sweep across Ontario in recent memory:<ul><li>most squalls last about 3 minutes - tough, but bearable to ride out with enough open water. This one lasted about <em>30</em> minutes.</li><li>70+ knot (120km/h) winds</li><li>all across Manitoulin Island, hundreds of fully-grown trees are snapped in half or pulled up by the root</li><li>a 42 foot trawler sunk just two miles from our location</li><li>$7  million damage to the town, including a marina just to the east of Little Current, with scores of boats in dry dock, is completely <em>flattened</em></li><li>90,000 homes without power for as much as 2 days</li><li>North Bay is hammered, with 90% of the houses in town suffering some form of damage</li><li>amazingly, there are only two reported deaths, by falling trees</li></ul><br><br>We spend the evening processing the day's events over and over; we have a swim and some snacks. Everyone is in very good spirits, all things considered. It has been an adventurous first day and no one will have any trouble falling asleep tonight.<br><br>The world out there seems just a little bit smaller from this point on."
	mapType[1][4]		= "red"

	mapCoords[1][5] 	= "N46.078 W82.242"
	mapComment[1][5] 	= "<strong>Tuesday -</strong> Morning finds us as if nothing happened. We have an excellent breakfast, weigh anchor and are on our way. We sail out the harbour, the way we came in, I, looking over the side in as if I might see my camera glinting from the bottom of the lake."
	mapType[1][5]		= "orange"

	mapCoords[1][6] 	= "N46.149 W82.359"
	mapComment[1][6] 	= "<strong>Little Detroit Passage -</strong> After several hours of sailing, we approach Little Detroit passage, only 200 yards wide. We must use range finder markers on the shore to line up our heading into the channel."
	mapType[1][6]		= "orange"

	mapCoords[1][7] 	= "N46.159 W82.507"
	mapComment[1][7] 	= "<strong>Whaleback Channel -</strong><img src='images/sketch4.gif' align='right'> We play in the lake for a few hours and then make our way slowly upwind by tacking back and forth. This takes about two hours.<br clear=all>"
	mapType[1][7]		= "orange"

	mapCoords[1][8] 	= "N46.142 W82.617"
	mapComment[1][8] 	= "<strong>Tuesday night anchorage -</strong> We drop anchor in John Harbour on a calm, peaceful evening. We set two anchors, with floats and <a href='gl_t2'>trip lines</a>. We find we've set the stern trip line too short, so the buoy is actually submerged. Paul and I must swim out to it (we both brought goggles) and attach a longer line so the buoy has room to bob.<img src='images/sketch1.gif' align='right'> Dinner is barbequed chicken (on the pushpit-mounted hibachi) and couscous."
	mapType[1][8]		= "orange"

	mapCoords[1][9] 	= "N46.172 W82.493"
	mapComment[1][9] 	= "<strong>Wednesday morning -</strong> We take some time in Whaleback Channel to practice our <a href='#gl_g1'>gybes</a>. Sailnig standard requires six successful gybes in les than ten minutes. I need more practrice as I tend to oversteer or understeer.<br clear=all>"
	mapType[1][9]		= "green"

	mapCoords[1][10] 	= "N46.152 W82.263"
	mapComment[1][10] 	= "<strong>Wednesday anchorage -</strong><img src='images/sketch3.gif' align='right'> Jinni makes tuna steaks while I take the dinghy out set the stern anchor. A slip of the foot though, and I am on my butt in the dinghy. Now, dinghies are not known for their stability, and I land on the rail. I go over just far enough that I put the rail under water and it comes pouring in. Fortunately, it's unsinkable. I begin bailing, and it takes me a few moments to realize that the boat is not quie so close anymore. 'Paul, I am tied off, right?' Paul standing on the stern gives me a very sheepish look as I drift down current.<br clear=all>"
	mapType[1][10]		= "green"

	mapCoords[1][11] 	= "N46.075 W82.122"
	mapComment[1][11] 	= "<strong>Thursday - Dave as cook and skipper -</strong> I make breakfast - a big veggie 'scramelette', toasted English Muffins, fruit slices and avocado. Afterwards, I relax and go for a swim while the dishes are done. But still have one part of my mind on skippering, and do the engine check early. We come out of anchorage. I have tghe helmsman take us into open water on a beam reach, and my uber-skipper questions my decision, saying I'm making my crew work extra hard. My crew and skipper and I debate our course while we go nowhere. I give it five minutes, and then I tell the uber-skipper that I'm going to follow through with my plan. The mark of a good skipper is that he is decisive. If it is the <em>right</em> decision, so much the better. He acqueisces. through the straight north of Fox Island, we see grey on the horizon again. While I know that Monday's events are not about to repeat themselves, I do feel that we may not be ready to handle it out in the open, and better to be safe. I ask the navigator to set us a course that will put us in the lee of an island. I ask the skipper (the real skipper) for confirmation, but he just shrugs. At this point in the week, we are supposed to be making our own decisions, and as long as we don't crash the boat, he's letting us be. My navigator and crew disagree but after some discussion, I pull rank. We head for the lee of the island."
	mapType[1][11]		= "blue"

	mapCoords[1][12] 	= "N45.967 W82.057"
	mapComment[1][12] 	= "<strong>Thursday afternoon -</strong> The expected storm passes us by, barely deigning to sprinkle us with rain. This, despite me standing on the deck, shaking my fist at the sky, shouting '<em>You call this weather?? Bring it on!!</em>' Our course home takes us directly downwind so we do a series of gybes to keep us on course."
	mapType[1][12]		= "blue"

	mapCoords[1][13] 	= "N45.973 W81.948"
	mapComment[1][13] 	= "<strong>Thursday anchorage -</strong> After 4 days on open water, we finally pull into the town dock for a pump out, fresh water and diesel. We move to our long-term dock and wrap up for the night."
	mapType[1][13]		= "blue"

	mapCoords[1][14] 	= "N45.987 W81.922"
	mapComment[1][14] 	= "<strong>Friday docking -</strong> We spend the morning practicing stopping the boat on a dime and docking under power in current and wind. The owners of the boats docked adjacent were very attentive, and very eager to help. We say our good-byes, knowing we'll all see each other around the club, and head across Manitoulin Island toward the Tobermory Ferry and home."
	mapType[1][14]		= "purple"
 
 	//map functions
	
	function setMaps(){

		for (mapNum=1; mapNum<=numMaps; mapNum++){

			// 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(mapW[mapNum]-mapE[mapNum])//deg - width of map (in degrees)
			mapHtdeg=Math.abs(mapN[mapNum]-mapS[mapNum])//deg - height of map (in degrees)
	
			for (i=1; i<=mapItems[mapNum]; i++){
				//store value from mapcoords.js
				inCoords = mapCoords[mapNum][i];
		
				//validate input string N## ## ##[.#] W[#]## ## ##[.#]
				//break single input coord into N + W
				latitude = inCoords.slice(inCoords.indexOf("N")+1,inCoords.indexOf("W"))
				longitude = inCoords.slice(inCoords.indexOf("W")+1,inCoords.length)
		
				//convert degrees/decimal into pixels
				coordHrz = (mapW[mapNum] - longitude) * mapWd[mapNum]/mapWddeg  - trgWd[mapNum]/2;
				coordVrt = (mapN[mapNum] - latitude) * mapHt[mapNum]/mapHtdeg  - trgHt[mapNum]/2;
				
				
				//trap values outside map borders
				if (longitude > mapW[mapNum] || longitude < mapE[mapNum]){ alert("Warning: longitude must be between " + mapE[mapNum] + " and " + mapW[mapNum] + " degrees.\nLongitude in data is " + longitude + ".") }
				if (latitude > mapN[mapNum] || latitude < mapS[mapNum]){ alert("Warning: latitude must be between " + mapS[mapNum] + " and " + mapN[mapNum] + " degrees.\nLatitude in data is " + latitude + ".") }
		
						
				//move icon
				moveDivTo('target' + i, 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] ;
	}
}

//
	

