function imgCell(icWidth, icSRC, icScanType)
{
	this.width = icWidth;
	this.src = icSRC;
	this.scantype = icScanType;
}

var bannerColor = "darkred";
var galleryColor = "#BB3030";
var missingColor = "red";
var picURL = "http://home.comcast.net/~plastereddragon/srp/pic/";
var pageURL = "http://stonerainproject.blogharbor.com/blog/_WebPages/";

function renderGallery(galleryName)
{

	var gList = new Array();
	var output = new Array();
	var L;

	// get the cards for the gallery //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	if (galleryName != "SPECIAL")
	{
		for (i=0; i<masterList.length; i++)
		{
			if (masterList[i].lang == galleryName)
			{
				gList[gList.length] = masterList[i];
			}
		}
	}
	else
	{
		for (i=0; i<specialList.length; i++)
		{
			gList[gList.length] = specialList[i];
		}
	}

	// open up the gallery ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	output.push("<div style=\"display: block; background-color: ");
	output.push(galleryColor);
	output.push(";\">");
	output.push("<div id=\"gallery\">");

	// banner, shows language, language sample graphic, and the number of printings ///////////////////////////////////////////////////////////////////////

	output.push("<div id=\"galleryheader\"><table width=99% border=0 cellpadding=2><tr><td width=40% align=left>");
	
	if (galleryName == "SPECIAL")
	{
		output.push("Special ");
	}
	else
	{
		L = getLanguage(galleryName);
		output.push(L.name);
		output.push(" ");
	}
	output.push("Stone Rains:");
		
	output.push("</td><td width=20% align=center>");
	
	if (galleryName == "SPECIAL")
	{
		output.push("&nbsp;");	// no language sample for the special stone rains
	}
	else
	{
		output.push("<IMG WIDTH=250 HEIGHT=32 SRC=\"");
		output.push(picURL);
		output.push(galleryName.toLowerCase());
		output.push("_lang_sample.jpg\" ALT=\"");
		output.push(L.name);
		output.push(" Language Sample\">");
	}	
	
	output.push("</td><td width=40% align=right><i>");
	output.push(gList.length);
	output.push(" printings</I></td></tr></table></div>");

	// Output the cards ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	var cdClass;
	var donorNotes = new Array();
	var i,j;
	
	for (j=0; j<gList.length; j++)
	{
		// figure out card class (singlewide, doublewide, or triplewide)
		
		var cd = gList[j];
		
		if (cd.scan3type != "")
		{
			cdClass = "s3";
		}
		else if (cd.scan2type != "")
		{
			cdClass = "s2";
		}
		else
		{
			cdClass = "s1";
		}
		
		// open the rolling division for this card
		
		output.push("<p><span class=\"");
		output.push(cdClass);
		
		if (cd.status=="") output.push("missing");
		
		output.push("\"><span class=\"cdTitle\">");
		
		// Determine the card title.  For SPECIAL's this includes the language symbol.
		
		if (galleryName=="SPECIAL")
		{
			L = getLanguage(cd.lang);
			output.push(L.symbol);
			output.push(" ");
		}
		
		// Now the edition name.  For SPECIAL's we use the short name.
		
		var ed = getEdition(cd.edition);
		
		if (galleryName=="SPECIAL")
		{
			output.push(ed.shortname);
		}
		else
		{
			output.push(ed.name);
		}
		
		output.push("</span>");
		
		// If this is a SPECIAL, display the card classification (oddity, misprint, etc.)
		var classification="";
		
		if (galleryName=="SPECIAL")
		{
			classification = getClassification(cd.code);
			output.push("<BR><span class=\"cdClass\">");
			output.push(classification);
			output.push("</span>");
		}
		
		output.push("<br>&nbsp;");
		
		// build image table for this card
				
		output.push("<TABLE class=imgBox WIDTH=");
		
		var tblWidth;
		
		if (cdClass=="s1")
		{
			tblWidth = "260";
		}
		else if (cdClass=="s2")
		{
			tblWidth = "525";
		}
		else
		{
			tblWidth = "800";
		}
		
		output.push(tblWidth);
		output.push(" BORDER=0><TR>");

		// set up an array for the image cells so that we can produce them with a loop
		
		var imgCells = new Array();
		ic1 = new imgCell("", "", "");
		ic2 = new imgCell("", "", "");
		ic3 = new imgCell("", "", "");
		
		ic1.scantype = (cd.code.indexOf("N") == -1 ? "face" : "print");
		ic1.src = getScanSource(cd.status, cd.scan1, ic1.scantype, cd.lang, cd.edition, cd.id);
		
		if (cdClass == "s1")
		{
			ic1.width="100%";
			imgCells[imgCells.length] = ic1;
			if (ic1.scantype=="face")
			{
				ic1.scantype = "";
			}
		}
		else if (cdClass == "s2")
		{
			ic1.width="50%";
			ic2.width="50%";
			ic2.scantype=cd.scan2type;
			ic2.src = getScanSource(cd.status, cd.scan2, ic2.scantype, cd.lang, cd.edition, cd.id);
			imgCells[imgCells.length] = ic1;
			imgCells[imgCells.length] = ic2;
		}
		else
		{
			ic1.width="33%";
		
			ic2.width="34%";
			ic2.scantype=cd.scan2type;
			ic2.src = getScanSource(cd.status, cd.scan2, ic2.scantype, cd.lang, cd.edition, cd.id);
		
			ic3.width="33%";
			ic3.scantype=cd.scan3type;
			ic3.src = getScanSource(cd.status, cd.scan3, ic3.scantype, cd.lang, cd.edition, cd.id);

			imgCells[imgCells.length] = ic1;
			imgCells[imgCells.length] = ic2;
			imgCells[imgCells.length] = ic3;
		}
		
		// output the image cells

		for (i=0; i<imgCells.length; i++)
		{
			output.push("<TD class=\"cardImg\" WIDTH=");
			output.push(imgCells[i].width);
			output.push(" ALIGN=CENTER><IMG hspace=10 WIDTH=250 HEIGHT=350 SRC=\"");
			output.push(imgCells[i].src);
			output.push("\" ALT=\"");
			output.push(L.name);
			output.push(" ");
			output.push(ed.name);
			
			if (classification != "")
			{
				output.push(" ");
				output.push(classification);
			}
			
			var footer = getImageFooter(imgCells[i].scantype);
			
			if ((footer != "") && (footer != "&nbsp;"))
			{
				output.push(" ");
				output.push(footer);
			}

			output.push("\"><BR>");
			output.push(footer);
			output.push("</TD>");

		}

		// card status

		output.push("</TR></TABLE><SPAN CLASS=status>");

		if (cd.status=="x")
			output.push("&nbsp;");
		else if (cd.status=="o")
			output.push("on order");
		else
			output.push("NEEDED");

		output.push("</SPAN><BR>");

		// donor information
		
		var D = getDonor(cd.donor);
		
		if (D.name != "???")
		{
			if (D.anon == "y")
			{
				output.push("anonymous<BR>");
			}
			else
			{
				output.push(makeDonorLink(D, "normal"));
				if (D.notes != "")
				{
					var x = getDonorNotesIndex(donorNotes, D.symbol);
					if (x == -1)
					{
						donorNotes.push(D);
						x = donorNotes.length;
					}
					else
					{
						x++;
					}
					output.push("&nbsp;(<A style=\"color: yellow;\" HREF=\"#DONOR");
					output.push(x);
					output.push("\" target=_self title=\"See more information about this donor.\"><b>More</b></a>)");
				}
				output.push("<BR>");
			}

			output.push("&nbsp;");
			if (D.city != "")
			{
				output.push(D.city);
				output.push(", ");
			}
			if (D.country != "")
			{
				output.push(D.country);
			}
			output.push("&nbsp;");

			if (cd.notes != "")
			{
				output.push("<HR><div style=\"padding-left: 10px; padding-right: 10px;\"><I>");
				output.push(cd.notes);
				output.push("</I></DIV>");
			}
		}
		else
		{
			output.push("&nbsp;<BR>"); 	// donor
			output.push("&nbsp;"); 		// donor location
		}
		
		
		output.push("<BR><img src=\"http://unbecominglevity.blogharbor.com/banners/clearpixel.gif\" width=");
		output.push(tblWidth);
		output.push(" height=1></span></p>");
	} // end of loop through cards

	// Time for the footer. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	output.push("<div id=\"donorlist\" align=center>");
	
	if (donorNotes.length == 0)
	{
		output.push("&nbsp;<br>&nbsp;");
	}
	else
	{
		output.push("<div style=\"width: 80%; color: white; font-size: 16px; font-family: Verdana;\" align=left><center>Additional Donor Information</center><ol>");
		
		for (i=0; i<donorNotes.length; i++)
		{
			output.push("<li><A NAME=\"DONOR");
			output.push((i+1));
			output.push("\"></A>");
			output.push(makeDonorLink(donorNotes[i], "normal"));
			output.push(":<BR><span class=donor>");
			output.push(donorNotes[i].notes);
			output.push("</span></li>");
		}
		
		output.push("</ol>&nbsp;</div>");
	}
	
	output.push("</div> <!-- donor list -->");
	
	// close out the gallery
	
	output.push("</div> <!-- gallery -->");
	output.push("</div> <!-- gallery background -->");
	
	var gDiv = document.getElementById("GALLERY_DIV");
	gDiv.innerHTML = output.join("");

	return(true);
}

