﻿
function onSelChange(sel,hidclientid)
{
    var selEle  = document.getElementById(sel);
    var selVal = selEle.options[selEle.selectedIndex].getAttribute('value'); 
    var hidEle = document.getElementById(hidclientid);  
    hidEle.setAttribute('value',selVal);    
}
function createIntS(id,small,count,curval)
{
    var selEle = document.getElementById(id);       
    while(selEle.firstChild)
    {
        selEle.removeChild(selEle.firstChild);                                
    }
    for(var i = 0; i< count ;i++){
      var value = small + i*10000;
      var opt = document.createElement('option');
      var txt = document.createTextNode(value/10000);
      opt.appendChild(txt);
      opt.setAttribute('value',value);
      if(value == curval)opt.setAttribute('selected',true);
      selEle.appendChild(opt);   
    }
}
function create16S(id,small,count,curval)
{
    opts = ['0','1/16','1/8','3/16','1/4','5/16','3/8','7/16','1/2','9/16','5/8','11/16','3/4','13/16','7/8','15/16','1','1+1/16'];
    //ints = [000,625,1250,1875,2500,3125,3750,4375,5000,5625,6250,6875,7500,8125,8750,9375,10000,10625];
    var selEle = document.getElementById(id);       
    while(selEle.firstChild)
    {
        selEle.removeChild(selEle.firstChild);                                
    }
    for(var i = 0; i<count;i++)
    {
      var value = small + i*625;
      var opt = document.createElement('option');
      var txt = document.createTextNode(opts[value/625]);
      opt.appendChild(txt);
      opt.setAttribute('value', value);
      if(value == curval)opt.setAttribute('selected',true);
      selEle.appendChild(opt);              
    }
}

