The passage isn't rendered at the time the window.onload event triggers. To trigger the image to be updated when the passage is rendered you'll want to put code in your passage like this:
<<script>>
$(document).one(":passagerender", function (ev) {
var num = Math.floor(Math.random() * (setup.tableCard.length+1));
$(ev.content).find("#table-card").attr("src", setup.cards[num]);
});
<</script>>
That uses the jQuery .attr() method to set the source of the "table-card" image.
Also, to avoid any possible scope problems (problems where something is defined in one location, but not the location you're currently working in), you should also move your "cards" variable onto the setup object in your JavaScript section like this:
setup.cards = ["images/uno/back-card.png", "images/uno/blue-5.png",
"images/uno/blue-7.png", "images/uno/blue-9.png",
"images/uno/blue-plus2.png", "images/uno/blue-skip.png",
"images/uno/green-1.png", "images/uno/green-3.png",
"images/uno/green-4.png", "images/uno/green-6.png",
"images/uno/green-skip.png", "images/uno/red-0.png",
"images/uno/red-1.png", "images/uno/red-2.png",
"images/uno/red-3.png", "images/uno/red-skip.png",
"images/uno/red-0.png", "images/uno/yellow-2.png",
"images/uno/yellow-5.png", "images/uno/yellow-8.png",
"images/uno/yellow-9.png", "images/uno/yellow-plus2.png",
"images/uno/plus4.png", "images/uno/wild.png"];
A scope problem is also why you're having trouble calling your drawCard() function. Rewrite it like this and it will have a global scope:
window.drawCard = function () {
alert("hi");
};
Alternately, you could put it on the setup object, which also has global scope, like this:
setup.drawCard = function () {
alert("hi");
};
though in this case you'd have to call that using "setup.drawCard()", instead of just "drawCard()" like you would if you put it on the window object.
Hope that helps! :-)