function getLanguage(symbol)
{
	var ret = new lang("???", "???", "???");

	for (i=0; i<langArray.length; i++)
	{
		if (langArray[i].symbol == symbol)
		{
			ret = langArray[i];
			break;
		}
	}

	return ret;	
}

function getEdition(symbol)
{
	var ed = new edition("???", "???", "???", "???");

	for (i=0; i<editionArray.length; i++)
	{
		if (editionArray[i].symbol == symbol)
		{
			ed = editionArray[i];
			break;
		}
	}

	return ed;	
}

function getClassification(code)
{
	var ret = "";
	
	if (code=="")
	{
		ret = "&nbsp;";
	}
	else
	{
		if (code.indexOf("A") != -1)
		{
		    ret += "autographed ";
		}

		if (code.indexOf("T") != -1)
		{
		    ret += "altered ";
		}

		if (code.indexOf("F") != -1)
		{
		    ret += "counterfeit ";
		}

		if (code.indexOf("C") != -1)
		{
		    ret += "miscut ";
		}

		if (code.indexOf("M") != -1)
		{
		    ret += "misprint ";
		}

		if (code.indexOf("P") != -1)
		{
		    ret += "proof ";
		}

		if (code.indexOf("X") != -1)
		{
		    ret += "hoax ";
		}

		if (code.indexOf("O") != -1)
		{
		    ret += "oddity ";
		}

		if (code.indexOf("N") != -1)
		{
		    ret += "print ";
		}

		if (code.indexOf("S") != -1)
		{
		    ret += "sketch ";
		}
	}


	return ret;
}


