//skins.js - Copyright (c) 2005 by David K Goodman
// Some code created by Godels.com using the cookie functions from:
//
//Display Time of last visit script- Mattias Sjoberg
//Modified by JavaScript Kit (http://javascriptkit.com)
//Visit http://javascriptkit.com for this script

var skinCodeLoaded = true;

var expDays = 356;
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

// paint a ribbon
function PutRibbon()
{
	return;

document.writeln('<style type="text/css">' +
'div.Ribbon1 { position:absolute; left:0px; top:0px; overflow:visible; height:163px; width:163px; background-image:url(http://dkgoodman.com/blogpics/ribbon1.gif); background-repeat:no-repeat; background-position:-200px -200px; background-color:transparent; margin:0; padding:0; color:#000; z-index:1000000000; border:none; float:none; }' +
'</style>');
document.writeln('<div class="Ribbon1"><img src="http://dkgoodman.com/blogpics/ribbont.gif" width="163" height="163" border="0" usemap="#RibbonMap">' +
'<map name="RibbonMap"><area shape="poly" coords="163,0,0,163,0,133,133,0" href="http://www.ussindianapolis.org/" target="_blank"></map></div>');
}

function MOTD() {
  // document.write('<br><div id="motd" align=center><font face="verdana, arial"><b>July 20. Step outside and look at the sky. Thank you, NASA. Thank you, James Doohan.</b></font></div>');
  // document.write('<br><div id="motd" align=center><font face="verdana, arial"><font color="#f00000">======&gt; </font><b>Blogger outage expected Tuesday, July 11, 4pm to 5:30pm PST!</b><font color="#f00000"> &lt;======</font></font></div>')
  document.write('<br><div id="motd" align=center><font face="verdana, arial"><b>'+asQuotes[Rand(asQuotes.length) + 1]+'</b></font></div>')
}

function ShowDaysUntil()
{
   DaysUntil( 7,  4, 2005, "Independence Day!<br>", "Happy Independence Day!<br>","")
   // DaysUntil( 7,  13, 2005, "next shuttle launch!<br>", "Shuttle launch today!<br>","")
   DaysUntil(10, 31, 2005, "Halloween!<br>","Happy Halloween!<br>","")
   DaysUntil(12, 25, 2005, "Christmas<br>","Merry Christmas!<br>","")
   DaysUntil(1, 1, 2006, "New Year's Day<br>","Happy New Years!<br>","")
}


var aSmileys = new initArray(
	"lol",		"lol.gif",		// lol
	"LOL",		"lol.gif",		// lol
	"rofl",	"lol.gif",		// rofl
	"ROFL",	"lol.gif",		// rofl
	":)",		"smile.gif",	// happy
	":-)",		"smile.gif",	// happy
	":))",		"bigsmile.gif",	// very happy
	":-))",	"bigsmile.gif",	// very happy
	":D",		"bigsmile.gif",	// big smile
	":-D",		"bigsmile.gif",	// big smile
	":O",		"eek.gif",		// surprise / oh-no!
	":-O",		"eek.gif",		// surprise / oh-no!
	":p",		"tongue.gif",	// tongue out
	":P",		"tongue.gif",	// tongue out
	":-p",		"tongue.gif",	// tongue out
	":-P",		"tongue.gif",	// tongue out
	";)",		"wink.gif",		// wink
	";-)",		"wink.gif",		// wink
	":(",		"frown.gif",	// sad
	":-(",		"frown.gif",	// sad
	":-((",	"frown.gif",	// very sad
	":-/",		"confused.gif",	// confused
	":-\\",	"confused.gif",	// confused
	":|",		"undecided.gif",// undecided
	":-|",		"undecided.gif",// undecided
	":O)",		"redface.gif",	// clown
	":0)",		"redface.gif",	// clown
	":o)",		"redface.gif"	// clown
)

// Call this function like so: commenthtml('topc<$BlogItemNumber$>')
function commenthtml(string)
{
	var text = document.getElementById(string).innerHTML;
	var pretext = "> \t\r\n";

	for (var iSel=1; iSel < aSmileys.length; iSel += 2)
		for (;;)
		{
			var emoticon = aSmileys[iSel];
			var iPos = text.indexOf(emoticon);
			if (iPos < 0)
				break;
			if ( (iPos > 0) && (pretext.indexOf(text.charAt(iPos-1)) < 0) )
				break;
			var graphic = ' <img src="http://dkgoodman.com/smileys1/' + aSmileys[iSel+1] + '">';
			text = text.substr(0, iPos) + graphic + text.substr(iPos + emoticon.length);
		}

	for (;;)
	{
		var bFound = false;
		var iOpen = text.indexOf("[img]");
		if (iOpen >= 0)
		{
			var iClose = text.indexOf("[/img]");
			if ( (iClose >= 0) && (iClose > iOpen) )
			{
				iOpen += 5;
				var sURL = text.substr(iOpen, iClose - iOpen);
				text = text.substr(0, iOpen-5) + '<img src="' + sURL + '">' + text.substr(iClose + 6);
				bFound = true;
			}
		}
		if ( !bFound )
			break;
	}

	document.getElementById(string).innerHTML = text;
}



