printerFriendly = false

if(self.location == top.location){
	if(location.hash == '#print'){
		printerFriendly = true
		}
	else	{
		top.location.replace('../jokes.htm?' + escape(self.location.toString().match(/\w+\.htm/)))
		}
	}

document.write('\
	<meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />\
	<meta name="author" content="Thomas Russell" />\
	<meta name="description" content="Thomas Russell\'s Home Page" />\
	<meta name="generator" content="Notepad" />\
	<meta name="keywords" content="Thomas Russell,Victoria University of Wellington,Churton Park,Johnsonville,New Zealand,Wellington,Law School,Law Notes,LAWS,Bule,Jokes" />\
	<link rel="shortcut icon" href="favicon.ico" />\
	<link rel="stylesheet" type="text/css" href="jokestylesheet.css" />\
	')

joke =	[
	[null,null],
	['Asian English',					'24 Sep 01'],
	['Bear warning',					'24 Sep 01'],
	['Men are like...',					'24 Sep 01'],
	['5 questions women should never ask guys',		'24 Sep 01'],
	['50 ways to know you are Korean',			'24 Sep 01'],
	['Understanding women',					'24 Sep 01'],
	['Frivolous lawsuits',					'24 Sep 01'],
	['Product labels',					'24 Sep 01'],
	['The Man Answer List',					'24 Sep 01'],
	['Stupid chain letters',				'25 Sep 01'],
	['Man\'s answers to Woman\'s questions (R18)',		'26 Sep 01'],
	['Things overheard while on patrol',			'26 Sep 01'],
	['Things that piss me off (R18)',			'26 Sep 01'],
	['Training courses for women',				'26 Sep 01'],
	['What kind of girl..?',				'26 Sep 01'],
	['To women everywhere...',				'26 Sep 01'],
	['Sarcasm 101',						'26 Sep 01'],
	['Rangi and the fish',					'26 Sep 01'],
	['Which animal are you?',				'26 Sep 01'],
	['25 things a perfect girl might say (R18)',		'26 Sep 01'],
	['15 Christmas gifts for men',				'26 Sep 01'],
	['Debra and Jack',					'28 Sep 01'],
	['How to shower like a...',				'28 Sep 01'],
	['51 pickup lines (R18)',				'28 Sep 01'],
	['6 reasons computers are female',			'28 Sep 01'],
	['The perfect day (R18)',				'28 Sep 01'],
	['Accident report',					'28 Sep 01'],
	['Fart joke',						'28 Sep 01'],
	['Virus warning',					'28 Sep 01'],
	['Bottom deodorant',					'28 Sep 01'],
	['Classic signs',					'28 Sep 01'],
	['Condom sponsorship (R18)',				'28 Sep 01'],
	['Virus list',						'28 Sep 01'],
	['A girl walks into a supermarket...',			'30 Sep 01'],
	['Quotable quotes',					'01 Oct 01'],
	['At the gym',						'01 Oct 01'],
	['Chest letters (R18)',					'01 Oct 01'],
	['The chicken and the horse',				'01 Oct 01'],
	['Company policy',					'01 Oct 01'],
	['Computer helpline transcript',			'01 Oct 01'],
	['Cybersex gone wrong',					'01 Oct 01'],
	['Wayne, Wayne, Wayne, Wayne, Wayne...',		'01 Oct 01'],
	['Damn cheque account',					'01 Oct 01'],
	['Date rape drug for men',				'01 Oct 01'],
	['Deathbed',						'01 Oct 01'],
	['Designated driver',					'01 Oct 01'],
	['Drive-thru banking',					'01 Oct 01'],
	['Standard form dump',					'02 Oct 01'],
	['Presidents in Hell (R18)',				'02 Oct 01'],
	['Elevator amusements',					'02 Oct 01'],
	['Name obsessions',					'02 Oct 01'],
	['Tips from employees',					'02 Oct 01'],
	['USA v Canada',					'02 Oct 01'],
	['Uncle Fred',						'02 Oct 01'],
	['12 things not to say to a cop',			'02 Oct 01'],
	['Three daughters (R18)',				'02 Oct 01'],
	['100 ways to be a man (R18)',				'02 Oct 01'],
	['82 signs you\'re Asian',				'02 Oct 01'],
	['Porirua Olympics',					'03 Oct 01'],
	['11 types of Bay Area Asians',				'03 Oct 01'],
	['Job application',					'03 Oct 01'],
	['How to impress a client',				'05 Oct 01'],
	['Kiwi ingenuity',					'05 Oct 01'],
	['Surround yourself with intelligent people',		'05 Oct 01'],
	['How to impress a man/woman',				'05 Oct 01'],
	['Revocation of Independence',				'05 Oct 01'],
	['Sister Logical and Sister Mathematical',		'05 Oct 01'],
	['Schubert\'s inefficient symphony',			'05 Oct 01'],
	['Stevie and Tiger',					'05 Oct 01'],
	['The good salesman',					'05 Oct 01'],
	['GI Insurance',					'05 Oct 01'],
	['Tales of stupidity',					'05 Oct 01'],
	['Zimbabwe plane trip',					'05 Oct 01'],
	['Gloves (R18)',					'05 Oct 01'],
	['Life insurance',					'05 Oct 01'],
	['Baby photos (R18)',					'05 Oct 01'],
	['Latest mergers',					'05 Oct 01'],
	['Why not to yell at bad women drivers',		'06 Oct 01'],
	['The Seven Dwarves and the Pope',			'06 Oct 01'],
	['The Kiwi, the Aussie and the South African',		'06 Oct 01'],
	['Pensioner surprise (R18)',				'06 Oct 01'],
	['Rude parrot',						'06 Oct 01'],
	['Tickle-Me Elmo',					'06 Oct 01'],
	['Volvo innovation',					'06 Oct 01'],
	['Very crude jokes (R18 - Crude)',			'06 Oct 01'],
	['Answering machine messages',				'06 Oct 01'],
	['Why guys fear commitment',				'06 Oct 01'],
	['Brain transplant',					'06 Oct 01'],
	['Special High-Intensity Training',			'06 Oct 01'],
	['Pregnant woman on bus',				'06 Oct 01'],
	['Latest Barbie',					'06 Oct 01'],
	['Bumper stickers',					'09 Oct 01'],
	['Blonde jokes',					'09 Oct 01'],
	['Professional test',					'09 Oct 01'],
	['Holmes and Watson',					'09 Oct 01'],
	['Do not walk behind me...',				'09 Oct 01'],
	['Payrise request (R18)',				'11 Oct 01'],
	['Making sandwiches (R18, Gross)',			'12 Oct 01'],
	['The power of observation (Gross)',			'13 Oct 01'],
	['Clever signs',					'14 Oct 01'],
	['Cross purposes (R18)',				'15 Oct 01'],
	['Your personal horoscope for today',			'16 Oct 01'],
	['Creation story',					'18 Oct 01'],
	['BBQ butt (R18)',					'19 Oct 01'],
	['Three reasons Jesus must have been...',		'22 Oct 01'],
	['Misogynist jokes (R18 - Not PC)',			'25 Oct 01'],
	['Aesop\'s Fables revisited',				'25 Oct 01'],
	['Magic beer',						'25 Oct 01'],
	['Married life',					'25 Oct 01'],
	['Sports quotes',					'25 Oct 01'],
	['Taxi driver',						'25 Oct 01'],
	['Trans-Tasman recycling (R18)',			'29 Oct 01'],
	['Halloween party',					'29 Oct 01'],
	['Paddy\'s friends',					'10 Nov 01'],
	['The vicar\'s day off',				'10 Nov 01'],
	['Weird maths',						'10 Nov 01'],
	['Roger and Elaine',					'10 Nov 01'],
	['Easy money (R18)',					'11 Nov 01'],
	['What your drink says about you',			'14 Nov 01'],
	['The blonde and the coke machine',			'14 Nov 01'],
	['Man jokes (R18)',					'20 Nov 01'],
	['Love dress',						'18 Jan 02'],
	['Maori place name',					'25 Jan 02'],
	['Wife gets double',					'25 Jan 02'],
	['The blonde and the ventriloquist',			'06 Feb 02'],
	['Wifespeak',						'06 Feb 02'],
	['I need the rake',					'06 Feb 02'],
	['42 muscles (R18)',					'06 Feb 02'],
	['Chinese phrasebook',					'06 Feb 02'],
	['Female prenup',					'06 Feb 02'],
	['Flat tyre',						'06 Feb 02'],
	['Marriage scoring system',				'06 Feb 02'],
	['Oops...',						'15 Mar 02'],
	['Kiwi in Amsterdam',					'15 Mar 02'],
	['Car accident',					'26 Mar 02'],
	['The Melting Princess',				'26 Mar 02'],
	['Nude marathon',					'26 Mar 02'],
	['Pearly Gates conversation',				'26 Mar 02'],
	['Things you learn from movies',			'26 Mar 02'],
	['Stupid people',					'26 Mar 02'],
	['Payday',						'31 Mar 02'],
	['Why did the chicken cross the road?',			'19 Apr 02'],
	['Another blonde joke',					'21 Apr 02'],
	['Where babies come from (R18)',			'21 Apr 02'],
	['Weird thing',						'21 Apr 02'],
	['Wrong email address',					'26 Apr 02'],
	['Stupid criminals',					'26 Apr 02'],
	['\'The Confusing Country\', by Douglas Adams',		'26 Apr 02'],
	['New words',						'26 Apr 02'],
	['Soap',						'04 May 02'],
	['Easy money 2',					'17 May 02'],
	['Sex quotes (R18)',					'01 Jun 02'],
	['Shutting the Gates',					'03 Jun 02'],
	['Stall talk',						'07 Jun 02'],
	['Most embarrassing moments competition',		'27 Jul 02'],
	['Corporate Lessons',					'27 Jul 02'],
	['So bad they\'re good',				'27 Jul 02'],
	['The best patients',					'27 Jul 02'],
	['Human resources',					'27 Jul 02'],
	['Letter of resignation',				'27 Jul 02'],
	['Public Health Notice',				'27 Jul 02'],
	['Easy solution',					'28 Jul 02'],
	['Confucius say...',					'28 Jul 02'],
	['The conscience',					'28 Jul 02'],
	['\'MYASS\'',						'28 Jul 02'],
	['Good comeback',					'28 Jul 02'],
	['Mystery meat',					'08 Aug 02'],
	['UN Survey',						'04 Oct 02'],
	['He said... she said...',				'16 Oct 02'],
	['Kids\' attitude to marriage',				'16 Oct 02'],
	['Snails',						'18 Oct 02'],
	['Gorilla mime',					'18 Oct 02'],
	['Blonde on plane',					'12 Nov 02'],
	['Moral dilemma',					'12 Nov 02'],
	['Gates of Heaven',					'12 Nov 02'],
	['Islamic Wedding',					'13 Nov 02'],
	['New rooster',						'21 Nov 02'],
	['You know you\'re Indonesian if...',			'07 Jan 03'],
	['Condom shortage',					'27 Jan 03'],
	['Tragedy',						'27 Jan 03'],
	['Talking centipede',					'27 Jan 03'],
	['Kumara',						'08 Feb 03'],
	['Disorder in the Court',				'29 Feb 04'],
	['Genie\'s Lamp',					'05 Dec 04']
	]