function getDonor(symbol)
{
	var D = new donor("???", "y", "???", "???", "???", "???", "???", "???", "???", "???");

	for (i=0; i<donorArray.length; i++)
	{
		if (donorArray[i].symbol == symbol)
		{
			D = donorArray[i];
			break;
		}
	}

	return D;	
}

function getScanSource(status, haveScan, scanType, langSymbol, edSymbol, cdId)
{
	var SRC;
	var tmp = scanType;
	
	if (tmp == "face" || tmp == "print") tmp = "";

	if (status == "")
	{
		SRC = "missing.jpg";
	}
	else if (haveScan == "n")
	{
		SRC = "noscan.jpg";
	}
	else if (haveScan != "y")
	{
		SRC = haveScan;  	// override that allows us to specify the filename
	}
	else if (tmp.substr(0,8) == "compare:")
	{
		SRC = tmp.substr(8);
	}
	else
	{
		SRC = langSymbol.toUpperCase() + edSymbol.toUpperCase();
		
		if (cdId != "")
		{
			SRC = "SP" + SRC + cdId;
		}
				
		SRC =  SRC + compressScanType(tmp.toLowerCase()) + ".jpg";
	}

	SRC =  picURL + SRC;
	
	return SRC;
}

function compressScanType(S)
{
    var tmp;
    var c;
    
    tmp = new Array();
    
    for (i=0; i<S.length; i++)
    {
        c = S.charAt(i);
        if ((c >= "a" && c <= "z") || (c >= "0" && c <= "9"))
        {
        	tmp.push(c);
        }
    }
    
    return tmp.join("");
}

