// global variable declaration
// -----
var pPump	= 0;	// product: pump
var pTube	= 1;	// product: tube
var pSupply	= 2;	// product: supply
var Bioprene	= 2;	// the following constants correspond to their form input indices
var Marprene	= 8;
var Silicone	= 14;
var PeroxideS	= 1;
var PlatinumS	= 2;
var Neoprene	= 20;
var Butyl	= 26;
var Tygon	= 32;
var Viton	= 38;
var langTC	= 0;	// Traditional Chinese
var langSC	= 1;	// Simplified Chinese
var langEN	= 2;	// English
var pumpNum	= 1;
var pumpSpd	= 2;
var pumpSupp	= 3;
var tubeMat	= 1;
var tubeWall	= 2;
var tubeBore	= 3;

// - - - - - - - -
// Public domain cookie code written by: Bill Dortch, hIdaho Design (bdortch@netw.com)
// - - - - - - - -

// - - - - - - - - called by GetCookie - - - - - - - -
function getCookieVal (offset)
{
  var endstr = window.document.cookie.indexOf (";", offset);

  if (endstr == -1)
    endstr = window.document.cookie.length;

  return unescape(window.document.cookie.substring(offset, endstr));
}

// - - - - - - - - Get Value of Cookie - - - - - - - -
function GetCookie (name)
{
  var arg = name + "=";
  var alen = arg.length;
  var clen = window.document.cookie.length;
  var i = 0;

  while (i < clen)
  {
    var j = i + alen;

    if (window.document.cookie.substring(i, j) == arg)
      return getCookieVal (j);

    i = window.document.cookie.indexOf(" ", i) + 1;

    if (i == 0)
      break;
  }

  return null;
}

// - - - - - - - - Set Value of Cookie - - - - - - - -
function SetCookie (name, value)		// w/o expiration (memoryless)
{
  var argv = SetCookie.arguments;
  var argc = SetCookie.arguments.length;
  var expires = (argc > 2) ? argv[2] : null;	// the 3rd parameter is expiration date
  var domain = (argc > 3) ? argv[3] : null;	// the 4th parameter is domain
  var path = (argc > 4) ? argv[4] : null;	// the 5th parameter is path
  var secure = (argc > 5) ? argv[5] : false;	// the 6th parameter is SSL

  window.document.cookie = name + "=" + escape (value) +
    ((expires == null) ? "" : ("; expires=" + expires.toUTCString())) +
    ((domain == null) ? "" : ("; domain=" + domain)) +
    ((path == null) ? "" : ("; path=" + path)) +
    ((secure == true) ? "; secure" : "");
}

// - - - - - - - - Delete Cookie by name - - - - - - - -
function DeleteCookie (name)
{
  var exp = new Date();

  exp.setTime (exp.getTime() - 1);

  var cval = GetCookie (name);			// old cookie value

  if (cval != null)
    window.document.cookie = name + "=" + cval + ";expires=" + exp.toUTCString();
}

// - - - - - - - - End of Public Domain code - - - - - - - -

// save the cookie (with expiration)
// -----
function SaveCookie(name, value)
{
  var expires=new Date();

  expires.setTime(expires.getTime() + (24 * 60 * 60 * 1000));
  SetCookie(name, value, expires);

  return;
}

// clear all related cookies upon coming into the site
// -----
function clearAllCookie()
{
  var onSite;

  onSite=GetCookie("s_onSite");

  if (onSite == null)
    SetCookie("s_onSite", "true");

  return;
}

// change centerpiece of the first page
// -----
function centerArt(pic)
{
  window.document.centerpiece.src=pic;

  return;
}

// fill in the quotation query list
// -----
function fillList()
{
  var itemCount, queryCount, queryList;

  queryList=GetCookie("s_queryList");

  if (queryList != null)
    window.document.contact.content.value=queryList +
       "\n===== Please Fill in the Amount(s) =====\n\n";
}

// check if the query checkbox has been checked
// -----
function setQuery(lang)
{
  var queryCount, itemCount, promptP;

  queryCount=0;
  itemCount=window.document.product.elements.length;

  for (idx=0; idx<itemCount; idx++)
    if (window.document.product.elements[idx].checked == true)		// true if just checked
      queryCount++;

  if (queryCount > 1)
  {
    switch (lang)
    {
//       case langTC:
      case 0:
        promptP="叫匡拒虫高基兜ヘ";
        break;

//       case langSC:
      case 1:
        promptP="请选择单一询价项目！";
        break;

//       case langEN:
      case 2:
        promptP="Please Choose Only One Item!";
        break;
    }

    window.alert(promptP);
  }

  return;
}