if(window.isJoke != false){
	isJoke = true
	}

if(isJoke){
	imgs =	[
		'upArrow.gif',
		'downArrow.gif',
		'myCloseBox.gif',
		'myCorner1.gif',
		'myCorner2.gif',
		'myCorner3.gif',
		'myCorner4.gif'
		]

	preloads = new Array()
	for(i in imgs){
		preloads[i] = new Image()
		preloads[i].src = imgs[i]
		}

	joke_number = document.URL.toString().replace(/.*(\d{3})\.htm.*/g,'$1')

	pageName = joke[parseFloat(joke_number)][0]

	if(top.mf && top.mf.document && (jl = top.mf.document.getElementById('jl' + joke_number))){

		//	NS returns a number for jl.offsetTop that is offset from the top of the page.

		if(top.mf.document.getElementById('jl' + (joke.length - 1)).offsetTop < 100){
			where_to_stop = jl.offsetTop + top.mf.document.getElementById('jokeTable').offsetTop - 3
			}
		else	{
			where_to_stop = jl.offsetTop - 3
			}

		top.mf.scrollMenu(where_to_stop)
		}
	}
else	{
	if(!window.pageName){
		pageName = 'Unnamed page'
		}
	if(top.mf && top.mf.scrollMenu){
		top.mf.scrollMenu(0)
		}
	}

