

function refreshPaintMatch( select ) {
      var result="";
      var title="";
      var fvid = [];
      var fvcode = [];
      var fvname = [];
      var fvimg = [];

      var fd = getXMLNode( select, "fd" );
      var fdid = getXMLValue( fd, "fdid" );
      var fdcode = getXMLValue( fd, "fdcode" );
      var fdname = getXMLValue( fd, "fdname" );
      var choices = getXMLNodes( fd, "choice" );
      for (var i=0;i<choices.length;i++) {
        fvid[i]= getXMLValue( choices[i], "fvid" );
        fvcode[i]= getXMLValue( choices[i], "fvcode" );
        fvname[i]= getXMLValue( choices[i], "fvname" );
        fvimg[i]= getXMLValue( choices[i], "fvimg" );
      }

      var index;
      result += '<table border="0" cellpadding="0" cellspacing="0" width="100%" rules="cols" bordercolor="#FFFFFF">';
      result += '<tr>';
      result += '<td height="40" colspan="5" align="left" valign="middle" class="BlkBold14px">&nbsp;&nbsp;Do you want BOTH Exterior View (viewed from outside)<br />&nbsp;&nbsp;and Interior View (viewed from the inside) to be the SAME color?</td>';
      result += '</tr>';
      result += '<tr>';
      result += '<td height="25" width="26%" align="left" valign="middle" class="BlkBold14px">&nbsp;</td>';
      for (var i=0;i<choices.length;i++) {
          result += '<td width="5%" align="left" valign="top" class="Blk14px"><input type="radio" name="paintmatch" onclick="nextAction( ' + rqtControl_FDFV + ','  + fdid + ',' + fvid[i] + ' )" class="Blk10px"/></td>';
          result += '<td width="30%" align="left" valign="middle" class="Blk14px">' + fvname[i] + '</td>';
      }   
      result += '</tr>';
      result += '</table>';

      var elmt = document.getElementById( div_PaintMatch );
      elmt.innerHTML = result;
      MM_showHideLayers(div_PaintMatch,'','show');
}

function refreshPaintSame( select ) {
      var result="";
      var title="";
      var fvid = [];
      var fvcode = [];
      var fvname = [];
      var fvimg = [];

      var fd = getXMLNode( select, "fd" );
      var fdid = getXMLValue( fd, "fdid" );
      var fdcode = getXMLValue( fd, "fdcode" );
      var fdname = getXMLValue( fd, "fdname" );
      var choices = getXMLNodes( fd, "choice" );
      for (var i=0;i<choices.length;i++) {
        fvid[i]= getXMLValue( choices[i], "fvid" );
        fvcode[i]= getXMLValue( choices[i], "fvcode" );
        fvname[i]= getXMLValue( choices[i], "fvname" );
        fvimg[i]= getXMLValue( choices[i], "fvimg" );
      }

      var index;
      result += '<table border="0" cellpadding="0" cellspacing="0" width="100%" rules="cols" bordercolor="#FFFFFF">';
      result += '<tr>';
      result += '<td width="100%" height="30" align="left" valign="middle" bgcolor="#999999" class="BlkBold10px" ><img src="../images/guielements/IntExtCombo.jpg" width="507" height="26" border="0" /></td>';
      result += '</tr>';
      result += '</table>';
      result += '<table border="0" cellpadding="0" cellspacing="0" width="100%" rules="cols" bordercolor="#FFFFFF">';
      result += '<tr>';
      result += '<td height="70" align="left" >';
      result += '<div class="DS_PREPAINT_STYL" >';
      result += '<ul>';
      for (var i=0;i<choices.length;i++) {
          result += '<li><div class="Blk10px-1" ><a href="javascript:nextAction( ' + rqtControl_FDFV + ','  + fdid + ',' + fvid[i] + ' )"><img src="' + rpath + fvimg[i] + '" alt="' + fvname[i] + '" title="' + fvname[i] + '" width="65" height="65" border="0"  /><br>' + fvname[i] + '</a></div></li>';
      }
      result += '</ul>';
      result += '</div>';
      result += '</td>';
      result += '</tr>';
      result += '</table>';

      var elmt = document.getElementById( div_samePaint );
      elmt.innerHTML = result;

      MM_showHideLayers(div_extPaint,'','hide');
      MM_showHideLayers(div_intPaint,'','hide');
      MM_showHideLayers(div_samePaint,'','show');
}