// save the query list
// -----
function sendQuery(lang, productType)
{
  var itemCount, queryCount, queryList, header, userChoice, redirectPage;
  var confirmP, pageSuffix;

  header=false;
  queryCount=0;
  queryList=GetCookie("s_queryList");
  itemCount=window.document.product.elements.length;

  for (idx=0; idx<itemCount; idx++)
  {
    if (window.document.product.elements[idx].checked == true)		// true if checked
    {
      queryCount++;

      if (queryList == null)
        queryList=" \n" + "========= Item(s) to Quote =========\n\n";

      if (header == false)
      {
        switch (productType)
        {
//           case pPump:
          case 0:
            queryList=queryList + "Pump:\n";
            break;

//           case pTube:
//           case pSupply:
          case 1:
          case 2:
            queryList=queryList + "Tube:\n";
            break;
        }
        header=true;
      }

      switch (productType)
      {
//         case pPump:
        case 0:
          // note: in Netscape, hidden inputs can be accessed only if named
          queryList=queryList + " " + window.document.product.elements[idx+pumpNum].value + " at S=" +
            window.document.product.elements[idx+pumpSpd].value + ". Amount(s): \n\n";
          break;

//         case pTube:
//         case pSupply:
        case 1:
        case 2:
          // note: in Netscape, hidden inputs can be accessed only if named
          queryList=queryList + " " + window.document.product.elements[idx+tubeMat].value + " at " +
            " W=" + window.document.product.elements[idx+tubeWall].value +
            ", B=" + window.document.product.elements[idx+tubeBore].value + ".\n Amount(s): \n\n";
          break;
      }

      break;
    }
  }

  SetCookie("s_queryList", queryList);

  switch (lang)
  {
//     case langTC:
    case 0:
      confirmP="眤琌璶ミㄨ盚琩高獺ン"
      redirectPage="s_contact_tc.htm";
      pageSuffix="_tc.htm"
      break;                                                                            

//     case langSC:
    case 1:
      confirmP="您是否要立刻寄出查询信件？";
      redirectPage="s_contact_sc.htm";
      pageSuffix="_sc.htm"
      break;

//     case langEN:
    case 2:
      confirmP="Do you want to mail the QUOTATION REQUEST now?";
      redirectPage="s_contact_en.htm";
      pageSuffix="_en.htm"
      break;                                                                
  }

  userChoice=window.confirm(confirmP);

  switch (productType)
  {
//     case pPump:
    case 0:
      if (userChoice)
        window.location.href=redirectPage;
      else
      {
        window.document.product.reset();
        window.location.href=("s_pump" + pageSuffix);
      }

      break;

//     case pTube:
    case 1:
      if (userChoice)
        window.location.href=redirectPage;
      else
      {
        window.document.product.reset();
        window.location.href=("s_tube" + pageSuffix);
      }

      break;

//     case pSupply:
    case 2:
      if (userChoice)
        window.opener.location.href=redirectPage;
      else
      {
        window.opener.document.product.reset();
        window.opener.location.href=("s_pump" + pageSuffix);
      }

      window.close();
      break;
  }

  return;
}

// query handler
// -----
function handleQuery(lang, productType)
{
  var itemCount, header, queryList, supplyWindow, checkIdx, userChoice, pageSuffix;
  var multiP, checkP, supplyP, errorP;

  checkIdx=null;
  header=false;
  itemCount=window.document.product.elements.length;

  switch (lang)
  {
//     case langTC:
    case 0:
      multiP="Τ材兜ヘ高基睲虫\n饼琩高兜坝珇叫狡翴匡˙艼";
      checkP="叫翴匡高基坝珇";
      supplyP="叫拜眤璶匡拒穎皌溅恨盾";
      errorP="巨岿粇叫浪琩翴匡兜ヘ";
      pageSuffix="_tc.htm";
      break;

//     case langSC:
    case 1:
      multiP="只有第一个项目纳入询价清单！\n欲查询多项商品，请重复点选步骤。";
      checkP="请先点选询价商品！";
      supplyP="请问您要选择搭配的胶管吗？";
      errorP="操作错误！请检查点选项目！";
      pageSuffix="_sc.htm";
      break;       

//     case langEN:
    case 2:
      multiP="Only the FIRST ITEM is sent for query!\nPlease repeat the process for other items.";
      checkP="Please Select Items for Quotation First!";
      supplyP="Do You Want Any Tubing\nfor the Pump(s) You Have Selected?";
      errorP="Error! Please Check Your Request!";
      pageSuffix="_en.htm";
      break;
  }

  for (idx=0; idx<itemCount; idx++)
    if (window.document.product.elements[idx].checked == true)		// true if just checked
    {
      if (checkIdx == null)
        checkIdx=idx;
      else
      {
        window.alert(multiP);
        break;
      }
    }

  if (checkIdx == null)
  {
    window.alert(checkP);
    return;
  }

  switch (productType)
  {
//     case pPump:
    case 0:
      userChoice=window.confirm(supplyP);

      if (userChoice)
      {
        queryList=GetCookie("s_queryList");

        if (queryList == null)
          queryList=" \n" + "========= Item(s) to Quote =========\n\n";

        queryList=queryList + "Pump:\n";

        queryList=queryList + " " + window.document.product.elements[checkIdx+pumpNum].value + " at S=" +
          window.document.product.elements[checkIdx+pumpSpd].value + ". Amount(s): \n\n";

        SetCookie("s_queryList", queryList);

        // opening supply window
        // -----
        supplyWindow=window.open(("s_" + window.document.product.elements[checkIdx+pumpSupp].value + pageSuffix), "supply", "innerHeight=420; innerWidth=450; height=470; width=450; directories=no; scrollbars=no; status=no; toolbar=no; resizable=no; location=no; menubar=no");
      }
      else
        sendQuery(lang, productType);

      break;

//     case pTube:
    case 1:
      if ((window.document.product.elements[checkIdx+tubeWall].options.value == 0) | (window.document.product.elements[checkIdx+tubeBore].options.value == 0))
      {
        window.alert(errorP);
        break;
      }

//     case pSupply:
    case 2:
      sendQuery(lang, productType);
      break;
  }
}