var iAuthors = 0;
function AddAuthor(id, u, w, h)
{
var entry = new Array();
entry["i"] = id;
entry["u"] = u;
entry["w"] = w;
entry["h"] = h;
this[iAuthors++] = entry;
}

Array.prototype.AddAuthor = AddAuthor;
authors = new Array();


function CheckAuthor(url)
{
	var sDefault = "dkgoodman.com/blogpics/pen.gif";
	var iXDefault = 82;
	var iYDefault = 39;
	var iStart = url.indexOf('<a href');
	if (iStart != -1)
		url = url.substr(iStart);
	url = url.replace('<a href="http://', '')
	var iEnd = url.indexOf('"')
	if (iEnd != -1)
		url = url.substr(0, iEnd)
	for (var iAuth=0; iAuth<iAuthors; iAuth++)
		if (authors[iAuth]["i"] == url )
		{
			document.writeln('<a href="http://' + url + '"><img src="http://' + authors[iAuth]["u"] + '" width=' + authors[iAuth]["w"] + ' height=' + authors[iAuth]["h"] + ' border=0></a><br>');
			break;
		}
	if (iAuth >= iAuthors)
		document.writeln('<a href="http://' + url + '"><img src="http://' + sDefault + '" width=' + iXDefault + ' height=' + iYDefault + ' border=0></a><br>');
}

function AddAuthors()
{
	authors.AddAuthor('www.blogger.com/profile/82180', 'dkgoodman.com/DKGSpySmall.gif', 100, 110); // dkg
	authors.AddAuthor('www.blogger.com/profile/06731373688572121714', 'dkgoodman.com/DKGSpySmall.gif', 100, 110); // dkg
	// authors.AddAuthor('www.blogger.com/profile/82180', 'dkgoodman.com/dkgcaric.gif', 66, 72); // dkg
	// authors.AddAuthor('www.blogger.com/profile/06731373688572121714', 'dkgoodman.com/dkgcaric.gif', 66, 72); // dkg
	authors.AddAuthor('www.blogger.com/profile/23938505', 'img.photobucket.com/albums/v600/chalmerebhai/alanscott.jpg', 86, 113); // alan
	authors.AddAuthor('www.blogger.com/profile/11013518337156050036', 'img.photobucket.com/albums/v600/chalmerebhai/alanscott.jpg', 86, 113); // alan
	authors.AddAuthor('www.blogger.com/profile/3362676', 'photos1.blogger.com/img/148/138/320/befrankcool1.1.jpg', 66, 72); // befrank
	authors.AddAuthor('www.blogger.com/profile/11814239467355086230', 'photos1.blogger.com/img/148/138/320/befrankcool1.1.jpg', 66, 72); // befrank
	authors.AddAuthor('www.blogger.com/profile/12786852987308471211', 'dkgoodman.com/blogpics/boris.gif', 64, 60); // BORis
	authors.AddAuthor('www.blogger.com/profile/4034921', 'photos1.blogger.com/blogger/4457/492/400/PA122800_copy_ghs.jpg', 80, 60); // candace
	authors.AddAuthor('www.blogger.com/profile/12798616907806760582', 'photos1.blogger.com/blogger/4457/492/400/PA122800_copy_ghs.jpg', 80, 60); // candace
	authors.AddAuthor('www.blogger.com/profile/5315967', 'www.synergypartners.org/bailey620-1.jpg', 125, 104); // dana
	authors.AddAuthor('www.blogger.com/profile/4150344', 'garylapointe.com/mypointe/images/mygravatar.jpg', 66, 66); // gary
	authors.AddAuthor('www.blogger.com/profile/15376397138498178987', 'garylapointe.com/mypointe/images/mygravatar.jpg', 66, 66); // gary
	authors.AddAuthor('www.blogger.com/profile/3323045', 'i8.photobucket.com/albums/a29/gemmak/newavat.gif', 100, 85); // gemmak
	authors.AddAuthor('www.blogger.com/profile/12575349964533883253', 'i8.photobucket.com/albums/a29/gemmak/newavat.gif', 100, 85); // gemmak
	authors.AddAuthor('www.blogger.com/profile/4484345', 'myspace-479.vo.llnwd.net/00691/97/48/691968479_m.jpg', 85, 84); // jake
	authors.AddAuthor('www.blogger.com/profile/1676824', 'i4.photobucket.com/albums/y128/lisa721/littlemoon.jpg', 77, 113); // lisa
	authors.AddAuthor('www.blogger.com/profile/19610311', 'i4.photobucket.com/albums/y128/lisa721/littlemoon.jpg', 77, 113); // lisa
	authors.AddAuthor('www.blogger.com/profile/07376261671451473457', 'i4.photobucket.com/albums/y128/lisa721/littlemoon.jpg', 77, 113); // lisa
	authors.AddAuthor('www.blogger.com/profile/2667114', 'i7.photobucket.com/albums/y292/theladyjustice/Save0001.jpg', 66, 67); // justitia
	authors.AddAuthor('www.blogger.com/profile/15400006028099229571', 'i7.photobucket.com/albums/y292/theladyjustice/Save0001.jpg', 66, 67); // justitia
	authors.AddAuthor('www.blogger.com/profile/1977902', 'publish.hometown.aol.com/twistofkate/images/icon.jpg', 80, 82); // kate
	authors.AddAuthor('www.blogger.com/profile/3366887', 'www.gemmak.co.uk/images/magzavatar.gif', 66, 92); // magz
	authors.AddAuthor('www.blogger.com/profile/5517798', 'img.photobucket.com/albums/v389/Seanny/meye.jpg', 66, 47); // mary
	authors.AddAuthor('www.pickoutyourcloud.blogspot.com/', 'img.photobucket.com/albums/v389/Seanny/meye.jpg', 66, 47); // mary
	authors.AddAuthor('www.blogger.com/profile/513408', 'www.mandarindesign.com/images/v169.gif', 66, 66); // meg
	authors.AddAuthor('www.blogger.com/profile/8610428', 'dkgoodman.com/blogpics/melissa2.jpg', 66, 47); // melissa
	authors.AddAuthor('www.blogger.com/profile/08075729636505487627', 'dkgoodman.com/blogpics/melissa2.jpg', 66, 47); // melissa
	authors.AddAuthor('mikeduffy.typepad.com/', 'mikeduffy.typepad.com/Mike%20Duffy%20-%20NBB%20Head%20Shot%20-%20cropped.jpg', 47, 72); // mike
	authors.AddAuthor('www.blogger.com/profile/636746', 'photos1.blogger.com/blogger/5962/77/1600/shanlee.jpg', 70, 70); // shannon
	authors.AddAuthor('www.blogger.com/profile/4702193', 'i4.photobucket.com/albums/y140/Hobbit223/Bonnabelle.jpg', 77, 113); // shari
	authors.AddAuthor('www.blogger.com/profile/10760819644411162762', 'i4.photobucket.com/albums/y140/Hobbit223/Bonnabelle.jpg', 77, 113); // shari
	authors.AddAuthor('www.blogger.com/profile/11979691', 'img379.imageshack.us/img379/1164/myt153sf.jpg', 66, 90); // tammy
}