function refreshPaintExt( select ) {
      var result="";
      var title="";
      var fvid = [];
      var fvcode = [];
      var fvname = [];
      var fvimg = [];

      var fd = getXMLNode( select, "fd" );
      var fdid = getXMLValue( fd, "fdid" );
      var fdcode = getXMLValue( fd, "fdcode" );
      var fdname = getXMLValue( fd, "fdname" );
      var choices = getXMLNodes( fd, "choice" );
      for (var i=0;i<choices.length;i++) {
        fvid[i]= getXMLValue( choices[i], "fvid" );
        fvcode[i]= getXMLValue( choices[i], "fvcode" );
        fvname[i]= getXMLValue( choices[i], "fvname" );
        fvimg[i]= getXMLValue( choices[i], "fvimg" );
      }

      var index;
      result += '<table border="0" cellpadding="0" cellspacing="0" width="100%" rules="cols" bordercolor="#FFFFFF">';
      result += '<tr>';
      result += '<td width="100%" height="30" align="left" valign="middle" bgcolor="#999999" class="BlkBold10px" ><img src="../images/guielements/ExteriorTab.jpg" width="507" height="26" border="0" usemap="#prepaintmap" /></td>';  
      result += '</tr>';
      result += '</table>';
      result += '<table border="0" cellpadding="0" cellspacing="0" width="100%" rules="cols" bordercolor="#FFFFFF">';
      result += '<tr>';
      result += '<td height="70" align="left" >';
      result += '<div class="DS_PREPAINT_STYL" >';
      result += '<ul>';
      for (var i=0;i<choices.length;i++) {
          result += '<li><div class="Blk10px-1" ><a href="javascript:nextAction( ' + rqtControl_FDFV + ','  + fdid + ',' + fvid[i] + ' )"><img src="' + rpath + fvimg[i] + '" alt="' + fvname[i] + '" title="' + fvname[i] + '" width="65" height="65" border="0"  /><br>' + fvname[i] + '</a></div></li>';
      }
      result += '</ul>';
      result += '</div>';
      result += '</td>';
      result += '</tr>';
      result += '</table>';

      var elmt = document.getElementById( div_extPaint );
      elmt.innerHTML = result;

      MM_showHideLayers(div_samePaint,'','hide');
      MM_showHideLayers(div_extPaint,'','show');
}
function refreshPaintInt( select ) {
      var result="";
      var title="";
      var fvid = [];
      var fvcode = [];
      var fvname = [];
      var fvimg = [];

      var fd = getXMLNode( select, "fd" );
      var fdid = getXMLValue( fd, "fdid" );
      var fdcode = getXMLValue( fd, "fdcode" );
      var fdname = getXMLValue( fd, "fdname" );
      var choices = getXMLNodes( fd, "choice" );
      for (var i=0;i<choices.length;i++) {
        fvid[i]= getXMLValue( choices[i], "fvid" );
        fvcode[i]= getXMLValue( choices[i], "fvcode" );
        fvname[i]= getXMLValue( choices[i], "fvname" );
        fvimg[i]= getXMLValue( choices[i], "fvimg" );
      }

      var index;
      result += '<table border="0" cellpadding="0" cellspacing="0" width="100%" rules="cols" bordercolor="#FFFFFF">';
      result += '<tr>';
      result += '<td width="100%" height="30" align="left" valign="middle" bgcolor="#999999" class="BlkBold10px" ><img src="../images/guielements/InteriorTab.jpg" width="507" height="26" border="0" usemap="#prepaintmap" /></td>';  
      result += '</tr>';
      result += '</table>';
      result += '<table border="0" cellpadding="0" cellspacing="0" width="100%" rules="cols" bordercolor="#FFFFFF">';
      result += '<tr>';
      result += '<td height="70" align="left" >';
      result += '<div class="DS_PREPAINT_STYL" >';
      result += '<ul>';
      for (var i=0;i<choices.length;i++) {
          result += '<li><div class="Blk10px-1" ><a href="javascript:nextAction( ' + rqtControl_FDFV + ','  + fdid + ',' + fvid[i] + ' )"><img src="' + rpath + fvimg[i] + '" alt="' + fvname[i] + '" title="' + fvname[i] + '" width="65" height="65" border="0"  /><br>' + fvname[i] + '</a></div></li>';
      }
      result += '</ul>';
      result += '</div>';
      result += '</td>';
      result += '</tr>';
      result += '</table>';

      var elmt = document.getElementById( div_intPaint );
      elmt.innerHTML = result;
}

