<!--
function OnChangeType( sValue )
{
  var oForm = document.frmJacket;
  
  switch ( sValue )
  {
  case "Formal":
    // disable buttons type
    oForm.rdoButtonsColor[0].checked = true;
    for ( i = 0; i < oForm.rdoButtonsColor.length; i++ )
      oForm.rdoButtonsColor[i].disabled = true;
      
    // fabric - disable pattern & cashmere
    oForm.rdoFabric[0].checked = true;
    oForm.rdoFabric[3].disabled = true;
    oForm.rdoFabric[4].disabled = true;
    
    // colors
    oForm.rdoColor[0].disabled = false;
    oForm.rdoColor[1].disabled = false;
    oForm.rdoColor[2].disabled = false;
    oForm.rdoColor[3].disabled = false;
    oForm.rdoColor[0].checked = true;
    oForm.txtColor.disabled = true;
    break;
    
  case "Blazer":
    // enable buttons type
    for ( i = 0; i < oForm.rdoButtonsColor.length; i++ )
      oForm.rdoButtonsColor[i].disabled = false;
    oForm.rdoButtonsColor[0].checked = true;

    // fabric - disable pattern & cashmere
    oForm.rdoFabric[0].checked = true;
    oForm.rdoFabric[3].disabled = true;
    oForm.rdoFabric[4].disabled = true;
    
    // colors
    oForm.rdoColor[0].disabled = false;
    oForm.rdoColor[1].disabled = true;
    oForm.rdoColor[2].disabled = true;
    oForm.rdoColor[3].disabled = true;
    oForm.rdoColor[0].checked = true;
    oForm.txtColor.disabled = true;
    break;
    
  case "Casual":
    // disable buttons type
    oForm.rdoButtonsColor[0].checked = true;
    for ( i = 0; i < oForm.rdoButtonsColor.length; i++ )
      oForm.rdoButtonsColor[i].disabled = true;
      
    // fabric - any
    for ( i = 0; i < oForm.rdoFabric.length; i++ )
	  oForm.rdoFabric[i].disabled = false;
    oForm.rdoFabric[0].checked = true;

    // colors - any
    oForm.rdoColor[0].disabled = false;
    oForm.rdoColor[1].disabled = false;
    oForm.rdoColor[2].disabled = false;
    oForm.rdoColor[3].disabled = false;
    oForm.rdoColor[0].checked = true;
    oForm.txtColor.disabled = true;
    break;
    
  default:
    break;
  }
}

function OnChangeBreasted()
{
  var oForm = document.frmJacket;
  oForm.rdoButtons[0].checked = true;
  for ( i = 0; i < oForm.rdoButtons.length; i++ )
    oForm.rdoButtons[i].disabled = oForm.rdoBreasted[0].checked;
}

function OnChangeColor()
{
  var oForm = document.frmJacket, sValue;
  
  for ( i = 0; i < oForm.rdoColor.length; i++ )
  {
    if ( oForm.rdoColor[i].checked )
    {
      sValue = oForm.rdoColor[i].value;
      break;
    }
  }
  
  oForm.txtColor.disabled = ( sValue != "Custom" );
}

function OnSubmit()
{
  // Validation here!
  var oForm = document.frmJacket, sValue;
  
  for ( i = 0; i < oForm.rdoColor.length; i++ )
  {
    if ( oForm.rdoColor[i].checked )
    {
      sValue = oForm.rdoColor[i].value;
      break;
    }
  }
  
  if ( ( sValue == "Custom" ) && oForm.txtColor.value == "" )
  {
    alert( "Please specify color." );
    oForm.txtColor.focus();
    return false;
  }

  if ( oForm.txtOutsideArm.value == "" )
  {
    alert( "Please enter sleeve length (outside arm)." );
    oForm.txtOutsideArm.focus();
    return false;
  }

  if ( oForm.txtInsideArm.value == "" )
  {
    alert( "Please enter sleeve length (inside arm)." );
    oForm.txtInsideArm.focus();
    return false;
  }

  if ( oForm.txtShoulder.value == "" )
  {
    alert( "Please enter shoulder seam from collar to sleeve." );
    oForm.txtShoulder.focus();
    return false;
  }

  if ( oForm.txtLength.value == "" )
  {
    alert( "Please enter coat length." );
    oForm.txtLength.focus();
    return false;
  }

  if ( oForm.txtChest.value == "" )
  {
    alert( "Please enter chest size." );
    oForm.txtChest.focus();
    return false;
  }

  if ( oForm.txtWaist.value == "" )
  {
    alert( "Please enter waist size." );
    oForm.txtWaist.focus();
    return false;
  }

  return true;
}
//-->

