
function shoppingCart_choice() {
	var oEl;
	clearSectionError("productNotification");
	if (oEl = document.getElementById("productNotification.messageContainer")) oEl.style.display="none";
	if (oEl = document.getElementById("productNotification.formContainer")) oEl.style.visibility="visible";
		
	oFloatingWindow.addContentType("productNotification","Selected Product Is Unavailable",document.getElementById("productNotification.container"));
	oFloatingWindow.show("productNotification");
}

/*-------------------------------------------------------------------------------
Add Product
-------------------------------------------------------------------------------*/
function shoppingCart_addProduct() {
	var oCartForm, oRadio;
	if (oCartForm = document.getElementById("addToCart.form")) {
		oFloatingWindow.addContentType("productAdd","Selected Product Has Been Added",document.getElementById("productAdd.container"));
		oFloatingWindow.show("productAdd");
		
		oFloatingWindow.showWait();
		(new ckAjaxObj()).postForm(oCartForm,ajaxReturnHandler_shoppingCart)
	}
}
function ajaxReturnHandler_shoppingCart() {
	var oEl;
	oFloatingWindow.clearMessage();
	if (oEl = document.getElementById("productAdd.messageContainer")) {
		oEl.style.display="block";
		if (oEl = document.getElementById("productAdd.messageText"))
			oEl.innerHTML = "Thank You. The item has been added to your shopping cart.";
	}
	if (oEl = document.getElementById("productAdd.formContainer")) oEl.style.visibility="hidden";
}
/*-------------------------------------------------------------------------------
Email When Product Available
-------------------------------------------------------------------------------*/
function productNotification_submit(oForm) {
	if (oForm) {
		var invalidSections = "";
		invalidSections += (validateSection(oForm,"productNotification",sectionErrors_productNotification) ? "" : "Email, ")
		
		if (invalidSections=="") {
			var oCartForm, oRadio;
			if (oCartForm = document.getElementById("addToCart.form")) {
				if (oRadio = getSelectedRadio(oCartForm.product)) oForm.product.value = oRadio.value;
				oFloatingWindow.showWait();
				oAjax.postForm(oForm,ajaxReturnHandler_productNotification)
			}
		} else return evalSubmission(oForm,invalidSections);
	}
}
function sectionErrors_productNotification(oForm,sectionID) {
	var errorStr = "";
	var blankErr = "";
	var invalidErr = "";
	switch (sectionID) {
		case "productNotification" :
			blankErr += checkBlankField("Email",oForm.email);
			invalidErr += checkValidField("Email",oForm.email)
			break;
	}
		
	return evalErrors(blankErr,invalidErr);
}

function ajaxReturnHandler_productNotification() {
	var oEl;
	oFloatingWindow.clearMessage();
	if (oEl = document.getElementById("productNotification.messageContainer")) {
		oEl.style.display="block";
		oEl.innerHTML = "Thank You. We have received your request.";
	}
	if (oEl = document.getElementById("productNotification.formContainer")) oEl.style.visibility="hidden";
}


/*-------------------------------------------------------------------------------
Show Cart
-------------------------------------------------------------------------------*/
function shoppingCart_show() {
	var oEl;
	/*
	clearSectionError("sendToFriend");
	if (oEl = document.getElementById("infoContainer.sendToFriend")) oEl.style.display="none";
	if (oEl = document.getElementById("formContainer.sendToFriend")) oEl.style.visibility="visible";
	*/	
	oFloatingWindow.addCloseHandler(shoppingCart_closeHandler);
	oFloatingWindow.addContentType("shoppingCart","Shopping Cart",document.getElementById("shoppingCart.container"));
	oFloatingWindow.show("shoppingCart");
}
function shoppingCart_closeHandler() {
}
/*-------------------------------------------------------------------------------
Show Supp Facts
-------------------------------------------------------------------------------*/
function showSuppFacts() {
	oFloatingWindow.addContentType("suppFacts","",document.getElementById("suppFacts.container"));
	oFloatingWindow.show("suppFacts");
}