function refreshColorView( colorView ) {
      var elmt = document.getElementById( "colorview" );
      var result="";
      var intColorView = getXMLNode( colorView, "intcolorview" );

      if ( intColorView != null ) {
         var img = getXMLValue( intColorView, "img" );
         var name = getXMLValue( intColorView, "name" );
         result = '<img src="' + rpath + img + '" alt="' + convertSafeString(name) + '" title="' + convertSafeString(name) + '" width="69" height="20" border="0"  />'; 
        
         var elmt2 = document.getElementById( "intcolorview" );
         elmt2.innerHTML = result;
         elmt.style.display = "block";
      }
      else {
         elmt.style.display = "none";
      }
}


function finish() {
      var url_printview = 'extprintview.action?' + tokenName + '=' + token;
      var url_newdesign = 'javascript:new_design()';

      var tab1content = document.getElementById( "ConfigurationContent" );
      var tab2container = document.getElementById( "Configuration2container" );

      tab2container.style.display = "none";
      tab1content.style.height = "325px";

      var etitle = document.getElementById( "ConfigurationTabTitle" );
      var elmt = document.getElementById( "ConfigurationSelect" );
      var result = "";

      etitle.innerHTML = '';

      result += '<div id="blkfinish" >';
      result += '<br/>';
      result += 'CONGRATULATIONS! You\'re a click away from your dream entryway.';
      result += '<div id="blkfinishsub" >';
      result += '<br/>';
      result += '<br/>';
      result += '<p>To proceed with your purchase, please <a href="' + url_printview + '" target="_blank" >print</a> your final selection and bring it to a Home Depot millwork specialist. </p>';
      result += '<br/>';
      result += '<p style="text-align: center; " >Thank you!</p>';
      result += '</div>';
      result += '<br/>';
      result += '<br/>';
      result += '<a href="' + url_newdesign + '" ><img src="' + rpath + 'nextbttn/startOver.jpg" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;';
      result += '<a href="' + url_HOMEDEPOT + '" target="_blank" ><img src="' + rpath + 'nextbttn/locatorUp.png" border="0" /></a>&nbsp;&nbsp;&nbsp;&nbsp;';
      result += '<a href="' + url_printview + '" target="_blank" ><img src="' + rpath + 'nextbttn/printUp.png" border="0" /></a>&nbsp;&nbsp;&nbsp;&nbsp;';
      result += '</div>';
      elmt.innerHTML = result;
}

