// JavaScript Document
function fisherYates ( myArray ) { var i = myArray.length; if ( i == 0 ) return false; while ( --i ) { var j = Math.floor( Math.random() * ( i + 1 ) ); var tempi = myArray[i]; var tempj = myArray[j]; myArray[i] = tempj; myArray[j] = tempi; } }
var root_path = "http://www.bnhba.com/";
var name = new Array;
var images = new Array;
var links = new Array;
var alts = new Array;
var emails = new Array;
var expires = new Array;

var numCards = 15;

// date is (year, month -1, day
name[0] = "Propane Plus";
images[0] = root_path + "images/BusinessCards/propanePlus.jpg";
links[0] = "http://www.propaneplus.com";
alts[0] = "Tim Johnson, PO Box 38, 177 Winthrop St., Rehoboth, MA, 02769, 508-252-3359, (fax) 508-252-9944";
emails[0] = "tim@propaneplus.com";
expires[0] = new Date(2013,02,01,0,0,0,0);

name[1] = "Norwood Cooperative Bank";
images[1] = root_path + "images/BusinessCards/norwood_coop.jpg";
links[1] = "http://www.norwoodbank.com";
alts[1] = "We provide Residential Land Acquisition, Development, and Construction Loans plus Construction/Permanent Financing for commercial properties. Lawrence J. Pitman, VP Commercial Lending, 11 Central Street, Norwood, MA, 02062, 781-440-4222, (fax) 781-255-7877";
emails[1] = "none";
expires[1] = new Date(2012,01,01,0,0,0,0);

name[2] = "D.A.Baker Construction Co., Inc.";
images[2] = root_path + "images/BusinessCards/dabaker.jpg";
links[2] = "none";
alts[2] = "Your full service residential specialist since 1959, Custom Homes, Additions, Remodeling, Kitchens, Bathrooms, Windows and More, 65 Neponset St., Foxboro, MA 02035, 508-543-8276, (fax) 508-543-5262";
emails[2] = "dabaker@mindspring.com";
expires[2] = new Date(2012,07,01,0,0,0,0); 

name[3] = "The Bank of Canton";
images[3] = root_path + "images/BusinessCards/bankofcanton.jpg";
links[3] = "http://www.thebankofcanton.com";
alts[3] = "Brian E. Dunn, VP, 557 Washingon St., Canton, MA 02021, 781-828-1690, (fax) 781-828-6824";
emails[3] = "bdunn@thebankofcanton.com";
expires[3] = new Date(2010,06,01,0,0,0,0); 

name[4] = "National Lumber";
images[4] = root_path + "images/BusinessCards/national_lumber_website_ad.jpg";
links[4] = "http://www.national-lumber.com";
alts[4] = "Call 1-800-370-WOOD or click through to our website for more information.";
emails[4] = "mmcdole@national-lumber.com";
expires[4] = new Date(2013,02,01,0,0,0,0); 

name[5] = "Gagnon Consulting, Inc., The Computer Guy";
images[5] = root_path + "/images/BusinessCards/gagnon.gif";
links[5] = "http://www.gagnonconsulting.com";
alts[5] = "Web and IT Soulutions for Your Business, 2035 West Street, Wrentham, MA 02093, Richard Gagnon, 508-876-2721 (office), 781-727-8122 (cell)";
emails[5] = "richard@gagnonconsulting.com";
expires[5] = new Date(2010,08,01,0,0,0,0); 

name[6] = "Horner Millwork";
images[6] = root_path + "images/BusinessCards/horner.jpg";
links[6] = "http://www.hornermillwork.com";
alts[6] = "Windows, Doors, Kitchens, Stairs, Jim Britland,, 1255 G.A.R. Highway, Somerset, MA, 02726, 800-543-5403, 508-679-6479, (direct) 508-235-4327, (fax) 508-235-4434";
emails[6] = "jbritland@hornermillwork.com";
expires[6] = new Date(2011,08,01,0,0,0,0); 

name[7] = "West Wind Development Corp.";
images[7] = root_path + "images/BusinessCards/magri.jpg";
links[7] = "none";
alts[7] = "Real Estate Development, General Contracting, Charles P. Magri, 1 Berkshire Avenue, Norton, MA 02766, 508-286-9378, (fax) 508-285-1990";
emails[7] = "cpmagri@aol.com";
expires[7] = new Date(2006,08,01,0,0,0,0);

name[8] = "Bedrock Granite Company";
images[8] = root_path + "images/BusinessCards/bedrockGranite006.jpg";
links[8] = "http://www.bedrockgranite-ma.com";
alts[8] = "Joe LaPalme, 394 Old Colony Rd., Norton, MA, 508-226-2616, (fax) 508-226-2614, 188 Washington St., Plainville, MA 02762, 508-695-8582, (fax) 508-695-8588, Toll Free 866-940-ROCK";
emails[8] = "none";
expires[8] = new Date(2012,09,01,0,0,0,0);

