﻿function nuFormDate( myDate ) {
	// if empty - do nothing
	if( '' != myDate ) {
	myArray = myDate.split( ' ' ) ;
		// only advance if there is more than one
		if( 1 != myArray.length ) {	
			// item 0 is the number
			if( '0' == myArray[0].charAt(0) ) { myArray[0] = myArray[0].substr(1) ; }	
			//	examine last number
			switch( myArray[0].charAt( myArray[0].length -1 )) {
				case( '1' ) : myArray[0] += '<sup>st</sup>' ; break ;
				case( '2' ) : myArray[0] += '<sup>nd</sup>' ; break ;
				case( '3' ) : myArray[0] += '<sup>rd</sup>' ; break ;
				default :
					myArray[0] += '<sup>th</sup>' ;
			}
			// the output
			document.write( myArray.join( ' ' )) ;
		} else {
			if( '0' == myDate.charAt(0) ) { myDate = myDate.substr(1) ; }
			document.write( myDate ) ;	
		}
	}
}


/* redirection code */
var gURL = 'baltimorehudhomes' ;
var tURL = '' ;
var bURL = true ;

function extTarget(){
	for( var i = 0 ;i <=( document.links.length -1 ) ; i++ ) {
		// remove server name 'www.' if present
		tURL      = document.links[i].hostname ;
		tURLArray = tURL.split( '.' ) ;

		// look for domain name	
		for( var ii = 0;ii < tURLArray.length ; ii++ ) {
			if( tURLArray[ii] == gURL ) { bURL = false ; }
		}
		// if not found then do blank
		if( bURL ) { 
			document.links[i].target = '_blank' ; 
		}
		// reset
		bURL = true ;
	}
}

/*     -----------------------
       FORMATS DATE
       -----------------------
       JM - 2004/08/09
*/

function nuFormDate( myDate ) {
	// if empty - do nothing
	if( '' != myDate ) {
	myArray = myDate.split( ' ' ) ;
		// only advance if there is more than one
		if( 1 != myArray.length ) {	
			// item 0 is the number
			if( '0' == myArray[0].charAt(0) ) { myArray[0] = myArray[0].substr(1) ; }	
			//	examine last number
			switch( myArray[0].charAt( myArray[0].length -1 )) {
				case( '1' ) : myArray[0] += '<sup>st</sup>' ; break ;
				case( '2' ) : myArray[0] += '<sup>nd</sup>' ; break ;
				case( '3' ) : myArray[0] += '<sup>rd</sup>' ; break ;
				default :
					myArray[0] += '<sup>th</sup>' ;
			}
			// the output
			document.write( myArray.join( ' ' )) ;
		} else {
			if( '0' == myDate.charAt(0) ) { myDate = myDate.substr(1) ; }
			document.write( myDate ) ;	
		}
	}
}


/* random links */

