﻿

if (typeof arc != "undefined") {

	arc.addEventListener(arc.Event.APPLICATION, function(event) {
		var slot = event.sourceClientId;
		switch (event.data.kind) {
			case 'displayShown':
				// Fire analytics for first view of presentation
				break;
			case 'addedToCart':
				// Fire analytics for user adding item to cart
				// Payload: event.data.product
				//registerProduct(style,name,color,size,event.data.quantity,sku,price,cartOpen);
				//showBag();
				var intCount = getShoppingBagItemsCount();
				intCount += event.data.quantity;
				setShoppingBagItemsCount(intCount)
				break;
			case 'itemSelected':
				// Fire analytics for user viewing product details in presentation
				// Payload: event.data.product
				break;
			case 'interaction':
				// Fire analytics for generic UI interaction
				// Payload: event.data.action
				break;
			case 'productInfo':
				// Fire analytics for user request for external product info
				// Payload: event.data.product
				// Example: window.location.href = productPageFor(event.data.product);
				break;
			case 'navigateToUrl':
				// Fire analytics for user navigation request for specific URL
				// Payload: event.data.url
				// Example: window.location.href = event.data.url;
				break;
			case 'checkout':
				// Fire analytics for user navigation request for cart/checkout page
				// Example window.location.href = "your checkout page URL";
				break;
		}
	});
}
            