function ShowEvents()
{
	var bdaycount = 0;
	function addbday(event, year, month, day, href, title )
	{
	var entry = new Array();
	entry["e"] = event;
	entry["y"] = year;
	entry["m"] = month;
	entry["d"] = day;
	entry["h"] = href;
	entry["t"] = title;
	this[bdaycount++] = entry;
	}

	Array.prototype.addbday = addbday;
	bdays = new Array();

	// bdays.addbday('b',0, 7,13,'','TEST');

	bdays.addbday('h',0, 1, 1,'','Happy New Years!');
	bdays.addbday('h',0, 1, 27,'','Holocaust Day');
	bdays.addbday('b',1957, 2, 4,'dkgoodman.com/blog.html','myself');
	bdays.addbday('b',0, 2,12,'mikeduffy.typepad.com/','my friend Mike Duffy');
	bdays.addbday('h',0, 2,14,'',"Happy Valentine's Day!");
	bdays.addbday('b',0, 2,14,'chasingdaisy.com/','my friend Daisy');
	bdays.addbday('h',0, 3,15,'','Beware the Ides of March');
	bdays.addbday('b',0, 3,30,'theladyjustitia.blogspot.com/','blogger Michelle at Justitia');
	bdays.addbday('h',0, 4,10,'','Paid your property taxes?');
	bdays.addbday('b',0, 4,13,'jmw500.blogspot.com/','my friend GemmaK');
	bdays.addbday('b',0, 4,13,'wealthcountry.com','my friend Bal');
	bdays.addbday('h',0, 4,15,'','Your Tax Dollars at Work');
	bdays.addbday('h',0, 5, 4,'','Happy Star Wars Day! &nbsp; May the 4th be with you. Always.');
	bdays.addbday('h',0, 5, 5,'','Feliz Cinco de Mayo!');
	bdays.addbday('b',0, 5, 5,'coolshots.blogspot.com/','my friend beFrank');
	bdays.addbday('b',0, 5,21,'utterlyboring.com','my friend Jake');
	bdays.addbday('b',0, 6, 3,'misadventurousmelissa.blogspot.com/','my friend Melissa');
	bdays.addbday('h',0, 6, 14,'','Happy anniversary to my beautiful wife!');
	bdays.addbday('b',0, 6, 16,'maggiezfarmaz.blogspot.com/','my friend Magz');
	bdays.addbday('h',0, 6, 25,'mandarindesign.com/blogger.html','We miss you, Meg. RIP');
	bdays.addbday('h',0, 7, 4,'','Happy 4th of July!');
	bdays.addbday('b',0, 7, 7,'','sci-fi author Robert A. Heinlein');
	bdays.addbday('b',0, 7,21,'','my friend Lisa');
	bdays.addbday('h',0, 7,30,'www.ussindianapolis.org/','July 30, 1945 - Japanese submarine sinks the USS Indianapolis');
	bdays.addbday('b',0, 8,24,'deepthoughtsfuzzymemories.blogspot.com/','my friend Terri');
	bdays.addbday('h',0, 9,11,'','September 11 - We will never forget!');
	bdays.addbday('b',0, 9,11,'garysaid.com/','my friend Gary');
	bdays.addbday('b',0, 10,20,'pickoutyourcloud.blogspot.com/','my friend Mary');
	bdays.addbday('h',0, 10,31,'','Happy Halloween!');
	// bdays.addbday('b',0, 11,21,'www.mandarindesign.com/blogger.html','Mandarin Meg');
	bdays.addbday('b',0, 11,30,'','my dear wife');
	bdays.addbday('h',0, 12,25,'','Merry Christmas!');
	bdays.addbday('b',0, 12,28,'','my darling daughter');
	bdays.addbday('h',0, 12,31,'','Happy New Years!');

	todayDate = new Date();
	thisyear = todayDate.getYear();
	thisyear = thisyear % 100;
	thisyear = ((thisyear < 50) ? (2000 + thisyear) : (1900 + thisyear));
	thismonth = todayDate.getMonth() + 1;
	thisdate = todayDate.getDate();
	// thismonth = 5;	// uncomment these two lines and force a date to test
	// thisdate = 4
	var bFirst = true;

	for (c=0;c<bdays.length;c++)
	{
		if ( (bdays[c]["m"] == thismonth) && (bdays[c]["d"] == thisdate) )
		{
			if (bFirst)
			{
				bFirst = false;
				document.write('<br><div id="motd" align=center><font face="verdana, arial">');
			}
			if (bdays[c]["e"] == "b")
			{
				document.write('<b>To ');
				if ( bdays[c]["h"].length > 0 )
					document.write('<a href="http://' + bdays[c]["h"] + '">' + bdays[c]["t"]+'</a>: &nbsp; Happy Birthday!</b><br>');
				else
					document.write(bdays[c]["t"]+': &nbsp; Happy Birthday!</b><br>');
			}
			else if (bdays[c]["e"] == "h")
			{
				if ( bdays[c]["h"].length > 0 )
					document.write('<a href="http://' + bdays[c]["h"] + '"></a> ');
				if ( (bdays[c]["y"] == 0) || (bdays[c]["y"] == thisyear) )
					document.write('<b>' + bdays[c]["t"] + '</b><br>');
			}
		}

	}
	if (!bFirst)
		document.write('</font></div>');
}

