/* 
	emails.js
	File containing all the email address details as global variables
	Created by Questronics Computing Service
 */

var ns4 = document.layers
var ie4 = document.all
var ns6 = document.getElementById && !document.all
var isNav = (ns4 || ns6)
var isIE = !isNav

function theDestination(no, position, title, name, username, address) {
	this.no = no
	this.position = position
	this.title = title
	this.name = name
	this.username = username
	this.address = address
}

/* EMAIL ADDRESSES */

var Emails = new Array()

if (Emails.length == 0) {
	var i = 0
	Emails[i] = new theDestination (i++, 'GenSec', 'General&nbsp;Secretary', 'Richard Parrotte', 'GenSec', 'ShaftesburyCC.co.uk' )
	Emails[i] = new theDestination (i++, 'TTSec', 'Time&nbsp;Trial&nbsp;Secretary', 'Lily Shakespeare', 'TTSec', 'ShaftesburyCC.co.uk' )
	Emails[i] = new theDestination (i++, 'AsstTTSec', 'Asst. Time&nbsp;Trial&nbsp;Secretary', '<br>', '', '' )
	Emails[i] = new theDestination (i++, 'BCFSec', 'BCF&nbsp;Secretary', 'Mark Howard', 'BCFSec', 'ShaftesburyCC.co.uk' )
	Emails[i] = new theDestination (i++, 'RRSec', 'Road&nbsp;Race&nbsp;Secretary', 'Mark Howard', 'RRSec', 'ShaftesburyCC.co.uk' )
	Emails[i] = new theDestination (i++, 'OffRoadSec', 'Off-Road&nbsp;Secretary', 'Bruce Robinson', 'bprob', 'btinternet.com' )
	Emails[i] = new theDestination (i++, 'MTBSec', 'MTB&nbsp;Liaison', 'Ralph Mullan', 'ralph_mullan', 'hotmail.com' )
	Emails[i] = new theDestination (i++, 'WebMaster', 'Webmaster', 'Keith West', 'WebMaster', 'ShaftesburyCC.co.uk' )
	Emails[i] = new theDestination (i++, 'AudaxSec', 'Audax&nbsp;Secretary', 'Tim Stout', 'AudaxSec', 'ShaftesburyCC.co.uk' )
	Emails[i] = new theDestination (i++, 'Stout', 'Photographer', 'Tim Stout', 'AudaxSec', 'ShaftesburyCC.co.uk' )
	Emails[i] = new theDestination (i++, 'SocialSec', 'Social Secretary', 'George Shakespeare', 'george', 'shaky.me.uk' )
	Emails[i] = new theDestination (i++, 'PressSec', 'Press Secretary', 'Volunteer Needed', '', ''  )
	Emails[i] = new theDestination (i++, 'Dinner', 'Dinner Organiser', 'George Shakespeare', 'george', 'shaky.me.uk' )
	Emails[i] = new theDestination (i++, 'WebPhotos', 'Website&nbsp;Photographer', 'Anthony Dando', 'WebPhotos', 'ShaftesburyCC.co.uk' )
	Emails[i] = new theDestination (i++, 'Dando', 'Photographer', 'Anthony Dando', 'AntDando', 'fsmail.net' )
	Emails[i] = new theDestination (i++, 'RROrganiser', 'Road&nbsp;Race Organiser', 'Dan Scott', 'RROrg', 'ShaftesburyCC.co.uk' )
	Emails[i] = new theDestination (i++, 'ClubCaptain', 'Club Captain', 'Tim Stout', 'timstout', 'btconnect.com' )
	Emails[i] = new theDestination (i++, 'JunClubCaptain', 'Junior Committee Member', '<br>', '', '' )
	Emails[i] = new theDestination (i++, 'YouthOfficer', 'Youth Officer', '<br>', '', '' )
	Emails[i] = new theDestination (i++, 'MarshalSec', 'Marshalling&nbsp;Secretary', 'Volunteer Needed', '', '' )
	Emails[i] = new theDestination (i++, 'ECCAOrganiser', 'ECCA&nbsp;Festival Organiser', 'Alan Osborne', 'alan', 'osborne-41.freeserve.co.uk' )
	Emails[i] = new theDestination (i++, 'DaveMiesner', 'Dave&nbsp;Miesner', 'Dave Miesner', 'drm_drm', 'lineone.net' )
	Emails[i] = new theDestination (i++, 'InternationalSec', 'SCC&nbsp;International Secretary', 'Peter Elsey', 'InternationalSec', 'ShaftesburyCC.co.uk' )
//	Emails[i] = new theDestination (i++, 'AudaxOrganiser1', 'Audax&nbsp;Organiser&nbsp;1', 'Mick Dodge', 'AudaxOrg1', 'ShaftesburyCC.co.uk' )
	Emails[i] = new theDestination (i++, 'Chairman', 'Chairman', 'Terry Anderson', 'Chairman', 'ShaftesburyCC.co.uk' )
	Emails[i] = new theDestination (i++, 'AudaxOrganiser1', 'Audax&nbsp;Organiser&nbsp;1', 'Tim Stout', 'AudaxOrg1', 'ShaftesburyCC.co.uk' )
	Emails[i] = new theDestination (i++, 'AudaxOrganiser2', 'Audax&nbsp;Organiser&nbsp;2', 'Richard Parrotte', 'AudaxOrg2', 'ShaftesburyCC.co.uk' )
	Emails[i] = new theDestination (i++, 'NewsEditor', 'Newsletter&nbsp;Editor', 'Barry Tucker-Vincent', 'NewsEditor', 'ShaftesburyCC.co.uk' )
	Emails[i] = new theDestination (i++, 'KenMcDonald', 'Ken McDonald', 'Ken McDonald', 'Teskey', 'BTinternet.com' )
	Emails[i] = new theDestination (i++, 'PeterLittle', 'Peter Little', 'Peter Little', 'peter', 'glendenecc.fsnet.co.uk' )
	Emails[i] = new theDestination (i++, 'RichardParrotte', 'Richard Parrotte', 'Richard Parrotte', 'r.parrotte', 'btinternet.com' )
	Emails[i] = new theDestination (i++, 'KenPearce', 'email', 'Ken Pearce', 'kpearce', 'kpearce.plus.com' )
//	Emails[i] = new theDestination (i++, 'TonyPC', 'Organiser', 'Tony Potipher-Cook', 'cookpot', 'tinyworld.co.uk' )
	Emails[i] = new theDestination (i++, 'HeronRROrganiser', 'Heron CSA Road&nbsp;Race&nbsp;Organiser', 'Geoff Fletcher', 'road07', 'cyclerace.co.uk' )
	Emails[i] = new theDestination (i++, 'MartinWheeler', 'Martin Wheeler', 'Martin Wheeler', 'sketchytrail', 'hotmail.co.uk' )
	Emails[i] = new theDestination (i++, 'GeorgeShakespeare', 'George Shakespeare', 'George Shakespeare', 'george', 'shaky.me.uk' )
	Emails[i] = new theDestination (i++, 'AdrianWard', 'Adrian Ward', 'Adrian Ward', 'akabward', 'btinternet.com')
	Emails[i] = new theDestination (i++, 'TrevorMills', 'Trevor Mills', 'Trevor Mills', 'trevor_mills04', 'yahoo.co.uk')
	Emails[i] = new theDestination (i++, 'Organiser25', '25 Organiser', 'Joe OHerlihy', 'joe.theo', 'virgin.net' )
	Emails[i] = new theDestination (i++, 'jgolder', 'John Golder', 'John Golder', 'jgolder', 'ford.com')
}

