/* ----------------------------------------------------------------------------
cartUtil.js:

 This file contains some functions used when AJAXing the cart.
 
 *Notes:
    - You'll need to include the ajax.js file from centralCode/jsLib
    - You'll also need to create your own callbackAddToCart function to handle
      the JSON object returned from the AJAX call to /cart/AJAX/cartAdd.cfm that is made here.
    - The call looks like this: javascript:AddToCart('asep','9780736032438',1,'divId_9780736032438');
    - You'll also need a div to contain the message that looks something like this: <div id="divId_9780736032438"></div>    
    
    1.00.00 jwl 04/21/2007  Created.
    1.00.01 jwl 05/01/2007  Removed the basePath as parameter that's passed in.   
    1.00.02 jwl 05/11/2007  Changed the path from the cart folder to the jslib folder.          
    
---------------------------------------------------------------------------- */    


// AddToCart:
//
// This does an AJAX call to add the item to the cart and 
// displays a message that says the product has been added to the cart.
//
// siteName:    The name the cart uses for the site.
// isbn:        The isbn of the product you want to add to the cart.
// quantity:    The number of these products that you want to add to the cart.
// ajaxInfoDiv: The div that will contain the message returned in the AJAX call.
//
function AddToCart(siteName, isbn, quantity, ajaxInfoDiv) 
{
    var url = "/jslib/cart/cartAdd.cfm?site=" + siteName + "&isbn=" + isbn + "&quantity=" + quantity;  	
    	
	useJSON = true;     // Global variable from ajax.js
    ajax('GET', url, true, callbackAddToCart, ajaxInfoDiv);                       		
	
} // AddToCart


