/*
C-note$ -- Hundred-dollar auctions of noteworthy Carpenters items
(featured message in KC RAM, newsletter of the Karen Carpenter Remembrance Page)
*/

// month covered:
var cnmonth = "January";

// intro/summary: -- if not blank, include "<br>&nbsp; &nbsp; &nbsp;" at end
var cnintro = "Several of the new 35th-Anniversary limited edition boxed sets were auctioned last month, in addition to three autographed LP albums. The price of each set was at or near $300, while one of the autographed LPs sold for over $200.<br>&nbsp; &nbsp; &nbsp;Apart from these, a Carpenters photo booklet was the only other known item that reached the century mark.<br>&nbsp; &nbsp; &nbsp;";


// table listing:

// date
// auction site
// number/ID
// item
// quoted description
// # bidders
// sold for <span style=\"font-size: .8em;\"><br>GBP 100.00</span>
// remarks

var cni = new Array();
var cnj = -1;

cni[++cnj] = new Array(); var cnk = -1;
cni[cnj][++cnk] = "1/18/04";
cni[cnj][++cnk] = "eBay";
cni[cnj][++cnk] = "3377586125";
cni[cnj][++cnk] = "CARPENTERS SIGNED NOW & THEN ALBUM";
cni[cnj][++cnk] = "signed vinyl record album cover (includes the vinyl LP) FROM CARPENTERS LP ENTITLED \"NOW AND THEN\" autographed in person by RICHARD CARPENTER AND KAREN CARPENTER....AUTHENTIC AUTOGRAPHS is comprised of a group of twelve collectors that began pooling their resources to help one another about five years ago. The funds received are used to help our members further their abilities to get quality autographs from the stars they adore and follow.";
cni[cnj][++cnk] = "10";
cni[cnj][++cnk] = "US $202.50";
cni[cnj][++cnk] = "private auction & seller";

cni[++cnj] = new Array(); var cnk = -1;
cni[cnj][++cnk] = "1/23/04";
cni[cnj][++cnk] = "eBay";
cni[cnj][++cnk] = "3378652666";
cni[cnj][++cnk] = "THE CARPENTERS A4 SIZE GLOSSY BOOKLET";
cni[cnj][++cnk] = "Glossy A4 sized booklet of The Carpenters - In good condition with lots of nice colour and B&W photos of this great singing duo from the 70s & 80s";
cni[cnj][++cnk] = "18";
cni[cnj][++cnk] = "US $102.11<span style=\"font-size: .8em;\"><br>GBP 56.00</span>";
cni[cnj][++cnk] = "";

cni[++cnj] = new Array(); var cnk = -1;
cni[cnj][++cnk] = "1/23/04";
cni[cnj][++cnk] = "eBay";
cni[cnj][++cnk] = "2589326857";
cni[cnj][++cnk] = "Japan 13 Mini lp CD Box CARPENTERS Sealed";
cni[cnj][++cnk] = "The CARPENTERS' 35th Aniversary Box contains; 13 paper sleeve jacket CDs +Original Box +Original Booklet +Original Handkerchief. Not like the 30th Box, two Christmas albums are available in the box. MINT CONDITION. FACTORY SEALED....The serial number is 000440....\"CARPENTERS 35TH ANNIVERSARY COLLECTOR'S EDITION\" 1.THE OFFERING (1969) 2.CLOSE TO YOU(1970) 3.CARPENTERS(1971) 4.A SONG FOR YOU(1972) 5.NOW AND THEN(1973) 6.HORIZON(1975) 7.A KIND OF HUSH(1976) 8.PASSAGE (1977) 9.CHRISTMAS PORTRAIT(1978) 10.MADE IN AMERICA(1981) 11.VOICE OF THE HEART(1983) 12.AN OLD-FASHIONED CHRISTMAS(1984) 13.LOVELINES(1989)";
cni[cnj][++cnk] = "1";
cni[cnj][++cnk] = "US $295.00";
cni[cnj][++cnk] = "";