function getImageFooter(scanType)
{
	var ret = "";

	if (scanType == "")
		ret = "&nbsp;";
	else if (scanType == "face")
		ret = "card face";
	else if (scanType == "back")
		ret = "card back";
	else if (scanType.substr(0,7) == "compare")
		ret = "for comparison";
	else
		ret = scanType;
        
    return ret;
}

function makeDonorLink(D, style)
{
	var tmp = "";
	var linkText = "";
	var linkHREF = "";
    
	if (D.anon == "y")
	{
		tmp = "anonymous";
	}
	else
	{
		tmp = D.name;

		if ((D.linkType != "") || (D.URL != ""))
		{
			if (D.linkType == "EMAIL")
			{
				linkText = "E-Mail";
				linkHREF = "mailto:" + D.URL + "?SUBJECT=Saw%20you%20on%20the%20Stone%20Rain%20Project";
			}
			else if (D.linkType == "MTTA")
			{
				linkText = "MOTL Trade/Auction";
				linkHREF = "http://www.magictraders.com/ubb/Forum3/HTML/" + D.URL + ".html";
			}
			else if (D.linkType == "MTHW")
			{
				linkText = "MOTL H/W List";
				linkHREF = "http://www.magictraders.com/ubb/Forum2/HTML/" + D.URL + ".html";
			}
			else if (D.linkType == "MTREF")
			{
				linkText = "MOTL References";
				linkHREF = "http://refs.magictraders.com/" + D.userId + ".html";
			}
			else if (D.linkType == "EBA")
			{
				linkText = "eBay Auctions";
				linkHREF = "http://cgi6.ebay.com/aw-cgi/eBayISAPI.dll?ViewListedItems&userid=" + D.userId + "&sort=3&page=1&rows=50&since=-1";
			}
			else if (D.linkType == "EBF")
			{
				linkText = "eBay Feedback";
				linkHREF = "http://feedback.ebay.com/ws/eBayISAPI.dll?ViewFeedback&userid=" + D.userId;
			}
			else
			{
				if (D.linkType == "")
				{
					linkText = tmp;
				}
				else
				{
					linkText = D.linkType;
				}
				linkHREF = D.URL;
			}


			if (D.URL.substr(0,7) == "http:\\")
			{
				linkHREF = D.URL;
			}
			
			// "normal" is used on the language scan pages
			// the other style "compact" is used in the master list

			if (style == "normal")
			{
				tmp = tmp + "&nbsp;(<A style=\"color: yellow;\" HREF=\"" + linkHREF + "\" TARGET=_blank>" + linkText + "</A>)";
			}
			else if (style == "intro")
			{
				tmp = tmp + "&nbsp;(<A style=\"color: yellow;\" HREF=\"" + linkHREF + "\" TARGET=_blank>" + linkText + "</A>)";
			}
			else
			{
				tmp = "<A style=\"color: red;\" HREF=\"" + linkHREF + "\" TARGET=_blank>" + tmp + "</A>";
			}
		}
	}

	return tmp;
}

function getDonorNotesIndex(dnotes, symbol)
{
	var x = -1;

	for (i=0; i<dnotes.length; i++)
	{
		if (dnotes[i].symbol == symbol)
		{
			x=i;
			break;
		}
	}

	return x;	
}