name[9] = "Austin W. McHoul & Associates, Attorney at Law";
images[9] = root_path + "images/BusinessCards/mchoul009.gif";
links[9] = "none";
alts[9] = "Austin W. McHoul, Attorney, 555 Elm Street, North Attleboro, MA 02760, 508-695-2311, facsimile 508-695-2331";
emails[9] = "amchoul@comcast.net";
expires[9] = new Date(2012,08,01,0,0,0,0);

name[10] = "AMC Construction Co Inc";
images[10] = root_path + "images/BusinessCards/AMC007.gif";
links[10] = "http://www.webuildyourfuture.com/";
alts[10] = "We Build Your Future, Since 1989, Mack Craverio, Freetown, MA, (office) 508-763-8445, (fax) 508-763-8745";
emails[10] = "amcconst@comcast.net";
expires[10] = new Date(2011,08,01,0,0,0,0);

name[11] = "Garys Sealcoating";
images[11] = root_path + "images/BusinessCards/2007/garys.jpg";
links[11] = "none";
alts[11] = "Cracksealing - Patchwork, Neil P. DeGirolamo, PO Box 403, Mansfield, MA 02048, 508-339-8022";
emails[11] = "none";
expires[11] = new Date(2010,06,01,0,0,0,0);

name[12] = "Mechanics Cooperative Bank";
images[12] = root_path + "images/BusinessCards/2008/mechanics_bank.jpg";
links[12] = "http://www.mechanics-coop.com";
alts[12] = "Joseph T. Baptista, Jr., President, CEO, 308 Bay Street, Taunton, MA 02780, 800-MECHANICS (632-4264), 508-823-7744, 508-884-2155, (fax) 508-880-3928";
emails[12] = "jbaptista@mechanics-coop.com";
expires[12] = new Date(2012,03,01,0,0,0,0);

name[13] = "TMG Carpentry";
images[13] = root_path + "images/BusinessCards/2008/tmgcarpentry.jpg";
links[13] = "http://www.tmgcarpentry.com";
alts[13] = "TMG Carpenty, 46 Barrows Street, Norton, MA 02766, HIC registration and CSL licence numbers available upon request, 508-285-5005";
emails[13] = "tom@tmgcarpentry.com";
expires[13] = new Date(2012,09,01,0,0,0,0);

name[14] = "Eastern Propane";
images[14] = root_path + "images/BusinessCards/2010/Larkin.jpg";
links[14] = "http://www.eastern.com";
alts[14] = "Propane Since 1932 - Sales, Service, Construction Heat, Water Heating, Central Home Heating, Pool Heat - Contact Glen Larkin for a no obligation consultation, 978-807-4601 ";
emails[14] = "tom@tmgcarpentry.com";
expires[14] = new Date(2011,08,01,0,0,0,0);



cards = new Array;
today = new Date();
var names_el=0;
var alts_el=1;
var images_el=2;
var links_el=3;
var emails_el=4;
var expires_el=5;

for (i=0; i < numCards; i++ ) {
	cards[i]= new Array (name[i], alts[i], images[i], links[i], emails[i], expires[i] );
}

fisherYates (cards);

document.write('<table width="400px" border="0" cellpadding="3" cellspacing="0" align="center">');
// for each company
total_not_expired = 1;
for (i=0; i < numCards; i++ ) {
	// if not expired
	if (cards[i][expires_el] >= today) {
		total_not_expired++;
		document.write('<tr align="center" valign="middle">');
		// put up the business card image, linking if there is a web site
		if (cards[i][links_el] == "none") {
			document.write('<td><a onclick="alert(\'There is no web site for '+cards[i][names_el]+'\')"><IMG SRC="' + cards[i][images_el] + '" border="0" alt="' + cards[i][names_el] + ', ' + cards[i][alts_el] +'root_path + "a></td>');
		} else {
			document.write('<td><a href="' + cards[i][links_el] + '"target="_blank" ><IMG SRC="' + cards[i][images_el] + '" border="0" alt="' + cards[i][names_el] + ', ' + cards[i][alts_el] +'root_path + "a></td>');
		}
		// in the next cell, put the name of the company and the description
		document.write('</tr><tr><td class="normalSmall"><strong>' + cards[i][names_el] + '</strong><br>' + cards[i][alts_el]);
		// if there is an email address, add the mailto link
		if (cards[i][emails_el] != "none") {
			document.write('<br><a href="mailto:'+cards[i][emails_el]+'">email me</a>');
		}
		// close the cell and the row
		document.write('</td></tr><tr><td><hr></td></tr>');
	}
	// else they are expired
	//else {
		//alert ("today is "+today+", not displaying "+ cards[i][0]+" -expired on "+cards[i][3]);
	//}
}
document.write('</table>');
document.write('<p>There are '+total_not_expired+' member business cards posted on this page.</p>');