// checking "must-filled" fields of the mailing form
function checkMailForm(lang)
{
  var itemCount, warningList, errorP, nameP, companyP, telP, faxP, emailP, bodyP;

  var formName	= 0;
  var formCompany=1;
  var formTEL	= 6;
  var formFAX	= 7;
  var formEmail	= 8;
  var formBody	= 9;

  itemCount=window.document.contact.elements.length;
  warningList="";

  switch (lang)
  {
//     case langTC:
    case 0:
      nameP=" \'﹎\'";
      companyP=" \'そ嘿\'";
      telP=" \'筿杠腹絏\'";
      faxP=" \'肚痷腹絏\'";
      emailP=" \'筿秎ン獺絚\'";
      bodyP=" \'ず甧\'";
      break;

//     case langSC:
    case 1:
      nameP=" \'姓名\'";
      companyP=" \'公司名称\'";
      telP=" \'电话号码\'";
      faxP=" \'传真号码\'";
      emailP=" \'电子邮件信箱\'";
      bodyP=" \'内容\'";
      break;

//     case langEN:
    case 2:
      nameP=" \'Full Name\'";
      companyP=" \'Company Name\'";
      telP=" \'Office Phone No.\'";
      faxP=" \'Fax No.\'";
      emailP=" \'e-mail Address\'";
      bodyP=" \'Enquires or Letter\'";
      break;
  }

  for (idx=0; idx<itemCount; idx++)
  {
    if (window.document.contact.elements[idx].value == "")
    {
      switch (idx)
      {
//         case formName:
        case 1:
          if (warningList != "")
           warningList=warningList + ",";

          warningList=warningList + nameP;
          break;

//         case formCompany:
        case 2:
          if (warningList != "")
           warningList=warningList + ",";

          warningList=warningList + companyP;
          break;

//         case formTEL:
        case 7:
          if (warningList != "")
           warningList=warningList + ",";

          warningList=warningList + telP;
          break;

//         case formFAX:
        case 8:
          if (warningList != "")
           warningList=warningList + ",";

          warningList=warningList + faxP;
          break;

//         case formEmail:
        case 9:
          if (warningList != "")
           warningList=warningList + ",";

          warningList=warningList + emailP;
          break;

//         case formBody:
        case 10:
          if (warningList != "")
           warningList=warningList + ",";

          warningList=warningList + bodyP;
          break;
      }
    }
  }

  if (warningList != "")
  {
    switch (lang)
    {
//       case langTC:
      case 0:
        errorP=("叫恶Т" + warningList + "单戈");
        break;
    
//       case langSC:
      case 1:
        errorP=("请先填妥" + warningList + "（等）资料！");
        break;
    
//       case langEN:
      case 2:
        errorP=("Please fill up the" + warningList + " section(s) of your mail!");
        break;
    }

    window.alert(errorP);
  }
  else
    window.document.contact.submit();
}

// checking whether the "idx" input has been selected
function checkSelect(lang, idx, promptW)
{
  var promptP;

  if (window.document.product.elements[idx].value == "0")
  {
    switch (lang)
    {
//       case langTC:
      case 0:
        promptP=("叫匡﹚ " + promptW + "");
        break;

//       case langSC:
      case 1:
        promptP=("请先选定 " + promptW + "！");
        break;

//       case langEN:
      case 2:
        promptP=("Please Select " + promptW + " First!");
        break;
    }

    window.alert(promptP);
  }
}

// enabling the "idx" input
function setEnabled(idx)
{
  window.document.product.elements[idx].disabled=false;
}

