function qvShowExcludedBubble() {
	$("#quickview_excluded_bubble").remove();
	
	var excludedDetail = 'The dollar value of this item will count toward meeting a required minimum purchase total necessary to receive a discount, but the price of this item itself will not be discounted. Only other eligible items in your cart will be discounted. (Example: You can purchase this product to reach the order threshold to receive a discount, but you will only receive the discount on other eligible items in your cart.)';
		
	var offset = $("#quickview_excludedMessage").offset();
	var left = offset.left - 0;
	var top = offset.top - 170;
	
	$("body").prepend('<div id="quickview_excluded_bubble"><p></p></div>');
	
	$("#quickview_excluded_bubble").css("left", left);
	$("#quickview_excluded_bubble").css("top", top);
	$("#quickview_excluded_bubble").css("opacity", 0.9);
	$("#quickview_excluded_bubble p").html(excludedDetail);
	$("#quickview_excluded_bubble").show();
}

function qvHideExcludedBubble() {
	$("#quickview_excluded_bubble").fadeOut(function() {
		$("#quickview_excluded_bubble").remove();
	});
}

function qvShowFreeShippingBubble() {
	$("#quickview_freeshipping_bubble").remove();
	
	var freeShippingDetail = global_quickViewFreeStandardShippingDetails;
		
	var offset = $("#quickview_freeShipping").offset();
	var left = offset.left - 20;
	var top = offset.top - 285;
	
	$("body").prepend('<div id="quickview_freeshipping_bubble"><p></p></div>');
	
	$("#quickview_freeshipping_bubble").css("left", left);
	$("#quickview_freeshipping_bubble").css("top", top);
	$("#quickview_freeshipping_bubble").css("opacity", 0.9);
	$("#quickview_freeshipping_bubble p").html(freeShippingDetail);
	$("#quickview_freeshipping_bubble").show();
}

function qvHideFreeShippingBubble() {
	$("#quickview_freeshipping_bubble").fadeOut(function() {
		$("#quickview_freeshipping_bubble").remove();
	});
}
		
function viewMoreOtherStyles() {
	$("#quickviewPDP .otherStyles").css("overflow", "auto");
	$("#quickviewPDP .otherStyles a.more").css("display", "inline");
	$("#quickviewPDP .viewMoreStyles").css("display", "none");
}

function validateQuickViewAddToCart(formObj, action) {
	// TODO: Need to validate for integer
	if (formObj.qty && (isNaN($(formObj.qty).val()) || $(formObj.qty).val().length == 0) ) {
		alert("Please enter a valid quantity.");
		return false;
	}
	if (formObj.size && $(formObj.size).val() == "choose") {
		alert("Please select a size.");
		return false;
	}
	//hot sku check
	if (formObj.hotsku_quantity_left != null) {
		if (parseInt($(formObj.qty).val()) > parseInt($(formObj.hotsku_quantity_left).val())) {
		alert("Order quantity is limited on this product to " + $(formObj.hot_launch_max_per_order).val() + " per customer.");
		return false;
		}
	}
	
	if (inlineAddToCartEnabled && action == 'addtocart' && (lineID == undefined || lineID == 0 )) {
		// skip mini add to cart if personalizing or protective_packaging or XForYPromo
		var personalized = ($(formObj.personalization).length && $(formObj.personalization).is(":checked"));
		var protective_packaging = ($(formObj.protective_packaging).length && $(formObj.protective_packaging).is(":checked"));
		var hasXYPromo = ($("#hasXYPromo").length && $("#hasXYPromo").val());
		if (personalized == false && protective_packaging == false && hasXYPromo == "false" && (typeof(qvSourcePage) == "undefined" || qvSourcePage != "shoppingCart") ) {
			miniAddToCart.openMiniAddToCart("quickview_product_form", closeQuickViewWithFade);
			return false;
		}
	}
	
	return true;
}

function displayBackOrderMsg(thisObj) {
	var index = thisObj.selectedIndex;
	
	$("#backorderMsg").html(backorderMsg[index]);
}
