var navClicked = 0

function preload(fn) {
}

function imgBright(o) {
}

function imgNormal(o) {
}

function openCV() {

	window.open('cv.html', 'bcps_cv', 'width=610,height=450,menubar=yes,scrollbars=yes')
	return false
}

function setClicked(obj, count, onColour, offColour) {

	navClicked = 1

	for (i = 0; i < count; i++) {
		if (document.all)
			l = document.all['link' + i]
		else if (document.getElementById)
			l = document.getElementById('link' + i)

		if (l)
			l.style.color = offColour
	}

	obj.style.color = onColour
}

function PageLoading() {

	txt = '<p align=center>&nbsp;<br>&nbsp;<br>&nbsp;<br><center><em>Page loading...</em></center>' +
		'<br>&nbsp;<br>&nbsp;<br>&nbsp;</p>'

	if (document.all)
		document.all["mainContent"].innerHTML = txt 
	else if (document.layers) {
		l = document.mainContent.document
		l.open()
		l.write(txt)
		l.close()
	} else if (document.getElementById)
		document.getElementById("mainContent").innerHTML = txt
}

function browserWarn() {
	cn = navigator.appCodeName.toLowerCase()
	av = navigator.appVersion.toLowerCase()
	ap = navigator.platform.toLowerCase()
	if (cn == "mozilla" && av.indexOf("compatible") < 0 && av.charAt(0) == '4') {
		document.write('<p><strong>Note:</strong> Netscape 4 is very poor at rendering sites ',
		  'containing deeply nested tables.  Although this site has been tested, and ',
		  'does not cause Netscape too much trouble, I would strongly recommend you ',
		  'investigate other browsers')
		if (ap.indexOf("x11") >= 0 || ap.indexOf("linux") >= 0 || ap.indexOf("bsd") >= 0)
			document.write(' such as Konqueror, Opera, Mozilla, or Netscape 6')
		else if (ap.indexOf("win") == 0)
			document.write(' such as Microsoft Internet Explorer, Opera, Mozilla, or Netscape 6')
		document.write('.</p>')
	}
}

