var ids = new Array("", "13", "26", "27", "32", "34", "35", "38", "43", "44", "46", "48", "49", "5", "50", "51", "52", "56", "61", "62", "73", "77", "81", "82", "86", "87");
var nums = new Array(0, 2, 5, 3, 1, 1, 1, 1, 4, 7, 1, 2, 1, 1, 1, 1, 3, 2, 2, 4, 2, 2, 1, 1, 1, 6);

function indexOfID (id) {
	for (var i = 1; i < ids.length; i++)
		if (ids[i] == id)
			return i;
	return 0;
}

function linkComments (id, txt) {
	var n = nums[indexOfID(id)] || 0;
  document.write('<a href="javascript:void(0);" target="_self" '
		+ 'onmouseover="window.status=\'\'; return true;" '
		+ 'onclick="openComments(\''+id+'\');">'
		+ (txt || (n
			? (n == 1
				? "One comment, please join in!"
				: "Comments ("+n+")"
				)
			: "Leave a comment!"
			)
    ) + '</a>');
}

function openComments (id) {
	window.open('http://www.bill-wilson.net/cgi-bin/index.cgi?id='+escape(id)+'&mode=view',
		id+'commentsbillwilsonnet',
		'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,copyhistory=0,left=' + parseInt((screen.availWidth - 500)/2) + ',top=' + parseInt((screen.availHeight - 300)/2) + ',width=500,height=300');
}