function finish_purchase() {
      var url_printview = 'extprintview.action?' + tokenName + '=' + token;
      var url_newdesign = 'javascript:new_design()';

      var tab1content = document.getElementById( "ConfigurationContent" );
      var tab2container = document.getElementById( "Configuration2container" );

      tab2container.style.display = "none";
      tab1content.style.height = "325px";

      var etitle = document.getElementById( "ConfigurationTabTitle" );
      var elmt = document.getElementById( "ConfigurationSelect" );
      var result = "";

      etitle.innerHTML = '';

      result += '<div id="blkfinish" >';
      result += '<br/>';
      result += 'CONGRATULATIONS! You\'re a click away from your dream entryway.';
      result += '<div style="padding-left: 10px; text-align: left; font-weight: normal;" >';
      result += '<p>Please proceed to purchase your door online or in person.</p>';
      result += '<p>Online: Click on \'PURCHASE\' button and your final selection will be placed through The Home Depot website to complete the order.</p>';
      result += '<p>In-Person: Print your final selection and bring it to a Home Depot millwork specialist to place your order.</p>';
      result += '<p>Thank you!</p>';
      result += '</div>';
      result += '<br/>';
      result += '<a href="' + url_newdesign + '" ><img src="' + rpath + 'nextbttn/startOver.jpg" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;';
      result += '<a href="' + url_HOMEDEPOT + '" target="_blank" ><img src="' + rpath + 'nextbttn/locatorUp.png" border="0" /></a>&nbsp;&nbsp;&nbsp;&nbsp;';
      result += '<a href="' + url_printview + '" target="_blank" ><img src="' + rpath + 'nextbttn/printUp.png" border="0" /></a>&nbsp;&nbsp;&nbsp;&nbsp;';
      result += '</div>';
      elmt.innerHTML = result;
}


