<!--
var OrderItemID = 0;
var sizeWidth;
function handleChange(index)
{  
	--index;
	var SizeSelect, WidthSelect, NumEntries, i;
	SizeSelect = document.forms[0].ddlSize;
	WidthSelect = document.forms[0].ddlWidth;

	// Delete all entries in the cities list box
	WidthSelect.length = 2;
	WidthSelect[1] = new Option("Select size first", -1);
	
	// if size is selected add its width to the Width List box
	if (index >= 0)
	{
		var cnt = sizeWidth[index].length
		for (var i=1;i<=cnt;++i)
		{
			WidthSelect.options[i] = new Option(sizeWidth[index][i-1], sizeWidth[index][i-1])
		}
	}
	WidthSelect.selectedIndex = 0;
}
function addtocart()
{
  if((document.forms[0].ddlSize.selectedIndex > 0 && document.forms[0].ddlWidth.selectedIndex > 0))
  {
    var sid = document.forms[0].ddlSize[document.forms[0].ddlSize.selectedIndex].value;
    var wid = document.forms[0].ddlWidth[document.forms[0].ddlWidth.selectedIndex].value;

    var fp = null;
    if (document.forms[0].hidFlashParams != null)
		fp = document.forms[0].hidFlashParams.value;

    window.location.href = "addtocart.aspx?OIID="+ OrderItemID +"&sizeid="+ sid + "&widthid="+ wid + "&" + fp;
  }
  else
  {
		alert("Select Size and Width please.");
  }
}
function addothertocart()
{
  if(document.forms[0].ddlStyleVariation.selectedIndex > 0)
  {
    var fp = null;
    if (document.forms[0].hidFlashParams != null)
		fp = document.forms[0].hidFlashParams.value;

    var svid = document.forms[0].ddlStyleVariation[document.forms[0].ddlStyleVariation.selectedIndex].value;
    window.location.href = "addtocart.aspx?OIID="+ OrderItemID +"&StyleVariationID=" + svid + "&" + fp;
  }
  else
  {
		alert("Select Size please.");
  }
}


// Show/Hide sections of the Product Detail Page based on Product Availability.
function updateAvailability(variationSelected)
{
	var isInStock = !variationSelected || variationSelected.IsInStock;
	if (isInStock)
	{
		$(".hideIfOutOfStock").removeClass("stockbasedHidden");
		$(".hideIfInStock").addClass("stockbasedHidden");
	}
	else
	{
		$(".hideIfOutOfStock").addClass("stockbasedHidden");
		$(".hideIfInStock").removeClass("stockbasedHidden");
	}
}

//-->