


var eastCoord;
var northCoord;

function getAreaCoords (area, grEast, grNorth)
{
	if (area=="TQ")
	{
		eastCoord = '5'+grEast;
		northCoord = '1'+grNorth;
	}
	else if (area=="SU")
	{
		eastCoord = '4'+grEast;
		northCoord = '1'+grNorth;
	}
	else if (area=="TL")
	{
		eastCoord = '5'+grEast;
		northCoord = '2'+grNorth;
	}
	else if (area=="TR")
	{
		eastCoord = '6'+grEast;
		northCoord = '1'+grNorth;
	}
	else
	{
		eastCoord = '';
		northCoord = '';
	}
}

/*function addEventGR (area, grEast, grNorth, doc)*/
function addPOCGR (gridReference, doc)
{
	var area = gridReference.substring(0, 2);

	var grEast = gridReference.substring(2, 5);
	var grNorth = gridReference.substring(5, 8);

	if (gridReference == '')
		return

	getAreaCoords (area, grEast, grNorth);

	if (eastCoord != '')
	{
/*
		doc.write ('<A HREF="http://uk.multimap.com/map/browse.cgi?GridE=');
		doc.write (eastCoord+'00&GridN='+northCoord+'00&db=grid" TARGET="_top">'+
			area+' '+grEast+grNorth+'</A>');
*/

		doc.write ('<A HREF="http://uk.multimap.com/map/browse.cgi?GridE=');
		doc.write (eastCoord+'00&GridN='+northCoord+'00&db=grid&zm=1&scale=200000" TARGET="_top">'+
			area+' '+grEast+grNorth+'</A>');



	}
	else
		doc.write (area+' '+grEast+grNorth+'.');
}




function doPageStart (pageName, doc)
{
	doc.write ('<HEAD><TITLE>'+pageName+'</TITLE></HEAD>');
	doc.write ('<BODY TOPMARGIN=5 LEFTMARGIN=20 >');
}


function doPageEnd (doc)
{
	doc.write ('<BR><HR><CENTER><FONT FACE="ARIAL" SIZE="2">'+
		'These pages are maintained by <A HREF="mailto:dave_m_moore@post2me.freeserve.co.uk">'+
		'<I>David Moore</I></A>.</FONT></CENTER>');

	doc.write ('</BODY>');

}


function doPOCIntro (doc)
{

	doc.write ('<TABLE COLS="2" CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH="100%"><TR>'+
		'<TD BGCOLOR=#75ffffff><FONT FACE="ARIAL" SIZE="4">&nbsp<B><I>Permanent Orienteering Courses in the South-East Of England</I></B></FONT></TD>'+
		'<TD ALIGN="RIGHT" BGCOLOR=#75ffffff WIDTH="120" BACKGROUND="../images/fade.gif">&nbsp</TD>'+
		'</TR></TABLE><BR>');
	
	doc.write ('<FONT FACE="ARIAL" SIZE="2"><P ALIGN="CENTER">Here is a list of Permanent Orienteering Courses (or POCs) in the South-East'+
		' region. Many thanks to Ray Weekes and Julianna Grant for compiling this list.'+
		' Before travelling to any of these courses, it is strongly advised that you check the correctness of the below details'+
		' with a second information source, such as the associated clubs website and/or the appropriate contacts listed below.'+
		' If you would like to add, remove or update any of the current details, please <A HREF="mailto:dave_m_moore@post2me.freeserve.co.uk">email</A>'+
		' the information to me and I will make the appropriate adjustment.<BR></P></FONT>');

	doc.write ('<FONT FACE="ARIAL" SIZE="2"><P ALIGN="CENTER"><B>What is a Permanent Orienteering Course (POC)?</B><BR>'+
		'It is a number of permanent control points (usually about 20) identified by sturdy wooden posts with a code'+
		' and an orienteering logo carved or painted on it. All the controls are shown on an overprinted map. They are'+
		' usually situated in local parks or forests owned by councils, the National Trust or Forest Enterprise.'+
		'  Management of the courses may be by the owner of the land, or by the local orienteering club.<BR></P></FONT>');

	doc.write ('<FONT FACE="ARIAL" SIZE="2"><P ALIGN="CENTER"><B>What is the purpose of a POC?</B><BR>'+
		'The courses have many purposes, depending on your own specific needs. The great thing about them is that'+
		' you can go at a time to suit you, on whatever day of the week you choose. If you are an experienced orienteer'+
		' you may use them to fine tune some techniques, maybe pace counting, relocation or line orienteering. They are'+
		' also an ideal way of introducing children and adults alike to the sport, where you can go at your own pace and'+
		' spend as much time as you like figuring out the map. If you want to go in a pair or as a group, again, this is'+
		' the perfect opportunity. You may have just started orienteering and are wanting to gain confidence in your skills'+
		' outside of the pressures of an organized competition. So whether you are using them for training purposes or just'+
		' for a more adventurous family stroll, the choice is entirely yours.<BR></P></FONT>');



}


/*
function doMonth (month, doc)
{
	doc.write ('<BR><FONT FACE=ARIAL SIZE="4">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp'+
		'<B><I>'+month+'</I></B></FONT>')
}

*/

function doPOC (venue, club, clubCode, gridReference, doc)
{

	doc.write ('<CENTER><TABLE WIDTH=90% CELLSPACING=4 CELLPADDING=0 BORDER=0><TR>'+
		'<TD ROWSPAN=2 VALIGN=TOP WIDTH=15% ALIGN=RIGHT BACKGROUND="../images/fade2.gif">'+
		'<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD ALIGN=RIGHT BACKGROUND="">'+
		'<FONT FACE=ARIAL></FONT></TD><TD BACKGROUND="">&nbsp</TD></TR></TABLE></TD>'+

		'<TD><TABLE CELLSPACING=0 BORDER=0 WIDTH=100% COLS="3">'+
		'<TD ALIGN=LEFT VALIGN=TOP BGCOLOR=#75ffffff>&nbsp<FONT FACE=ARIAL SIZE="4">'+
		'<B><I>'+venue+'</I></B></FONT></TD>'+
		'<TD BGCOLOR=#75ffffff  WIDTH="20%"  ALIGN="MIDDLE">');

	getClubURL (clubCode);
	if (clubURL != 'NOTFOUND')
	{
		doc.write ('<A HREF="');
		doc.write (clubURL);
		doc.write ('" TARGET="_top"><FONT FACE=ARIAL SIZE="3"><B><I>'+club+'</I></B></FONT></A>');
	}
	else
	{
		doc.write ('<FONT FACE=ARIAL SIZE="3"><B><I>'+club+'</I></B></FONT>');

	}

	doc.write ('</TD>'+
		'<TD ALIGN=RIGHT BGCOLOR=#75ffffff VALIGN=MIDDLE WIDTH=20%>'+
		'<FONT FACE=ARIAL SIZE="4">&nbsp</FONT><FONT FACE=ARIAL SIZE="3"><B><I>');

	addPOCGR (gridReference, doc);

	doc.write ('&nbsp</I></B></FONT></TD>'+
		'</TD></TR><TR><TD HEIGHT=3></TD></TR>');

	doc.write ('<TR><TD COLSPAN=3><FONT SIZE="2" FACE=ARIAL>');

}


function endPOC (doc)
{
	doc.write ('</FONT></TD></TR></TABLE></TABLE></CENTER>');
}


function addPOCInfo (heading, info, doc)
{
	if (heading != '')
		doc.write ('<B>'+heading+':</B> '+info+' ');
	else
		doc.write (info+' ');
}

