function validatePick3() {							
	var errMsg = "";
	var itemQty = $("#qty").val();	
	
	$("#youpick3_bar1,#youpick3_bar2,#youpick3_bar3").each(function() {																		
		if (this.value == "") {
			errMsg = "Please select a blend for each bar!";
		}
	});																								
	
	//validate qty
	if (!errMsg.length) {		
		if (isNaN(itemQty) || itemQty == '') {				
			errMsg = "Please enter a numeric quantity and try again.";
		}				
	}
								
	if (errMsg.length) {
		alert(errMsg);
		return false;
	}
	else {
		return true;
	}		
}	
							
							
function addPick3(objForm) {
	if (!validatePick3()) return false;
								
	//get blends
	var blend1 = $("#youpick3_bar1").val();
	var blend2 = $("#youpick3_bar2").val();
	var blend3 = $("#youpick3_bar3").val();								
								
	//build parameters
	var params = "method=CreateYouPick3";
	params += "&blend1=" + escape(blend1);
	params += "&blend2=" + escape(blend2);
	params += "&blend3=" + escape(blend3);								
	//alert(params);
	
	//loader
	//$("#pick3Loader").html("please wait...").show();
								
	//lookup product for youpick3
	$.ajax({
		type: "POST",
		url: "/shopping/youpick.cfm",									
		data: params,
		dataType: "html",
		async: false,
		success: function(strProductID, textStatus) {
			//alert(strProductID);
			if (strProductID != "") {
				$("#productID").val(strProductID);												
				addToCart(objForm); //see store_functions.js
				
				//objForm.productID.value = strProductID;
				//objForm.submit();
			}			
			else { //unexpected failure
				alert("An unexpected error occurred while adding your product.  Please try again.  If the problem continues, please contact us!");				
				//$("#pick3Loader").hide();
			}
		},
		error: function(XMLHttpRequest, textStatus, errorThrown){						
			alert("An unexpected error occurred.  Please try again.  If the problem continues, please contact us!")
			//$("#pick3Loader").hide();
		}									
	}); //$.ajax({																																																				
}