var asPic = new initArray(
"Antenna.jpg", 180, 100, "Limo TV Antenna",
"Batman.jpg", 180, 145, "Sister-in-Law's Cat",
"Bird_of_Paradise.jpg", 180, 142, "Bird of Paradise",
"Cat.jpg", 180, 159, "A cousin's cat",
"DoYouKnowThem.jpg", 180, 241, "Girls my daughter met in Europe",
"FaireGoer.jpg", 180, 210, "Seen at the Forest Faire",
"FireEater.jpg", 180, 193, "A fire eater in Nice, France",
"Flamingo.jpg", 180, 302, "A live flamingo in Canada's Edmonton Mall",
"Flowers.jpg", 180, 159, "A bed of flowers at the Bellagio",
"GlassArt.jpg", 180, 167, "A light fixture at the Bellagio",
"Hawk.jpg", 180, 135, "A Harris hawk at the Forest Faire",
"Nice.jpg", 180, 192, "Nice, France",
"PortOfSF.jpg", 180, 264, "The Port of San Francisco through a Wet Ferry Window",
"Punkins.jpg", 180, 131, "Pumpkins at the Bellagio",
"Scaffold.jpg", 180, 230, "Scaffolding off Whyte Ave. in Edmonton, Alberta",
"Sidewalk.jpg", 180, 170, "A sidewalk in Edmonton"
)

var nSel = Rand(asPic.length/4) * 4 + 1
var sPic = asPic[nSel]
var nWidth = asPic[nSel+1]
var nHeight = asPic[nSel+2]
var sTitle = asPic[nSel+3]

function ShowRandomPic()
{
	document.writeln('<div style="margin:0px auto;width='+nWidth+'px;height='+nHeight+'px;padding:10px;background:#666666; border:2px solid black"><img src="'+'http://dkgoodman.com/randpics/' + sPic+'" width='+nWidth+' height='+nHeight+' border=1 alt="' + sTitle + '" style="border:1px solid #000000;"><br><font color="#ffffff">' + sTitle + '</font></div><br>')
}