function showOptionSelect( select ) {
//alert( "optionselect" );
      var result="";
      var title="";
      var fvid = [];
      var fvcode = [];
      var fvname = [];
      var fvimg = [];

      overlay( "ON" );

      var taboptcontent = document.getElementById( "taboptcontent" );

      var etitle = document.getElementById( "tabopttitle" );
      var elmt = document.getElementById( "taboptselect" );
      var econtrol = document.getElementById( "taboptcontrol" );
      var edesc = document.getElementById( "taboptdesc" );

      title = getXMLValue( select, "title" );
      etitle.innerHTML = title.toUpperCase();

      var fd = getXMLNode( select, "fd" );
      var currentFvid = getXMLValue( fd, "currentfvid" );
      var currentFvcv = getXMLValue( fd, "currentfvcv" );
      var fdid = getXMLValue( fd, "fdid" );
      var fdcode = getXMLValue( fd, "fdcode" );
      var fdname = getXMLValue( fd, "fdname" );
      var fddesc = getXMLValue( fd, "fddesc" );
      var fdattrs1 = getXMLValue( fd, "fdattrs1" );
      var choices = getXMLNodes( fd, "choice" );
      for (var i=0;i<choices.length;i++) {
        fvid[i]= getXMLValue( choices[i], "fvid" );
        fvcode[i]= getXMLValue( choices[i], "fvcode" );
        fvname[i]= getXMLValue( choices[i], "fvname" );
        fvimg[i]= getXMLValue( choices[i], "fvimg" );
      }

      result += '<form name="optForm">';
      var index, disabled;
      if ( fdcode == "EV_CTDN" ) {
          optionSelectedid = '0'
          optionSelectedvalue = '0';

	  result += '<div id="slider-bgCutdown" tabindex="-1" title="Cut down">';
	  result += '<div id="slider-thumbCutdown" ></div>';
	  result += '</div>';
	  result += '<div id="slider-value" >Total Cut down: <span id="slider-converted-valueCutdown">' + optionSelectedvalue + '</span></div>';
          disabled = false;
      }
      else if ( fdcode == "OP_JAMB" ) {
          var jambs = new Object();
          for (var i=0;i<choices.length;i++) {
              var fvid = getXMLValue( choices[i], "fvid" )
              var fvname = getXMLValue( choices[i], "fvname" )
              var fvimg = getXMLValue( choices[i], "fvimg" )
              var attrs1 = getXMLValue( choices[i], "attrs1" )
              var attrs2 = getXMLValue( choices[i], "attrs2" )
              var attrs3 = getXMLValue( choices[i], "attrs3" )
              if ( jambs[attrs1] == undefined ) {
                 jambs[attrs1] = {
                        colorName: attrs1,
                        image: fvimg,
                        commons: "",
                        customs: ""
                 }
              }
              var optionStr = '<input type="radio" name="opt" value="' + fvid + '" onclick="do_jamb( this )" />';
              if ( attrs2 == "" ) { // common width
                 jambs[attrs1].commons += optionStr + fvname + '<br/>';
              }
              else { // custom width
                 jambs[attrs1].customs += optionStr + createJambCustomSelect( fvid, fvname, attrs2, attrs3, currentFvid, currentFvcv ) + '<br/>';
              }
          }
          result += '<table width="97%">';
          for ( var jamb in jambs ) {
            result += '<tr valign="top" class="style10">';
            result += '<td width="20%" height="18" align="center"><strong>' + jambs[jamb].colorName + '</strong></td>';
            result += '<td width="30%" align="center">&nbsp;</td>';
            result += '<td width="1%" align="center">&nbsp;</td>';
            if ( jambs[jamb].customs != "" ) {
                result += '<td width="40%" align="center">&nbsp;</td>';
            }
            result += '</tr>';
            result += '<tr valign="top">';
            result += '<td height="109" align="center" class="style10"><img src="' + rpath + jambs[jamb].image + '" width="100" height="100" border="1" /></td>';
            result += '<td align="left" class="style10">Common Widths:<br /><br />'  + convertSafeString(jambs[jamb].commons) + '</td>';
            result += '<td></td>';
            if ( jambs[jamb].customs != "" ) {
                result += '<td align="left" class="style10">Custom Widths:<br /><br />' + convertSafeString(jambs[jamb].customs) + '</td>';
            }
            result += '</tr>';
          }
          result += '</table>';

          disabled = true;
      }
      else if ( fdcode == "OP_BKMD_OPTN" ) {
          result += '<div>';
          result += '<ul>';
          for (var i=0;i<choices.length;i++) {
                result += '<li><a href="javascript:option_select( ' + fvid[i] + ' )">'
                        + '<img src="' + rpath + fvimg[i] + '" border="0" /></a><br>'
                        + '<input type="radio" name="opt" value="' + fvid[i] + '" onclick="do_opt( this )" />' + convertSafeString(fvname[i]) + '</li>';
          }
          result += '</ul>';
          result += '</div>';
          result += '<div style="position:absolute;left:0px;top:0px;width:100%;text-align:right;"><img src="' + rpath + 'BrickMold/Brickmold-KEY.jpg" /></div>';

          disabled = true;
      }
      else if ( fdcode == "OP_JAMB_PREPNT_COLOR_OUT" ) {
          result += '<table width="100%" >';
  	  result += '<tr valign="top" >';
  	  result += '<td width="370" >';
          result += '<table width="100%" cellpadding="2" cellspacing="2" >';
  	  result += '<tr valign="top">';
          for (var i=0;i<choices.length;i++) {
            result += '<td width="120" class="style10" align="left"><a href="javascript:option_select( ' + fvid[i] + ' )">'
                        + '<img src="' + rpath + fvimg[i] + '" border="0" '
                        + ' alt="' + convertSafeString(fvname[i]) + '" title="' + convertSafeString(fvname[i]) + '" /></a><br>'
                        + '<input type="radio" name="opt" value="' + fvid[i] + '" onclick="do_opt( this )" />' + convertSafeString(fvname[i]) + '</td>';
            if ( i%3 == 2 && i != choices.length - 1 ) {
                result += "</tr><tr>";
            }
          }        
          for (var i=0;i<(3-choices.length%3)%3;i++) {
            result +='<td width="120" ></td>';
          }        
  	  result += '</tr>';
          result += '</table>';
  	  result += '</td>';
  	  result += '<td width="190" >';
          result += '<img src="' + rpath + 'jamb/Jamb-Prepainted-EXTERIOR.jpg" />'
  	  result += '</td>';
  	  result += '</tr>';
          result += '</table>';

          disabled = true;
      }
      else if ( fdcode == "OP_JAMB_PREPNT_COLOR_IN" ) {
          result += '<table width="100%" >';
  	  result += '<tr valign="top" >';
  	  result += '<td width="370" >';
          result += '<table width="100%" cellpadding="2" cellspacing="2" >';
  	  result += '<tr valign="top">';
          for (var i=0;i<choices.length;i++) {
            result += '<td width="120" class="style10" align="left"><a href="javascript:option_select( ' + fvid[i] + ' )">'
                        + '<img src="' + rpath + fvimg[i] + '" border="0" '
                        + ' alt="' + convertSafeString(fvname[i]) + '" title="' + convertSafeString(fvname[i]) + '" /></a><br>'
                        + '<input type="radio" name="opt" value="' + fvid[i] + '" onclick="do_opt( this )" />' + convertSafeString(fvname[i]) + '</td>';
            if ( i%3 == 2 && i != choices.length - 1 ) {
                result += "</tr><tr>";
            }
          }        
          for (var i=0;i<(3-choices.length%3)%3;i++) {
            result +='<td width="120" ></td>';
          }        
  	  result += '</tr>';
          result += '</table>';
  	  result += '</td>';
  	  result += '<td width="190" >';
          result += '<img src="' + rpath + 'jamb/Jamb-Prepainted-INTERIOR.jpg" />'
  	  result += '</td>';
  	  result += '</tr>';
          result += '</table>';

          disabled = true;
      }
      else { // default ul based style 
          liclass = "";
          switch ( fdattrs1 ) {
            case "4": liclass ='class="optperline4"';
                      break;
            case "3": liclass ='class="optperline3"';
                      break;
            case "2": liclass ='class="optperline2"';
                      break;
          }

          result += '<div>';
          result += '<ul>';
          for (var i=0;i<choices.length;i++) {
                result += '<li ' + liclass + ' ><a href="javascript:option_select( ' + fvid[i] + ' )">'
                        + '<img src="' + rpath + fvimg[i] + '" border="0" /></a><br>'
                        + '<input type="radio" name="opt" value="' + fvid[i] + '" onclick="do_opt( this )" />' + convertSafeString(fvname[i]) + '</li>';
          }
          result += '</ul>';
          result += '</div>';

          disabled = true;
      }
/* default table based style
      else {
          result += '<table width="100%" cellpadding="5" cellspacing="5" >';
  	  result += '<tr valign="top">';
          for (var i=0;i<choices.length;i++) {
            result += '<td width="120" class="style10" align="center"><a href="javascript:option_select( ' + fvid[i] + ' )">'
                        + '<img src="' + rpath + fvimg[i] + '" border="0" '
//                        + ' height="125" width="125" '
                        + ' alt="' + convertSafeString(fvname[i]) + '" title="' + convertSafeString(fvname[i]) + '" /></a><br>'
                        + '<input type="radio" name="opt" value="' + fvid[i] + '" onclick="do_opt( this )" />' + convertSafeString(fvname[i]) + '</td>';
            if ( i%4 == 3 && i != choices.length - 1 ) {
                result += "</tr><tr>";
            }
          }        
          for (var i=0;i<(4-choices.length%4)%4;i++) {
            result +='<td width="120" ></td>';
          }        
  	  result += '</tr>';
          result += '</table>';


          disabled = true;
      } */
      result += '</form>';
      elmt.innerHTML = result;
      edesc.innerHTML = fddesc;
      if ( fdcode == "EV_CTDN" ) {
          cutdown( currentFvcv );
      }
      var control = '<input type="button" id="nextButton" ' + (disabled?"disabled":"") + ' value="Next" onclick="option_Next(' + fdid + ')" />&nbsp;&nbsp;'
                  + '<input type="button" id="okButton" ' + (disabled?"disabled":"") + ' value="OK" onclick="option_OK(' + fdid + ')" />&nbsp;&nbsp;'
                  + '<input type="button" id="cancelButton" value="Cancel" onclick="option_Cancel(' + fdid + ')" />&nbsp;&nbsp;';
      econtrol.innerHTML = control;
      if ( currentFvid != null ) {
        option_select( currentFvid ); //set default selected
      }
}