statusmsg = 'tamago > jokes > ' + pageName.toLowerCase()

if(top.document.URL.indexOf('sitemap') == -1 && window.name != 'mf'){
	top.document.title = statusmsg
	top.status = statusmsg
	}

function mail_joke(){
	msg_sub = escape('Joke: '+pageName)
	msg_bod = escape('\n\n' + pageName + ': ' + document.URL)

	window.location = 'mailto:?subject=' + msg_sub + '&body=' + msg_bod
	}

var contributor , website , email , ICQ

function writeHeader(omit){
	if(omit){
		return(false)
		}

	if(isJoke){
		header=''
		if(contributor || website || email || ICQ){
			header += '\
				<div class="noprint" style="position:absolute;left:50px;text-align:center;top:10px;width:443px;">\
					<div id="displayLink" style="font-size:9px;width:100%;">[ <a title="Show information about the person who submitted the joke" href="#showAcknowledgement" onclick=";document.getElementById(\'displayLink\').style.display=\'none\';document.getElementById(\'acknowledgement\').style.visibility=\'visible\';return(false)">Show acknowledgement</a> ]</div>\
					<table align="center" cellspacing="0" id="acknowledgement" style="font-size:10px;line-height:15px;visibility:hidden;">\
						<tr>\
							<td><img src="myCorner1.gif" style="height:9px;width:9px;" /></td>\
							<td colspan="2" style="background-color:#6ac;border-top:#379 solid 1px;line-height:1px;">&nbsp;</td>\
							<td><img src="myCorner2.gif" style="height:9px;width:9px;" /></td>\
						</tr>\
						<tr style="background-color:#6ac;">\
							<td style="border-left:#379 1px solid;">&nbsp;</td>\
							<td colspan="2" style="font-weight:bold;padding-bottom:2px;"><img style="background-color:#7bd;cursor:pointer;float:right;height:13px;width:13px;" onclick="document.getElementById(\'acknowledgement\').style.visibility=\'hidden\';document.getElementById(\'displayLink\').style.display=\'block\'" onfocus="this.blur()" onmouseover="this.style.backgroundColor=\'#fff\'" onmouseout="this.style.backgroundColor=\'#7bd\'" src="myCloseBox.gif" alt="Close" />Acknowledgement</td>\
							<td style="border-right:#379 1px solid;">&nbsp;</td>\
						</tr>\
						<tr id="theBar" style="background-color:#6ac;">\
							<td style="border-left:#379 1px solid;">&nbsp;</td>\
							<td colspan="2" style="padding-top:2px;">This joke was submitted by:</td>\
							<td style="border-right:#379 1px solid;">&nbsp;</td>\
						</tr>\
						<tr style="background-color:#6ac;">\
							<td colspan="4" style="border:#379 1px solid;border-top-style:none;line-height:5px;">&nbsp;</td>\
						</tr>\
				'

			if(!contributor){
				contributor='Unknown Benefactor'
				}

			header += '\
				<tr style="background-color:#8ce;">\
					<td style="border-left:#379 1px solid;">&nbsp;</td>\
					<td colspan="2" style="font-weight:bold;padding:5px 0px 2px 0px;text-align:center;">' + contributor + '</td>\
					<td style="border-right:#379 1px solid;">&nbsp;</td>\
				</tr>\
				'

			if(website){
				header += '\
					<tr style="background-color:#8ce;">\
						<td style="border-left:#379 1px solid;">&nbsp;</td>\
						<td style="padding-right:5px;">Website:</td>\
						<td><a href="' + website + '" target="_blank" title="' + contributor + '\'s website&#10;(Opens in a new window)">' + website + '</a></td>\
						<td style="border-right:#379 1px solid;">&nbsp;</td>\
					</tr>\
					'
				}

			if(email){
				header += '\
					<tr style="background-color:#8ce;">\
						<td style="border-left:#379 1px solid;">&nbsp;</td>\
						<td style="padding-right:5px;">Email:</td>\
						<td><a href="mailto:' + email + '?subject=' + pageName + ' (tamago jokes)" title="Email ' + contributor + '">' + email + '</a></td>\
						<td style="border-right:#379 1px solid;">&nbsp;</td>\
					</tr>\
					'
				}

			if(ICQ) {
				icqWarning='Reminder:\n\nWhen sending a message to an ICQ number,\nkeep it down to fewer than 450 characters.\n'
				header += '\
					<tr style="background-color:#8ce;">\
						<td style="border-left:#379 1px solid;">&nbsp;</td>\
						<td style="padding-right:5px;">ICQ:</td>\
						<td><a href="mailto:' + ICQ + '@pager.icq.com?subject=' + pageName + ' (Thomas Russell\'s website)" title="Send ' + contributor + ' an ICQ message through email" onclick="if(!confirm(icqWarning))return(false)">' + ICQ + '</a></td>\
						<td style="border-right:#379 1px solid;">&nbsp;</td>\
					</tr>\
					'
				}

			header += '\
						<tr style="background-color:#8ce;">\
							<td colspan="4" style="border:#379 solid 1px;border-top-style:none;line-height:4px;">&nbsp;</td>\
						</tr>\
						<tr>\
							<td><img src="myCorner4.gif" style="height:9px;width:9px;" /></td>\
							<td colspan="2" style="background-color:#6ac;border-bottom:#379 1px solid;line-height:1px;">&nbsp;</td>\
							<td><img src="myCorner3.gif" style="height:9px;width:9px;" /></td>\
						</tr>\
					</table>\
				</div>\
				'
			}

		header += '\
			<div class="noprint" style="color:#6ac;font-size:10px;line-height:15px italic;margin:10px;text-align:center;">- ' + parseFloat(joke_number) + ' -</div>\
			<div style="font-weight:bold;margin:0px 20px 20px 20px;text-align:center;text-decoration:underline;">' + pageName + '</div>\
			'

		document.write(header)
		}
	}