function geekParse(code, s2) {
	var txt = ''

	if (code == 'GCS') {
		s1 = 'occupation or field of study'
		s3 = 'of Computer Science'
	} else if (code == 'd') {
		s1 = 'dress style'
		s3 = 'who normally wears jeans and a t-shirt'
	} else if (code == 's') {
		s1 = 'size, in terms of height and weight'
		s3 = 'who is shorter than average, but of average build'
	} else if (code == 'a') {
		s1 = 'age'
		s3 = 'aged from 20 to 24 inclusive'
	} else if (code == 'C') {
		s1 = 'use of computers'
		s3 = 'who\'s life includes significant use of computers, and gets paid for it'
	} else if (code == 'U') {
		s1 = 'use of Unix'
		s3 = 'who is very familiar with Unix, in particular FreeBSD, is a sysadmin of some FreeBSD machines, ' +
			'and gets paid for it'
	} else if (code == 'P') {
		s1 = 'use of Perl'
		s3 = 'who is very familiar with the Perl language, uses it for many administrative tasks, and gets ' +
			'paid for it'
	} else if (code == 'L') {
		s1 = 'use of Linux'
		s3 = 'who has used Linux, quite likes it, but personally prefers other Unix systems such as FreeBSD'
	} else if (code == 'E') {
		s1 = 'use of Emacs'
		s3 = 'who refuses to have anything to do with Emacs'
	} else if (code == 'W') {
		s1 = 'use of the Web'
		s3 = 'who only really uses the web when the is something in particular he is looking for'
	} else if (code == 'N') {
		s1 = 'use of Usenet'
		s3 = 'who has read Usenet in the past, but has no time for it these days'
	} else if (code == 'o') {
		s1 = 'knowledge of the Usenet Oracle'
		s3 = 'who has no idea what the Usenet Oracle is'
	} else if (code == 'K') {
		s1 = 'knowledge of Kibo'
		s3 = 'who doesn\'t know who Kibo is'
	} else if (code == 'w') {
		s1 = 'use of Microsoft Windows'
		s3 = 'who uses Windows from time to time, doesn\'t particularly object to it, but prefers FreeBSD ' +
			'for his home computer'
	} else if (code == 'O') {
		s1 = 'use of OS/2'
		s3 = 'who used OS/2 once, and didn\'t like it'
	} else if (code == 'M') {
		s1 = 'use of Macs'
		s3 = 'who has never used a Mac'
	} else if (code == 'V') {
		s1 = 'use of VMS'
		s3 = 'who has never used VMS'
	} else if (code == 'PS') {
		s1 = 'views on political/social issues'
		s3 = 'who doesn\'t have much of an opinion on such issues'
	} else if (code == 'PE') {
		s1 = 'views on political/economic issues'
		s3 = 'who doesn\'t have much of an opinion on such issues'
	} else if (code == 'Y') {
		s1 = 'interest in privacy issues'
		s3 = 'who has a slight interest in such issues, but is not active or vocal about it'
	} else if (code == 'PGP') {
		s1 = 'use of PGP'
		s3 = 'who routinely PGP signs his email, and has his PGP key on his website'
	} else if (code == 't') {
		s1 = 'views on Star Trek'
		s3 = 'who has never watched Star Trek'
	} else if (code == '5') {
		s1 = 'views on Babylon 5'
		s3 = 'who has never watched Babylon 5'
	} else if (code == 'X') {
		s1 = 'views on the X-Files'
		s3 = 'who used to watch it occasionally, but doesn\'t really like it any more'
	} else if (code == 'R') {
		s1 = 'views on role playing games'
		s3 = 'who considers role playing games a waste of time'
	} else if (code == 'tv') {
		s1 = 'television watching habits'
		s3 = 'who only watches shows he particularly likes'
	} else if (code == 'b') {
		s1 = 'reading habits'
		s3 = 'who doesn\'t read very often, but can sometimes enjoy it'
	} else if (code == 'DI') {
		s1 = 'views on Dilbert'
		s3 = 'who has only read Dilbert a few times'
	} else if (code == 'D') {
		s1 = 'views on Doom'
		s3 = 'who used to play it a lot, and enjoyed it, but doesn\'t play any more'
	} else if (code == 'G') {
		s1 = 'views on the Geek Code'
		s3 = 'who knows what it is and took the time to write the code for himself'
	} else if (code == 'e') {
		s1 = 'education'
		s3 = 'who has a Bachelors Degree'
	} else if (code == 'h') {
		s1 = 'housing situation'
		s3 = 'who live with his girlfriend (non-geek)'
	} else if (code == 'r') {
		s1 = 'relationships'
		s3 = 'who has been with his current girlfriend for a long time'
	} else if (code == 'y') {
		s1 = 'sex'
		s3 = 'who is male and considers his sex-life to be none of anyone\'s business!'
	} else {
		return 'Move your mouse over each part of the code to view an explanation, if your browser ' +
			'supports it.  If your browser doesn\'t support it, ' +
			'visit <a href="http://www.geekcode.com/">geekcode.com</a> for a full explanation.'
	}

	txt = '<strong><tt>' + code + '</tt></strong>: specifies ' + s1 + '. <strong><tt>' +
		s2 + '</tt></strong> indicates a geek ' + s3 + '.'

	return '<div style="border: solid #acac7f 1px; background-color: #ffffbd; padding: 3px">' + txt + '</div>';
}

function geekText(code, s2) {
	var txt = geekParse(code, s2)
	if (document.all)
		document.all["geek"].innerHTML = txt 
	else if (document.layers) {
		l = document.geek.document
		l.open()
		l.write(txt)
		l.close()
	} else if (document.getElementById)
		document.getElementById("geek").innerHTML = txt
}