// from wall thickness to tube bore
function thickness2Bore(pMaterial)
{
  switch (pMaterial)
  {
// item
// -----
//     case Bioprene:
    case 2:
      switch (window.document.product.elements[Bioprene].value)
      {
        case "1.6mm":
          window.document.product.elements[Bioprene+1].options.length=7;

          window.document.product.elements[Bioprene+1].options[0].text="0.5mm";
          window.document.product.elements[Bioprene+1].options[1].text="0.8mm";
          window.document.product.elements[Bioprene+1].options[2].text="1.6mm";
          window.document.product.elements[Bioprene+1].options[3].text="3.2mm";
          window.document.product.elements[Bioprene+1].options[4].text="4.8mm";
          window.document.product.elements[Bioprene+1].options[5].text="6.4mm";
          window.document.product.elements[Bioprene+1].options[6].text="8.0mm";

          window.document.product.elements[Bioprene+1].options[0].value="0.5mm";
          window.document.product.elements[Bioprene+1].options[1].value="0.8mm";
          window.document.product.elements[Bioprene+1].options[2].value="1.6mm";
          window.document.product.elements[Bioprene+1].options[3].value="3.2mm";
          window.document.product.elements[Bioprene+1].options[4].value="4.8mm";
          window.document.product.elements[Bioprene+1].options[5].value="6.4mm";
          window.document.product.elements[Bioprene+1].options[6].value="8.0mm";

          break;

        case "2.4mm":
          window.document.product.elements[Bioprene+1].options.length=6;

          window.document.product.elements[Bioprene+1].options[0].text="1.6mm";
          window.document.product.elements[Bioprene+1].options[1].text="3.2mm";
          window.document.product.elements[Bioprene+1].options[2].text="4.8mm";
          window.document.product.elements[Bioprene+1].options[3].text="6.4mm";
          window.document.product.elements[Bioprene+1].options[4].text="8.0mm";
          window.document.product.elements[Bioprene+1].options[5].text="9.6mm";

          window.document.product.elements[Bioprene+1].options[0].value="1.6mm";
          window.document.product.elements[Bioprene+1].options[1].value="3.2mm";
          window.document.product.elements[Bioprene+1].options[2].value="4.8mm";
          window.document.product.elements[Bioprene+1].options[3].value="6.4mm";
          window.document.product.elements[Bioprene+1].options[4].value="8.0mm";
          window.document.product.elements[Bioprene+1].options[5].value="9.6mm";

          break;

        case "3.2mm":
          window.document.product.elements[Bioprene+1].options.length=4;

          window.document.product.elements[Bioprene+1].options[0].text="6.4mm";
          window.document.product.elements[Bioprene+1].options[1].text="9.6mm";
          window.document.product.elements[Bioprene+1].options[2].text="12.7mm";
          window.document.product.elements[Bioprene+1].options[3].text="15.9mm";

          window.document.product.elements[Bioprene+1].options[0].value="6.4mm";
          window.document.product.elements[Bioprene+1].options[1].value="9.6mm";
          window.document.product.elements[Bioprene+1].options[2].value="12.7mm";
          window.document.product.elements[Bioprene+1].options[3].value="15.9mm";

          break;

        case "4.0mm":
          window.document.product.elements[Bioprene+1].options.length=3;

          window.document.product.elements[Bioprene+1].options[0].text="8.0mm";
          window.document.product.elements[Bioprene+1].options[1].text="12.0mm";
          window.document.product.elements[Bioprene+1].options[2].text="16.0mm";

          window.document.product.elements[Bioprene+1].options[0].value="8.0mm";
          window.document.product.elements[Bioprene+1].options[1].value="12.0mm";
          window.document.product.elements[Bioprene+1].options[2].value="16.0mm";

          break;

        case "4.8mm":
          window.document.product.elements[Bioprene+1].options.length=5;

          window.document.product.elements[Bioprene+1].options[0].text="9.6mm";
          window.document.product.elements[Bioprene+1].options[1].text="12.7mm";
          window.document.product.elements[Bioprene+1].options[2].text="15.9mm";
          window.document.product.elements[Bioprene+1].options[3].text="19.0mm";
          window.document.product.elements[Bioprene+1].options[4].text="25.4mm";

          window.document.product.elements[Bioprene+1].options[0].value="9.6mm";
          window.document.product.elements[Bioprene+1].options[1].value="12.7mm";
          window.document.product.elements[Bioprene+1].options[2].value="15.9mm";
          window.document.product.elements[Bioprene+1].options[3].value="19.0mm";
          window.document.product.elements[Bioprene+1].options[4].value="25.4mm";

          break;
      }
      break;

// item
// -----
//     case Marprene:
    case 8:
      switch (window.document.product.elements[Marprene].value)
      {
        case "1.6mm":
          window.document.product.elements[Marprene+1].options.length=7;

          window.document.product.elements[Marprene+1].options[0].text="0.5mm";
          window.document.product.elements[Marprene+1].options[1].text="0.8mm";
          window.document.product.elements[Marprene+1].options[2].text="1.6mm";
          window.document.product.elements[Marprene+1].options[3].text="3.2mm";
          window.document.product.elements[Marprene+1].options[4].text="4.8mm";
          window.document.product.elements[Marprene+1].options[5].text="6.4mm";
          window.document.product.elements[Marprene+1].options[6].text="8.0mm";

          window.document.product.elements[Marprene+1].options[0].value="0.5mm";
          window.document.product.elements[Marprene+1].options[1].value="0.8mm";
          window.document.product.elements[Marprene+1].options[2].value="1.6mm";
          window.document.product.elements[Marprene+1].options[3].value="3.2mm";
          window.document.product.elements[Marprene+1].options[4].value="4.8mm";
          window.document.product.elements[Marprene+1].options[5].value="6.4mm";
          window.document.product.elements[Marprene+1].options[6].value="8.0mm";

          break;

        case "2.4mm":
          window.document.product.elements[Marprene+1].options.length=6;

          window.document.product.elements[Marprene+1].options[0].text="1.6mm";
          window.document.product.elements[Marprene+1].options[1].text="3.2mm";
          window.document.product.elements[Marprene+1].options[2].text="4.8mm";
          window.document.product.elements[Marprene+1].options[3].text="6.4mm";
          window.document.product.elements[Marprene+1].options[4].text="8.0mm";
          window.document.product.elements[Marprene+1].options[5].text="9.6mm";

          window.document.product.elements[Marprene+1].options[0].value="1.6mm";
          window.document.product.elements[Marprene+1].options[1].value="3.2mm";
          window.document.product.elements[Marprene+1].options[2].value="4.8mm";
          window.document.product.elements[Marprene+1].options[3].value="6.4mm";
          window.document.product.elements[Marprene+1].options[4].value="8.0mm";
          window.document.product.elements[Marprene+1].options[5].value="9.6mm";

          break;

        case "3.2mm":
          window.document.product.elements[Marprene+1].options.length=4;

          window.document.product.elements[Marprene+1].options[0].text="6.4mm";
          window.document.product.elements[Marprene+1].options[1].text="9.6mm";
          window.document.product.elements[Marprene+1].options[2].text="12.7mm";
          window.document.product.elements[Marprene+1].options[3].text="15.9mm";

          window.document.product.elements[Marprene+1].options[0].value="6.4mm";
          window.document.product.elements[Marprene+1].options[1].value="9.6mm";
          window.document.product.elements[Marprene+1].options[2].value="12.7mm";
          window.document.product.elements[Marprene+1].options[3].value="15.9mm";

          break;

        case "4.0mm":
          window.document.product.elements[Marprene+1].options.length=3;

          window.document.product.elements[Marprene+1].options[0].text="8.0mm";
          window.document.product.elements[Marprene+1].options[1].text="12.0mm";
          window.document.product.elements[Marprene+1].options[2].text="16.0mm";

          window.document.product.elements[Marprene+1].options[0].value="8.0mm";
          window.document.product.elements[Marprene+1].options[1].value="12.0mm";
          window.document.product.elements[Marprene+1].options[2].value="16.0mm";

          break;

        case "4.8mm":
          window.document.product.elements[Marprene+1].options.length=5;

          window.document.product.elements[Marprene+1].options[0].text="9.6mm";
          window.document.product.elements[Marprene+1].options[1].text="12.7mm";
          window.document.product.elements[Marprene+1].options[2].text="15.9mm";
          window.document.product.elements[Marprene+1].options[3].text="19.0mm";
          window.document.product.elements[Marprene+1].options[4].text="25.4mm";

          window.document.product.elements[Marprene+1].options[0].value="9.6mm";
          window.document.product.elements[Marprene+1].options[1].value="12.7mm";
          window.document.product.elements[Marprene+1].options[2].value="15.9mm";
          window.document.product.elements[Marprene+1].options[3].value="19.0mm";
          window.document.product.elements[Marprene+1].options[4].value="25.4mm";

          break;
      }
      break;

// item
// -----
//     case Silicone:
    case 14:
      switch (window.document.product.elements[Silicone-1].options.value)
      {
        case "Peroxide c. Silicone":
          switch (window.document.product.elements[Silicone].value)
          {
            case "1.6mm":
              window.document.product.elements[Silicone+1].options.length=7;

              window.document.product.elements[Silicone+1].options[0].text="0.5mm";
              window.document.product.elements[Silicone+1].options[1].text="0.8mm";
              window.document.product.elements[Silicone+1].options[2].text="1.6mm";
              window.document.product.elements[Silicone+1].options[3].text="3.2mm";
              window.document.product.elements[Silicone+1].options[4].text="4.8mm";
              window.document.product.elements[Silicone+1].options[5].text="6.4mm";
              window.document.product.elements[Silicone+1].options[6].text="8.0mm";

              window.document.product.elements[Silicone+1].options[0].value="0.5mm";
              window.document.product.elements[Silicone+1].options[1].value="0.8mm";
              window.document.product.elements[Silicone+1].options[2].value="1.6mm";
              window.document.product.elements[Silicone+1].options[3].value="3.2mm";
              window.document.product.elements[Silicone+1].options[4].value="4.8mm";
              window.document.product.elements[Silicone+1].options[5].value="6.4mm";
              window.document.product.elements[Silicone+1].options[6].value="8.0mm";

              break;

            case "2.4mm":
              window.document.product.elements[Silicone+1].options.length=8;

              window.document.product.elements[Silicone+1].options[0].text="0.5mm";
              window.document.product.elements[Silicone+1].options[1].text="0.8mm";
              window.document.product.elements[Silicone+1].options[2].text="1.6mm";
              window.document.product.elements[Silicone+1].options[3].text="3.2mm";
              window.document.product.elements[Silicone+1].options[4].text="4.8mm";
              window.document.product.elements[Silicone+1].options[5].text="6.4mm";
              window.document.product.elements[Silicone+1].options[6].text="8.0mm";
              window.document.product.elements[Silicone+1].options[7].text="9.6mm";

              window.document.product.elements[Silicone+1].options[0].value="0.5mm";
              window.document.product.elements[Silicone+1].options[1].value="0.8mm";
              window.document.product.elements[Silicone+1].options[2].value="1.6mm";
              window.document.product.elements[Silicone+1].options[3].value="3.2mm";
              window.document.product.elements[Silicone+1].options[4].value="4.8mm";
              window.document.product.elements[Silicone+1].options[5].value="6.4mm";
              window.document.product.elements[Silicone+1].options[6].value="8.0mm";
              window.document.product.elements[Silicone+1].options[7].value="9.6mm";

              break;

            case "3.2mm":
              window.document.product.elements[Silicone+1].options.length=5;

              window.document.product.elements[Silicone+1].options[0].text="4.8mm";
              window.document.product.elements[Silicone+1].options[1].text="6.4mm";
              window.document.product.elements[Silicone+1].options[2].text="9.6mm";
              window.document.product.elements[Silicone+1].options[3].text="12.7mm";
              window.document.product.elements[Silicone+1].options[4].text="15.9mm";

              window.document.product.elements[Silicone+1].options[0].value="4.8mm";
              window.document.product.elements[Silicone+1].options[1].value="6.4mm";
              window.document.product.elements[Silicone+1].options[2].value="9.6mm";
              window.document.product.elements[Silicone+1].options[3].value="12.7mm";
              window.document.product.elements[Silicone+1].options[4].value="15.9mm";

              break;

            case "4.0mm":
              window.document.product.elements[Silicone+1].options.length=3;

              window.document.product.elements[Silicone+1].options[0].text="8.0mm";
              window.document.product.elements[Silicone+1].options[1].text="12.0mm";
              window.document.product.elements[Silicone+1].options[2].text="16.0mm";

              window.document.product.elements[Silicone+1].options[0].value="8.0mm";
              window.document.product.elements[Silicone+1].options[1].value="12.0mm";
              window.document.product.elements[Silicone+1].options[2].value="16.0mm";

              break;

            case "4.8mm":
              window.document.product.elements[Silicone+1].options.length=5;

              window.document.product.elements[Silicone+1].options[0].text="9.6mm";
              window.document.product.elements[Silicone+1].options[1].text="12.7mm";
              window.document.product.elements[Silicone+1].options[2].text="15.9mm";
              window.document.product.elements[Silicone+1].options[3].text="19.0mm";
              window.document.product.elements[Silicone+1].options[4].text="25.4mm";

              window.document.product.elements[Silicone+1].options[0].value="9.6mm";
              window.document.product.elements[Silicone+1].options[1].value="12.7mm";
              window.document.product.elements[Silicone+1].options[2].value="15.9mm";
              window.document.product.elements[Silicone+1].options[3].value="19.0mm";
              window.document.product.elements[Silicone+1].options[4].value="25.4mm";

              break;
          }
          break;	// break - Peroxide c. Silicone

        case "Platinum c. Silicone":
          switch (window.document.product.elements[Silicone].value)
          {
            case "1.6mm":
              window.document.product.elements[Silicone+1].options.length=7;

              window.document.product.elements[Silicone+1].options[0].text="0.5mm";
              window.document.product.elements[Silicone+1].options[1].text="0.8mm";
              window.document.product.elements[Silicone+1].options[2].text="1.6mm";
              window.document.product.elements[Silicone+1].options[3].text="3.2mm";
              window.document.product.elements[Silicone+1].options[4].text="4.8mm";
              window.document.product.elements[Silicone+1].options[5].text="6.4mm";
              window.document.product.elements[Silicone+1].options[6].text="8.0mm";

              window.document.product.elements[Silicone+1].options[0].value="0.5mm";
              window.document.product.elements[Silicone+1].options[1].value="0.8mm";
              window.document.product.elements[Silicone+1].options[2].value="1.6mm";
              window.document.product.elements[Silicone+1].options[3].value="3.2mm";
              window.document.product.elements[Silicone+1].options[4].value="4.8mm";
              window.document.product.elements[Silicone+1].options[5].value="6.4mm";
              window.document.product.elements[Silicone+1].options[6].value="8.0mm";

              break;

            case "2.4mm":
              window.document.product.elements[Silicone+1].options.length=6;

              window.document.product.elements[Silicone+1].options[0].text="1.6mm";
              window.document.product.elements[Silicone+1].options[1].text="3.2mm";
              window.document.product.elements[Silicone+1].options[2].text="4.8mm";
              window.document.product.elements[Silicone+1].options[3].text="6.4mm";
              window.document.product.elements[Silicone+1].options[4].text="8.0mm";
              window.document.product.elements[Silicone+1].options[5].text="9.6mm";

              window.document.product.elements[Silicone+1].options[0].value="1.6mm";
              window.document.product.elements[Silicone+1].options[1].value="3.2mm";
              window.document.product.elements[Silicone+1].options[2].value="4.8mm";
              window.document.product.elements[Silicone+1].options[3].value="6.4mm";
              window.document.product.elements[Silicone+1].options[4].value="8.0mm";
              window.document.product.elements[Silicone+1].options[5].value="9.6mm";

              break;

            case "3.2mm":
              window.document.product.elements[Silicone+1].options.length=5;

              window.document.product.elements[Silicone+1].options[0].text="4.8mm";
              window.document.product.elements[Silicone+1].options[1].text="6.4mm";
              window.document.product.elements[Silicone+1].options[2].text="9.6mm";
              window.document.product.elements[Silicone+1].options[3].text="12.7mm";
              window.document.product.elements[Silicone+1].options[4].text="15.9mm";

              window.document.product.elements[Silicone+1].options[0].value="4.8mm";
              window.document.product.elements[Silicone+1].options[1].value="6.4mm";
              window.document.product.elements[Silicone+1].options[2].value="9.6mm";
              window.document.product.elements[Silicone+1].options[3].value="12.7mm";
              window.document.product.elements[Silicone+1].options[4].value="15.9mm";

              break;

            case "4.0mm":
              window.document.product.elements[Silicone+1].options.length=3;

              window.document.product.elements[Silicone+1].options[0].text="8.0mm";
              window.document.product.elements[Silicone+1].options[1].text="12.0mm";
              window.document.product.elements[Silicone+1].options[2].text="16.0mm";

              window.document.product.elements[Silicone+1].options[0].value="8.0mm";
              window.document.product.elements[Silicone+1].options[1].value="12.0mm";
              window.document.product.elements[Silicone+1].options[2].value="16.0mm";

              break;

            case "4.8mm":
              window.document.product.elements[Silicone+1].options.length=5;

              window.document.product.elements[Silicone+1].options[0].text="9.6mm";
              window.document.product.elements[Silicone+1].options[1].text="12.7mm";
              window.document.product.elements[Silicone+1].options[2].text="15.9mm";
              window.document.product.elements[Silicone+1].options[3].text="19.0mm";
              window.document.product.elements[Silicone+1].options[4].text="25.4mm";

              window.document.product.elements[Silicone+1].options[0].value="9.6mm";
              window.document.product.elements[Silicone+1].options[1].value="12.7mm";
              window.document.product.elements[Silicone+1].options[2].value="15.9mm";
              window.document.product.elements[Silicone+1].options[3].value="19.0mm";
              window.document.product.elements[Silicone+1].options[4].value="25.4mm";

              break;
          }
          break;	// break - Platinum c. Silicone

      }
      break;	// break - Silicone

// item
// -----
//     case Neoprene:
    case 20:
      switch (window.document.product.elements[Neoprene].value)
      {
        case "1.6mm":
          window.document.product.elements[Neoprene+1].options.length=6;

          window.document.product.elements[Neoprene+1].options[0].text="0.8mm";
          window.document.product.elements[Neoprene+1].options[1].text="1.6mm";
          window.document.product.elements[Neoprene+1].options[2].text="3.2mm";
          window.document.product.elements[Neoprene+1].options[3].text="4.8mm";
          window.document.product.elements[Neoprene+1].options[4].text="6.4mm";
          window.document.product.elements[Neoprene+1].options[5].text="8.0mm";

          window.document.product.elements[Neoprene+1].options[0].value="0.8mm";
          window.document.product.elements[Neoprene+1].options[1].value="1.6mm";
          window.document.product.elements[Neoprene+1].options[2].value="3.2mm";
          window.document.product.elements[Neoprene+1].options[3].value="4.8mm";
          window.document.product.elements[Neoprene+1].options[4].value="6.4mm";
          window.document.product.elements[Neoprene+1].options[5].value="8.0mm";

          break;

        case "3.2mm":
          window.document.product.elements[Neoprene+1].options.length=5;

          window.document.product.elements[Neoprene+1].options[0].text="3.2mm";
          window.document.product.elements[Neoprene+1].options[1].text="6.4mm";
          window.document.product.elements[Neoprene+1].options[2].text="9.6mm";
          window.document.product.elements[Neoprene+1].options[3].text="12.7mm";
          window.document.product.elements[Neoprene+1].options[4].text="15.9mm";

          window.document.product.elements[Neoprene+1].options[0].value="3.2mm";
          window.document.product.elements[Neoprene+1].options[1].value="6.4mm";
          window.document.product.elements[Neoprene+1].options[2].value="9.6mm";
          window.document.product.elements[Neoprene+1].options[3].value="12.7mm";
          window.document.product.elements[Neoprene+1].options[4].value="15.9mm";

          break;

        case "4.8mm":
          window.document.product.elements[Neoprene+1].options.length=5;

          window.document.product.elements[Neoprene+1].options[0].text="9.6mm";
          window.document.product.elements[Neoprene+1].options[1].text="12.7mm";
          window.document.product.elements[Neoprene+1].options[2].text="15.9mm";
          window.document.product.elements[Neoprene+1].options[3].text="19.0mm";
          window.document.product.elements[Neoprene+1].options[4].text="25.4mm";

          window.document.product.elements[Neoprene+1].options[0].value="9.6mm";
          window.document.product.elements[Neoprene+1].options[1].value="12.7mm";
          window.document.product.elements[Neoprene+1].options[2].value="15.9mm";
          window.document.product.elements[Neoprene+1].options[3].value="19.0mm";
          window.document.product.elements[Neoprene+1].options[4].value="25.4mm";

          break;
      }
      break;

// item
// -----
//     case Butyl:
    case 26:
      switch (window.document.product.elements[Butyl].value)
      {
        case "1.6mm":
          window.document.product.elements[Butyl+1].options.length=5;

          window.document.product.elements[Butyl+1].options[0].text="1.6mm";
          window.document.product.elements[Butyl+1].options[1].text="3.2mm";
          window.document.product.elements[Butyl+1].options[2].text="4.8mm";
          window.document.product.elements[Butyl+1].options[3].text="6.4mm";
          window.document.product.elements[Butyl+1].options[4].text="8.0mm";

          window.document.product.elements[Butyl+1].options[0].value="1.6mm";
          window.document.product.elements[Butyl+1].options[1].value="3.2mm";
          window.document.product.elements[Butyl+1].options[2].value="4.8mm";
          window.document.product.elements[Butyl+1].options[3].value="6.4mm";
          window.document.product.elements[Butyl+1].options[4].value="8.0mm";

          break;

        case "3.2mm":
          window.document.product.elements[Butyl+1].options.length=5;

          window.document.product.elements[Butyl+1].options[0].text="3.2mm";
          window.document.product.elements[Butyl+1].options[1].text="6.4mm";
          window.document.product.elements[Butyl+1].options[2].text="9.6mm";
          window.document.product.elements[Butyl+1].options[3].text="12.7mm";
          window.document.product.elements[Butyl+1].options[4].text="15.9mm";

          window.document.product.elements[Butyl+1].options[0].value="3.2mm";
          window.document.product.elements[Butyl+1].options[1].text="6.4mm";
          window.document.product.elements[Butyl+1].options[2].value="9.6mm";
          window.document.product.elements[Butyl+1].options[3].value="12.7mm";
          window.document.product.elements[Butyl+1].options[4].value="15.9mm";

          break;

        case "4.8mm":
          window.document.product.elements[Butyl+1].options.length=2;

          window.document.product.elements[Butyl+1].options[0].text="19.0mm";
          window.document.product.elements[Butyl+1].options[1].text="25.4mm";

          window.document.product.elements[Butyl+1].options[0].value="19.0mm";
          window.document.product.elements[Butyl+1].options[1].value="25.4mm";

          break;
      }
      break;

// item
// -----
//     case Tygon:
    case 32:
      switch (window.document.product.elements[Tygon].value)
      {
        case "1.6mm":
          window.document.product.elements[Tygon+1].options.length=5;

          window.document.product.elements[Tygon+1].options[0].text="1.6mm";
          window.document.product.elements[Tygon+1].options[1].text="3.2mm";
          window.document.product.elements[Tygon+1].options[2].text="4.8mm";
          window.document.product.elements[Tygon+1].options[3].text="6.4mm";
          window.document.product.elements[Tygon+1].options[4].text="8.0mm";

          window.document.product.elements[Tygon+1].options[0].value="1.6mm";
          window.document.product.elements[Tygon+1].options[1].value="3.2mm";
          window.document.product.elements[Tygon+1].options[2].value="4.8mm";
          window.document.product.elements[Tygon+1].options[3].value="6.4mm";
          window.document.product.elements[Tygon+1].options[4].value="8.0mm";

          break;

        case "3.2mm":
          window.document.product.elements[Tygon+1].options.length=4;

          window.document.product.elements[Tygon+1].options[0].text="6.4mm";
          window.document.product.elements[Tygon+1].options[1].text="9.6mm";
          window.document.product.elements[Tygon+1].options[2].text="12.7mm";
          window.document.product.elements[Tygon+1].options[3].text="15.9mm";

          window.document.product.elements[Tygon+1].options[0].value="6.4mm";
          window.document.product.elements[Tygon+1].options[1].value="9.6mm";
          window.document.product.elements[Tygon+1].options[2].value="12.7mm";
          window.document.product.elements[Tygon+1].options[3].value="15.9mm";

          break;
      }
      break;

// item
// -----
//     case Viton:
    case 38:
      switch (window.document.product.elements[Viton].value)
      {
        case "1.6mm":
          window.document.product.elements[Viton+1].options.length=6;

          window.document.product.elements[Viton+1].options[0].text="0.8mm";
          window.document.product.elements[Viton+1].options[1].text="1.6mm";
          window.document.product.elements[Viton+1].options[2].text="3.2mm";
          window.document.product.elements[Viton+1].options[3].text="4.8mm";
          window.document.product.elements[Viton+1].options[4].text="6.4mm";
          window.document.product.elements[Viton+1].options[5].text="8.0mm";

          window.document.product.elements[Viton+1].options[0].value="0.8mm";
          window.document.product.elements[Viton+1].options[1].value="1.6mm";
          window.document.product.elements[Viton+1].options[2].value="3.2mm";
          window.document.product.elements[Viton+1].options[3].value="4.8mm";
          window.document.product.elements[Viton+1].options[4].value="6.4mm";
          window.document.product.elements[Viton+1].options[5].value="8.0mm";

          break;

        case "3.2mm":
          window.document.product.elements[Viton+1].options.length=4;

          window.document.product.elements[Viton+1].options[0].text="6.4mm";
          window.document.product.elements[Viton+1].options[1].text="9.6mm";
          window.document.product.elements[Viton+1].options[2].text="12.7mm";
          window.document.product.elements[Viton+1].options[3].text="15.9mm";

          window.document.product.elements[Viton+1].options[0].value="6.4mm";
          window.document.product.elements[Viton+1].options[1].value="9.6mm";
          window.document.product.elements[Viton+1].options[2].value="12.7mm";
          window.document.product.elements[Viton+1].options[3].value="15.9mm";

          break;

        case "4.8mm":
          window.document.product.elements[Viton+1].options.length=1;

          window.document.product.elements[Viton+1].options[0].text="19.0mm";

          window.document.product.elements[Viton+1].options[0].value="19.0mm";

          break;
      }
      break;
  }
}