function print_joke(){
	window.open('#print')
	}

function writeFooter(myLMDate,hide){
	LMfulldate = new Date(document.lastModified)
	LMDateToShow = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'][LMfulldate.getDay()] + ', ' + LMfulldate.getDate() + ' ' + ['January','February','March','April','May','June','July','August','September','October','November','December'][LMfulldate.getMonth()] + ' ' + LMfulldate.getFullYear()

	footer = ''
	
	if(isJoke && !hide){
		if(!printerFriendly){
			nextJoke = parseFloat(joke_number) + 1
			prevJoke = parseFloat(joke_number) - 1

			footer += '\
				<table align="center" cellspacing="0" style="background-color:#8ce;border:#fff solid 1px;border-color:#cef #6ac #6ac #cef;color:#379;font-size:10px;line-height:11px;margin-top:50px;margin-bottom:20px;position:relative;">\
					<tr>\
						<td style="padding:3px 15px 0px 8px;"><a title="Printer-friendly version" href="javascript:print_joke()">Print</a></td>\
						<td style="padding:3px 8px 0px 15px;text-align:right;"><a title="Email someone this joke" href="javascript:mail_joke()">Email</a></td>\
					</tr>\
					<tr>\
						<td colspan="2" style="text-align:center;">\
							<div style="background-color:#9df;border:#fff solid 1px;border-color:#6ac #cef #cef #6ac;margin:3px;padding:7px 10px;">\
				'

			if(nextJoke != joke.length){
				while(nextJoke.toString().length < 3){
					nextJoke = '0' + nextJoke
					}

				nextJokeName = joke[parseFloat(nextJoke)][0]

				if(parent.document.getElementById('nextLink')){
					parent.document.getElementById('nextLink').href = 'jokes/' + nextJoke + '.htm'
					parent.document.getElementById('nextLink').title = 'Next joke: ' + nextJokeName
					}

				footer += '<a class="jokeLink" href="' + nextJoke + '.htm" title="Next joke: ' + nextJokeName + '">' + nextJokeName + '</a><br /><img src="upArrow.gif" /><br />'
				}
			else	{
				noNextJoke()
				}

			footer += joke[parseFloat(joke_number)][0] + '<br />'

			if(prevJoke != 0){
				while(prevJoke.toString().length < 3){
					prevJoke = '0' + prevJoke
					}

				prevJokeName = joke[parseFloat(prevJoke)][0]

				if(parent.document.getElementById('prevLink')){
					parent.document.getElementById('prevLink').href = 'jokes/' + prevJoke + '.htm'
					parent.document.getElementById('prevLink').title = 'Previous joke: ' + prevJokeName
					}

				footer += '<img src="downArrow.gif" /><br /><a class="jokeLink" href="' + prevJoke + '.htm" title="Previous joke: ' + prevJokeName + '">' + prevJokeName + '</a>'
				}
			else	{
				noPrevJoke()
				}

			footer += '\
				</td></tr></table></div>\
				'
			}
		else	{
			footer += '\
				<div lass="print" style="font-weight:bold;font-size:10px;line-height:15px;margin:20px 0px;text-align:center;">\
					' + statusmsg.replace(/>/g,'&rsaquo;') + '\
					<br />\
					' + window.location.toString().replace(/#.*/,'') + '\
					<br /><br />\
					\
					Got any good jokes? Email them to me, at <span style="text-decoration:underline;">bule@ya' + 'hoo.com</span>.\
				</div>\
				'
			}
		}
	else	{
		noPrevJoke()
		noNextJoke()
		}

	if(!hide){
		footer += '\
			<table class="noprint" style="color:#6ac;font-size:10px;line-height:13px;margin-top:30px;width:100%;">\
				<tr>\
					<td style="text-align:center;">Last modified on ' + LMDateToShow + '</td>\
				</tr>\
			</table>\
			'
		}

	document.write(footer)
	}

function noPrevJoke() {
	if(!top.document.getElementById('prevLink') || name == 'mf'){
		return(false)
		}
	top.document.getElementById('prevLink').href = 'jokes/' + parseFloat(joke.length-1) + '.htm'
	top.document.getElementById('prevLink').title = 'Most recent joke: ' + joke[parseFloat(joke.length-1)][0]
	}

function noNextJoke(){
	if(!top.document.getElementById('nextLink') || name == 'mf'){
		return(false)
		}
	top.document.getElementById('nextLink').href = 'jokes/001.htm'
	top.document.getElementById('nextLink').title = 'First joke: ' + joke[1][0]
	}

function declineToRead(){
	history.back()
	}

//END OF DOCUMENT