function renderMasterList()
{

	var gList = new Array();
	var output = new Array();
	var L;
	var i,j,k;
	
	var output = new Array();
	
	output.push("<TABLE BORDER=5 BORDERCOLOR=BLACK CELLSPACING=0 CELLPADDING=0><TR><TD>");
	output.push("<TABLE WIDTH=800 CELLSPACING=0 CELLPADDING=0 BORDER=0>");
	output.push("");
	output.push("");
	output.push("");
	output.push("");   
	
	for (i=0; i<=langArray.length; i++)
	{
		if (i == langArray.length)
		{
			L = new lang("SPECIAL","Special","","");
			gList = specialList;
		}
		else
		{
			L = langArray[i];
			gList = new Array();
			
			for (j=0; j<masterList.length; j++)
			{
				if (masterList[j].lang == L.symbol) gList.push(masterList[j]);
			}
		}
		
		if (gList.length>0)
		{
			output.push("<TR CLASS=mlist_hdr><TD COLSPAN=5>");
			output.push(L.name);
			output.push(":</TD><TD ALIGN=RIGHT><I>");
			output.push(gList.length);
			output.push(" printings</I></TD></TR>");
			
			if (L.symbol=="SPECIAL")
			{
				output.push("<TR><TD ALIGN=LEFT COLSPAN=6><TABLE border=0><TR CLASS=mlist_row><TD WIDTH=48 VALIGN=TOP><I><B>Note:</B></I></TD>");
				output.push("<TD VALIGN=TOP><I>This section identifies Stone Rains I have found that are autographed, misprints, miscuts, proofs, or in some other way unique.  The cards listed here do not count toward the global set of ");
				output.push(masterList.length);
				output.push(" but are interesting just the same.</I></TD></TR></TABLE></TD></TR>");
			}
			
			output.push("<TR CLASS=mlist_subhdr><TH WIDTH=32>?</TH><TH ALIGN=LEFT WIDTH=224>Printing</TH><TH ALIGN=RIGHT WIDTH=176>Acquired From</TH><TH ALIGN=LEFT WIDTH=16>&nbsp;</TH><TH ALIGN=LEFT WIDTH=112>Country</TH><TH ALIGN=LEFT WIDTH=192>City &amp; Province</TH></TR>");
		}
		
		for (j=0; j<gList.length; j++)
		{
			var cd = gList[j];
			var L2 = L;
			
			if (L.symbol=="SPECIAL") L2 = getLanguage(cd.lang);
			
			var ed = getEdition(cd.edition);
			var D = getDonor(cd.donor);

			var rowclass = "mlist_row";
			if (cd.status=="") rowclass = "mlist_row_needed";
			
			output.push("<TR CLASS=");
			output.push(rowclass);
			output.push("><TD ALIGN=CENTER VALIGN=TOP WIDTH=32>");
			
			if (cd.status=="x")
				output.push("&nbsp;");
			else if (cd.status=="")
				output.push("x");
			else
				output.push(cd.status);			
			
			
			output.push("</TD>");
			output.push("<TD VALIGN=TOP WIDTH=224>");

			if (L.symbol=="SPECIAL")
			{
				output.push(L2.name);
				output.push(" ");
				output.push(ed.name);
				output.push("<BR>&nbsp;&nbsp;&nbsp;<I>");
				output.push(getClassification(cd.code));
				output.push("</I>");
			}
			else
			{
				output.push(ed.name);
			}
			
			output.push("</TD><TD VALIGN=TOP ALIGN=RIGHT WIDTH=176>");
			
			if ((D.name == "") || (D.name == "???"))
			{
				output.push("&nbsp;");
			}
			else
			{
				output.push(makeDonorLink(D, "compact"));
			}
			
			output.push("</TD><TD VALIGN=TOP WIDTH=16>&nbsp;</TD><TD VALIGN=TOP WIDTH=112>");
			
			if ((D.country != "???") && (D.country != ""))
				output.push(D.country);
			else
				output.push("&nbsp;");
			
			output.push("</TD><TD VALIGN=TOP WIDTH=192>");

			if ((D.city != "???") && (D.city != ""))
				output.push(D.city);
			else
				output.push("&nbsp;");

			output.push("</TD></TR>");
		}
	}

	output.push("</TABLE></TD></TR></TABLE>");

	// close out the list
	
	var mlDiv = document.getElementById("MASTERLIST_DIV");
	mlDiv.innerHTML = output.join("");

	return(true);
}