function cutdown( para1 ) {   
    this.sizes = ["0","1/2\"","5/8\"","3/4\"","7/8\"",
                  "1\"","1 1/8\"","1 1/4\"","1 3/8\"","1 1/2\"","1 5/8\"","1 3/4\"","1 7/8\"",
                  "2\"","2 1/8\"","2 1/4\"","2 3/8\"","2 1/2\"","2 5/8\"","2 3/4\"","2 7/8\"",
                  "3\"","3 1/8\"","3 1/4\"","3 3/8\"","3 1/2\"","3 5/8\"","3 3/4\"","3 7/8\"",
                  "4\"","4 1/8\"","4 1/4\"","4 3/8\"","4 1/2\"","4 5/8\"","4 3/4\"","4 7/8\"",
                  "5\"","5 1/8\"","5 1/4\"","5 3/8\"","5 1/2\""];
    this.getStep = function( val ) {
        for ( var i = 0; i < this.sizes.length; i++ ) {
            if ( this.sizes[i] == val ) return i;
        }
        return 0;
    }
    if ( para1 == "" ) para1 = "0";
    var sldcd = new dhtmlxSlider( "slider-thumbCutdown", 410, "arrowgreen", false, 0, 41, getStep( para1 ), 1  );
    var elem = document.getElementById( "slider-converted-valueCutdown" );
    elem.innerHTML = para1;
    sldcd.setImagePath("../include/codebase/imgs/"); 
    sldcd.setSkin( "simplesilver" );
    sldcd.attachEvent("onChange",function(newValue,sliderObj){ 
        elem.innerHTML = sizes[newValue];
        optionSelectedvalue = sizes[newValue];
    });
    sldcd.init();
    sldcd.enableTooltip( false );
};   

