//--------------------------------------------------------------
// AdjItemCnt - Adjust number of items in shopping cart by
//              specified amount.
//--------------------------------------------------------------
function AdjItemCnt(offset)
{
    itemcnt = GetItemCnt() + offset;
    SetCookie("ASTItemCnt",itemcnt);
//alert("in AdjItemCnt, itemcnt=" + itemcnt + " offset=" + offset);
}

//--------------------------------------------------------------
// EmptyCart - Empty shopping cart.
//--------------------------------------------------------------
function EmptyCart()
{
    DeleteCookie("ASTOrderCookie")
    SetCookie("ASTItemCnt",0);
}

//--------------------------------------------------------------
// GetItemCnt - Get count of items in shopping cart.
//--------------------------------------------------------------
function GetItemCnt()
{
    ASTItemCnt = GetCookie("ASTItemCnt");
    if (ASTItemCnt==null) var itemcnt = 0;
    else var itemcnt = parseInt(GetCookie("ASTItemCnt"));
//alert("GetItemCnt, itemcnt=" + itemcnt + " ASTItemCnt=" + ASTItemCnt);    
    return itemcnt;
}

//--------------------------------------------------------------
// SetTimeStamp - Set cookie containing current time in 
//                milliseconds.
//--------------------------------------------------------------
function SetTimeStamp()
{
    var today  = new Date();
//alert ("getTime=" + today.getTime());
    SetCookie("ASTTimeStamp",today.getTime());
}

//--------------------------------------------------------------
// GetTimestamp - Get value of timestamp.
//--------------------------------------------------------------
function GetTimeStamp()
{
    var timestamp = GetCookie("ASTTimeStamp");
    if (timestamp==null) {timestamp = 0;}
    return timestamp;
}