var asXSPFPlayerSlim = new initArray(
'<div class="gbox"><div class="gbox2"><div class="gbox3">',
'<h2 class="sidebar-title">eMusic</h2>',
'<table align="center" width="204" height="19"  border="1" cellpadding="0" cellspacing="0" bgcolor="#FFBB33"><tr><td>',
'<object type="application/x-shockwave-flash" width="200" height="15"',
'data="http://dkgoodman.com/xspf_player_slim.swf?playlist_url=http://dkgoodman.com/playlist.xspf&autoload=true&shuffle=true">',
'<param name="movie" ',
'value="http://dkgoodman.com/xspf_player_slim.swf?playlist_url=http://dkgoodman.com/playlist.xspf&autoload=true&shuffle=true" />',
'</object>',
'</td></tr></table>',
'<center><font size="-3">[<a href="javascript:ShowPlayer(true);" title="Popup eMusic Player">popup</a>]</font></center>',
'</div></div></div>'
);

var asXSPFPlayerExt = new initArray(
'<html><head><title>eMusings eMusic</title></head>',
'<body bgcolor="#FFBB33"><center>',
'<object type="application/x-shockwave-flash" width="400" height="175"',
'data="http://dkgoodman.com/xspf_player.swf?playlist_url=http://dkgoodman.com/playlist.xspf&autoload=true&shuffle=true&nocover=true">',
'<param name="movie" ',
'value="http://dkgoodman.com/xspf_player.swf?playlist_url=http://dkgoodman.com/playlist.xspf&autoload=true&shuffle=true&nocover=true" />',
'</object>',
'</center>',
'</body></html>'
);

function ShowPlayer(pop)
{
	if (pop == null)
		pop = false;

	var wWnd;

	if (pop)
	{
		wWnd = window.open("","eMusic","toolbar=no,width=420,height=200,directories=no,status=no,scrollbars=no,resizable=no,menubar=no");
		wWnd.document.open();

		for (iSel=1; iSel <= asXSPFPlayerExt.length; iSel++)
			wWnd.document.writeln( asXSPFPlayerExt[iSel] );

		wWnd.document.close();
	}

	else
		for (iSel=1; iSel <= asXSPFPlayerSlim.length; iSel++)
			document.writeln( asXSPFPlayerSlim[iSel] );
}


var rot13map;

function rot13init()
{
  var map = new Array();
  var s   = "abcdefghijklmnopqrstuvwxyz";
  
  for (i=0; i<s.length; i++)
    map[s.charAt(i)]			= s.charAt((i+13)%26);
  for (i=0; i<s.length; i++)
    map[s.charAt(i).toUpperCase()]	= s.charAt((i+13)%26).toUpperCase();
  return map;
}

function rot13(a)
{
  if (!rot13map)
    rot13map=rot13init();
  s = "";
  for (i=0; i<a.length; i++)
    {
      var b = a.charAt(i);

      s	+= (b>='A' && b<='Z' || b>='a' && b<='z' ? rot13map[b] : b);
    }
  return s;
}

