﻿// JScript File
function OnQuantityChanged(obj)
{
    var costField = document.getElementById("TotalCost");
    if(isNaN(obj.value) || obj.value.indexOf(".") > -1)
    {
        obj.value = "";
        if(costField)
            costField.innerText = "";//IE DOM
            costField.textContent = "";//W3 DOM
        return;
    }
    
    if(costField)
    {
        var priceEach = 89.99;
        var qty  = parseInt(obj.value);
        if(qty > 5 && qty < 16)
        {
            priceEach = 79.99;
        }
        if(qty > 15)
        {
            priceEach = 69.99;
        }
        var priceExtended = qty * priceEach;
        costField.innerText = priceExtended.toFixed(2);//IE
        costField.textContent = priceExtended.toFixed(2);//W3
    }
}

function SetSelectedTabStrip(tabID)
{
    var tabItem = document.getElementById(tabID);
    if(tabItem)
    {
        tabItem.className='Selected';
    }
}