function writeEmail(posn,extra,doc,subject,addressee) {
	var i, cText = 'Email details not available', textOnly = false
	var obj = eval(((doc == null) || (doc == "") || (doc == "undefined")) ? 'document' : 'doc.document')
	var subj = (((subject == null) || (subject == "") || (subject == "undefined")) ? obj.title : subject)
	var dek_exists = checkDek(obj)
	if (extra == "exact") {
		cText = '<a href="mailto:' + posn + '?subject=' + subj + '"'
		if (dek_exists) { cText += ' onmouseover="popupMsg(\'Click to E-mail<br>' + addressee + '\')" onmouseout="killMsg()" ' }
		else { cText += ' title="Click to E-mail ' + addressee + '"' }
		cText += '>' + addressee + '</a>'
	} else {
		if (extra.substring(0,1) == '-') {
			textOnly = true
			extra = extra.substr(1)
		}
		for (i = 0; i < Emails.length; i++) {
			if (Emails[i].position.toLowerCase() == posn.toLowerCase()) {
				if ((Emails[i].username =='') && (Emails[i].address == '')) {
					cText = Emails[i].name
				} else {
					cText = '<a href="mailto:' + Emails[i].username+ '@' +Emails[i].address + '?subject=' + subj + '"'
					if (dek_exists) { cText += ' onmouseover="popupMsg(\'Click to E-mail<br>' + Emails[i].title + '\')" onmouseout="killMsg()" ' }
					else { cText += ' title="Click to E-mail ' + Emails[i].title + '"' }
					cText += '>' + ((extra == 'name') ? Emails[i].name : ((extra == 'email') ? Emails[i].username+ '@' +Emails[i].address : Emails[i].title)) + '</a>'
				}
				break
			}
		}
	}
	if (textOnly) { return (cText) }
	obj.write(cText)
}

