//
//-------------------------------------------------------------------
// Licensed Materials - Property of IBM
//
// WebSphere Commerce
//
// (c) Copyright IBM Corp. 2006
//
// US Government Users Restricted Rights - Use, duplication or
// disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
//-------------------------------------------------------------------
//

/**********************************************************
* Function to add a catEntry to the shopping cart. Used in conjunction
* with CatalogEntryThumbnailDisplay.jspf. 
*
*	Parameters:
*	catEntryIdentifier - the identifier of the catalog entry element
* storeId - the store identifier
* catalogId - the catalog identifier
* langId - the language identifier
**********************************************************/
function Add2ShopCartAjax(catEntryIdentifier, storeId, catalogId, langId)
{
			var params = [];
			params.storeId		= storeId;
			params.catalogId	= catalogId;
			params.langId			= langId;
			params.orderId		= ".";
			params.catEntryId	= catEntryIdentifier;
			params.quantity		= "1";

			wc.service.invoke("AjaxAddOrderItem", params);
			objAddToCartMessage = eval(document.getElementById('AddedToCartMessage_' + catEntryIdentifier));
			objAddToCartMessage.innerHTML = "Added to Order";
			cursor_wait();
}
		
/**********************************************************
* Function to add a catEntry to the wish list. Used in conjunction
* with CatalogEntryThumbnailDisplay.jspf. 
*
*	Parameters:
*	catEntryIdentifier - the identifier of the catalog entry element
* storeId - the store identifier
* catalogId - the catalog identifier
* langId - the language identifier
**********************************************************/
function Add2WishListAjax(catEntryIdentifier, storeId, catalogId, langId)
{

		var params = [];
		params.storeId		= storeId;
		params.catalogId	= catalogId;
		params.langId			= langId;
		params.catEntryId	= catEntryIdentifier;
		params.URL = "SuccessfulAJAXRequest";
		wc.service.invoke("AjaxInterestItemAdd", params);
		cursor_wait();
}

/**********************************************************
* Function to add a catEntry to the compare zone.
*
*	Parameters:
*	catEntryIdentifier - the identifier of the catalog entry element
**********************************************************/
function Add2CompareAjax(catEntryIdentifier, dragImagePath , url) 
{
	if(storeAccordionJS != null)
		storeAccordionJS.Add2CompareAjaxWith(catEntryIdentifier, dragImagePath , url);
}