function renderNeededList()
{
	var output = new Array();
	
	output.push("<DIV class=section_hdr>Needed Printings:</div>");
	
	var gList = new Array();
	
	for (i=0; i<masterList.length; i++)
	{
		if (masterList[i].status=="") gList.push(masterList[i]);
	}
	
	if (gList.length==0)
	{
		output.push("<p><b>No cards needed!!!</b></p>");
	}
	else
	{
		output.push("<OL>");
		for (xx=0; xx<gList.length; xx++)
		{
			var L = getLanguage(gList[xx].lang);
			var E = getEdition(gList[xx].edition);
			output.push("<LI>");
			output.push(L.name);
			output.push(" ");
			output.push(E.name);
			output.push("</LI>");
		}
		output.push("</OL>");
	}

	// close out the list
	
	var nDiv = document.getElementById("NEEDED_DIV");
	nDiv.innerHTML = output.join("");

	return(true);
}

function renderOrderedList()
{
	var output = new Array();
	
	output.push("<DIV class=section_hdr>Cards on order:</div>");
	
	var gList = new Array();
	
	for (i=0; i<masterList.length; i++)
	{
		if (masterList[i].status=="o") gList.push(masterList[i]);
	}
	for (i=0; i<specialList.length; i++)
	{
		if (specialList[i].status=="o") gList.push(specialList[i]);
	}

	if (gList.length==0)
	{
		output.push("<p><b>No cards on order!</b></p>");
	}
	else
	{
		output.push("<OL>");
		for (xx=0; xx<gList.length; xx++)
		{
			var L = getLanguage(gList[xx].lang);
			var E = getEdition(gList[xx].edition);
			var D = getDonor(gList[xx].donor);
			
			output.push("<LI>");
			output.push(L.name);
			output.push(" ");
			output.push(E.name);
			output.push(" ");

			if (gList[xx].code != "")
			{
				output.push("<i>");
				output.push(getClassification(gList[xx].code));
				output.push("</i> ");
			}

			output.push("(from ");
			output.push(makeDonorLink(D, "compact"));
			
			if (((D.city != "") && (D.city != "???")) || ((D.country != "") && (D.country != "???"))) {
				output.push(" in ");
			}
			
			if ((D.city != "") && (D.city != "???")) {
				output.push(D.city);
				if ((D.country != "") && (D.country != "???")) {
					output.push(", ");
				}
			}

			if ((D.country != "") && (D.country != "???")) {
				output.push(D.country);
			}
			output.push(")");
			output.push("</LI>");
		}
		output.push("</OL>");
	}

	// close out the list
	
	var oDiv = document.getElementById("ORDERED_DIV");
	oDiv.innerHTML = output.join("");

	return(true);
}

function renderPrintCount(spanid)
{
	var s = document.getElementById(spanid);
	s.innerHTML = " "+ masterList.length + " ";

	return(true);
}

function renderNeedCount(spanid)
{
	var s = document.getElementById(spanid);

	var i;
	var c = 0;

	for (i=0; i<masterList.length; i++)
	{
		if (masterList[i].status=="") c++;
	}

	s.innerHTML = " " + c + " ";

	return(true);
}

