﻿function postProduct(lblCartStatClientID,ctlAmount,productId,action)
{
    var strlblCartStatClientID;
    var strQty;
    var strProduct;
    
    if ((lblCartStatClientID!=null)&&(lblCartStatClientID!=""))
    {
        strlblCartStatClientID = "&RefererControl=" + lblCartStatClientID;
    }
    
    if ((ctlAmount!=null)&&(ctlAmount!=""))
    {
        var qty = document.getElementById(ctlAmount).value;
        strQty = "&Qty=" + qty;
    }
    else
        strQty="&Qty=1";
    
    strProduct = "?productid=" + productId;
    
    if (action==1)
        parent.Header1_iFrameAddToCart.location = "AddtoCartFla.aspx" + strProduct + strQty + strlblCartStatClientID;
    else
        window.location="AddtoCart.aspx" + strProduct + strQty;
}
