    var totals = new Array(0, 0, 0, 0, 0, 0);

    function GetProductPrice(rownum)
    {
        select = document.getElementById('productid_' + rownum);
        id = select.options[select.selectedIndex].value;
        
        if (id == '')
        {
            price = 0;
        }
        else
        {
            price = prices[id];
        }
        
        productPrice = document.getElementById('price' + rownum);
        quantity = document.getElementById('quantity' + rownum);
        total = document.getElementById('total' + rownum);
        ttls = document.getElementById('ttl');
        sent_total = document.getElementById('total_price');
        
        quant = Number(quantity.value);
        
        productPrice.innerHTML = ("&nbsp;&nbsp;$" + price.toFixed(2));
        cost = (price * quant);
        total.innerHTML = ("&nbsp;&nbsp;$" + cost.toFixed(2));
        
        finalCost = 0;
        totals[rownum] = cost;
        for(p = 1; p <= 5; p++)
        {
            finalCost = finalCost + totals[p];
        }
        
        ttls.innerHTML = "&nbsp;&nbsp;$" + finalCost.toFixed(2);
        sent_total.value = "$" + finalCost.toFixed(2);
        
    }
    
    function NewLine()
    {
        count = count + 1;
        var tblBody = document.getElementById('datatable').tBodies[0];
        var newNode = tblBody.rows[0].cloneNode(true);
        newNode.style.visibility="visible";
        tblBody.appendChild(newNode);
    }