function change_ripjamb( obj ) {
    var op = obj.options[obj.selectedIndex];
    optionSelectedvalue = op.text;
//    alert( "name: " + obj.name + " value: " + op.value + " text: " + op.text );
}

function createJambCustomSelect( fvid, fvname, from, to, currentFvid, currentFvcv ) {
    var result = "";
    var checked, visibleName, visibleRip;
    if ( fvid != currentFvid ) {
        visibleName = "inline";
        visibleRip = "none";
    }
    else {
        visibleName = "none";
        visibleRip = "inline";
    }
    var selectList = getDispersedInch( from, to, '1/8"' );
    result += '<span id="jambName' + fvid + '" style="display:' + visibleName + '">' + fvname + '</span>';
    result += '<span id="jambRip' + fvid + '" style="display:' + visibleRip + '">';
    result += '<select name="ripjamb' + fvid + '" onchange="change_ripjamb( this )">';
    for ( var i = 0; i < selectList.length; i++ ) {
        result += '<option value="" ' +  (fvid==currentFvid && selectList[i]==currentFvcv?'selected':'') + '>' + selectList[i] + '</option>';
    }
    result += '</select>';
    result += '</span>';
    return result;
}

function do_jamb( obj ) {
    var nextBt = document.getElementById( "nextButton" );
    var okBt = document.getElementById( "okButton" );

    if ( optionSelectedid == obj.value ) {
        if ( nextBt != null ) nextBt.disabled = false;
        if ( okBt != null ) okBt.disabled = false;
        return;
    }

    var preJN = document.getElementById( "jambName" + optionSelectedid );
    var preJR = document.getElementById( "jambRip" + optionSelectedid );
    var curJN = document.getElementById( "jambName" + obj.value );
    var curJR = document.getElementById( "jambRip" + obj.value );
    var jambRip = obj.form.elements[ "ripjamb" + obj.value ];
    if ( obj.checked ) {
        if ( preJN != null ) {
            preJN.style.display = "inline";
        }
        if ( preJR != null ) {
            preJR.style.display = "none";
        }
        if ( curJN != null ) {
            curJN.style.display = "none";
        }
        if ( curJR != null ) {
            curJR.style.display = "inline";
        }

        optionSelectedid = obj.value;
        if ( jambRip != null ) {
            optionSelectedvalue = jambRip.options[jambRip.selectedIndex].text;
        }
        else {
            optionSelectedvalue = '0';
        }

        if ( nextBt != null ) nextBt.disabled = false;
        if ( okBt != null ) okBt.disabled = false;
    }
}