cni[++cnj] = new Array(); var cnk = -1;
cni[cnj][++cnk] = "1/24/04";
cni[cnj][++cnk] = "eBay";
cni[cnj][++cnk] = "2588945416";
cni[cnj][++cnk] = "Carpenters Japan exclusive 13 CD Box Set Lmtd";
cni[cnj][++cnk] = "Carpenters 13 CD Japan Exclusive Box set in Gold Embossed Flip Top Box Limited to 2000 copies. - UICY-9345/57 - Recently released Carpenters Box Set includes all 11 studio albums and 2 Christmas albums. It also includes a booklet and handkerchief with Carpenter's logo. This is limited to 2,000 copies. The 13 CDs were remastered in 1990 and are packaged in mini-LP covers. All of the mini-LPs are encased in a gold embossed leather flip top box. This is still sealed and in great condition. - CDs Included: 1. Offering 2. Close To You 3. Carpenters 4. Bless The Beasts And The Children 5. A Song For You 6. Now & Then 7. Horizon 8. A Kind Of Hush 9. Passage 10. Christmas Portrait 11. Made In America 12. Voice Of The Heart 13. An Old Fashioned Christmas";
cni[cnj][++cnk] = "1";
cni[cnj][++cnk] = "US $300.00";
cni[cnj][++cnk] = "";

cni[++cnj] = new Array(); var cnk = -1;
cni[cnj][++cnk] = "1/26/04";
cni[cnj][++cnk] = "eBay";
cni[cnj][++cnk] = "2591764656";
cni[cnj][++cnk] = "CARPENTERS 35th Aniversary Box JAPAN MINI LP";
cni[cnj][++cnk] = "Recently released Carpenters Box Set , very limited. the LTD erial number is printed on the bottom - 000709) The 13 CDs are packaged in mini-LP covers. - CDs Included: 1. Offering 2. Close To You 3. Carpenters 4. Bless The Beasts And The Children 5. A Song For You 6. Now & Then 7. Horizon 8. A Kind Of Hush 9. Passage 10. Christmas Portrait 11. Made In America 12. Voice Of The Heart 13. An Old Fashioned Christmas.";
cni[cnj][++cnk] = "1";
cni[cnj][++cnk] = "US $294.99";
cni[cnj][++cnk] = "";

cni[++cnj] = new Array(); var cnk = -1;
cni[cnj][++cnk] = "1/27/04";
cni[cnj][++cnk] = "eBay";
cni[cnj][++cnk] = "3379507587";
cni[cnj][++cnk] = "Carpenters signed/autographed LP w/COA";
cni[cnj][++cnk] = "This is the Close To You LP and has been signed by Richard Carpenter and Karen Carpenter. The LP is in great condition with very little wear....COA: Issued by Nancy Sullivan - Musik Memorabilia - Hartford, Conn.";
cni[cnj][++cnk] = "27";
cni[cnj][++cnk] = "US $107.50";
cni[cnj][++cnk] = "private auction & seller";

cni[++cnj] = new Array(); var cnk = -1;
cni[cnj][++cnk] = "1/29/04";
cni[cnj][++cnk] = "eBay";
cni[cnj][++cnk] = "2590996092";
cni[cnj][++cnk] = "THE CARPENTERS-JAPANESE BOX SET RARE CD SET";
cni[cnj][++cnk] = "THE CARPENTERS-THE 35TH.ANNIVERSARY COLLECTORS BOX SET.A&M UICY-9345/57 JAPAN....FACTORY SEALED JAPANESE MINI LP SLEEVE BOX SET,ALL BRAND NEW IN ALL WAYS.THE LKP SLEVE CD SET CONTAINS ALL OF THE CARPENTERS STUDIO RELEASES.ALL WITH STATE OF THE ART IN SOUND AND QUALITY.THE CD SET CONTAINS THE LINER NOTES IN JAPANESE AND ENGLISH AND ALL VERY RARE!THE CD BOX SET IS AN 13 CD BOX SET";
cni[cnj][++cnk] = "1";
cni[cnj][++cnk] = "US $299.99";
cni[cnj][++cnk] = "";

cni[++cnj] = new Array(); var cnk = -1;
cni[cnj][++cnk] = "1/30/04";
cni[cnj][++cnk] = "eBay";
cni[cnj][++cnk] = "3381220610";
cni[cnj][++cnk] = "SIGNED CARPENTERS Karen Richard Carpenter LP";
cni[cnj][++cnk] = "AUTOGRAPHED CARPENTERS A KIND OF HUSH ALBUM; KAREN CARPENTER, RICHARD CARPENTER....HANDSIGNED CARPENTERS A KIND OF HUSH LP BY KAREN CARPENTER AND RICHARD CARPENTER! SIGNED IN PEN AND MARKER! SIGNATURES ARE CLEAR AND BEAUTIFUL....The jacket artwork is an incredible masterpiece that was way ahead of it's time. The inner sleeve has a Carpenters photo on one side and the song lyrics to all the tracks on the other. The album also features \"I Need To Be In Love\" with its melancholy John Bettis lyrics, this became Karen's favorite \"Carpenters\" song....A KIND OF HUSH - SP-4581 - A&M RECORDS 1976";
cni[cnj][++cnk] = "17";
cni[cnj][++cnk] = "US $102.50";
cni[cnj][++cnk] = "private auction";