function doRandomLinks() {
	
	myArray = new Array( 
		'Crypto','Frode Weierud&#8217;s Cryptology','frode.home.cern.ch/frode/crypto/index.html',
		'Crypto','Lorenz Cipher Machine','www.codesandciphers.org.uk/lorenz/',
		'Cult of Mac','Folklore.org: Macintosh Stories','www.folklore.org/',
		'Cult of Mac','Making the Macintosh','library.stanford.edu/mac/',
		'Design','Foreword - Book Design Blog','www.ospreydesign.com/foreword/',
		'Fantastic Images','Entropy8 - Ephemera','entropy8.com/greatest_hits/hallucinations/ephemera/',
		'Fantastic Images','J.W.Waterhouse, Paintings','www.jwwaterhouse.com/paintings/',
		'Fantastic Images','Marionette Puppets - S.Radke','www.scottradke.com/',
		'Fantastic Images','Zendinou - the art of A.R.Menne','www.zendinou.com/',
		'Fun','20 Questions','y.20q.net:8095/',
		'Fun','Hamlet - The Text Adventure','www.robinjohnson.f9.co.uk/adventure/hamlet.html',
		'Fun','wrapped up in books: the game','www.wrappedupinbooks.com/gamefirst10.html',
		'Fun','Coraline','www.mousecircus.com/',
		'Fun','HHG2G online text adventure','www.douglasadams.com/creations/infocomjava.html',
		'Lists / Fun','Fluffy Stuff','www.dm.net/~lnh/fluff.html',
		'Music','Erik Satie: music samples','www.af.lu.se/~fogwall/samples.html',
		'Music','Internet Archive: Net Labels','www.archive.org/audio/netlabels.php',
		'Music','The Pixies, eMusic','emusic.com/artist/11488/11488305.html',
		'Music','Thea Gilmore','www.theagilmore.com/',
		'Music','here in my head [tori amos fan]','www.hereinmyhead.com/sounds/slg.html',
		'Music','autres directions in music','www.autresdirections.net/inmusic/',
		'Music','100 British Albums','www.guardian.co.uk/arts/features/story/0,11710,1244183,00.html',
		'Music','Better Propaganda','www.betterpropaganda.com/',
		'Music','Fredo Viola','fredo.em411.com/',
		'Music','Glide Magazine mp3 downloads','www.glidemagazine.com/downloads36.html',
		'Music','Halloween Alaska','www.halloweenalaska.com/mp3s.htm',
		'Music','Hem','www.rabbitsongs.com/',
		'Music','Music @ Download.com','music.download.com/',
		'Music','Sigur R&oacute;s','www.sigur-ros.co.uk/',
		'Music','Stephin Merrit &amp; Associates','www.houseoftomorrow.com/',
		'Music','Tweaker','www.tweaker.net/mp3.php',
		'Music','Warp Records','www.warprecords.com/',
		'Music','Wreckless Eric','www.wrecklesseric.com/',
		'Music','monotonik+friends','www.mono211.com/',
		'Online Literary Magazine','identity theory','www.identitytheory.com/',
		'Online Literary Magazine','small.spiral.notebook','www.smallspiralnotebook.com/',
		'Online Magazine','Salon.com','www.salon.com/',
		'Online Resources / Developers','Unix for beginners','www.ugu.com/sui/ugu/show?help.beginners',
		'Online Resources / Fun','Lost in Translation','www.tashian.com/multibabel/',
		'Online Resources / Fun','meish.org - anti-valentine','www.meish.org/vd/',
		'Online Resources / Graphics / Design','Happy Cog Studios','www.happycog.com/',
		'Online Resources / Graphics / Design','Speak Up','www.underconsideration.com/speakup/',
		'Online Resources / Graphics / Design','The Work of Edward Tufte','www.edwardtufte.com/tufte/',
		'Online Resources / Graphics / Design','java.net: Read about usability','weblogs.java.net/pub/wlg/318',
		'Online Resources / Graphics / Interface','The GUI Gallery','toastytech.com/guis/index.html',
		'Online Resources / Poetry','Craft of Poetry','www.uni.edu/~gotera/CraftOfPoetry/',
		'Online Resources / Poetry','D.Thomas - Death Shall Have No Dominion','laurie.ambers.net/books/DylanThomas.html',
		'Online Resources / Poetry','James Lasdun','www.nortonpoets.com/lasdunj.htm',
		'Online Resources / Poetry','Jet-propelled jaunts','books.guardian.co.uk/reviews/poetry/0,6121,1173709,00.html',
		'Online Resources / Poetry','Poetry Pointers Contents','members.aol.com/lucyhardng/pointers/index1.htm#top',
		'Online Resources / Poetry','Representative Poetry On-line','eir.library.utoronto.ca/rpo/display/index.cfm',
		'Online Resources / Poetry','T.S.Eliot: Four Quartets, notes','www.tristan.icom43.net/quartets/notes.html',
		'Online Resources / Poetry','T.S.Eliot - The Dry Salvages','www.tristan.icom43.net/quartets/salvages.html',
		'Online Resources / Poetry','T.S.Eliot - The Hollow Men, notes','aduni.org/~heather/occs/honors/Notesonpoem.htm',
		'Online Resources / Poetry','Ted Hughes - Birthday Letters','www.farlingaye.suffolk.sch.uk/engweb/a-level/poetry/hughes/bletters.htm',
		'Online Resources / Poetry','Tom Wayman, Poems','www.library.utoronto.ca/canpoetry/wayman/poem5.htm',
		'Online Resources / Serious Fun','Rudiments of Wisdom Encyclopedia','www.rudimentsofwisdom.com/default.htm',
		'Online Resources','Encyclopedia Mythica: Europe','www.pantheon.org/areas/mythology/europe/',
		'Online Resources','Footwear of the Middle Ages','www.personal.utulsa.edu/~marc-carlson/shoe/SHOEHOME.HTM',
		'Online Resources','Frida Kahlo Online','www.artcyclopedia.com/artists/kahlo_frida.html',
		'Online Resources','Fuller Projection Map','www.bfi.org/map.htm',
		'Online Resources','Google Labs','labs.google.com/',
		'Online Resources','Internet Archive','www.archive.org/',
		'Online Resources','Linguistic Phenomena/Devices','www.csi.uottawa.ca/~kbarker/ling-devices.html',
		'Online Resources','Political Compass','www.digitalronin.f2s.com/politicalcompass/',
		'Online Resources','Roget&#8217;s Thesaurus','www.bartleby.com/thesauri/',
		'Online Resources','Root-Zone Whois Index by TLD Code','www.iana.org/cctld/cctld-whois.htm',
		'Online Resources','The Visual Thesaurus','www.visualthesaurus.com/index.jsp',
		'Online Resources','The Word Spy','www.wordspy.com/',
		'Online Resources','A Victorian Compendium','www.victorianlinks.com/library/',
		'Online Resources','Webster&#8217;s Online Dictionary','www.websters-online-dictionary.org/',
		'Online Resources','Weird Words: Gallimaufry','www.worldwidewords.org/weirdwords/ww-gal1.htm',
		'Online Resources','Word Origins','www.wordorigins.org/',
		'Online Resources','command line quick ref','www.ss64.com/index.html',
		'Online Resources','Etymology &amp; History of First Names','www.behindthename.com/',
		'Online Tool / Typography','fontBROWSER','www.stcassociates.com/lab/fontbrowser.html',
		'Online Tool','Babel Fish Translation','babelfish.altavista.com/',
		'Online Tool','FavIcon from Pics','www.html-kit.com/e/favicon.cgi',
		'Online Tool','French dictionnaries','213.161.194.55/mediadico-tv5/asp/dicoweb.asp?NBD=1',
		'Online Tool','Grand dictionnaire terminologique','w3.granddictionnaire.com/btml/fra/r_motclef/index1024_1.asp',
		'Online Tool','Mailinator','www.mailinator.com/mailinator/Welcome.do',
		'Online Tool','Online Map Creation','www.aquarius.geomar.de/',
		'Online Tools','Dictionary of Phrase &amp; Fable','www.bootlegbooks.com/Reference/PhraseAndFable/Default.htm',
		'Online Tools','Wikipedia','en.wikipedia.org/',
		'Poetry','101 Stories - John M.Ford','nielsenhayden.com/110.html',
		'Reading / Blog / Software','Joel on Software','www.joelonsoftware.com/',
		'Reading / Developer','The Art of Unix Programming','www.faqs.org/docs/artu/',
		'Reading','J.Carroll - White Apples','www.whiteapples.com/about.html',
		'Reading','Bartleby.com - Books Online','bartleby.com/',
		'Reading','Cory Doctorov','craphound.com/',
		'Reading','H.Beard - X-Treme Latin','www.economist.co.uk/books/PrinterFriendly.cfm?Story_ID=2441549',
		'Reading','Gilbert K.Chesterton','www.pagebypagebooks.com/Gilbert_K_Chesterton/',
		'Reading','Infinite Jest: Reviews,Articles,&amp; Miscellany','www.smallbytes.net/~bobkat/jesterlist.html',
		'Reading','Online Books','www.readprint.com/',
		'Reading','Panphobia','www.panphobia.com/site_index.htm',
		'Reading','Quidditch.com&#8217;s Incomplete Guide to Lemony Snicket','www.quidditch.com/lemony%20snicket.htm',
		'Reading','Ursula Le Guin Q&amp;A','books.guardian.co.uk/departments/sciencefiction/story/0,6000,1144428,00.html',
		'Reading','Baen Free Library','www.baen.com/library/',
		'Reading','Beautiful Stuff','beautifulstuff.org/',
		'Reading','English section of Senoeni&#8217;s Site','www.senoeni.net/eng/index.html',
		'Reading','Fantagraphics Books','www.fantagraphics.com/',
		'Reading','H.Rider Haggard : She','www.classicreader.com/read.php/sid.1/bookid.1313/',
		'Reading','HHG2G - Episode 1 - D.Adams','www.ug-home.nottingham.ac.uk/~ppyvrts/Radio_Scripts/Scripts/Episode_1.html',
		'Reading','Happy ever after - A.S.Byatt','books.guardian.co.uk/review/story/0,12084,1115048,00.html',
		'Reading','Harry Stephen Keeler - 2','xavier.xu.edu:8000/~polt/keeler.html',
		'Reading','Harry Stephen Keeler - 3','members.aol.com/bigsecrets/Keeler/',
		'Reading','Harry Stephen Keeler','www.ramblehouse.com/HarryKeeler.htm',
		'Reading','Myths Over Miami  - Miami New Times','www.miaminewtimes.com/issues/1997-06-05/feature.html',
		'Reading','Norman Spinrad&#8217;s Home Page','ourworld.compuserve.com/homepages/normanspinrad/',
		'Reading','Small Beer Press','www.lcrw.net/',
		'Reading','Thackery T.Lambshead Pocket Guide to Eccentric and Discredited Diseases','www.nightshadebooks.com/diseaseguide.html',
		'Reading','The Child That Books Built - F.Spufford','www.complete-review.com/reviews/reading/spufford.htm#basic',
		'Reading','The David Copperfield Site','www.ellopos.net/dickens/copperfield.htm',
		'Reading','The Dreaming: Neil Gaiman Fan','holycow.com/dreaming/',
		'Reading','The Home Library','www.myhomelibrary.org/home.html',
		'Reading','Thorne Smith - The Biography','members.tripod.com/~JCHOMA/bio.htm',
		'Skepticism','James Randi Educational Foundation','www.randi.org/',
		'Typography','Au commencement &eacute;tait la lettre','typographie.free.fr/typographie_1.html',
		'Typography','Australian Type Foundry','www.atf.com.au/home.asp',
		'Typography','Cape-Arcona','www.cape-arcona.com/',
		'Typography','Claude Garamond Promotes His Old Style Typefaces','www.underconsideration.com/speakup/archives/001714.html',
		'HUD Homes','Department of Housing and Urban Development (HUD)','www.hud.gov',
		'HUD Homes','HUD, HUD Homes, foreclosured homes, foreclosures','www.hud.us.com',
		'HUD Homes','FHA Home Loans','www.fha-homeloans.com',
		'VA','VA Home Loans','www.baltimorehudhomes.com/va',
		'FHA','FHA Income','www.baltimore--homes.com/fha/income_qualifying.htm',
		'VA','VA Certificate','www.baltimorehudhomes.com/va/certificate.htm',
		'Online Resouce / Typography','Identifont - identify fonts and typefaces','www.identifont.com/',
		'Typography','L&#8217;Abecedarienne&#8217;s Fonts','www.abecedarienne.com/',
		'Typography','LettError: Typography, Fonts and Type','www.letterror.com/',
		'Typography','MADType','madtype.net/index.php',
		'Typography','Mark Simonson Studio','www.ms-studio.com/',
		'Typography','Optimo','www.optimo.ch/home.php',
		'Typography','OrangeItalic','www.orangeitalic.com/fonts/',
		'Typography','PSY/OPS: Home','www.psyops.com/html/home.html',
		'Typography','Planet typography','www.planet-typography.com/',
		'Typography','Porchez Typofonderie','www.typofonderie.com/',
		'Typography','Storm Type Foundry','www.stormtype.com/index.html',
		'Typography','Suitcase Type','www.suitcasetype.com/',
		'Typography','The Ensched&eacute; Font Foundry','www.teff.nl/index.html',
		'Typography','Thirstype','www.thirstype.com/',
		'Typography','Type, handwriting, and lettering','briem.ismennt.is/',
		'Typography','Typeworkshop','www.typeworkshop.com/',
		'Typography','Typodermic - Fonts by Ray Larabie','www.typodermic.com/index.html',
		'Typography','Typographica - Typography journal','typograpi.com/',
		'Typography','Underware - Fonts','www.underware.nl/site2/index.php3',
		'Typography','dinc! SuperFonts','www.girlswhowearglasses.com/',
		'Typography','typography - a black raindrop','dreamer.nitro.dk/typography/resources.html',
		'Online Resource / Music','Radio Paradise','www.radioparadise.com') 
		
	var myTotal = myArray.length ;
			myTotal = myTotal/3 ;
	// clear
	var counter = 0 ;
	var myHTML  = '' ;
	// only end when we have a good population
	do {
		// get rand
		myRand = Math.floor( Math.random() * myTotal ) *3 ;
		// is there something there?
		if( myArray[ myRand ] != '' ) {
			myHTML += '<a href="http://' +myArray[ myRand +2 ] +'" ' ;
			myHTML += 'title="' +myArray[ myRand ] +'">:: ' ;
			myHTML += myArray[ myRand +1 ] +'</a><br />' ;
			// clear
			myArray[ myRand ] = '' ;
			counter++ ;
		}
	} while( 12 > counter ) ;
	document.write( myHTML ) ;
}

