	//call back error handler
		function onCallbackError(excString)
		{
			alert('Cart Error: ' + excString); 
		}
		
		 function validate()
        {
			    if (isNaN(document.getElementById('tbQty').value))
			    {
				    alert("Invalid Quantity");
				    return false;
			    }
         }
         
           // document.getElementById(..) 
		    function $(id)
		    {
			    return document.getElementById(id);
            }
         
		 function getItems()
			{
				var params = '';
				try
				{
				//alert("in");
					//build params
					var isDone = false;
					var i = 1;
					//reference total items textbox in my cart control
					var tbMyCartTotalItems = document.getElementById("Header_MyCart_lblItems");
					var myCartTotalItems = 0;
					do
					{							
						var tbItemID = document.getElementById("dlCartItems__ctl" + i + "_tbItemId");
						//alert(tbItemID.value);
						var tbQty = document.getElementById("dlCartItems__ctl" + i + "_tbQty");
						//alert(tbQty.value);
						if (tbItemID == null)
						{
							isDone = true;
						} else {
							params += (tbItemID.value + '=');
							params += (tbQty.value + ';');
							myCartTotalItems += eval(tbQty.value);
							//alert (params);
							i += 1;
						}
					} while(!isDone);
					//update myCart control total
					 tbMyCartTotalItems.innerHTML = myCartTotalItems;
					//alert(params);
				} catch(ex) {
					//alert (ex.description);
					
				} finally {
					return params;
				}
			}
         
		//update qty for a given cart item
		function updateCart()
		{
			//reset error control
			if (document.getElementById('ErrorControlFrontEnd_plError') != null)
				document.getElementById('ErrorControlFrontEnd_plError').innerHTML = '';
			
			//build params
		
			var param = getItems();
			//alert("before callback");
			//do callback
			cartCallback.Callback(param);
			//alert("after callback");
		}
		
		
		//remove item from current cart
		function deleteItem(rowId)
		{
			//alert('del' + rowId);
			
			cartCallback.Callback('del' + rowId);
			//caGrid.Render();
		}
		
		function formatProduct(itm)
		{
			var output = itm.GetMember("DiscountMessageFormatted").Value;
			
			//add discount if it exists
			//if (itm.GetMember("DiscountMessageFormatted") != null)
			//	output += ('<BR>' + itm.GetMember("DiscountMessageFormatted").Value);
			
			return output;
		}
		
		function tbQty_onKeyDown(event) {
  			//GET KEY CODE
			var charCode = (event.which) ? event.which : event.keyCode;

			//if ENTER key is pressed default to submit
			if (charCode == 13)
				updateCart();
		}
		function showHide(value,divID)
	{
		if (value == "Yes") {
			document.getElementById(divID).style.display = "block"
		} else {
			document.getElementById(divID).style.display = "none"
		}
	}
	
	function checkValue() 
	{ 
		var divID;
		divID  = "GetquotePostCode";
		if (document.form1.rbDelivery[0].checked)
			showHide("Yes",divID)
		else
			showHide("No",divID)
	}
	
	function checkValue2() 
	{ 
		var divID;
		divID  = "getQuoteSubscriberGroups";
		if (document.form1.cbPrivacyPolicy.checked)
			showHide("Yes",divID)
		else
			showHide("No",divID)
	}
	