var busy = false;

function Add2ShopCart(productId, quantity, size, sizeName, exploreAttribute) {
	if (!busy) {
		busy = true;
		
		var exploreAttributesEl = document.getElementById("exploreAttributes");
		var exploreAttributes = escape(exploreAttributesEl.value);

		//the currUrl represents the return URL
		currUrl = escape(document.location);
		if(size != null){
			size_CatId = "";
			maxItems = sizeVariants.length;
			for (i = 0; i < maxItems; i++){
				if(sizeVariants[i].sizeVariantId == sizeName){
					size_CatId = sizeVariants[i].variants[size].variantId;
				}
			}
			
			
			
			fullUrl = orderItemAddUrl + "&catEntryId=" + size_CatId + "&productId=" + productId + "&URL=" + currUrl + "&quantity=" + quantity + "&exploreAttributes=" + exploreAttributes;
		} else {
			fullUrl = orderItemAddUrl + "&catEntryId=" + productId + "&productId=" + productId + "&URL=" + currUrl + "&quantity=" + quantity + "&exploreAttributes=" + exploreAttributes;
		}
		document.location = fullUrl;
	}
}

function Add2WishList(catEntryId) {
	if (!busy) {
		busy = true;
		//the currUrl represents the return URL
		currUrl = escape(document.location);
		fullUrl = "InterestItemAdd?catEntryId=" + catEntryId + "&URL=" + currUrl;
		document.location = fullUrl;
	}
}

function Add2FavouriteItems(catEntryId) {
	if (!busy) {
		busy = true;
		//the currUrl represents the return URL
		currUrl = escape(document.location);
		fullUrl = "FavouriteItemAdd?catEntryId=" + catEntryId + "&URL=" + currUrl;
		document.location = fullUrl;
	}
}