function linkItem(typ, no, id, title, url, src, width, height, name) {
	this.typ = typ
	this.no = no
	this.name = name
	this.title = title
	this.alt = id
	this.id = id
	this.url = url
	this.src = src
	this.width = width
	this.height = height
	this.desc = ''
}

var linkArray = new Array()

if (linkArray.length == 0) {
	var item = 0
//	linkArray[item] = new linkItem('N', item, 'bcf', "British Cycling", "http://www.britishcycling.org.uk", "images/bcf2.gif", 60, 0, 'B.C.')
	linkArray[item] = new linkItem('N', item, 'bcf', "British Cycling", "http://www.britishcycling.org.uk", "images/bc_colour_logo.gif", 75, 0, 'B.C.')
linkArray[item++].desc =
		 "Official Website of British Cycling Federation, now re-named British Cycling. Includes Major Event Rankings and Category Rankings. "
			+ "Also details on WCPP and general matters."	// Can be very slow and not always up to date."

	linkArray[item] = new linkItem('N', item, 'ctt', "Cycling Time Trials", "http://www.cyclingtimetrials.org.uk", "images/rttc.gif", 60, 0, 'C.T.T.')
	linkArray[item++].desc ="Official Website of Cycling Time Trials (formerly Road Time Trials Council). Includes Results of Weekend Events and "
		+ "National Championships, details of British B.A.R. Competitions and latest Competition Records. "
		+ "Also archive information and details on general matters."

	linkArray[item] = new linkItem('N', item, 'ctc', "Cyclists\' Touring Club", "http://www.ctc.org.uk", "images/ctc2.gif", 60, 0, 'C.T.C.')
	linkArray[item++].desc =
		"Official Website of the Cyclists\' Touring Club. A site full of information on Environmental issues as well as general club matters."

	linkArray[item] = new linkItem('N', item, 'auk', "Audax U.K.", "http://www.audax.uk.net", "images/audax.gif", 60, 0, 'A.U.K.')
	linkArray[item++].desc ="Official Website of Audax UK. A difficult site to navigate but includes full calendar of all UK Randonn&eacute;es and also "
		+ "details of major Continental events. All the organisation's regulations are included plus latest Magazine and AGM minutes."

	linkArray[item] = new linkItem('N', item, 'uci', "Union Cycliste Internationale", "http://www.uci.ch", "images/uci.jpg", 60, 0, 'U.C.I.')
	linkArray[item++].desc ="Official Website of the Union Cycliste Internationale, the World Governing Body for all forms of Cycle Competition. "
		+ "Useful for getting up to date information on major Continental Races. Road, Track, MTB, BMX, cyclo-Cross and the rest - it's all here with images, "
		+ "rankings, results and archives."

	linkArray[item] = new linkItem('N', item, 'bsca', "British Schools Cycling Association", "http://www.bsca.org.uk", "images/bsca.gif", 60, 0, 'B.S.C.A.')
	linkArray[item++].desc ="Official Website of British Schools Cycling Association, the organisation which promotes and caters for cycling in schools. "
		+ "Championship and BAR results and Rules are included amongst other useful data."

	linkArray[item] = new linkItem('N', item, 'new', "Your Link?", "", "images/qmark.gif", 40, 0)
	linkArray[item++].desc ="If you would like to have a link to your Website on this page, please send details via email to our Webmaster. "
		+ "The right is reserved to reject any requests without giving a reason. Similarly, if you wish to have your link removed, please notify by email."

	linkArray[item] = new linkItem('L', item, 'errl', "Eastern Road Race League", "http://www.errl.org.uk", "images/bici4.gif", 60, 0, 'E.R.R.L.')
	linkArray[item++].desc ="Website for the Eastern Road Race League. Contains Race Results, ERRL Calendar and Rules and Latest News of the League."

	linkArray[item] = new linkItem('L', item, 'ecca', "<nobr>Eastern Counties <wbr>Cycling <wbr>Association</nobr>", 
		"http://www.EasternCounties.org.uk", "images/ecca_logo.gif", 60, 0, 'E.C.C.A.')
	linkArray[item++].desc ="Website for Eastern Counties Cycling Association"

	linkArray[item] = new linkItem('L', item, 'hoghill', "<nobr>Hog Hill<wbr> Circuit</nobr>", 
		"http://www.hoghill.co.uk", "images/hoghill_logo.gif", 75, 0, 'Hog Hill')
	linkArray[item++].desc ="Website for Redbridge Cycling Centre - Hog Hill Circuit"

	linkArray[item] = new linkItem('L', item, 'redbridge', "Redbridge C.C.", "http://www.redbridgecc.org.uk", "images/redbridge_logo.gif", 60, 0)
	linkArray[item++].desc ="Website for Redbridge Cycling Club. Also includes a link to the Eastern Counties page"
/*
	linkArray[item] = new linkItem('L', item, 'cceast', "Cycle Coaching East", "http://www.cycletrainingeast.org.uk", "images/bici4.gif", 60, 0)
	linkArray[item++].desc ="Website for Cycle Coaching East. Contains Guide to Road Training, Coaching Your Mind, Aims & Objectives and "
		+ "Coaching Courses in East Region."		// Also lists of local BCF and LVRC events."
*/
	linkArray[item] = new linkItem('L', item, 'bceastern', "British Cycling Eastern Region", "http://www.britishcyclingeasterndivision.co.uk/", "images/bc_colour_logo.gif", 75, 0)
	linkArray[item++].desc ="Website for British Cycle Eastern Region. "

	linkArray[item] = new linkItem('L', item, 'tse', "Tri Sport Epping", "http://www.trisportepping.co.uk", "images/trisporteppinglogo.gif", 80, 0)
	linkArray[item++].desc ="Tri Sport Epping. A local Triathlon club, many members of which have also joined the Shaftesbury as their cycling club. "
		+ "Full details of their involvement in Triathlons and associated activities. Over 200 members with a special section for under 17's."

	linkArray[item] = new linkItem('L', item, 'bikemagic', "Bikemagic", "http://www.bikemagic.com", "images/bikemagic.gif", 80, 40)
	linkArray[item++].desc ="<b>Bikemagic.</b> Punchy magazine-style site with a good mixture of news, views and reviews."

	linkArray[item] = new linkItem('L', item, 'cyclingnews', "Cycling News", "http://www.cyclingnews.com", "images/cyclingnews.jpg", 80, 40)
	linkArray[item++].desc ="<b>Cycling News.</b> Tremendous site for world-wide Cycling news and results."

	linkArray[item] = new linkItem('L', item, 'veloriders', "Veloriders", "http://www.veloriders.co.uk", "images/veloriders.gif", 60, 0)
	linkArray[item].name="www.veloriders.co.uk"
	linkArray[item++].desc ="<b>Veloriders.</b> Excellent racing pictures that you can actually order as Photos at a very reasonable price."

	linkArray[item] = new linkItem('L', item, 'cycleweb', "Cycleweb", "http://www.cycleweb.co.uk", "images/cycleweblogo.gif", 80, 40)
	linkArray[item++].desc ="<b>Cycleweb.</b> Interesting site with wide ranging information and some very useful links to other sites."

	linkArray[item] = new linkItem('End', item, '', "", "", "", 0, 0)
}

