var values = [];
values[0] = "A year ago";
values[1] = "jobs";
values[2] = "economy";
values[3] = "Republicans";
values[4] = "Democrats";
values[5] = "improve education";
values[6] = "innovation";
values[7] = "industry";
values[8] = "infrastructure";
values[9] = "economic base";
values[10] = "government debt";
values[11] = "government reform";
values[12] = "cut spending";
values[13] = "Rep. Gabrielle Giffords";
values[14] = "China";
values[15] = "Afghanistan";
values[16] = "Iraq";
values[17] = "government unity";
values[18] = "work together";
values[19] = "winning the future";
values[20] = "competition";
values[21] = "a new direction";
values[22] = "invest in the future";
values[23] = "public works";
values[24] = "responsible governing";
values[25] = "Social Security";
values[26] = "health care reform";
values[27] = "tax reform";
values[28] = "technology";
values[29] = "unemployment";
values[30] = "Tea Party";
values[31] = "Oprah";
values[32] = "compete globally";
values[33] = "sense of pride";
values[34] = "pledge";
values[35] = "investments";
values[36] = "stimulus";
values[37] = "immigration reform";
values[38] = "heroes";
values[39] = "auto industry";
values[40] = "bailout";
values[41] = "veto";
values[42] = "reaching out";
values[43] = "Medicare";
values[44] = "Camera shot of Michelle Obama";
values[45] = "Only half of the audience applauds";
values[46] = "Camera shot of one person sitting while everyone else stands";
values[47] = "Sputnik";
values[48] = "Camera shot of Democrats and Republicans sitting together";
values[49] = "Tucson";
values[50] = "the American family";
values[51] = "I believe";
values[52] = "Calling any Kennedy by name";
values[53] = "Ronald Reagan";
values[54] = "the American dream";
values[55] = "Facebook";
values[56] = "Twitter";
values[57] = "Google";
values[58] = "Internet";
values[59] = "Any URL";
values[60] = "high-speed rail";
values[61] = "bipartisan";
values[62] = "Speaker John Boehner cries";


function createBingoCard(notfirst) {
	// Local copy of the values array
            var cardvalues = values.slice();

            card = document.getElementById('card');
            if (!card) {
                //alert("Can't find bingocard table")
                return;
            }

            var h2 = document.createElement("h2");
            if (notfirst) {
h2.className = "notfirst";
}
            card.appendChild(h2);

            // IE needs this to be explicit
            var ctable = document.createElement("table");
            card.appendChild(ctable);
            if (notfirst) {
ctable.className = "notfirst";
}
            var tbody = document.createElement("tbody");
            ctable.appendChild(tbody);
            card = tbody;

            var headrow = document.createElement("tr");
            var cell, textelem;
            cell = document.createElement("th"); textelem = document.createTextNode("B");
            cell.appendChild(textelem); headrow.appendChild(cell);
            cell = document.createElement("th"); textelem = document.createTextNode("I");
            cell.appendChild(textelem); headrow.appendChild(cell);
            cell = document.createElement("th"); textelem = document.createTextNode("N");
            cell.appendChild(textelem); headrow.appendChild(cell);
            cell = document.createElement("th"); textelem = document.createTextNode("G");
            cell.appendChild(textelem); headrow.appendChild(cell);
            cell = document.createElement("th"); textelem = document.createTextNode("O");
            cell.appendChild(textelem); headrow.appendChild(cell);
            card.appendChild(headrow);

            for (var row=0; row<5; ++row) {
                var rowelem = document.createElement("tr");
                for (var col=0; col<5; ++col) {
                    cell = document.createElement("td");

                    if (row == 2 && col == 2) {
                        // Center space
                        cell.className = 'free';
                        var imgelem = document.createElement('img');
                        imgelem.src = 'seal.jpg';
                        cell.appendChild(imgelem);
                    } else {
                        var v = Math.floor( Math.random() * cardvalues.length );
                        var text = cardvalues.splice(v, 1);
                        textelem = document.createTextNode(text);
                        cell.appendChild(textelem);
                    }

                    rowelem.appendChild(cell);
                }
                card.appendChild(rowelem);
            }
        }
        function createManyBingoCards(n) {
            // Clear first
            card = document.getElementById('card');
            if (!card) { return; }
            card.innerHTML = "";

            var num = new Number(n);
            if (num != Number.NaN && num > 0) {
                for (var i=0; i<num; ++i) {
                    createBingoCard( (i!==0)?1:0 );
                }
            }

        }