function renderFeatured()
{
	var L = getLanguage(featured.lang);
	var E = getEdition(featured.edition);
	var cds = (featured.id == "") ? masterList : specialList;
	var cd;
	var output = new Array();
	
	var k;
	
	for (k=0; k<cds.length; k++)
	{
		if ((cds[k].lang == featured.lang) && (cds[k].edition == featured.edition) && (cds[k].id == featured.id))
		{
			cd = cds[k];
			break
		}
	}
	
	var D = getDonor(cd.donor);
	
	output.push("<DIV ID = \"featured\">");
	output.push("<TABLE width=100%><TR><TD BGCOLOR=DARKRED COLSPAN=2>Featured Card:</TD></TR>");
	output.push("<TR STYLE=\"color:white\">");
	output.push("<TD WIDTH=266 VALIGN=TOP ALIGN=\"CENTER\"><IMG WIDTH=250 HEIGHT=350 SRC=\"");
	output.push(picURL);
	
	if (featured.id != "")
	{
		output.push("SP");
		output.push(featured.lang);
		output.push(featured.edition);
		output.push(featured.id);
	}
	else
	{
		output.push(featured.lang);
		output.push(featured.edition);
	}
	
	output.push(".jpg\" ALT=\"");
	output.push(L.name);
	output.push(" ");
	output.push(E.name);

	if (featured.id != "")
	{
		output.push(" ");
		output.push(getClassification(cd.code));
	}
	output.push("\"></TD><TD VALIGN=MIDDLE ALIGN=LEFT><span class=featuredTitle>");
	output.push(L.name);
	output.push(" ");
	output.push(E.name);

	if (featured.id != "")
	{
		output.push(" ");
		output.push(getClassification(cd.code));
	}
	output.push("</span><br>&nbsp;<HR ALIGN=center WIDTH=95% COLOR=darkred><p><span class=featuredDonor>");
	output.push("Acquired from: <FONT COLOR=DARKORANGE><B>");
	output.push(makeDonorLink(D, "intro"));
	output.push("</b></FONT> of ");
	
	if ((D.city != "???") && (D.city != ""))
	{
		output.push(D.city);
		output.push(", ");
	}
	output.push(D.country);
	output.push("</span></p><p><span class=featuredBlurb>");
	output.push(featured.notes);
	output.push("</span></p></td></tr></table></div>");
	
	// close out the list
	
	var fDiv = document.getElementById("FEATURED_DIV");
	fDiv.innerHTML = output.join("");

	return(true);
}

function renderProjectStatus(e_ID)
{
	var s = document.getElementById(e_ID);
	var i;
	var needed = 0;
	var onorder = 0;
	var owned = 0;
	
	var specialowned = 0;
	var specialonorder = 0;

	for (i=0; i<masterList.length; i++)
	{
		if (masterList[i].status=="") needed++;
		if (masterList[i].status=="o") onorder++;
		if (masterList[i].status=="x") owned++;
	}

	var output = new Array();
	
	output.push("<table bordercolor=white cellpadding=2 cellspacing=0 width=90% border=1 style=\"color:white; font-family: verdana; font-size:10px;\">");
	output.push("<tr><td align=center nowrap><b>Set Size</b></td><td align=center nowrap><b>Owned</b></td><td align=center nowrap><b>On Order</b></td><td align=center nowrap><b>Need</b></td></tr>");
	output.push("<tr style=\"color:yellow;\"><td align=center><b>");
	output.push(masterList.length);
	output.push("</b></td><td align=center><b>");
	output.push(owned);
	output.push("</b></td><td align=center><b>");
	output.push(onorder);
	output.push("</b></td><td align=center><b>");
	output.push(needed);
	output.push("</b></td></tr>");

	for (i=0; i<specialList.length; i++)
	{
		if (specialList[i].status=="o") specialonorder++;
		if (specialList[i].status=="x") specialowned++;
	}

	output.push("<tr><td align=left>");
	output.push("Special:");
	output.push("</td><td align=center>");
	output.push(specialowned);
	output.push("</td><td align=center>");
	output.push(specialonorder);
	output.push("</td><td align=center>");
	output.push("<font style=\"color: gray;\">n/a</font>");
	output.push("</td></tr>");
	output.push("<tr><td align=left>");
	output.push("TOTAL:");
	output.push("</td><td align=center>");
	output.push(specialowned+owned);
	output.push("</td><td align=center>");
	output.push(specialonorder+onorder);
	output.push("</td><td align=center>");
	output.push("&nbsp;");
	output.push("</td></tr>");


	output.push("</table>");
	
	s.innerHTML = output.join("");

	return(true);
}