function writeWebsite(id, extra, doc) {
	var i, x, cText = 'Website Address details not available', wText, linkID
	var obj = eval(((doc == null) || (doc == "") || (doc == "undefined")) ? 'document' : 'doc.document')
	var dek_exists = checkDek(obj)
//alert(extra)
	for (i = 0; i < linkArray.length; i++) {
		linkID = linkArray[i].id.toUpperCase()
		if (linkID == id.toUpperCase()) {
			wText = ((extra == '-id') ? linkID : linkArray[i].title) + " Website"
			x = wText.indexOf("'")
			if (x > 0) { wText = wText.substring(0, x) + "\\" + wText.substr(x) }
			wText = "Click to open<br>" + wText
			cText = '<a href="' + linkArray[i].url + '" target="new" '
			if (dek_exists) { cText += ' onmouseover="popupMsg(\'' + wText + '\')" onmouseout="killMsg()"' }
			else { cText += ' title="' + wText + '"' }
			cText +='>' + ((extra=='id') ? linkID : linkArray[i].name) + '</a>'
			break
		}
	}
	obj.write(cText)
}

function checkDek(obj) {
	var dek_exists
	if (ns4) { dek_exists = obj.dek }
	else if (ns6) { dek_exists = obj.getElementById("dek") }
	else if (ie4) { dek_exists = obj.all.dek }
	return dek_exists
}