var alltotal = 0;
var phighest = 0;
var plowest = 9999999;
var pval = new Array();
   for (t = 0; t < cni.length; t++) {
   var usd = convertUSD(cni[t][6]);
   alltotal += usd;
   pval[t] = usd;
   var plowest = (usd < plowest) ? usd : plowest;
   var phighest = (usd > phighest) ? usd : phighest;
   }
var usdtotal = CurrencyFormatted(alltotal);
var usdtotal = CommaFormatted(usdtotal);
var usdavg = CurrencyFormatted(alltotal/cni.length);
var usdavg = CommaFormatted(usdavg);
var usdlowest = CurrencyFormatted(plowest);
var usdlowest = CommaFormatted(usdlowest);
var usdhighest = CurrencyFormatted(phighest);
var usdhighest = CommaFormatted(usdhighest);

var ilowest = new Array();
var iln = -1;
var ihighest = new Array();
var ihn = -1;
   for (t = 0; t < pval.length; t++) {
      if (pval[t] == plowest) {
      ilowest[++iln] = t;
      }
      if (pval[t] == phighest) {
      ihighest[++ihn] = t;
      }
   }

var lweach = "";
var ll = ilowest.length;
   if (ll > 1) {
   var lweach = " each";
   var lshow = "s are ";
      for (k = 0; k < ll-1; k++) {
      var commasep = (k > 0) ? ", " : "";
      var lshow = lshow + commasep + "\"" + cni[ilowest[k]][3] + "\" (" + cni[ilowest[k]][0] + ")";
      }
   var lshow = lshow + " and \"" + cni[ilowest[ll-1]][3] + "\" (" + cni[ilowest[ll-1]][0] + ")";
   }
   else {
   var lshow = " is \"" + cni[ilowest[0]][3] + "\" (" + cni[ilowest[0]][0] + ")";
   }
var hweach = "";
var hl = ihighest.length;
   if (hl > 1) {
   var hweach = " each";
   var hshow = "s are \"";
      for (k = 0; k < hl-1; k++) {
      var commasep = (k > 0) ? ", " : "";
      var hshow = hshow + commasep + "\"" + cni[ihighest[k]][3] + "\" (" + cni[ihighest[k]][0] + ")";
      }
   var hshow = hshow + " and \"" + cni[ihighest[hl-1]][3] + "\" (" + cni[ihighest[hl-1]][0] + ")";
   }
   else {
   var hshow = " is \"" + cni[ihighest[0]][3] + "\" (" + cni[ihighest[0]][0] + ")";
   }

