function getStateValuesByCountry(index){
    var sStateValues = aStateValues[index];
    return sStateValues.split(";");
}

function MkStatesValues(index, sel){
    if (index != 226 && index != 38) {
      index = 1;
    }

    var aCurrStateValues = getStateValuesByCountry(index);
    var nCurrStateValuesCnt = aCurrStateValues.length;
    var oStateList = document.forms["reg"].state;

    var oStateListOptionsCnt = oStateList.options;
    oStateList.length = 0;
    for (i = 0; i < nCurrStateValuesCnt; i++){
        aState = aCurrStateValues[i].split(":");

        if (aState[0] == sel) {
          isel = i;
        }
        if (document.createElement){
            var newStateListOption = document.createElement("OPTION");

            newStateListOption.text = aState[1];
            newStateListOption.value = aState[0];

            (oStateList.options.add) ? oStateList.options.add(newStateListOption) : oStateList.add(newStateListOption, null);
        }else{

            oStateList.options[i] = new Option(aState[1], aState[0], false, false);
        }
    }
  document.forms["reg"].elements["state"].selectedIndex = isel;
}
