var returnURL ;

function AddToCart(sku, qty)
{
	var options = "";
	
	if ( document.all["Option1Name"].value != "" )
	{
		if ( document.all["ctl00$ProductOptions$Options1"].selectedIndex == 0 )
		{
			alert("Please select a valid " + document.all["Option1Name"].value + " from the list.");
			document.all["ctl00$ProductOptions$Options1"].focus();
			return;
		}
		else
		{
			options = options + "&Option1=" + document.all["ctl00$ProductOptions$Options1"].options[document.all["ctl00$ProductOptions$Options1"].selectedIndex].value;
		}		
	}
	
	if ( document.all["Option2Name"].value != "" )
	{
		if ( document.all["ctl00$ProductOptions$Options2"].selectedIndex == 0 )
		{
			alert("Please select a valid " + document.all["Option2Name"].value + " from the list.");
			document.all["ctl00$ProductOptions$Options2"].focus();
			return;
		}
		else
		{
			options = options + "&Option2=" + document.all["ctl00$ProductOptions$Options2"].options[document.all["ctl00$ProductOptions$Options2"].selectedIndex].value;
		}		
	}

	if ( document.all["Option3Name"].value != "" )
	{
		if ( document.all["ctl00$ProductOptions$Options3"].selectedIndex == 0 )
		{
			alert("Please select a valid " + document.all["Option3Name"].value + " from the list.");
			document.all["ctl00$ProductOptions$Options3"].focus();
			return;
		}
		else
		{
			options = options + "&Option3=" + document.all["ctl00$ProductOptions$Options3"].options[document.all["ctl00$ProductOptions$Options3"].selectedIndex].value;
		}		
	}

	if ( document.all["Option4Name"].value != "" )
	{
		if ( document.all["ctl00$ProductOptions$Options4"].selectedIndex == 0 )
		{
			alert("Please select a valid " + document.all["Option4Name"].value + " from the list.");
			document.all["ctl00$ProductOptions$Options4"].focus();
			return;
		}
		else
		{
			options = options + "&Option4=" + document.all["ctl00$ProductOptions$Options4"].options[document.all["ctl00$ProductOptions$Options4"].selectedIndex].value;
		}		
	}
	
	if ( document.all["Option5Name"].value != "" )
	{
		if ( document.all["ctl00$ProductOptions$Options5"].selectedIndex == 0 )
		{
			alert("Please select a valid " + document.all["Option5Name"].value + " from the list.");
			document.all["ctl00$ProductOptions$Options5"].focus();
			return;
		}
		else
		{
			options = options + "&Option5=" + document.all["ctl00$ProductOptions$Options5"].options[document.all["ctl00$ProductOptions$Options5"].selectedIndex].value;
		}		
	}

	document.location.href = "/Store/CartAction.aspx?Action=Add&SKU=" + sku + options + "&Qty=" + qty + "&ReturnURL=" + returnURL ;
}

function RemoveFromCart(id)
{
	document.location.replace("/Store/CartAction.aspx?Action=Remove&ID=" + id + "&ReturnURL=" + returnURL ) ;
}

function EmptyCart()
{
	document.location.replace("/Store/CartAction.aspx?Action=Empty" + "&ReturnURL=" + returnURL ) ;
}

function ReCalculate()
{
	document.frmCart.Action.value = "Update"
	document.frmCart.submit()
}

function Checkout()
{
	document.frmCart.Action.value = "CheckOut"
	document.frmCart.submit()
}

function ContinueShopping()
{
	if (returnURL == "")
		document.location.href = "/Store" ;
	else
		document.location.href = returnURL ;
}