function getCookieVal (offset) {  
	var endstr = document.cookie.indexOf (";", offset);  
	if (endstr == -1)    
		endstr = document.cookie.length;  
		return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {  
	var arg = name + "=";  
	var alen = arg.length;  
	var clen = document.cookie.length;  
	var i = 0;  
	while (i < clen) {    
	var j = i + alen;    
	if (document.cookie.substring(i, j) == arg)      
		return getCookieVal (j);    
		i = document.cookie.indexOf(" ", i) + 1;    
		if (i == 0) break;   
	}  
	return null;
}

function SetCookie (name, value) {  
	var argv = SetCookie.arguments;  
	var argc = SetCookie.arguments.length;  
	var expires = (argc > 2) ? argv[2] : null;  
	var path = (argc > 3) ? argv[3] : null;  
	var domain = (argc > 4) ? argv[4] : null;  
	var secure = (argc > 5) ? argv[5] : false;  
	document.cookie = name + "=" + escape (value) + 
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
	((path == null) ? "/" : ("; path=" + path)) +  
	((domain == null) ? "" : ("; domain=" + domain)) +    
	((secure == true) ? "; secure" : "");
}

function DeleteCookie (name) {  
	var exp = new Date();  
	exp.setTime (exp.getTime() - 1);  
	// This cookie is history  
	var cval = GetCookie (name);  
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();

}

var CSSCookieName;
var whichCSSFile;
var defaultCSS;
function whichCSS() {
	whichCSSFile=GetCookie(CSSCookieName);
	if (whichCSSFile == null) whichCSSFile=defaultCSS;
	whichCSSFile="styles"+whichCSSFile;
	// whichCSSFile = "stylesSpace";
}

function jump(cookieVal) {
	SetCookie(CSSCookieName,cookieVal,exp);
	document.location.href=document.location;
}

function ShowProgress(sTitle, iCompleted, iComplete, iWidth, sUnits)
{
iCompleted = 220;		// hard-coded to immediately reach all pages

	var iPercent = (iCompleted * 100) / iComplete;
	var iDone = (iWidth * iPercent) / 100;
	var iUndone = (iWidth * (100-iPercent)) / 100;
	iPercent = Math.floor(iPercent * 100) / 100;

	document.writeln('<font size="-1"><center>');
	document.writeln(sTitle + '<br>');
	document.write('<img src="http://dkgoodman.com/blogpics/ProgressLeft.gif" height=20>');
	document.write('<img src="http://dkgoodman.com/blogpics/ProgressDone.gif" height=20 width=' + iDone + '>');
	document.write('<img src="http://dkgoodman.com/blogpics/ProgressUndone.gif" height=20 width=' + iUndone + '>');
	document.write('<img src="http://dkgoodman.com/blogpics/ProgressRight.gif" height=20><br>');
	document.writeln(iCompleted + ' of ' + iComplete + ' ' + sUnits + ' (' + iPercent + '%)');
	document.writeln('</font></center>');
}

/*
// snippet to allow <abbr> tag in IE
function styleAbbr() {
 var oldBodyText, newBodyText, reg
 if (isIE) {
  oldBodyText = document.body.innerHTML;
  reg = /<ABBR([^>]*)>([^<]*)<\/ABBR>/g;
  newBodyText = oldBodyText.replace(reg, '<ABBR $1><SPAN class=\"abbr\" $1>$2</SPAN></ABBR>');
  document.body.innerHTML = newBodyText;
 }
}
window.onload = function(){
styleAbbr()
};
isIE = (document.all) ? true:false;
*/

  function initArray()
  {
	this.length = initArray.arguments.length
	for (var idx=1; idx<=this.length; idx++)
		this[idx] = initArray.arguments[idx-1]
  }
  function Rand(nMax) { var dDate = new Date(); return (Math.floor(dDate.getTime() / 1000)) % nMax }

var asQuotes = new initArray(
"A candle is not dimmed by lighting another candle.",
"A hen is an egg's way of making more eggs.",
"A horse walks into a bar. Bartender says, 'Why the long face?'",
"A procrastinator's work is never done.",
"Aim for success, not perfection. Never give up your right to be wrong, because then you will lose the ability to learn new things and move forward with your life. - Dr. David M. Burns",
"And the day came when the risk it took to remain tight inside the bud was more painful than the risk it took to blossom. -Anais Nin",
"Build a man a fire, and he'll be warm for a day.<br>Set him on fire, and he'll be warm the rest of his life.",
"Goodman don't play that!",
"I like 'em clever, clean and lean.",
"If corn oil is made from corn, what\'s baby oil made from?",
"If your PC doesn't fit in your pocket, it's not a <i>personal</i> computer.",
"Life is either a dichotomy, or it isn't.",
"Please stay calm.",
"Science has proven that if your parents didn't have children, neither will you.",
"Time is just nature's way of keeping everything from happening at once.",
"What a long, strange trip it's been!",
'"Call it a hunch." -- Quasimodo',
'"Criminal Lawyer" is a redundancy.',
'"I think not," said Descartes, and promptly disappeared.',
'"Imagination is more important than knowledge." - Einstein',
'100 years from now, will it have made a difference?',
'640K ought to be enough for anybody. - Bill Gates, 1981',
'96.37% of all statistics are made up.',
'A brain is only as strong as its weakest think.',
'A closed mouth gathers no foot.',
'A difference that makes no difference <i>is</i> no difference.',
'A good plan today is better than a perfect plan tomorrow.',
"A man needs self-acceptance or he can't live with himself; he needs self-criticism or others can't live with him. - James A. Pike",
'A truly lazy person is never bored.',
'Act natural.',
'Age and Treachery Overcome Youth and Skill',
'All stressed out, and no one to choke.',
"All things being equal, the simplest solution tends to be the right one. - Occam's Razor",
'And Adam asked, "What\'s a Headache?"',
"Anything that doesn't kill you... is just postponing the inevitable.",
"A patriot must always be ready to defend his country against his government. - Edward Abbey",
'A person who is nice to you, but rude to the waiter, is not a nice person.',
'As Thoreau once said, "Morons love to quote philosophers."',
"Believe those who are seeking the truth. Doubt those who find it. - Andre Gide",
"Better that ten guilty men go free than one innocent man is wrongly imprisoned.",
"Between the wish and the thing, life lies waiting.",
"By the time you read this you've already read it.",
"Call on God... but row away from the rocks! - Indian Proverb",
'Change is inevitable... except from a vending machine.',
"Children may forget what you taught them, but they’ll never forget how you treated them.",
'Click here to see me naked.',
'Confucius say, \"Man who run behind car get exhausted.\"',
'Confucius say, \"Passionate kiss like spider\'s web: soon lead to undoing of fly.\"',
"Credit cards are hazardous to your wealth.",
'Dates in calendar are closer than they appear.',
'Do not expose this message to direct sunlight.',
'Do not meddle in the affairs of dragons,<br>for you are crunchy and good with ketchup!',
'Do not taunt the happy fun ball!',
'Dogs come when you call. Cats have answering machines.',
'Don\'t believe everything you think.',
'Don\'t play "stupid" with me - I\'m better at it.',
'Dream as if you\'ll live forever, live as if you\'ll die tomorrow.',
'Editing is a rewording activity.',
"Enjoy life. This is not a dress rehearsal.",
"Everything happens for a reason. I just wish I knew what it was.",
"Experience is something you don't get until just after you need it.",
"Faced with the choice between changing one's mind and proving that there is no need to do so, almost everyone gets busy on the proof. -John Kenneth Galbraith",
"Find where your niche is and you'll always have riches.",
"From my fingers, to your eyes.",
'Get over it.',
'Getting caught is the mother of invention. - Robert Byrne',
'Good, fast or cheap? Pick two.',
'Goodman says, "Drive as if your life depended on it!"',
"Hard work may pay off in the long run, but procrastination always pays off today.",
'He that leaveth nothing to chance will do few things ill, but he will do very few things.<br>- George Savile, Marquis of Halifax',
"He who asks is a fool for five minutes, but he who does not ask remains a fool forever.",
'He who dies with the most toys is still dead.',
'He who laughs last probably doesn\'t understand the joke.',
'He who smiles in a crisis has found someone to blame.',
'Hell hath no fury like the lawyer of a woman scorned.',
'I *do* work for food!',
'If a vegetarian eats vegetables, what does a humanitarian eat?',
'If it was easy, anybody could do it!',
'If the facts don\'t fit the theory, change the theory!',
'If you believe in telekinesis, raise my hand.',
"If you could do tomorrow over again, would you?",
"If you don't risk anything you risk even more. - Erica Jong",
"If you don't stand for something, you'll fall for something.",
"I have not yet begun to procrastinate!",
"In any conflict, the boundaries of behavior are defined by the party that values morality least. - Randy Wayne White",
"In a time of universal deceit - telling the truth is a revolutionary act. - George Orwell",
"Indecision is the thief of opportunity.",
"It is better to live your life, I think, than to let your life live you. -Dave Goodman",
"It's on the Internet, so it must be good!",
'Language is a very difficult thing to put into words. - Voltaire',
"Luck favors the well prepared.",
"Life by the yard is very hard; life by the inch is a cinch.",
'Life is a sexually transmitted disease.',
'Life is like a simile.',
'Life is like arriving late for a movie, having to figure out what was going on without bothering everybody with a lot of questions, and then being unexpectedly called away before you find out how it ends. - Joseph Campbell',
'Life is not measured by the number of breaths we take, but by the moments that take our breath away.',
'Life shrinks or expands in proportion to one\'s courage. - Anais Nin',
'Love looks not with the eyes, but with the mind.',
'Minds, like parachutes, work only when open.',
"Never attribute to malice that which can be adequately explained by stupidity. - Hanlon's Razor",
'Never judge a book by its movie.',
'Never let a fool kiss you, or a kiss fool you.',
'Nine times out of ten the statisticians are wrong.',
'No one is free while others are oppressed.',
"No plan survives first contact with the enemy. - Karl von Clausewitz",
'No sniveling!',
'Nostalgia just ain\'t what it used to be.',
"Not all who wander are lost.",
'Not the real thing, but an incredible simulation.',
"Nothing is covered up that will not be uncovered,<br>and nothing secret that will not become known. - Luke 12:2",
'Nothing is foolproof to a sufficiently talented fool.',
"Nothing is stronger than an idea whose time has come. - Victor Hugo",
"Nuggets of wisdom in piles of junk.",
"Once is happenstance. Twice is coincidence. Three times is enemy action, Mr Bond. - Auric Goldfinger",
'Originality is the art of concealing your source.',
"Osama's mother dresses him funny.",
"People should not fear their government. A government should fear its people. - V",
'"People sleep peaceably in their beds at night only because rough men stand ready to do violence on their behalf."',
'People who want to share their religious views with you<br>almost never want you to share yours.',
'Perception is nine tenths of the law.',
'Perception is reality.',
'"Personalities are like impressionistic paintings.<br>At a distance, each person is \'all of a piece\'; up close, each is a bewildering complexity of moods, cognitions, and motives." - Theodore Millon',
'Politicians are like diapers. They both need changing regularly, and for the same reason.',
'Power corrupts, but we still need electricity.',
'Press any key to continue or any other key to quit',
'Profanity is the linguistic crutch of the inarticulate. -Lord Byron',
'Question Authority.',
'Question Reality.',
'Reality is for people with no grasp of fantasy.',
'Really, honey... just one more message.',
"Relapse is part of recovery.",
"Resentment is like taking poison and waiting for the other person to die.",
'Save the drama for your mama!',
'Science is like sex: sometimes something useful comes out,<br>but that is not the reason we are doing it.', // Richard Feynman
'Second star to the right, and straight on till morning.',
"Sometimes the harder thing is to do nothing.",
'Success lies in achieving the top of the foodchain.',
'Take one compass to sea, or take at least three.<br>A ship on two needles knows not where she be.',
'Talk nerdy to me.',

"There are two distinct classes of men...<br>those who pay taxes, and those who receive and live upon taxes. - Thomas Paine",
"The hardest thing in the world to understand is income tax! - Albert Einstein",
"When there is an income tax, the just man will pay more and the unjust less on the same amount of income. - Plato",
"The government that robs Peter to pay Paul can always depend on the support of Paul. - George Bernard Shaw",
"There is no art which one government sooner learns from another than that of draining money from the pockets of the people. - Adam Smith",
"Like mothers, taxes are often misunderstood but seldom forgotten. - Lord Bramwell",
"But in this world nothing is certain but death and taxes. - Benjamin Franklin",
"A taxpayer is someone who works for the federal government, but who doesn't have to take a civil service examination. - Ronald Reagan",
"The trick is to stop thinking of it as <i>your</i> money! - IRS Auditor",
'The end is near... but wait for the sequel!',
'The great man is he who does not lose his child\'s-heart.',
"The hottest places in Hell are reserved for those who in time of great moral crises maintain their neutrality. - Dante",
'The only assurance against tyranny is a well armed populace. -Thomas Jefferson',
'The stupid neither forgive nor forget; the naive forgive and forget;<br>the wise forgive but do not forget. - Thomas Szasz',
'The thoughtless are rarely wordless.',
'The wise man therefore always holds in these matters to this principle of selection:<br> he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains.', 
'There are no teachers -- only students.',
'There are some things so serious you can only joke about them.',
'There are two sides to every story.',
"There comes a time when silence is betrayal. - MLK",
'There is no bad weather, just bad clothing. - Swedish maxim',
'There must be more to life than having everything. - Maurice Sendak',
'Things are always easier after the first try. So just get that one out of the way.',
'This product was cruelly tested on small, furry animals.',
'This sentence no verb.',
'This web page displayed using 100% recycled pixels.',
'Three virtues of a programmer:  Laziness, Impatience and Hubris.',
'Time flies like an arrow, but fruit flies like a banana.',
'Time sneaks up on you like a windshield on a bug. -John Lithgow',
'To be human without passion is to be dead.',
'"To forgive is an action of compassion, Buffy. It\'s not done because people deserve it.<br>It\'s done because they need it." - Rupert Giles',
'"Treat the earth well. It was not given to you by your parents,<br>it was loaned to you by your children." - Native American Proverb',
"Trusting the government with your privacy is like having a Peeping Tom install your window blinds.",
'War doesn\'t determine who is right, war determines who is left.',
'Watch it - you\'re trying my infinite patience.',
"We don't see things as they are, we see them as we are. - Anais Nin",
'We must be willing to get rid of the life we\'ve planned,<br>so as to have the life that is waiting for us.<br>- Joseph Campbell',
"We're all here because we're not all there!",
"What if the Hokey Pokey really IS what it's all about?",
'When in doubt, mumble!',
'When one door of happiness closes, another opens; but often<br>we look so long at the closed door that we do not see the one which has been opened for us. - Helen Keller, Optimism',
'When privacy is outlawed only outlaws will have privates.',
'When puns are outlawed only outlaws will have puns.',
'When the only tool you have is a hammer, every problem looks like a nail.',
"When you can't take it with you, all that really matters is what you leave behind. - Howard F. Lyman",
"When you want to believe in something, you also have to believe in everything that's necessary for believing in it. - Ugo Betti",
"Which do you prefer? The pain of self discipline, or the pain of regret? - Lisa Smith",
'Yesterday is history, tomorrow is mystery. Today we live.',
'You can lead a man to ponder; you cannot make him think!',
"You can't be afraid and rational at the same time. Pick <i>one</i>.",
"You can't do anything about the length of your life, but you can do something about its width and depth. - Shira Tehrani",
"You can't free a fish from water.",
"You don't remember pain.",
"You go through this world looking for guarantees, McGee, you'll live small.",
"You must do the things you think you cannot do. - Eleanor Roosevelt",
'You\'re currently going through a difficult transition period called "Life."',
"You're not supposed to be so blind with patriotism that you can't face reality. Wrong is wrong, no matter who says it. - Malcolm X"
)


function CommentNum(count)
{
   var iCount = parseInt(count);
   if (iCount > 6)
      return "A whopping " + count + " comments!</a>";
   switch (iCount)
   {
   case 0: return "Post a comment!</a>"
   case 1: return "1 comment</a>:"
   default: return count + " comments</a>:"
   }
}

function DaysUntil(month, day, year, textYet, textToday, textDone)
{
	var date1 = new Date()
	var date2 = new Date()
	date2.setYear(year); date2.setMonth(month-1); date2.setDate(day)
	var iDays = Math.round( (date2.getTime() - date1.getTime()) / (1000 * 60 * 60 * 24) )
	if ( (iDays >= 1) || ((iDays>=0) && (textToday.length==0)) )
	{
		if (iDays == 1)
			document.writeln(iDays + " day until " + textYet);
		else
			document.writeln(iDays + " days until " + textYet);
	}
	else if (iDays >= 0)
		document.writeln(textToday);
	else if (textDone.length)
		document.writeln(iDays + textDone);
}
