function drawStack(context, value, color, w, h, dX, dY, sX, sY){ //var value = document.getElementById(value).value; var c = document.getElementById(context); var ctx = c.getContext("2d"); var width = w; var height = h; var distanceX = dX; var distanceY = dY+1; var shiftX = sX; var shiftY = sY; ctx.clearRect(0, 0, 300, 300); ctx.beginPath(); // determine number of whole coins (1 coin = 100 ECUs) nFullCoin = (value - (value%100))/100; /////// draw full coins var currentTower = 0; var currentLevel = -1; for(var i=0; i