function showItems() {
   if (cni.length < 2) {
      if (cni.length < 1) {
      var cnhighlowdescr = 'No final bids of at least $100 on any Carpenters items were found for ' + cnmonth;
      }
      else {
      var cnhighlowdescr = 'Below is the only final bid of at least $100 on a Carpenters item found for ' + cnmonth;
      }
   }
   else {
   var cnhighlowdescr = 'Below are all final bids of at least $100 on Carpenters items found for ' + cnmonth + '. ';
      if (usdhighest == usdlowest) {
      var cnhighlowdescr = cnhighlowdescr + 'The ' + cni.length + ' listed sold for $' + usdhighest + hweach;
      }
      else {
      var cnhighlowdescr = cnhighlowdescr + 'Of the ' + cni.length + ' listed, the highest priced item' + hshow + ', which sold for $' + usdhighest + hweach + '. The lowest priced one' + lshow + ', which sold for a mere $' + usdlowest + lweach;
      }
   }
document.write(cnintro + cnhighlowdescr + '.<br><br><table width="100%" style="font-family: arial; font-size: .8em;" cellpadding="2" cellspacing="0" border="0"><tr><td></td><td colspan="4" height="1" bgcolor="#dddddd"></td></tr><tr valign="bottom"><td align="center"><i>Date</i><br></td><td align="center" bgcolor="#dddddd"><i>Site</i><br></td><td bgcolor="#eeeeee" class="cnitem"><i>Item</i><br></td><td align="center" bgcolor="#dddddd"><i>Bids</i><br></td><td nowrap align="right" bgcolor="#dddddd" class="cnsold"><i>Sold for</i><br></td></tr><tr bgcolor="#dddddd" valign="top"><td colspan="2" align="center"><i>Number/ID</i><br></td><td colspan="3" bgcolor="#eeeeee"><i><span class="cndesc">Description </span><span class="cnrmks">& remarks</span></i><br></td></tr><tr><td colspan="2"></td><td colspan="3" height="1" bgcolor="#bbbbbb"></td></tr><tr><td colspan="5" height="1"></td></tr>');
   for (j = 0; j < cni.length; j++) {
   document.write('<tr><td></td><td colspan="4" height="1" bgcolor="#eeeedd"></td></tr><tr valign="top"><td align="center">' + cni[j][0] + '<br></td><td bgcolor="#eeeedd"><a href="http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=' + cni[j][2] + '">' + cni[j][1] + '</a><br></td><td bgcolor="#ffffee" class="cnitem">' + cni[j][3] + '<br></td><td align="center" bgcolor="#eeeedd">' + cni[j][5] + '<br></td><td nowrap align="right" bgcolor="#eeeedd" class="cnsold">' + cni[j][6] + '<br></td></tr><tr valign="top"><td colspan="2" align="center" bgcolor="#eeeedd">' + cni[j][2] + '<br></td><td colspan="3" rowspan="2" bgcolor="#ffffee"><dl><dt class="cndesc">' + cni[j][4] + '<dd class="cnrmks">' + cni[j][7] + '<br></td></tr><tr><td colspan="2">&nbsp;</td></tr><tr><td colspan="2"></td><td colspan="3" height="1" bgcolor="#ccccbb"></td></tr>');
   }
document.write('</table>' + listTotals());
}

function convertUSD(usdval) {
var ppcents = usdval.indexOf(".");
var ppdols = usdval.indexOf("$");
var susd = usdval.substring(ppdols+1,ppcents+3);
return eval(susd);
}

function listTotals() {
var cntotals = (cni.length < 2) ? '' : '<table width="100%" style="font-family: arial; font-size: .8em;"><tr valign="top"><td>' + cni.length + ' items<br></td><td align="right" class="cnsold"><i>total:&nbsp;</i> US $' + usdtotal + '<span style="font-size: .9em; font-weight: normal;"><br><i>average:&nbsp;</i> US $' + usdavg + '</span><br></td></tr></table>';
return cntotals;
}

// following 2 functions found at:
// http://devwebprocanada.com/devwebproca-44-20030520CurrencyFormattingandPuttingCommasInNumbers.html

function CurrencyFormatted(amount)
{
var i = parseFloat(amount);
if(isNaN(i)) { i = 0.00; }
var minus = '';
if(i < 0) { minus = '-'; }
i = Math.abs(i);
i = parseInt((i + .005) * 100);
i = i / 100;
s = new String(i);
if(s.indexOf('.') < 0) { s += '.00'; }
if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
s = minus + s;
return s;
}
// end of function CurrencyFormatted()

function CommaFormatted(amount)
{
var delimiter = ","; // replace comma if desired
var a = amount.split('.',2)
var d = a[1];
var i = parseInt(a[0]);
if(isNaN(i)) { return ''; }
var minus = '';
if(i < 0) { minus = '-'; }
i = Math.abs(i);
var n = new String(i);
var a = [];
while(n.length > 3)
{
var nn = n.substr(n.length-3);
a.unshift(nn);
n = n.substr(0,n.length-3);
}
if(n.length > 0) { a.unshift(n); }
n = a.join(delimiter);
if(d.length < 1) { amount = n; }
else { amount = n + '.' + d; }
amount = minus + amount;
return amount;
}
// end of function CommaFormatted()

/*
URL for item list:

http://search-completed.ebay.com/search/search.dll?MfcISAPICommand=GetResult&ht=1&query2=carpenters&search_option=1&submit=+Search+&minPrice=100&maxPrice=&category0=&srchdesc=y&completedOnly=30&exclude=&st=&SortProperty=MetaEndSort&maxRecordsPerPage=50&worldlocation=ebayavail&region=0&available_to=1&located_in=1&ebaycurr=&siteid=0&query=carpenters&shortcut=&ebaytag1code_tmp=&ebaytag1_tmp=&ebaytag1code=&ebaytag1=&ebaytag12=ebayreg&from=R6
*/
